38bd109c401f9e4ecf232224037fb2cc489e0a1d
[bse.git] / site / templates / admin / order_detail.tmpl
1 <:wrap admin/base.tmpl title => [concatenate "Order " [order id] " details"] bodyid => bse-order-detail :> 
2 <h1>Shop Administration</h1>
3 <p>| <a href="<:adminurl menu:>">Admin menu</a> |
4 <a href="<:adminurl shopadmin:>">Manage catalogs</a> |
5 <a href="<:adminurl shopadmin order_list 1:>">Manage orders</a> |
6 <a href="<:adminurl shopadmin order_list 1 template order_list_unfilled:>">Unfilled 
7   orders</a> |
8 <a href="<:adminurl shopadmin order_list 1 template order_list_filled:>">Filled 
9   orders</a> |
10 <:ifSiteuser id:><a href="<:adminurl siteusers a_edit 1 id [siteuser id]:>">Edit Member</a> |
11 <a href="<:adminurl siteusers a_edit 1 id [siteuser id] _t orders:>">Other member orders</a> |<:or:><:eif:>
12 </p>
13 <:ifMessage:><div class="message"><:message:></div><:or:><:eif:>
14 <h2>Order details - No: #<:order id:></h2>
15 <h3>Received: <span class="date order-date" data-datetime="<:date "%y-%m-%dT%H:%M:%S" order orderDate:>"><:date "%d/%m/%Y %I:%M%P" order orderDate:></span></h3>
16 <:ifOrder purchase_order:>
17 <h3 class="purchase-order">Purchase Order: <span class="purchase-order"><:order purchase_order:></span></h3>
18 <:or:><:eif:>
19 <:ifOrder complete:><:or:><p>This order is incomplete and should not be filled.</p><:eif:>
20 <table class="editform orderdetail_head">
21   <tr>
22     <th colspan="2" class="col_typehead">Billing</th>
23     <td rowspan="6">&nbsp;</td>
24     <th colspan="2" class="col_typehead">Delivery</th>
25   </tr>
26   <tr> 
27     <th class="col_head">E-mail:</th>
28     <td class="col_value"><a href="mailto:<:order billEmail:>"><:order billEmail:></a></td>
29     <th class="col_head">Email:</th>
30     <td class="col_value"><a href="mailto:<:order emailAddress:>"><:order emailAddress:></a></td>
31   </tr>
32   <tr> 
33     <th class="col_head">Phone:</th>
34     <td class="col_value"><a href="tel:<:order billTelephone:>"><:order billTelephone:></a></td>
35     <th class="col_head">Phone:</th>
36     <td class="col_value"><a href="tel:<:order telephone:>"><:order telephone:></a></td>
37   </tr>
38   <tr> 
39     <th class="col_head">Mobile:</th>
40     <td class="col_value"><a href="tel:<:order billMobile:>"><:order billMobile:></a></td>
41     <th class="col_head">Mobile:</th>
42     <td class="col_value"><a href="tel:<:order delivMobile:>"><:order delivMobile:></a></td>
43   </tr>
44   <tr> 
45     <th class="col_head">Facsimile:</th>
46     <td class="col_value"><a href="fax:<:order billFacsimile:>"><:order billFacsimile:></a></td>
47     <th class="col_head">Facsimile:</th>
48     <td class="col_value"><a href="fax:<:order facsimile:>"><:order facsimile:></a></td>
49   </tr>
50   <tr> 
51     <th class="col_head">Address:</th>
52     <td class="col_value">
53       <:order billFirstName:> <:order billLastName:>
54       <:ifOrder billOrganization:><br /><:order billOrganization:><:or:><:eif:>
55       <br /><:order billStreet:>
56       <:ifOrder billStreet2:><br /><:order billStreet2:><:or:><:eif:>
57       <br /><:order billSuburb:> <:order billState:> <:order billPostCode:>
58       <br /><:order billCountry:>
59     </td>
60     <th class="col_head">Address:</th>
61     <td class="col_value"><:order delivFirstName:> <:order delivLastName:>
62       <:ifOrder delivOrganization:><br /><:order delivOrganization:><:or:><:eif:>
63       <br /><:order delivStreet:>
64       <:ifOrder delivStreet2:><br /><:order delivStreet2:><:or:><:eif:>
65       <br /><:order delivSuburb:> <:order delivState:> <:order delivPostCode:>
66       <br /><:order delivCountry:></td>
67   </tr>
68 <:ifOrder instructions:>
69   <tr>
70     <th>Special Instructions:</th>
71     <td colspan="4" class="col_instructions"><:order instructions:></td>
72   </tr>
73 <:or:><:eif:>
74   <:include custom/order_detail.include optional:><:include admin/include/custom/order_detail_custom.tmpl optional:><:include admin/include/order_detail_custom.tmpl optional:>
75 </table>
76
77 <br />
78       <table class="editform orderdetail">
79         <tr> 
80           <th class="col_description">Description</th>
81           <th class="col_units">Units</th>
82           <th class="col_unit_wsale">Unit Wsale</th>
83           <th class="col_ext_wsale">Ext Wsale</th>
84           <th class="col_unit_gst">Unit GST</th>
85           <th class="col_ext_gst">Ext GST</th>
86           <th class="col_unitprice">Unit Price</th>
87           <th class="col_extension">Extension</th>
88 </tr>
89 <:iterator begin items:>
90         <tr> 
91           <td class="col_description"><:ifOr [ifEq [item productId] -1] [ifEq [product id] ""]:><:item title:> (product deleted)<:or:><a href="<:product admin:>"><:product
92             title:></a><:eif:> <:options:></td>
93           <td class="col_units"><:item units:></td>
94           <td class="col_unit_wsale"><:money item wholesalePrice:></td>
95           <td class="col_ext_wsale"><:extension wholesalePrice:></td>
96           <td class="col_unit_gst"><:money item gst:></td>
97           <td class="col_ext_gst"><:extension gst:></td>
98           <td class="col_unitprice"><:money item price:></td>
99           <td class="col_extension"><:extension price:></td>
100 </tr>
101 <:iterator end items:>
102 <tr>
103   <td colspan="7" class="col_label_right">Total Price of goods:</td>
104   <td  class="col_extension"><:= bse.number("money", order.total_cost) -:></td>
105 </tr>
106 <:.if order.coupon -:>
107 <tr>
108    <td>Coupon code <b><:= order.coupon_code -:></b></td>
109    <td colspan="6" class="col_label_right">Discount:</td>
110    <td class="col_extension">(<:= bse.number("money", order.product_cost_discount) -:>)</td>
111 </tr>
112 <tr>
113    <td colspan="7" class="col_label_right">Discounted total:</td>
114    <td class="col_extension"><:= bse.number("money", order.discounted_product_cost) -:></td>
115 </tr>
116 <:.end if -:>
117         <tr> 
118           <td colspan="7" class="col_contact">
119 <:if Eq [order shipping_name] "none":>
120 Nothing to ship.
121 <:or:>
122 <form method="post" action="<:adminurl shopadmin a_order_save 1:>">
123 Shipping via <:shipping_method_select:>
124     <input type="hidden" name="id" value="<:order id:>" />
125     <:csrfp shop_order_save hidden:>
126     <label>tracking code: <input type="text" name="freight_tracking" value="<:order freight_tracking:>" /></label>
127     <input type="submit" name="a_order_save" value="Save" />
128     </form>
129 <:eif:>
130 </td>
131           <td class="col_extension"><:money order shipping_cost:></td>
132 </tr>
133         <tr> 
134           <td colspan="3" class="col_total">Total:</td>
135           <td class="col_ext_wsale total"><:money order wholesaleTotal:></td>
136           <td>&nbsp;</td>
137           <td class="col_ext_gst total"><:money order gst:></td>
138           <td>&nbsp;</td>
139           <td class="col_extension total"><:money order total:></td>
140 </tr>
141 </table>
142 <p>Order progress: <:stage_description:> <a href="#" onclick="document.getElementById('update_stage').style.display='block'; this.style.display='none'; return false;">update</a></p>
143
144 <form id="update_stage" action="<:adminurl shopadmin:>" style="display: none" method="post">
145   <input type="hidden" name="id" value="<:order id:>" />
146   <:csrfp shop_order_save hidden:>
147   <:stage_select:>
148   <label>Log note: <input type="text" name="stage_note" size="40" /> (optional)</label>
149   <input type="submit" name="a_order_save" value="Save" />
150 </form>
151
152 <:.if !order.paidFor :>
153 <p>This order hasn't been paid</p>
154
155 <form action="<:adminurl2 shopadmin:>" method="post">
156 <input type="hidden" name="id" value="<:= order.id :>" />
157 <:csrfp shop_order_paid hidden:>
158 Payment type: <:.call "make_select", "name": "paymentType", "list": payment_types, "id": "id", "desc": "desc", "default": order.paymentType -:>
159 <input type="submit" name="a_order_paid" value="Mark this order paid" /></form>
160 <:.elsif order.is_manually_paid -:>
161 <form action="<:adminurl2 shopadmin:>" method="post">
162 This order has been manually marked paid via <:= payment_type_desc | html :>
163 <input type="hidden" name="id" value="<:= order.id :>" />
164 <:csrfp shop_order_unpaid hidden:>
165 <input type="submit" name="a_order_unpaid" value="Mark this order unpaid" /></form>
166
167 <:.elsif order.ccOnline:>
168 <p>This was processed as an online credit card transaction.</p>
169 <:.if order.ccSuccess:>
170 <p>This transaction was <b>SUCCESSFUL</b>.</p>
171 <table>
172 <tr><th>Receipt Number:</th><td><:order ccReceipt:></td></tr>
173 <:.if order.ccTranId:>
174 <tr><th>Transaction Id:</th><td><:order ccTranId:></td></tr>
175 <:.end if:>
176 <:.if order.ccName:>
177 <tr><th>Card Holder:</th><td><:order ccName:></td>
178 <:.end if:>
179 <:.if order.ccPAN:>
180 <tr><th>Card Number (partial):</th><td>...<:order ccPAN:></td>
181 <:.end if:>
182 </table>
183 <:.else:>
184 <p>This transaction <b>FAILED</b>.</p>
185 <table>
186 <tr><th>Status:</th><td><:order ccStatus:></td>
187 <tr><th>Error:</th><td><:order ccStatusText:></td>
188 <:.if order.ccStatus2:>
189 <tr><th>More status</th><td><:order ccStatus2:></td>
190 <:.end if:>
191 </table>
192 <:.end if:>
193 <:.elsif order.paymentType == 0:>
194 <p>Payment made by credit card.  Credit card details can be found in the encrypted email you received when the customer made the order.</p>
195 <:.if order.ccPAN or order.ccName :>
196 <table>
197 <:.if order.ccName:>
198 <tr><th>Card Holder</th><td><:order ccName:></td>
199 <:.end if:>
200 <:.if order.ccPAN:>
201 <tr><th>Card Number (partial)</th><td>...<:order ccPAN:></td>
202 <:.end if:>
203 </table>
204 <:.end if:>
205 <:.elsif order.paymentType == 1 -:>
206   <p>Payment will be made by cheque.</p>
207 <:.elsif order.paymentType == 2 -:>
208   <p>Contact the customer to arrange for payment.</p>
209 <:.elsif order.paymentType == 4:><p>Paid via PayPal, transaction id <:order paypal_tran_id:><:ifUserCan bse_shop_order_refund_paypal:> <a href="<:adminurl shopadmin a_paypal_refund 1 id [order id]:>">Refund</a><:or:><:eif:></p>
210 <:.end if:>
211 <:include custom/order_detail_payment.include optional:>
212 <:.if order.filled:>
213 <p>This order was filled on <:date order whenFilled:> by <:order whoFilled:>.</p>
214 <:.elsif order.complete:>
215 <p>This order hasn't been filled yet.  <a href="<:adminurl shopadmin id [order id] order_filled Yep filled 1 detail 1:>">Mark order filled</a>.</p>
216 <:.end if:>
217 <:.if order.instructions:>
218 <p style="white-space: pre-wrap;"><:order instructions:></p>
219 <:.end if:>
220
221 <table class="editform" id="auditlog">
222 <:include admin/include/audithead.tmpl:>
223 <:iterator begin auditlog object_id [order id] object_type BSE::TB::Order:>
224 <:include admin/include/auditentry.tmpl:>
225 <:iterator end auditlog:>
226 </table>