re-work coupons to allow multiple coupon types
[bse.git] / site / templates / admin / order_detail.tmpl
CommitLineData
c4f18087 1<:wrap admin/base.tmpl title => [concatenate "Order " [order id] " details"] bodyid => bse-order-detail :>
5bc24704 2<h1>Shop Administration</h1>
c4f18087 3<p>| <a href="<:adminurl menu:>">Admin menu</a> |
1b0b485d
TC
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
6a8a205a 7 orders</a> |
1b0b485d
TC
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> |
c4f18087 11<a href="<:adminurl siteusers a_edit 1 id [siteuser id] _t orders:>">Other member orders</a> |<:or:><:eif:>
6a8a205a 12</p>
13a986ee 13<:ifMessage:><div class="message"><:message:></div><:or:><:eif:>
918735d1 14<h2>Order details - No: #<:order id:></h2>
c4f18087
TC
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:>
8a3b8db8
TC
19<:ifOrder complete:><:or:><p>This order is incomplete and should not be filled.</p><:eif:>
20<table class="editform orderdetail_head">
c4f18087
TC
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>
918735d1 26 <tr>
8a3b8db8 27 <th class="col_head">E-mail:</th>
c4f18087
TC
28 <td class="col_value"><a href="mailto:<:order billEmail:>"><:order billEmail:></a></td>
29 <th class="col_head">Email:</th>
8a3b8db8 30 <td class="col_value"><a href="mailto:<:order emailAddress:>"><:order emailAddress:></a></td>
c4f18087
TC
31 </tr>
32 <tr>
8a3b8db8 33 <th class="col_head">Phone:</th>
c4f18087
TC
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>
918735d1
TC
37 </tr>
38 <tr>
8a3b8db8 39 <th class="col_head">Mobile:</th>
c4f18087
TC
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>
918735d1
TC
43 </tr>
44 <tr>
c4f18087
TC
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>
8a3b8db8
TC
52 <td class="col_value">
53 <:order billFirstName:> <:order billLastName:>
c4f18087 54 <:ifOrder billOrganization:><br /><:order billOrganization:><:or:><:eif:>
8a3b8db8
TC
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>
c4f18087
TC
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>
918735d1 72 </tr>
c4f18087 73<:or:><:eif:>
14604ada 74 <:include custom/order_detail.include optional:><:include admin/include/custom/order_detail_custom.tmpl optional:><:include admin/include/order_detail_custom.tmpl optional:>
5bc24704
TC
75</table>
76
8a3b8db8
TC
77<br />
78 <table class="editform orderdetail">
d9803c26 79 <tr>
8a3b8db8
TC
80 <th class="col_description">Description</th>
81 <th class="col_units">Units</th>
8a3b8db8
TC
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>
353585b9
TC
86 <th class="col_unitprice">Unit Price</th>
87 <th class="col_extension">Extension</th>
5bc24704 88</tr>
4ad0e50a
TC
89<:.for item in [order.items] -:>
90 <:.set product = @undef -:>
91 <:.if item.productId > 0 -:>
92 <:.set product = bse.products.getByPkey(item.productId) -:>
93 <:.end if -:>
d9803c26 94 <tr>
4ad0e50a 95 <td class="col_description"><:.if product :><a href="<:= product.admin :>"><:= product.title :></a><:.else:><:= item.title :> (product deleted)<:.end if:> <:= item.nice_options:>
b55d4af1
TC
96 <:.if item.tier_id:><br><span class="price_tier"><:= item.tier.description :></span><:.end if:>
97 <:.if item.product_discount_units -:>
98 <br><span class="productdiscount">
99 <:.if item.product_discount_units < item.units -:>
100 (Saved $<:= bse.number("money", item.product_discount) :> on the first <:= item.product_discount_units :> units)
101 <:-.else -:>
102Saved $<:= bse.number("money", item.product_discount) :> on each unit
103 <:.end if -:>
104&nbsp;(total $<:= bse.number("money", item.product_discount * item.product_discount_units) :>)
105 </span>
106 <:-.end if -:>
107 </td>
4ad0e50a
TC
108 <td class="col_units"><:= item.units:></td>
109 <td class="col_unit_wsale"><:= bse.number("money", item.wholesalePrice) :></td>
110 <td class="col_ext_wsale"><:= bse.number("money", item.extended("wholesalePrice")) :></td>
111 <td class="col_unit_gst"><:= bse.number("money", item.gst):></td>
112 <td class="col_ext_gst"><:= bse.number("money", item.extended("gst")):></td>
113 <td class="col_unitprice"><:= bse.number("money", item.price):></td>
114 <td class="col_extension"><:= bse.number("money", item.extended("price")) :></td>
5bc24704 115</tr>
4ad0e50a 116<:.end for -:>
353585b9
TC
117<tr>
118 <td colspan="7" class="col_label_right">Total Price of goods:</td>
119 <td class="col_extension"><:= bse.number("money", order.total_cost) -:></td>
120</tr>
2ced88e0 121<:.if order.coupon -:>
353585b9 122<tr>
b55d4af1 123 <td>Coupon code <b><:= order.coupon_code -:></b> (<:= order.coupon_description :>)</td>
353585b9
TC
124 <td colspan="6" class="col_label_right">Discount:</td>
125 <td class="col_extension">(<:= bse.number("money", order.product_cost_discount) -:>)</td>
126</tr>
127<tr>
128 <td colspan="7" class="col_label_right">Discounted total:</td>
129 <td class="col_extension"><:= bse.number("money", order.discounted_product_cost) -:></td>
130</tr>
131<:.end if -:>
d9803c26 132 <tr>
353585b9 133 <td colspan="7" class="col_contact">
4340de9f
TC
134<:if Eq [order shipping_name] "none":>
135Nothing to ship.
136<:or:>
6f0799a4
TC
137<form method="post" action="<:adminurl shopadmin a_order_save 1:>">
138Shipping via <:shipping_method_select:>
080fc207
TC
139 <input type="hidden" name="id" value="<:order id:>" />
140 <:csrfp shop_order_save hidden:>
141 <label>tracking code: <input type="text" name="freight_tracking" value="<:order freight_tracking:>" /></label>
142 <input type="submit" name="a_order_save" value="Save" />
143 </form>
4340de9f 144<:eif:>
d9803c26 145</td>
8a3b8db8 146 <td class="col_extension"><:money order shipping_cost:></td>
d9803c26 147</tr>
8a3b8db8
TC
148 <tr>
149 <td colspan="3" class="col_total">Total:</td>
8a3b8db8 150 <td class="col_ext_wsale total"><:money order wholesaleTotal:></td>
5bc24704 151 <td>&nbsp;</td>
8a3b8db8 152 <td class="col_ext_gst total"><:money order gst:></td>
353585b9
TC
153 <td>&nbsp;</td>
154 <td class="col_extension total"><:money order total:></td>
5bc24704
TC
155</tr>
156</table>
f0722dd2
TC
157<p>Order progress: <:stage_description:> <a href="#" onclick="document.getElementById('update_stage').style.display='block'; this.style.display='none'; return false;">update</a></p>
158
159<form id="update_stage" action="<:adminurl shopadmin:>" style="display: none" method="post">
160 <input type="hidden" name="id" value="<:order id:>" />
161 <:csrfp shop_order_save hidden:>
162 <:stage_select:>
163 <label>Log note: <input type="text" name="stage_note" size="40" /> (optional)</label>
164 <input type="submit" name="a_order_save" value="Save" />
165</form>
166
b62cae00 167<:.if !order.paidFor :>
14604ada 168<p>This order hasn't been paid</p>
b62cae00
TC
169
170<form action="<:adminurl2 shopadmin:>" method="post">
171<input type="hidden" name="id" value="<:= order.id :>" />
172<:csrfp shop_order_paid hidden:>
173Payment type: <:.call "make_select", "name": "paymentType", "list": payment_types, "id": "id", "desc": "desc", "default": order.paymentType -:>
174<input type="submit" name="a_order_paid" value="Mark this order paid" /></form>
175<:.elsif order.is_manually_paid -:>
176<form action="<:adminurl2 shopadmin:>" method="post">
177This order has been manually marked paid via <:= payment_type_desc | html :>
178<input type="hidden" name="id" value="<:= order.id :>" />
179<:csrfp shop_order_unpaid hidden:>
180<input type="submit" name="a_order_unpaid" value="Mark this order unpaid" /></form>
181
182<:.elsif order.ccOnline:>
5d88571c 183<p>This was processed as an online credit card transaction.</p>
b62cae00 184<:.if order.ccSuccess:>
5d88571c
TC
185<p>This transaction was <b>SUCCESSFUL</b>.</p>
186<table>
187<tr><th>Receipt Number:</th><td><:order ccReceipt:></td></tr>
b62cae00 188<:.if order.ccTranId:>
5d88571c 189<tr><th>Transaction Id:</th><td><:order ccTranId:></td></tr>
b62cae00
TC
190<:.end if:>
191<:.if order.ccName:>
6abd8ce8 192<tr><th>Card Holder:</th><td><:order ccName:></td>
b62cae00
TC
193<:.end if:>
194<:.if order.ccPAN:>
6abd8ce8 195<tr><th>Card Number (partial):</th><td>...<:order ccPAN:></td>
b62cae00 196<:.end if:>
5d88571c 197</table>
b62cae00 198<:.else:>
5d88571c
TC
199<p>This transaction <b>FAILED</b>.</p>
200<table>
201<tr><th>Status:</th><td><:order ccStatus:></td>
202<tr><th>Error:</th><td><:order ccStatusText:></td>
190d0ecc 203<:.if order.ccStatus2:>
5d88571c 204<tr><th>More status</th><td><:order ccStatus2:></td>
b62cae00 205<:.end if:>
5d88571c 206</table>
b62cae00
TC
207<:.end if:>
208<:.elsif order.paymentType == 0:>
209<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>
210<:.if order.ccPAN or order.ccName :>
6abd8ce8 211<table>
b62cae00 212<:.if order.ccName:>
6abd8ce8 213<tr><th>Card Holder</th><td><:order ccName:></td>
b62cae00
TC
214<:.end if:>
215<:.if order.ccPAN:>
6abd8ce8 216<tr><th>Card Number (partial)</th><td>...<:order ccPAN:></td>
b62cae00 217<:.end if:>
6abd8ce8 218</table>
b62cae00
TC
219<:.end if:>
220<:.elsif order.paymentType == 1 -:>
221 <p>Payment will be made by cheque.</p>
222<:.elsif order.paymentType == 2 -:>
223 <p>Contact the customer to arrange for payment.</p>
224<:.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>
225<:.end if:>
d64413ee 226<:include custom/order_detail_payment.include optional:>
b62cae00 227<:.if order.filled:>
a11a0d7c 228<p>This order was filled on <:date order whenFilled:> by <:order whoFilled:>.</p>
b62cae00
TC
229<:.elsif order.complete:>
230<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>
231<:.end if:>
232<:.if order.instructions:>
14604ada 233<p style="white-space: pre-wrap;"><:order instructions:></p>
b62cae00 234<:.end if:>
13a986ee
TC
235
236<table class="editform" id="auditlog">
237<:include admin/include/audithead.tmpl:>
238<:iterator begin auditlog object_id [order id] object_type BSE::TB::Order:>
239<:include admin/include/auditentry.tmpl:>
240<:iterator end auditlog:>
241</table>