PageRenderTime 55ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl

https://bitbucket.org/marcenuc/prestashop
Smarty Template | 794 lines | 719 code | 47 blank | 28 comment | 35 complexity | a2af93ef3ad10b46f8e51fa094823f89 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0
  1. {*
  2. * 2007-2012 PrestaShop
  3. *
  4. * NOTICE OF LICENSE
  5. *
  6. * This source file is subject to the Academic Free License (AFL 3.0)
  7. * that is bundled with this package in the file LICENSE.txt.
  8. * It is also available through the world-wide-web at this URL:
  9. * http://opensource.org/licenses/afl-3.0.php
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@prestashop.com so we can send you a copy immediately.
  13. *
  14. * DISCLAIMER
  15. *
  16. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  17. * versions in the future. If you wish to customize PrestaShop for your
  18. * needs please refer to http://www.prestashop.com for more information.
  19. *
  20. * @author PrestaShop SA <contact@prestashop.com>
  21. * @copyright 2007-2012 PrestaShop SA
  22. * @version Release: $Revision$
  23. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  24. * International Registered Trademark & Property of PrestaShop SA
  25. *}
  26. {extends file="helpers/view/view.tpl"}
  27. {block name="override_tpl"}
  28. <script type="text/javascript">
  29. var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')}";
  30. var id_order = {$order->id};
  31. var id_lang = {$current_id_lang};
  32. var id_currency = {$order->id_currency};
  33. {assign var=PS_TAX_ADDRESS_TYPE value=Configuration::get('PS_TAX_ADDRESS_TYPE')}
  34. var id_address = {$order->$PS_TAX_ADDRESS_TYPE};
  35. var currency_sign = "{$currency->sign}";
  36. var currency_format = "{$currency->format}";
  37. var currency_blank = "{$currency->blank}";
  38. var priceDisplayPrecision = 2;
  39. var use_taxes = {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}true{else}false{/if};
  40. var token = "{$smarty.get.token|escape:'htmlall':'UTF-8'}";
  41. var txt_add_product_stock_issue = "{l s='You want to add more product than are available in stock, are you sure you want to add this quantity?' js=1}";
  42. var txt_add_product_new_invoice = "{l s='Are you sure you want to create a new invoice?' js=1}";
  43. var txt_add_product_no_product = "{l s='Error: No product has been selected' js=1}";
  44. var txt_add_product_no_product_quantity = "{l s='Error: Quantity of product must be set' js=1}";
  45. var txt_add_product_no_product_price = "{l s='Error: Price of product must be set' js=1}";
  46. var txt_confirm = "{l s='Are you sure?' js=1}";
  47. var statesShipped = new Array();
  48. {foreach from=$states item=state}
  49. {if (!$currentState->shipped && $state['shipped'])}
  50. statesShipped.push({$state['id_order_state']});
  51. {/if}
  52. {/foreach}
  53. </script>
  54. {assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}}
  55. {if ($hook_invoice)}
  56. <div style="float: right; margin: -40px 40px 10px 0;">{$hook_invoice}</div><br class="clear" />';
  57. {/if}
  58. <div class="bloc-command">
  59. <div class="button-command">
  60. {if (count($invoices_collection))}
  61. <a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id}" target="_blank">
  62. <img src="../img/admin/charged_ok.gif" alt="{l s='View invoice'}" /> {l s='View invoice'}
  63. </a>
  64. {else}
  65. <img src="../img/admin/charged_ko.gif" alt="{l s='No invoice'}" /> {l s='No invoice'}
  66. {/if}
  67. |
  68. {if (($currentState && $currentState->delivery) || $order->delivery_number)}
  69. <a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}" target="_blank">
  70. <img src="../img/admin/delivery.gif" alt="{l s='View delivery slip'}" /> {l s='View delivery slip'}
  71. </a>
  72. {else}
  73. <img src="../img/admin/delivery_ko.gif" alt="{l s='No delivery slip'}" /> {l s='No delivery slip'}
  74. {/if}
  75. |
  76. <a class="button" href="javascript:window.print()"><img src="../img/admin/printer.gif" alt="{l s='Print order'}" title="{l s='Print order'}" /> {l s='Print order'}</a>
  77. </div>
  78. <div class="metadata-command">
  79. <dl>
  80. <dt>{l s='Date:'} </dt>
  81. <dd>{dateFormat date=$order->date_add full=true}</dd>
  82. |</dl>
  83. <dl>
  84. <dt>{l s='Messages:'}</dt>
  85. <dd>{sizeof($messages)}</dd>
  86. |</dl>
  87. <dl>
  88. <dt><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{l s='New Customer Messages:'}</a></dt>
  89. <dd><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{sizeof($customer_thread_message)}</a></dd>
  90. |</dl>
  91. <dl>
  92. <dt>{l s='Products:'}</dt>
  93. <dd id="product_number">{sizeof($products)}</dd>
  94. |</dl>
  95. <dl>
  96. <dt>{l s='Total:'}</dt>
  97. <dd class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</dd>
  98. </dl>
  99. <div class="clear"></div>
  100. </div>
  101. </div>
  102. <div class="container-command">
  103. <!-- Left column -->
  104. <div style="width: 49%; float:left;">
  105. <!-- Change status form -->
  106. <form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
  107. <select id="id_order_state" name="id_order_state">
  108. {foreach from=$states item=state}
  109. {if $state['id_order_state'] != $currentState->id}
  110. <option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
  111. {/if}
  112. {/foreach}
  113. </select>
  114. <input type="hidden" name="id_order" value="{$order->id}" />
  115. <input type="submit" name="submitState" value="{l s='Add'}" class="button" />
  116. </form>
  117. <br />
  118. <!-- History of status -->
  119. <table cellspacing="0" cellpadding="0" class="table history-status" style="width: 100%;">
  120. <colgroup>
  121. <col width="1%">
  122. <col width="">
  123. <col width="20%">
  124. <col width="20%">
  125. </colgroup>
  126. {foreach from=$history item=row key=key}
  127. {if ($key == 0)}
  128. <tr>
  129. <th><img src="../img/os/{$row['id_order_state']}.gif" /></th>
  130. <th>{$row['ostate_name']|stripslashes}</th>
  131. <th>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if}</th>
  132. <th>{dateFormat date=$row['date_add'] full=true}</th>
  133. </tr>
  134. {else}
  135. <tr class="{if ($key % 2)}alt_row{/if}">
  136. <td><img src="../img/os/{$row['id_order_state']}.gif" /></td>
  137. <td>{$row['ostate_name']|stripslashes}</td>
  138. <td>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else}&nbsp;{/if}</td>
  139. <td>{dateFormat date=$row['date_add'] full=true}</td>
  140. </tr>
  141. {/if}
  142. {/foreach}
  143. </table>
  144. {if $customer->id}
  145. <!-- Customer informations -->
  146. <br />
  147. <fieldset>
  148. <legend><img src="../img/admin/tab-customers.gif" /> {l s='Customer information'}</legend>
  149. <span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
  150. (<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
  151. {if ($customer->isGuest())}
  152. {l s='This order has been placed by a guest.'}
  153. {if (!Customer::customerExists($customer->email))}
  154. <form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
  155. <input type="hidden" name="id_lang" value="{$order->id_lang}" />
  156. <p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform guest into customer'}" /></p>
  157. {l s='This feature will generate a random password and send an e-mail to the customer'}
  158. </form>
  159. {else}
  160. <div><b style="color:red;">{l s='A registered customer account already exists with this e-mail address'}</b></div>
  161. {/if}
  162. {else}
  163. {l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br />
  164. {l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br />
  165. {l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
  166. </fieldset>
  167. {/if}
  168. {/if}
  169. <!-- Sources block -->
  170. {if (sizeof($sources))}
  171. <br />
  172. <fieldset>
  173. <legend><img src="../img/admin/tab-stats.gif" /> {l s='Sources'}</legend>
  174. <ul {if sizeof($sources) > 3}style="height: 200px; overflow-y: scroll;"{/if}>
  175. {foreach from=$sources item=source}
  176. <li>
  177. {dateFormat date=$source['date_add'] full=true}<br />
  178. <b>{l s='From:'}</b>{if $source['http_referer'] != ''}<a href="{$source['http_referer']}">{parse_url($source['http_referer'], $smarty.const.PHP_URL_HOST)|regex_replace:'/^www./':''}</a>{else}-{/if}<br />
  179. <b>{l s='To:'}</b> <a href="http://{$source['request_uri']}">{$source['request_uri']|truncate:100:'...'}</a><br />
  180. {if $source['keywords']}<b>{l s='Keywords:'}</b> {$source['keywords']}<br />{/if}<br />
  181. </li>
  182. {/foreach}
  183. </ul>
  184. </fieldset>
  185. {/if}
  186. <!-- Admin order hook -->
  187. {hook h="displayAdminOrder" id_order=$order->id}
  188. </div>
  189. <!-- END Left column -->
  190. <!-- Right column -->
  191. <div style="width: 49%; float:right;">
  192. <div class="button-command-prev-next">
  193. <b>{l s='Orders'}</b> :
  194. {if $previousOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$previousOrder}">{l s='< Prev'}</a>{/if}
  195. {if $nextOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$nextOrder}">{l s='Next >'}</a>{/if}
  196. </div>
  197. <div class="clear"></div>
  198. <!-- linked orders block -->
  199. {if count($order->getBrother()) > 0}
  200. <fieldset>
  201. <legend><img src="../img/admin/tab-orders.gif" /> {l s='Linked orders'}</legend>
  202. <table class="table" width="100%;" cellspacing="0" cellpadding="0">
  203. <thead>
  204. <tr>
  205. <th width="10%">
  206. {l s='Order no.'}
  207. </th>
  208. <th>
  209. {l s='Status'}
  210. </th>
  211. <th width="10%">
  212. {l s='Amount'}
  213. </th>
  214. <th width="5%">
  215. </th>
  216. </tr>
  217. </thead>
  218. <tbody>
  219. {foreach $order->getBrother() as $brother_order}
  220. <tr>
  221. <td>
  222. <a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">#{'%06d'|sprintf:$brother_order->id}</a>
  223. </td>
  224. <td>
  225. {$brother_order->getCurrentOrderState()->name[$current_id_lang]}
  226. </td>
  227. <td>
  228. {displayPrice price=$brother_order->total_paid_tax_incl currency=$currency->id}
  229. </td>
  230. <td>
  231. <a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}"><img alt="{l s='See the order'}" src="../img/admin/details.gif"></a>
  232. </td>
  233. </tr>
  234. {/foreach}
  235. </tbody>
  236. </table>
  237. </fieldset>
  238. <br />
  239. {/if}
  240. <!-- Documents block -->
  241. <fieldset>
  242. <legend><img src="../img/admin/details.gif" /> {l s='Documents'}</legend>
  243. {* Include document template *}
  244. {include file='controllers/orders/_documents.tpl'}
  245. </fieldset>
  246. <br />
  247. <!-- Payments block -->
  248. <fieldset>
  249. <legend><img src="../img/admin/money.gif" /> {l s='Payment'}</legend>
  250. {if (!$order->valid && sizeof($currencies) > 1)}
  251. <form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
  252. <p class="warn">{l s='Don\'t forget to update your conversion rate before make this change.'}</p>
  253. <label>{l s='Don\'t forget to update your conversion rate before make this change.'}</label>
  254. <select name="new_currency">
  255. {foreach from=$currencies item=currency_change}
  256. {if $currency_change['id_currency'] != $order->id_currency}
  257. <option value="{$currency_change['id_currency']}">{$currency_change['name']} - {$currency_change['sign']}</option>
  258. {/if}
  259. {/foreach}
  260. </select>
  261. <input type="submit" class="button" name="submitChangeCurrency" value="{l s='Change'}" />
  262. </form>
  263. <hr class="clear"/>
  264. {/if}
  265. {if count($order->getOrderPayments()) > 0}
  266. <p class="error" style="{if round($orders_total_paid_tax_incl, 2) == round($total_paid, 2) || $currentState->id == 6}display: none;{/if}">
  267. {l s='Warning:'} {displayPrice price=$total_paid currency=$currency->id}
  268. {l s='paid instead of'} <span class="total_paid">{displayPrice price=$orders_total_paid_tax_incl currency=$currency->id}</span>
  269. {foreach $order->getBrother() as $brother_order}
  270. {if $brother_order@first}
  271. {if count($order->getBrother()) == 1}
  272. <br />{l s='This warning also concerns the order '}
  273. {else}
  274. <br />{l s='This warning also concerns the next orders:'}
  275. {/if}
  276. {/if}
  277. <a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">#{'%06d'|sprintf:$brother_order->id}</a>
  278. {/foreach}
  279. </p>
  280. {/if}
  281. <form id="formAddPayment" method="post" action="{$current_index}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
  282. <table class="table" width="100%" cellspacing="0" cellpadding="0">
  283. <colgroup>
  284. <col width="15%">
  285. <col width="">
  286. <col width="20%">
  287. <col width="10%">
  288. <col width="10%">
  289. <col width="1%">
  290. </colgroup>
  291. <thead>
  292. <tr>
  293. <th>{l s='Date'}</th>
  294. <th>{l s='Payment method'}</th>
  295. <th>{l s='Transaction ID'}</th>
  296. <th>{l s='Amount'}</th>
  297. <th>{l s='Invoice'}</th>
  298. <th>&nbsp;</th>
  299. </tr>
  300. </thead>
  301. <tbody>
  302. {foreach from=$order->getOrderPaymentCollection() item=payment}
  303. <tr>
  304. <td>{dateFormat date=$payment->date_add full=true}</td>
  305. <td>{$payment->payment_method}</td>
  306. <td>{$payment->transaction_id}</td>
  307. <td>{displayPrice price=$payment->amount currency=$payment->id_currency}</td>
  308. <td>
  309. {if $invoice = $payment->getOrderInvoice($order->id)}
  310. {$invoice->getInvoiceNumberFormatted($current_id_lang)}
  311. {else}
  312. {l s='No invoice'}
  313. {/if}
  314. </td>
  315. <td class="right">
  316. <a href="#" class="open_payment_information"><img src="../img/admin/details.gif" title="{l s='See payment informations'}" alt="{l s='See payment informations'}" /></a>
  317. </td>
  318. </tr>
  319. <tr class="payment_information" style="display: none;">
  320. <td colspan="6">
  321. <p>
  322. <b>{l s='Card Number:'}</b>&nbsp;
  323. {if $payment->card_number}
  324. {$payment->card_number}
  325. {else}
  326. <i>{l s='Not defined'}</i>
  327. {/if}
  328. </p>
  329. <p>
  330. <b>{l s='Card Brand:'}</b>&nbsp;
  331. {if $payment->card_brand}
  332. {$payment->card_brand}
  333. {else}
  334. <i>{l s='Not defined'}</i>
  335. {/if}
  336. </p>
  337. <p>
  338. <b>{l s='Card Expiration:'}</b>&nbsp;
  339. {if $payment->card_expiration}
  340. {$payment->card_expiration}
  341. {else}
  342. <i>{l s='Not defined'}</i>
  343. {/if}
  344. </p>
  345. <p>
  346. <b>{l s='Card Holder:'}</b>&nbsp;
  347. {if $payment->card_holder}
  348. {$payment->card_holder}
  349. {else}
  350. <i>{l s='Not defined'}</i>
  351. {/if}
  352. </p>
  353. </td>
  354. </tr>
  355. {foreachelse}
  356. <tr>
  357. <td colspan="6" class="center">
  358. <h3>{l s='No payment available'}</h3>
  359. </td>
  360. </tr>
  361. {/foreach}
  362. <tr class="current-edit">
  363. <td><input type="text" name="payment_date" class="datepicker" size="17" value="{date('Y-m-d H:i:s')}" /></td>
  364. <td>
  365. <select name="payment_method" class="payment_method">
  366. {foreach from=$payment_methods item=payment_method}
  367. <option value="{$payment_method}">{$payment_method}</option>
  368. {/foreach}
  369. </select>
  370. </td>
  371. <td>
  372. <input type="text" name="payment_transaction_id" value="" />
  373. </td>
  374. <td>
  375. <input type="text" name="payment_amount" size="5" value="" />
  376. <select name="payment_currency" class="payment_currency">
  377. {foreach from=$currencies item=current_currency}
  378. <option value="{$current_currency['id_currency']}"{if $current_currency['id_currency'] == $currency->id} selected="selected"{/if}>{$current_currency['sign']}</option>
  379. {/foreach}
  380. </select>
  381. </td>
  382. {if count($invoices_collection) > 0}
  383. <td>
  384. <select name="payment_invoice" id="payment_invoice">
  385. {foreach from=$invoices_collection item=invoice}
  386. <option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
  387. {/foreach}
  388. </select>
  389. </td>
  390. {/if}
  391. <td><input class="button" type="submit" name="submitAddPayment" value="{l s='Add'}" /></td>
  392. </tr>
  393. </tbody>
  394. </table>
  395. </form>
  396. </fieldset>
  397. <br />
  398. <!-- Shipping block -->
  399. {if !$order->isVirtual()}
  400. <fieldset>
  401. <legend><img src="../img/admin/delivery.gif" /> {l s='Shipping'}</legend>
  402. <div class="clear" style="float: left; margin-right: 10px;">
  403. <span>{l s='Recycled packaging:'}</span>
  404. {if $order->recyclable}
  405. <img src="../img/admin/enabled.gif" />
  406. {else}
  407. <img src="../img/admin/disabled.gif" />
  408. {/if}
  409. </div>
  410. <div style="float: left;">
  411. <span>{l s='Gift-wrapping:'}</span>
  412. {if $order->gift}
  413. <img src="../img/admin/enabled.gif" />
  414. </div>
  415. <div style="clear: left; margin: 0px 42px 0px 42px; padding-top: 2px;">
  416. {if $order->gift_message}
  417. <div style="border: 1px dashed #999; padding: 5px; margin-top: 8px;"><b>{l s='Message:'}</b><br />{$order->gift_message|nl2br}</div>
  418. {/if}
  419. {else}
  420. <img src="../img/admin/disabled.gif" />
  421. {/if}
  422. </div>
  423. <div class="clear" style="margin-bottom: 10px;"></div>
  424. {include file='controllers/orders/_shipping.tpl'}
  425. {if $carrierModuleCall}
  426. {$carrierModuleCall}
  427. {/if}
  428. </fieldset>
  429. <br />
  430. <!-- Return block -->
  431. <fieldset>
  432. <legend><img src="../img/admin/delivery.gif" /> {l s='Merchandise returns'}</legend>
  433. {if $order->getReturn()|count > 0}
  434. <table class="table" width="100%" cellspacing="0" cellpadding="0">
  435. <thead>
  436. <tr>
  437. <th style="width:30%">Date</th>
  438. <th>Type</th>
  439. <th style="width:20%">Carrier</th>
  440. <th style="width:30%">Tracking number</th>
  441. </tr>
  442. </thead>
  443. <tbody>
  444. {foreach from=$order->getReturn() item=line}
  445. <tr>
  446. <td>{$line.date_add}</td>
  447. <td>{$line.type}</td>
  448. <td>{$line.state_name}</td>
  449. <td>
  450. <span id="shipping_number_show">{if isset($line.url) && isset($line.tracking_number)}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{elseif isset($line.tracking_number)}{$line.tracking_number}{/if}</span>
  451. {if $line.can_edit}
  452. <form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}&id_order_invoice={if $line.id_order_invoice}{$line.id_order_invoice|escape:'htmlall':'UTF-8'}{else}0{/if}&id_carrier={if $line.id_carrier}{$line.id_carrier|escape:'htmlall':'UTF-8'}{else}0{/if}">
  453. <span class="shipping_number_edit" style="display:none;">
  454. <input type="text" name="tracking_number" value="{$line.tracking_number|htmlentities}" />
  455. <input type="submit" class="button" name="submitShippingNumber" value="{l s='Update'}" />
  456. </span>
  457. <a href="#" class="edit_shipping_number_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a>
  458. <a href="#" class="cancel_shipping_number_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a>
  459. </form>
  460. {/if}
  461. </td>
  462. </tr>
  463. {/foreach}
  464. </tbody>
  465. </table>
  466. {else}
  467. {l s='No merchandise returns yet.'}
  468. {/if}
  469. {if $carrierModuleCall}
  470. {$carrierModuleCall}
  471. {/if}
  472. </fieldset>
  473. {/if}
  474. </div>
  475. <!-- END Right column -->
  476. <div class="clear" style="margin-bottom: 10px;"></div>
  477. </div>
  478. <div class="container-command container-command-top-spacing">
  479. <!-- Addresses -->
  480. {if !$order->isVirtual()}
  481. <div style="width: 49%; float:left;">
  482. <!-- Shipping address -->
  483. <fieldset>
  484. <legend><img src="../img/admin/delivery.gif" alt="{l s='Shipping address'}" />{l s='Shipping address'}</legend>
  485. {if $can_edit}
  486. <form method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}">
  487. <div style="margin-bottom:5px;">
  488. <p>
  489. <select name="id_address">
  490. {foreach from=$customer_addresses item=address}
  491. <option value="{$address['id_address']}"{if $address['id_address'] == $order->id_address_delivery} selected="selected"{/if}>{$address['alias']} - {$address['address1']} {$address['postcode']} {$address['city']}{if !empty($address['state'])} {$address['state']}{/if}, {$address['country']}</option>
  492. {/foreach}
  493. </select>
  494. <input class="button" type="submit" name="submitAddressShipping" value="{l s='Change'}" />
  495. </p>
  496. </div>
  497. </form>
  498. {/if}
  499. <div style="float: right">
  500. <a href="?tab=AdminAddresses&id_address={$addresses.delivery->id}&addaddress&realedit=1&id_order={$order->id}{if ($addresses.delivery->id == $addresses.invoice->id)}&address_type=1{/if}&token={getAdminToken tab='AdminAddresses'}&back={$smarty.server.REQUEST_URI|urlencode}"><img src="../img/admin/edit.gif" /></a>
  501. <a href="http://maps.google.com/maps?f=q&hl={$iso_code_lang}&geocode=&q={$addresses.delivery->address1} {$addresses.delivery->postcode} {$addresses.delivery->city} {if ($addresses.delivery->id_state)} {$addresses.deliveryState->name}{/if}" target="_blank"><img src="../img/admin/google.gif" alt="" class="middle" /></a>
  502. </div>
  503. {displayAddressDetail address=$addresses.delivery newLine='<br />'}
  504. {if $addresses.delivery->other}<hr />{$addresses.delivery->other}<br />{/if}
  505. </fieldset>
  506. </div>
  507. {/if}
  508. <div style="width: 49%; float:right;">
  509. <!-- Invoice address -->
  510. <fieldset>
  511. <legend><img src="../img/admin/invoice.gif" alt="{l s='Invoice address'}" />{l s='Invoice address'}</legend>
  512. {if $can_edit}
  513. <form method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}">
  514. <div style="margin-bottom:5px;">
  515. <p>
  516. <select name="id_address">
  517. {foreach from=$customer_addresses item=address}
  518. <option value="{$address['id_address']}"{if $address['id_address'] == $order->id_address_invoice} selected="selected"{/if}>{$address['alias']} - {$address['address1']} {$address['postcode']} {$address['city']}{if !empty($address['state'])} {$address['state']}{/if}, {$address['country']}</option>
  519. {/foreach}
  520. </select>
  521. <input class="button" type="submit" name="submitAddressInvoice" value="{l s='Change'}" />
  522. </p>
  523. </div>
  524. </form>
  525. {/if}
  526. <div style="float: right">
  527. <a href="?tab=AdminAddresses&id_address={$addresses.invoice->id}&addaddress&realedit=1&id_order={$order->id}{if ($addresses.delivery->id == $addresses.invoice->id)}&address_type=2{/if}&back={$smarty.server.REQUEST_URI|urlencode}&token={getAdminToken tab='AdminAddresses'}"><img src="../img/admin/edit.gif" /></a>
  528. </div>
  529. {displayAddressDetail address=$addresses.invoice newLine='<br />'}
  530. {if $addresses.invoice->other}<hr />{$addresses.invoice->other}<br />{/if}
  531. </fieldset>
  532. </div>
  533. <div class="clear" style="margin-bottom: 10px;"></div>
  534. </div>
  535. <form style="width: 98%" class="container-command-top-spacing" action="{$current_index}&vieworder&token={$smarty.get.token}&id_order={$order->id}" method="post" onsubmit="return orderDeleteProduct('{l s='Cannot return this product'}', '{l s='Quantity to cancel is greater than quantity available'}');">
  536. <input type="hidden" name="id_order" value="{$order->id}" />
  537. <fieldset style="width: 100%; ">
  538. <div style="display: none">
  539. <input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
  540. </div>
  541. <legend><img src="../img/admin/cart.gif" alt="{l s='Products'}" />{l s='Products'}</legend>
  542. <div style="float:left;width: 100%;">
  543. {if $can_edit}
  544. {if !$order->hasBeenDelivered()}<div style="float: left;"><a href="#" class="add_product button"><img src="../img/admin/add.gif" alt="{l s='Add a product'}" /> {l s='Add a product'}</a></div>{/if}
  545. <div style="float: right; margin-right: 10px" id="refundForm">
  546. <!--
  547. <a href="#" class="standard_refund"><img src="../img/admin/add.gif" alt="{l s='Process a standard refund'}" /> {l s='Process a standard refund'}</a>
  548. <a href="#" class="partial_refund"><img src="../img/admin/add.gif" alt="{l s='Process a partial refund'}" /> {l s='Process a partial refund'}</a>
  549. -->
  550. </div>
  551. <br clear="left" /><br />
  552. {/if}
  553. <table style="width: 100%;" cellspacing="0" cellpadding="0" class="table" id="orderProducts">
  554. <tr>
  555. <th height="39" align="center" style="width: 7%">&nbsp;</th>
  556. <th>{l s='Product'}</th>
  557. <th style="width: 15%; text-align: center">{l s='Unit Price'} <sup>*</sup></th>
  558. <th style="width: 4%; text-align: center">{l s='Qty'}</th>
  559. {if ($order->hasBeenPaid())}<th style="width: 3%; text-align: center">{l s='Refunded'}</th>{/if}
  560. {if ($order->hasBeenDelivered() || $order->hasProductReturned())}<th style="width: 3%; text-align: center">{l s='Returned'}</th>{/if}
  561. <th style="width: 10%; text-align: center">{l s='Available quantity'}</th>
  562. <th style="width: 10%; text-align: center">{l s='Total'} <sup>*</sup></th>
  563. <th colspan="2" style="display: none;" class="add_product_fields">&nbsp;</th>
  564. <th colspan="2" style="display: none;" class="edit_product_fields">&nbsp;</th>
  565. <th colspan="2" style="display: none;" class="standard_refund_fields"><img src="../img/admin/delete.gif" alt="{l s='Products'}" />
  566. {if ($order->hasBeenDelivered() || $order->hasBeenShipped())}
  567. {l s='Return'}
  568. {elseif ($order->hasBeenPaid())}
  569. {l s='Refund'}
  570. {else}
  571. {l s='Cancel'}
  572. {/if}
  573. </th>
  574. <th style="width: 12%;text-align:right;display:none" class="partial_refund_fields">
  575. {l s='Partial refund'}
  576. </th>
  577. {if !$order->hasBeenDelivered()}
  578. <th style="width: 8%;text-align:center;">
  579. {l s='Action'}
  580. </th>
  581. {/if}
  582. </tr>
  583. {foreach from=$products item=product key=k}
  584. {* Include customized datas partial *}
  585. {include file='controllers/orders/_customized_data.tpl'}
  586. {* Include product line partial *}
  587. {include file='controllers/orders/_product_line.tpl'}
  588. {/foreach}
  589. {if $can_edit}
  590. {include file='controllers/orders/_new_product.tpl'}
  591. {/if}
  592. </table>
  593. <div style="float:left; width:280px; margin-top:15px;">
  594. <sup>*</sup> {l s='For this customer group, prices are displayed as:'}
  595. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  596. {l s='tax excluded.'}
  597. {else}
  598. {l s='tax included.'}
  599. {/if}
  600. {if !Configuration::get('PS_ORDER_RETURN')}
  601. <br /><br />{l s='Merchandise returns are disabled'}
  602. {/if}
  603. </div>
  604. <div style="float:right; margin-top: 20px;">
  605. <table class="table" width="450px;" style="border-radius:0px;"cellspacing="0" cellpadding="0">
  606. <tr id="total_products">
  607. <td width="150px;"><b>{l s='Products'}</b></td>
  608. <td class="amount" align="right">{displayPrice price=$order->total_products_wt currency=$currency->id}</td>
  609. <td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td>
  610. </tr>
  611. <tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
  612. <td><b>{l s='Discounts'}</b></td>
  613. <td class="amount" align="right">-{displayPrice price=$order->total_discounts_tax_incl currency=$currency->id}</td>
  614. <td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td>
  615. </tr>
  616. <tr id="total_wrapping" {if $order->total_wrapping_tax_incl == 0}style="display: none;"{/if}>
  617. <td><b>{l s='Wrapping'}</b></td>
  618. <td class="amount" align="right">{displayPrice price=$order->total_wrapping_tax_incl currency=$currency->id}</td>
  619. <td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td>
  620. </tr>
  621. <tr id="total_shipping">
  622. <td><b>{l s='Shipping'}</b></td>
  623. <td class="amount" align="right">{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td>
  624. <td class="partial_refund_fields current-edit" style="display:none;">{$currency->prefix}<input type="text" size="3" name="partialRefundShippingCost" value="0" />{$currency->suffix}</td>
  625. </tr>
  626. <tr style="font-size: 20px" id="total_order">
  627. <td style="font-size: 20px">{l s='Total'}</td>
  628. <td class="amount" style="font-size: 20px" align="right">
  629. {displayPrice price=$order->total_paid_tax_incl currency=$currency->id}
  630. </td>
  631. <td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td>
  632. </tr>
  633. </table>
  634. </div>
  635. <div class="clear"></div>
  636. {if (sizeof($discounts) || $can_edit)}
  637. <div style="float:right; width:450px; margin-top:15px;">
  638. <table cellspacing="0" cellpadding="0" class="table" style="width:100%;">
  639. <tr>
  640. <th><img src="../img/admin/coupon.gif" alt="{l s='Discounts'}" />{l s='Discount name'}</th>
  641. <th align="center" style="width: 100px">{l s='Value'}</th>
  642. {if $can_edit}<th align="center" style="width: 30px">{l s='Action'}</th>{/if}
  643. </tr>
  644. {foreach from=$discounts item=discount}
  645. <tr>
  646. <td>{$discount['name']}</td>
  647. <td align="center">
  648. {if $discount['value'] != 0.00}
  649. -
  650. {/if}
  651. {displayPrice price=$discount['value'] currency=$currency->id}
  652. </td>
  653. {if $can_edit}
  654. <td class="center">
  655. <a href="{$current_index}&submitDeleteVoucher&id_order_cart_rule={$discount['id_order_cart_rule']}&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}"><img src="../img/admin/delete.gif" alt="{l s='Delete voucher'}" /></a>
  656. </td>
  657. {/if}
  658. </tr>
  659. {/foreach}
  660. {if $can_edit}
  661. <tr>
  662. <td colspan="3" class="center">
  663. <a class="button" href="#" id="add_voucher"><img src="../img/admin/add.gif" alt="{l s='Add'}" /> {l s='Add a new discount'}</a>
  664. </td>
  665. </tr>
  666. <tr style="display: none" >
  667. <td colspan="3" class="current-edit" id="voucher_form">
  668. {include file='controllers/orders/_discount_form.tpl'}
  669. </td>
  670. </tr>
  671. {/if}
  672. </table>
  673. </div>
  674. {/if}
  675. </div>
  676. <div style="clear:both; height:15px;">&nbsp;</div>
  677. <div style="float: right; width: 160px; display: none;" class="standard_refund_fields">
  678. {if ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN'))}
  679. <input type="checkbox" name="reinjectQuantities" class="button" />&nbsp;<label for="reinjectQuantities" style="float:none; font-weight:normal;">{l s='Re-stock products'}</label><br />
  680. {/if}
  681. {if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
  682. <input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" class="button" onclick="toggleShippingCost(this)" />&nbsp;<label for="generateCreditSlip" style="float:none; font-weight:normal;">{l s='Generate a credit slip'}</label><br />
  683. <input type="checkbox" id="generateDiscount" name="generateDiscount" class="button" onclick="toggleShippingCost(this)" />&nbsp;<label for="generateDiscount" style="float:none; font-weight:normal;">{l s='Generate a voucher'}</label><br />
  684. <span id="spanShippingBack" style="display:none;"><input type="checkbox" id="shippingBack" name="shippingBack" class="button" />&nbsp;<label for="shippingBack" style="float:none; font-weight:normal;">{l s='Repay shipping costs'}</label><br /></span>
  685. {/if}
  686. {if (!$order->hasBeenDelivered() || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
  687. <div style="text-align:center; margin-top:5px;">
  688. <input type="submit" name="cancelProduct" value="{if $order->hasBeenDelivered()}{l s='Return products'}{elseif $order->hasBeenPaid()}{l s='Refund products'}{else}{l s='Cancel products'}{/if}" class="button" style="margin-top:8px;" />
  689. </div>
  690. {/if}
  691. </div>
  692. <div style="float: right; width: 160px; display:none;" class="partial_refund_fields">
  693. <input type="checkbox" name="reinjectQuantities" class="button" />&nbsp;<label for="reinjectQuantities" style="float:none; font-weight:normal;">{l s='Re-stock products'}</label><br />
  694. <input type="checkbox" id="generateDiscountRefund" name="generateDiscountRefund" class="button" onclick="toggleShippingCost(this)" />&nbsp;<label for="generateDiscount" style="float:none; font-weight:normal;">{l s='Generate a voucher'}</label><br />
  695. <input type="submit" name="partialRefund" value="{l s='Partial refund'}" class="button" style="margin-top:8px;" />
  696. </div>
  697. </fieldset>
  698. </form>
  699. <div class="clear" style="height:20px;">&nbsp;</div>
  700. <div style="float: left">
  701. <form action="{$smarty.server.REQUEST_URI}&token={$smarty.get.token}" method="post" onsubmit="if (getE('visibility').checked == true) return confirm('{l s='Do you want to send this message to the customer?'}');">
  702. <fieldset style="width: 400px;">
  703. <legend style="cursor: pointer;" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> {l s='New message'}</legend>
  704. <div id="message_m" style="display: {if Tools::getValue('message')}none{else}block{/if}; overflow: auto; width: 400px;">
  705. <a href="#" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false"><b>{l s='Click here'}</b> {l s='to add a comment or send a message to the customer'}</a>
  706. </div>
  707. <a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}"><b>{l s='Click here'}</b> {l s='to see all messages'}</a><br>
  708. <div id="message" style="display: {if Tools::getValue('message')}block{else}none{/if}">
  709. <select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')">
  710. <option value="0" selected="selected">-- {l s='Choose a standard message'} --</option>
  711. {foreach from=$orderMessages item=orderMessage}
  712. <option value="{$orderMessage['message']|escape:'htmlall':'UTF-8'}">{$orderMessage['name']}</option>
  713. {/foreach}
  714. </select><br /><br />
  715. <b>{l s='Display to customer?'}</b>
  716. <input type="radio" name="visibility" id="visibility" value="0" /> {l s='Yes'}
  717. <input type="radio" name="visibility" value="1" checked="checked" /> {l s='No'}
  718. <p id="nbchars" style="display:inline;font-size:10px;color:#666;"></p><br /><br />
  719. <textarea id="txt_msg" name="message" cols="50" rows="8" onKeyUp="var length = document.getElementById('txt_msg').value.length; if (length > 600) length = '600+'; document.getElementById('nbchars').innerHTML = '{l s='600 chars max'} (' + length + ')';">{Tools::getValue('message')|escape:'htmlall':'UTF-8'}</textarea><br /><br />
  720. <input type="hidden" name="id_order" value="{$order->id}" />
  721. <input type="hidden" name="id_customer" value="{$order->id_customer}" />
  722. <input type="submit" class="button" name="submitMessage" value="{l s='Send'}" />
  723. </div>
  724. </fieldset>
  725. </form>
  726. {if (sizeof($messages))}
  727. <br />
  728. <fieldset style="width: 400px;">
  729. <legend><img src="../img/admin/email.gif" /> {l s='Messages'}</legend>
  730. {foreach from=$messages item=message}
  731. <div style="overflow:auto; width:400px;" {if $message['is_new_for_me']}class="new_message"{/if}>
  732. {if ($message['is_new_for_me'])}
  733. <a class="new_message" title="{l s='Mark this message as \'viewed\''}" href="{$smarty.server.REQUEST_URI}&token={$smarty.get.token}&messageReaded={$message['id_message']}"><img src="../img/admin/enabled.gif" alt="" /></a>
  734. {/if}
  735. {l s='At'} <i>{dateFormat date=$message['date_add']}
  736. </i> {l s='from'} <b>{if ($message['elastname'])}{$message['efirstname']} {$message['elastname']}{else}{$message['cfirstname']} {$message['clastname']}{/if}</b>
  737. {if ($message['private'] == 1)}<span style="color:red; font-weight:bold;">{l s='Private:'}</span>{/if}
  738. <p>{$message['message']|nl2br}</p>
  739. </div>
  740. <br />
  741. {/foreach}
  742. </fieldset>
  743. {/if}
  744. </div>
  745. <div class="clear">&nbsp;</div>
  746. <br /><br /><a href="{$current_index}&token={$smarty.get.token}"><img src="../img/admin/arrow2.gif" /> {l s='Back to list'}</a><br />
  747. {/block}