Permalink
Browse files

improvements in Order reporting in CMS.

  • Loading branch information...
1 parent b37e2af commit 68f55a212057b554dfada50b785cf0be6dd53eb7 @sunnysideup sunnysideup committed Jul 31, 2010
@@ -16,11 +16,16 @@ class StoreAdmin extends ModelAdmin{
public static $record_controller_class = 'StoreAdmin_RecordController';
-
public static function set_managed_models(array $array) {
self::$managed_models = $array;
}
+ function init() {
+ parent::init();
+ Requirements::themedCSS("OrderReport");
+ }
+
+
}
class StoreAdmin_CollectionController extends ModelAdmin_CollectionController {
View
@@ -240,31 +240,8 @@ function getCMSFields(){
$fields->removeByName($field);
}
- $fields->addFieldToTab('Root.Main', new HeaderField('MainDetails', 'Main Details'), 'Status');
- $fields->addFieldToTab('Root.Main', new ReadonlyField('OrderNo', 'Order No', "#{$this->ID}"), 'Status');
- $fields->addFieldToTab('Root.Main', new ReadonlyField('Date', 'Date', date('l jS F Y h:i A', strtotime($this->Created))), 'Status');
-
- $total = new Money('Total');
- $total->setValue(array(
- 'Currency' => Payment::site_currency(),
- 'Amount' => $this->Total()
- ));
- $fields->addFieldsToTab('Root.Main', array(new ReadonlyField('TheTotal', 'Total', $total->Nice())));
-
- $paid = new Money('TotalPaid');
- $paid->setValue(array(
- 'Currency' => Payment::site_currency(),
- 'Amount' => $this->TotalPaid()
- ));
- $fields->addFieldsToTab('Root.Main', array(new ReadonlyField('TheTotalPaid', 'Total Paid', $paid->Nice())));
-
- $outstanding = new Money('TotalOutstanding');
- $outstanding->setValue(array(
- 'Currency' => Payment::site_currency(),
- 'Amount' => $this->TotalOutstanding()
- ));
- $fields->addFieldsToTab('Root.Main', array(new ReadonlyField('TheTotalOutstanding', 'Total Outstanding', $outstanding->Nice())));
-
+ $htmlSummary = $this->renderWith("OrderInformation_Print_Details");
+ $fields->addFieldToTab('Root.Main', new LiteralField('MainDetails', $htmlSummary));
$orderItemsTable = new TableListField(
"OrderItems", //$name
"OrderItem", //$sourceClass =
View
@@ -0,0 +1,18 @@
+div#OrderInformation table {margin: 0 auto; clear: both; width: 700px;}
+div#OrderInformation thead {border-bottom: 1px dotted #ccc;}
+div#OrderInformation tbody {border-bottom: 1px dotted #ccc;}
+div#OrderInformation th, div#OrderInformation td {padding: 5px; width: 25%; text-align: left}
+ div#OrderInformation thead th, div#OrderInformation thead td {border-bottom: 1px solid #555; font-weight: bold; padding-top: 20px;}
+div#OrderInformation tbody {}
+div#OrderInformation th {}
+div#OrderInformation td {}
+div#OrderInformation tr.gap {}
+div#OrderInformation tr.gap th, div#OrderInformation tr.gap td {border-top: 1px dotted #555; font-weight: bold;}
+div#OrderInformation tr.last th, div#OrderInformation tr.last td {border-bottom: 1px dotted #555; }
+div#OrderInformation .center {text-align: center;}
+div#OrderInformation .right, div#OrderInformation .price {text-align: right;}
+div#OrderInformation .last {padding-bottom: 20px;}
+
+div#OrderInformation tr#SubTotal td, div#OrderInformation tr#SubTotal th,
+div#OrderInformation tr#Total td, div#OrderInformation tr#Total th,
+div#OrderInformation tr#Outstanding td, div#OrderInformation tr#Outstanding th {padding-bottom: 20px;}
@@ -0,0 +1,4 @@
+body{overflow: auto !important; width: 700px; font-family: arial, helvetica, sans-serif; font-size: 12px!important; padding: 20px; }
+#Icons a {display: block; float: right; background-repeat: no-repeat; background-position: right top; width: auto; padding-right: 20px;}
+ #PrintPageIcon {background-image: url(ecommerce/images/print.png); }
+ #PrintPageIcon {background-image: url(ecommerce/images/close.png); }
@@ -1,45 +0,0 @@
-/*************************************
- WELCOME TO THE PRINT STYLESHEET
---------------------------------------
- print.css
- BlueTrip CSS Framework
- Thanks to Priss Print Framework
- http://github.com/mikecrittenden/priss
-***************************************/
-
-/*** BODY ***/
-body {width:100% !important; margin:0 !important; padding:0 !important; line-height: 1.4; word-spacing:1.1pt; letter-spacing:0.2pt; font-family: Garamond,"Times New Roman", serif; color: #000; background: none; font-size: 12pt;}
-
-/*** HEADINGS ***/
-h1,h2,h3,h4,h5,h6 {font-family: Helvetica, Arial, sans-serif;}
-h1{font-size:19pt;}
-h2{font-size:17pt;}
-h3{font-size:15pt;}
-h4,h5,h6{font-size:12pt;}
-
-/*** ELEMENTS ***/
-code {font: 10px monospace;}
-blockquote {margin: 1.3em; padding: 1em; font-size: 10pt;}
-hr {background-color: #ccc;}
-
-/*** IMAGES ***/
-img {float: left; margin: 1em 1.5em 1.5em 0;}
-a img {border: none;}
-
-/*** LINKS ***/
-a:link, a:visited {background: transparent; font-weight: 700; text-decoration: underline;color:#333;}
-a:link[href^="http://"]:after, a[href^="http://"]:visited:after {content: " (" attr(href) ") "; font-size: 90%;}
-a[href^="http://"] {color:#000;}
-
-/*** TABLES ***/
-table {margin: 1px; text-align:left;}
-th {border-bottom: 1px solid #333; font-weight: bold;}
-td {border-bottom: 1px solid #333;}
-th,td {padding: 4px 10px 4px 0;}
-tfoot {font-style: italic;}
-caption {background: #fff; margin-bottom:2em; text-align:left;}
-thead {display: table-header-group;}
-tr {page-break-inside: avoid;}
-
-/*** Add sections here to hide various parts of the site when printing ***/
-#header, #footer, #navigation, #sidebar, button {display:none;}
@@ -1,2 +1 @@
-#PrintPageIcon {display: none;}
-#OrderStatus {display: none;}
+#Icons {display: none;}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,48 @@
+<% control Member %>
+ <tr class="gap mainHeader">
+ <th colspan="4" class="left"><h2><% _t("CUSTOMERDETAILS","Customer Details") %></h2></th>
+ </tr>
+ <tr class="summary odd first">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("NAME","Name") %></th>
+ <td colspan="2" class="price">$FirstName $Surname</td>
+ </tr>
+ <% if HomePhone %>
+ <tr class="summary even">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("PHONE","Phone") %></th>
+ <td colspan="2" class="price">$HomePhone</td>
+ </tr>
+ <% end_if %>
+ <% if MobilePhone %>
+ <tr class="summary odd">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("MOBILE","Mobile") %></th>
+ <td colspan="2" class="price">$MobilePhone</td>
+ </tr>
+ <% end_if %>
+ <tr class="summary even">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("EMAIL","Email") %></th>
+ <td colspan="2" class="price">$Email</td>
+ </tr>
+ <tr class="summary odd">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("BUYERSADDRESS","Buyer's Address") %></th>
+ <td colspan="2" class="price">$Address</td>
+ </tr>
+ <% if AddressLine2 %>
+ <tr class="summary even">
+ <th colspan="2" scope="row" class="twoColHeader">&nbsp;</th>
+ <td colspan="2" class="price">$AddressLine2</td>
+ </tr>
+ <% end_if %>
+ <tr class="summary odd">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("CITY","City") %></th>
+ <td colspan="2" class="price">$City</td>
+ </tr>
+ <% if Country %>
+ <tr class="summary even last">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("COUNTRY","Country") %></th>
+ <td colspan="2" class="price">$CountryTitle</td>
+ </tr>
+ <% end_if %>
+<% end_control %>
+
+
+
@@ -0,0 +1,31 @@
+<% control Payments %>
+ <tr class="gap mainHeader">
+ <th colspan="4" class="left"><h2><% _t("PAYMENTINFORMATION","Payment Information") %></h2></th>
+ </tr>
+ <tr class="summary odd first">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("DATE","Date") %></th>
+ <td colspan="2" class="price">$LastEdited.Nice</td>
+ </tr>
+ <tr class="summary even">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("AMOUNT","Amount") %></th>
+ <td colspan="2" class="price">$Amount.Nice $Currency</td>
+ </tr>
+ <tr class="summary odd">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("PAYMENTSTATUS","Payment Status") %></th>
+ <td colspan="2" class="price">$Status</td>
+ </tr>
+
+ <% if PaymentMethod %>
+ <tr class="summary even">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("PAYMENTMETHOD","Method") %></th>
+ <td colspan="2" class="price">$PaymentMethod - $IP $ProxyIP</td>
+ </tr>
+ <% end_if %>
+
+ <% if Message %>
+ <tr class="summary odd last">
+ <th colspan="2" scope="row" class="twoColHeader"><% _t("PAYMENTNOTE","Note") %></th>
+ <td colspan="2" class="price">$Message</td>
+ </tr>
+ <% end_if %>
+<% end_control %>
@@ -5,13 +5,19 @@
<title><% _t("PAGETITLE","Print Orders") %></title>
</head>
<body>
- <a href="#" onclick="window.print(); return false;" id="PrintPageIcon">print now</a>
- <div class="typography">
- <div id="OrderInformation">
- <% control DisplayFinalisedOrder %>
- <% include OrderInformation_Print_Details %>
- <% end_control %>
+ <div id="Icons">
+ <a href="#" onclick="window.print(); return false;" id="PrintPageIcon">print now</a>
+ <a href="#" onclick="window.close(); return false;" id="PrintCloseIcon">close</a>
+ </div>
+<% control DisplayFinalisedOrder %><% include OrderInformation_Print_Details %><% end_control %>
+ <div id="OrderStatus">
+ <div id="OrderStatusForm">
+ $StatusForm
+ </div>
+ <div id="OrderStatusLog">
+ $StatusLog
</div>
</div>
</body>
</html>
+
@@ -1,3 +1,4 @@
+<div id="OrderInformation">
<% if CustomerOrderNote %>
<div id="CustomerOrderNote">
<h2 id="CustomerOrderNoteHeading">Nota Bene</h2>
@@ -6,6 +7,9 @@
<% end_if %>
<table id="InformationTable">
<thead>
+ <tr class="mainHeader">
+ <th class="left" colspan="4"><h2>Sales</h2></th>
+ </tr>
<tr>
<th scope="col" class="left"><% _t("PRODUCT","Product") %></th>
<th scope="col" class="center"><% _t("QUANTITY", "Quantity") %></th>
@@ -15,7 +19,7 @@
</thead>
<tbody>
<% control Items %>
- <tr class="itemRow">
+ <tr class="itemRow $EvenOdd $FirstLast">
<td class="product title" scope="row">
<% if Link %>
<a href="$Link" title="<% sprintf(_t("READMORE","Click here to read more on &quot;%s&quot;"),$Title) %>">$ProductTitle</a>
@@ -29,28 +33,28 @@
</tr>
<% end_control %>
- <tr class="gap summary">
+ <tr class="gap summary" id="SubTotal">
<th colspan="3" scope="row" class="threeColHeader"><% _t("SUBTOTAL","Sub-total") %></th>
<td class="right">$SubTotal.Nice</td>
</tr>
<% control Modifiers %>
<% if ShowInTable %>
- <tr class="modifierRow">
+ <tr class="modifierRow $EvenOdd $FirstLast">
<td colspan="3" scope="row">$TableTitle</td>
<td class="right">$TableValue</td>
</tr>
<% end_if %>
<% end_control %>
- <tr class="gap Total">
+ <tr class="gap summary" id="Total">
<th colspan="3" scope="row" class="threeColHeader"><% _t("TOTAL","Total") %></th>
<td class="right">$Total.Nice $Currency</td>
</tr>
<% include OrderInformation_PaymentSection %>
- <tr class="gap Total Outstanding">
+ <tr class="gap summary" id="Outstanding">
<th colspan="3" scope="row" class="threeColHeader"><strong><% _t("TOTALOUTSTANDING","Total outstanding") %></strong></th>
<td class="right"><strong>$TotalOutstanding.Nice </strong></td>
</tr>
@@ -61,3 +65,4 @@
</tbody>
</table>
+</div>
@@ -5,36 +5,36 @@
</tr>
</thead>
<tbody>
- <tr class="summary">
+ <tr class="summary odd ">
<td colspan="3" scope="row" class="right"><% _t("PAYMENTID","Payment ID") %></td>
<td class="price">#$ID</td>
</tr>
- <tr class="summary">
+ <tr class="summary even ">
<td colspan="3" scope="row" class="right"><% _t("DATE","Date") %></td>
<td class="price">$LastEdited.Time $LastEdited.Nice</td>
</tr>
- <tr class="summary">
+ <tr class="summary odd ">
<td colspan="3" scope="row" class="right"><% _t("AMOUNT","Amount") %></td>
<td class="price">$Amount.Nice $Currency</td>
</tr>
-
- <tr class="summary">
+
+ <tr class="summary even ">
<td colspan="3" scope="row" class="right"><% _t("PAYMENTSTATUS","Payment Status") %></td>
<td class="price">$Status</td>
</tr>
-
- <tr class="summary">
+
+ <tr class="summary odd ">
<td colspan="3" scope="row" class="right"><% _t("PAYMENTMETHOD","Method") %></td>
<td class="price">$PaymentMethod</td>
</tr>
<% if Message %>
- <tr class="summary">
+ <tr class="summary even ">
<td colspan="3" scope="row" class="right"><% _t("DETAILS","Details") %></td>
<td class="price">$Message</td>
</tr>
<% end_if %>
-
+
</tbody>
</table>

0 comments on commit 68f55a2

Please sign in to comment.