PageRenderTime 54ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/prestashop/_/admin2200io4fc/themes/default/template/controllers/orders/_customized_data.tpl

https://gitlab.com/A.Julien/sendstockbymail-module-prestashop
Smarty Template | 238 lines | 211 code | 0 blank | 27 comment | 11 complexity | 8679db0d9d5d88cbe7ebfcad62b60d53 MD5 | raw file
  1. {*
  2. * 2007-2016 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-2016 PrestaShop SA
  22. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  23. * International Registered Trademark & Property of PrestaShop SA
  24. *}
  25. {if $product['customizedDatas']}
  26. {* Assign product price *}
  27. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  28. {assign var=product_price value=($product['unit_price_tax_excl'] + $product['ecotax'])}
  29. {else}
  30. {assign var=product_price value=$product['unit_price_tax_incl']}
  31. {/if}
  32. <tr class="customized customized-{$product['id_order_detail']|intval} product-line-row">
  33. <td>
  34. <input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
  35. {if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if}
  36. </td>
  37. <td>
  38. <a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$product['product_id']|intval}&amp;updateproduct&amp;token={getAdminToken tab='AdminProducts'}">
  39. <span class="productName">{$product['product_name']} - {l s='Customized'}</span><br />
  40. {if ($product['product_reference'])}{l s='Reference number:'} {$product['product_reference']}<br />{/if}
  41. {if ($product['product_supplier_reference'])}{l s='Supplier reference:'} {$product['product_supplier_reference']}{/if}
  42. </a>
  43. </td>
  44. {if ($order->getTaxCalculationMethod() != $smarty.const.PS_TAX_EXC)}
  45. <td>
  46. <span>{displayPrice price=$product.unit_price_tax_excl currency=$currency->id}</span>
  47. </td>
  48. {/if}
  49. <td>
  50. <span class="product_price_show">{displayPrice price=$product_price currency=$currency->id|intval}</span>
  51. {if $can_edit}
  52. <div class="product_price_edit" style="display:none;">
  53. <input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
  54. <div class="form-group">
  55. <div class="fixed-width-xl">
  56. <div class="input-group">
  57. {if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
  58. <input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}" size="5" />
  59. {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
  60. </div>
  61. </div>
  62. <br/>
  63. <div class="fixed-width-xl">
  64. <div class="input-group">
  65. {if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
  66. <input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}" size="5" />
  67. {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. {/if}
  73. </td>
  74. <td class="productQuantity text-center">{$product['customizationQuantityTotal']}</td>
  75. {if $display_warehouse}<td>&nbsp;</td>{/if}
  76. {if ($order->hasBeenPaid())}<td class="productQuantity text-center">{$product['customizationQuantityRefunded']}</td>{/if}
  77. {if ($order->hasBeenDelivered() || $order->hasProductReturned())}<td class="productQuantity text-center">{$product['customizationQuantityReturned']}</td>{/if}
  78. {if $stock_management}<td class="text-center">{$product['current_stock']}</td>{/if}
  79. <td class="total_product">
  80. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  81. {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
  82. {else}
  83. {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
  84. {/if}
  85. </td>
  86. <td class="cancelQuantity standard_refund_fields current-edit" style="display:none" colspan="2">
  87. &nbsp;
  88. </td>
  89. <td class="edit_product_fields" colspan="2" style="display:none">&nbsp;</td>
  90. <td class="partial_refund_fields current-edit" style="text-align:left;display:none;"></td>
  91. {if ($can_edit && !$order->hasBeenDelivered())}
  92. <td class="product_action text-right">
  93. {* edit/delete controls *}
  94. <div class="btn-group">
  95. <button type="button" class="btn btn-default edit_product_change_link">
  96. <i class="icon-pencil"></i>
  97. {l s='Edit'}
  98. </button>
  99. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  100. <span class="caret"></span>
  101. </button>
  102. <ul class="dropdown-menu" role="menu">
  103. <li>
  104. <a href="#" class="delete_product_line">
  105. <i class="icon-trash"></i>
  106. {l s='Delete'}
  107. </a>
  108. </li>
  109. </ul>
  110. </div>
  111. {* Update controls *}
  112. <button type="button" class="btn btn-default submitProductChange" style="display: none;">
  113. <i class="icon-ok"></i>
  114. {l s='Update'}
  115. </button>
  116. <button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
  117. <i class="icon-remove"></i>
  118. {l s='Cancel'}
  119. </button>
  120. </td>
  121. {/if}
  122. </tr>
  123. {foreach $product['customizedDatas'] as $customizationPerAddress}
  124. {foreach $customizationPerAddress as $customizationId => $customization}
  125. <tr class="customized customized-{$product['id_order_detail']|intval}">
  126. <td colspan="2">
  127. <input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
  128. <div class="form-horizontal">
  129. {foreach $customization.datas as $type => $datas}
  130. {if ($type == Product::CUSTOMIZE_FILE)}
  131. {foreach from=$datas item=data}
  132. <div class="form-group">
  133. <span class="col-lg-4 control-label"><strong>{if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}</strong></span>
  134. <div class="col-lg-8">
  135. <a href="displayImage.php?img={$data['value']}&amp;name={$order->id|intval}-file{$data@iteration}" class="_blank">
  136. <img class="img-thumbnail" src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt=""/>
  137. </a>
  138. </div>
  139. </div>
  140. {/foreach}
  141. {elseif ($type == Product::CUSTOMIZE_TEXTFIELD)}
  142. {foreach from=$datas item=data}
  143. <div class="form-group">
  144. <span class="col-lg-4 control-label"><strong>{if $data['name']}{l s='%s' sprintf=$data['name']}{else}{l s='Text #%s' sprintf=$data@iteration}{/if}</strong></span>
  145. <div class="col-lg-8">
  146. <p class="form-control-static">{$data['value']}</p>
  147. </div>
  148. </div>
  149. {/foreach}
  150. {/if}
  151. {/foreach}
  152. </div>
  153. </td>
  154. <td>-</td>
  155. <td class="productQuantity text-center">
  156. <span class="product_quantity_show{if (int)$customization['quantity'] > 1} red bold{/if}">{$customization['quantity']}</span>
  157. {if $can_edit}
  158. <span class="product_quantity_edit" style="display:none;">
  159. <input type="text" name="product_quantity[{$customizationId|intval}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
  160. </span>
  161. {/if}
  162. </td>
  163. {if $display_warehouse}<td>&nbsp;</td>{/if}
  164. {if ($order->hasBeenPaid())}
  165. <td class="text-center">
  166. {if !empty($product['amount_refund'])}
  167. {l s='%s (%s refund)' sprintf=[$customization['quantity_refunded'], $product['amount_refund']]}
  168. {/if}
  169. <input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" />
  170. <input type="hidden" value="{(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal']))}" class="partialRefundProductAmount" />
  171. </td>
  172. {/if}
  173. {if ($order->hasBeenDelivered())}<td class="text-center">{$customization['quantity_returned']}</td>{/if}
  174. <td class="text-center">-</td>
  175. <td class="total_product">
  176. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  177. {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval}
  178. {else}
  179. {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval}
  180. {/if}
  181. </td>
  182. <td class="cancelCheck standard_refund_fields current-edit" style="display:none">
  183. <input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']|intval}" />
  184. <input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']|intval}" />
  185. <input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
  186. {if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))}
  187. <input type="checkbox" name="id_customization[{$customizationId|intval}]" id="id_customization[{$customizationId|intval}]" value="{$product['id_order_detail']|intval}" onchange="setCancelQuantity(this, {$customizationId|intval}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
  188. {else}
  189. --
  190. {/if}
  191. </td>
  192. <td class="cancelQuantity standard_refund_fields current-edit" style="display:none">
  193. {if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])}
  194. <input type="hidden" name="cancelCustomizationQuantity[{$customizationId|intval}]" value="0" />
  195. {elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
  196. <input type="text" id="cancelQuantity_{$customizationId|intval}" name="cancelCustomizationQuantity[{$customizationId|intval}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
  197. {/if}
  198. </td>
  199. <td class="partial_refund_fields current-edit" colspan="2" style="display:none; width: 250px;">
  200. {if $product['quantity_refundable'] > 0}
  201. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  202. {assign var='amount_refundable' value=$product['amount_refundable']}
  203. {else}
  204. {assign var='amount_refundable' value=$product['amount_refundable_tax_incl']}
  205. {/if}
  206. <div class="form-group">
  207. <div class="{if $product['amount_refundable'] > 0}col-lg-4{else}col-lg-12{/if}">
  208. <label class="control-label">
  209. {l s='Quantity:'}
  210. </label>
  211. <div class="input-group">
  212. <input onchange="checkPartialRefundProductQuantity(this)" type="text" name="partialRefundProductQuantity[{$product['id_order_detail']|intval}]" value="{if ($customization['quantity']-$customization['quantity_refunded']) >0}1{else}0{/if}" />
  213. <div class="input-group-addon">/ {$product['quantity_refundable']}</div>
  214. </div>
  215. </div>
  216. <div class="{if $product['quantity_refundable'] > 0}col-lg-8{else}col-lg-12{/if}">
  217. <label class="control-label">
  218. <span class="title_box ">{l s='Amount:'}</span>
  219. <small class="text-muted">({$smarty.capture.TaxMethod})</small>
  220. </label>
  221. <div class="input-group">
  222. {if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
  223. <input onchange="checkPartialRefundProductAmount(this)" type="text" name="partialRefundProduct[{$product['id_order_detail']|intval}]" />
  224. {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
  225. </div>
  226. <p class="help-block"><i class="icon-warning-sign"></i> {l s='(Max %s %s)' sprintf=[Tools::displayPrice(Tools::ps_round($amount_refundable, 2), $currency->id), $smarty.capture.TaxMethod]}</p>
  227. </div>
  228. </div>
  229. {/if}
  230. </td>
  231. {if ($can_edit && !$order->hasBeenDelivered())}
  232. <td class="edit_product_fields" colspan="2" style="display:none"></td>
  233. <td class="product_action" style="text-align:right"></td>
  234. {/if}
  235. </tr>
  236. {/foreach}
  237. {/foreach}
  238. {/if}