// orders WIP

This commit is contained in:
Kevin Granger committed 2013-10-03 21:04:35 +02:00
1 parent 874e17aa6f
commit bb7dd876af
11 files changed
+587 -396

No files matched your search

@@ -8392,6 +8392,17 @@ tr.highlight td {
-webkit-box-shadow: none; -webkit-box-shadow: none;
box-shadow: none; } box-shadow: none; }
/* line 737, admin-theme.sass */
li.sortable-placeholder {
border: 1px dashed #cccccc;
background-color: #bbbbbb;
margin-bottom: 4px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px; }
/* line 1, _nav.sass */ /* line 1, _nav.sass */
#nav-sidebar { #nav-sidebar {
float: left; float: left;
@@ -733,6 +733,15 @@ tr.highlight td
outline: 0 outline: 0
+box-shadow(none) +box-shadow(none)
//module positions
li.sortable-placeholder
border: 1px dashed #CCC
background-color: #BBB
margin-bottom: 4px
+border-radius(5px)
@import "nav" @import "nav"
@import "toggle-switch" @import "toggle-switch"
@import "carrier-wizard" @import "carrier-wizard"
@@ -23,78 +23,94 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<div class="form-group"> <div class="form-horizontal">
<label class="control-label"> <div class="form-group">
{l s='Name'} <label class="control-label col-lg-3">
</label> {l s='Name'}
<input class="form-control" type="text" name="discount_name" value="" /> </label>
</div> <div class="col-lg-9">
<div class="form-group"> <input class="form-control" type="text" name="discount_name" value="" />
<label class="control-label"> </div>
{l s='Type'} </div>
</label>
<select class="form-control" name="discount_type" id="discount_type"> <div class="form-group">
<option value="1">{l s='Percent'}</option> <label class="control-label col-lg-3">
<option value="2">{l s='Amount'}</option> {l s='Type'}
<option value="3">{l s='Free shipping'}</option> </label>
</select> <div class="col-lg-9">
</div> <select class="form-control" name="discount_type" id="discount_type">
<div class="form-group"> <option value="1">{l s='Percent'}</option>
<div id="discount_value_field"> <option value="2">{l s='Amount'}</option>
<label class="control-label"> <option value="3">{l s='Free shipping'}</option>
</select>
</div>
</div>
<div id="discount_value_field" class="form-group">
<label class="control-label col-lg-3">
{l s='Value'} {l s='Value'}
</label> </label>
<div class="input-group"> <div class="col-lg-9">
{if ($currency->format % 2)} <div class="input-group">
<span id="discount_currency_sign" class="input-group-addon" style="display: none;">{$currency->sign}</span> {if ($currency->format % 2)}
{else} <span id="discount_currency_sign" class="input-group-addon" style="display: none;">{$currency->sign}</span>
<span id="discount_percent_symbol" class="input-group-addon">%</span> {else}
{/if} <span id="discount_percent_symbol" class="input-group-addon">%</span>
{if !($currency->format % 2)} {/if}
<span id="discount_currency_sign" class="input-group-addon" style="display: none;">{$currency->sign}</span>
{/if} {if !($currency->format % 2)}
<input class="form-control" type="text" name="discount_value"/> <span id="discount_currency_sign" class="input-group-addon" style="display: none;">{$currency->sign}</span>
{/if}
<input class="form-control" type="text" name="discount_value"/>
</div>
<p class="text-muted" id="discount_value_help" style="display: none;">
{l s='This value must include taxes.'}
</p>
</div> </div>
<p class="text-muted" id="discount_value_help" style="display: none;">
{l s='This value must include taxes.'}
</p>
</div> </div>
</div>
{if $order->hasInvoice()} {if $order->hasInvoice()}
<div class="form-group"> <div class="form-group">
<label class="control-label"> <label class="control-label col-lg-3">
{l s='Invoice'} {l s='Invoice'}
</label>
<select name="discount_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" selected="selected">
{$invoice->getInvoiceNumberFormatted($current_id_lang)} - {displayPrice price=$invoice->total_paid_tax_incl currency=$order->id_currency}
</option>
{/foreach}
</select>
</div>
<div class="form-group">
<p class="checkbox">
<label class="control-label" for="discount_all_invoices">
<input type="checkbox" name="discount_all_invoices" id="discount_all_invoices" value="1" />
{l s='Apply on all invoices'}
</label> </label>
</p> <div class="col-lg-9">
<p class="help-block"> <select name="discount_invoice">
{l s='If you chooses to create this discount for all invoices, only one discount will be created per order invoice.'} {foreach from=$invoices_collection item=invoice}
</p> <option value="{$invoice->id}" selected="selected">
{/if} {$invoice->getInvoiceNumberFormatted($current_id_lang)} - {displayPrice price=$invoice->total_paid_tax_incl currency=$order->id_currency}
</div> </option>
{/foreach}
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<button class="btn btn-default" type="submit" name="submitNewVoucher"> <div class="col-lg-9 col-lg-offset-3">
<i class="icon-ok"></i> <p class="checkbox">
{l s='Add'} <label class="control-label" for="discount_all_invoices">
</button> <input type="checkbox" name="discount_all_invoices" id="discount_all_invoices" value="1" />
<button class="btn btn-default" type="button" id="cancel_add_voucher"> {l s='Apply on all invoices'}
<i class="icon-remove"></i> </label>
{l s='Cancel'} </p>
</button> <p class="help-block">
</div> {l s='If you chooses to create this discount for all invoices, only one discount will be created per order invoice.'}
</p>
</div>
</div>
{/if}
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<button class="btn btn-default" type="submit" name="submitNewVoucher">
<i class="icon-ok"></i>
{l s='Add'}
</button>
<button class="btn btn-default" type="button" id="cancel_add_voucher">
<i class="icon-remove"></i>
{l s='Cancel'}
</button>
</div>
</div>
</div>
@@ -25,19 +25,19 @@
<table class="table" id="documents_table"> <table class="table" id="documents_table">
<thead> <thead>
<tr> <tr>
<th width="10%"> <th>
<span class="title_box ">{l s='Date'}</span> <span class="title_box ">{l s='Date'}</span>
</th> </th>
<th> <th>
<span class="title_box ">{l s='Document'}</span> <span class="title_box ">{l s='Document'}</span>
</th> </th>
<th width="20%"> <th>
<span class="title_box ">{l s='Number'}</span> <span class="title_box ">{l s='Number'}</span>
</th> </th>
<th width="20%"> <th>
<span class="title_box ">{l s='Amount'}</span> <span class="title_box ">{l s='Amount'}</span>
</th> </th>
<th width="1%"></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -67,23 +67,32 @@
</td> </td>
<td> <td>
{if get_class($document) eq 'OrderInvoice'} {if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)} {if isset($document->is_delivery)}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order_invoice={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order_invoice={$document->id}">
{else} {else}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}">
{/if} {/if}
{elseif get_class($document) eq 'OrderSlip'} {elseif get_class($document) eq 'OrderSlip'}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}">
{/if} {/if}
{if get_class($document) eq 'OrderInvoice'} {if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)} {if isset($document->is_delivery)}
#{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number} #{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number}
{else} {else}
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)} {$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{/if} {/if}
{elseif get_class($document) eq 'OrderSlip'} {elseif get_class($document) eq 'OrderSlip'}
#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id} #{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
{/if} <span class="btn btn-default">
{/if}
<span class="btn btn-default">
<i class="icon-search"></i> <i class="icon-search"></i>
{l s='See the document'} {l s='See the document'}
</span> </span>
@@ -159,9 +168,9 @@
{foreachelse} {foreachelse}
<tr> <tr>
<td colspan="5" class="text-center"> <td colspan="5" class="text-center">
<h4>{l s='No documents are available'}</h4> <i class="icon-warning-sign"></i> {l s='No documents are available'}
{if isset($invoice_management_active) && $invoice_management_active} {if isset($invoice_management_active) && $invoice_management_active}
<a class="btn btn-default" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}{/if}"> <a class="btn btn-link" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}{/if}">
<i class="icon-repeat"></i> <i class="icon-repeat"></i>
{l s='Generate invoice'} {l s='Generate invoice'}
</a> </a>
@@ -22,29 +22,46 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<tr id="new_product" height="52" style="display:none;background-color:#e9f1f6"> <tr id="new_product" style="display:none">
<td style="display:none;" colspan="2"> <td style="display:none;" colspan="2">
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" /> <input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
{l s='Product:'} <input type="text" id="add_product_product_name" value="" size="42" /> {l s='Product:'} <input type="text" id="add_product_product_name" value=""/>
<div id="add_product_product_attribute_area" style="margin-top: 5px;display: none;"> <div id="add_product_product_attribute_area" style="display: none;">
{l s='Combinations'} <select name="add_product[product_attribute_id]" id="add_product_product_attribute_id"></select> {l s='Combinations'} <select name="add_product[product_attribute_id]" id="add_product_product_attribute_id"></select>
</div> </div>
<div id="add_product_product_warehouse_area" style="margin-top: 5px; display: none;"> <div id="add_product_product_warehouse_area" style="display: none;">
{l s='Warehouse'} <select id="add_product_warehouse" name="add_product_warehouse"> {l s='Warehouse'} <select id="add_product_warehouse" name="add_product_warehouse">
</select> </select>
</div> </div>
</td> </td>
<td style="display:none;"> <td style="display:none;">
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" size="4" disabled="disabled" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax excl.'}<br /> {if $currency->sign % 2}
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" size="4" disabled="disabled" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'}<br /> {$currency->sign}
{/if}
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" disabled="disabled" />
{if !($currency->sign % 2)}
{$currency->sign}
{/if}
{l s='tax excl.'}
<br />
{if $currency->sign % 2}
{$currency->sign}
{/if}
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" disabled="disabled" />
{if !($currency->sign % 2)}
{$currency->sign}
{/if}
{l s='tax incl.'}<br />
</td> </td>
<td style="display:none;" align="center" class="productQuantity"><input type="text" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" size="3" disabled="disabled" /></td> <td style="display:none;" class="productQuantity">
{if ($order->hasBeenPaid())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if} <input type="text" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" />
</td>
{if ($order->hasBeenPaid())}<td style="display:none;" class="productQuantity">&nbsp;</td>{/if}
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if} {if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenDelivered())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if} {if ($order->hasBeenDelivered())}<td style="display:none;" class="productQuantity">&nbsp;</td>{/if}
<td style="display:none;" align="center" class="productQuantity" id="add_product_product_stock">0</td> <td style="display:none;" class="productQuantity" id="add_product_product_stock">0</td>
<td style="display:none;" align="center" id="add_product_product_total">{displayPrice price=0 currency=$currency->id}</td> <td style="display:none;" id="add_product_product_total">{displayPrice price=0 currency=$currency->id}</td>
<td style="display:none;" align="center" colspan="2"> <td style="display:none;" colspan="2">
{if sizeof($invoices_collection)} {if sizeof($invoices_collection)}
<select name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled"> <select name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
<optgroup class="existing" label="{l s='Existing'}"> <optgroup class="existing" label="{l s='Existing'}">
@@ -59,10 +76,13 @@
{/if} {/if}
</td> </td>
<td style="display:none;"> <td style="display:none;">
<input type="button" class="button" id="submitAddProduct" value="{l s='Add product'}" disabled="disabled" /> <button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled">
<i class="icon-ok"></i>
{l s='Add product'}
</button>
</td> </td>
</tr> </tr>
<tr id="new_invoice" style="display:none;background-color:#e9f1f6;"> <tr id="new_invoice" style="display:none">
<td colspan="10"> <td colspan="10">
<h3>{l s='New invoice information'}</h3> <h3>{l s='New invoice information'}</h3>
<label>{l s='Carrier'}</label> <label>{l s='Carrier'}</label>
@@ -31,34 +31,42 @@
{/if} {/if}
{if ($product['product_quantity'] > $product['customizationQuantityTotal'])} {if ($product['product_quantity'] > $product['customizationQuantityTotal'])}
<tr{if isset($product.image) && $product.image->id && isset($product.image_size)} height="{$product['image_size'][1] + 7}"{/if}> <tr class="product-line-row" {if isset($product.image) && $product.image->id && isset($product.image_size)} height="{$product['image_size'][1] + 7}"{/if}>
<td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td> <td>{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td>
<td><a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}"> <td><a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<span class="productName">{$product['product_name']}</span><br /> <span class="productName">{$product['product_name']}</span><br />
{if $product.product_reference}{l s='Ref:'} {$product.product_reference}<br />{/if} {if $product.product_reference}{l s='Ref:'} {$product.product_reference}<br />{/if}
{if $product.product_supplier_reference}{l s='Ref Supplier:'} {$product.product_supplier_reference}{/if} {if $product.product_supplier_reference}{l s='Ref Supplier:'} {$product.product_supplier_reference}{/if}
</a></td> </a>
<td align="center"> </td>
<td>
<span class="product_price_show">{displayPrice price=$product_price currency=$currency->id}</span> <span class="product_price_show">{displayPrice price=$product_price currency=$currency->id}</span>
{if $can_edit} {if $can_edit}
<span class="product_price_edit" style="display:none;"> <span class="product_price_edit" style="display:none;">
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" /> <input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
{if $currency->sign % 2}{$currency->sign}{/if}<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" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax excl.'}<br /> {if $currency->sign % 2}
{if $currency->sign % 2}{$currency->sign}{/if}<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" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'} {$currency->sign}
{/if}
<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)}"/>
{if !($currency->sign % 2)}{$currency->sign}{/if}
{l s='tax excl.'}<br />
{if $currency->sign % 2}{$currency->sign}{/if}
<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)}"/>
{if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'}
</span> </span>
{/if} {/if}
</td> </td>
<td align="center" class="productQuantity"> <td class="productQuantity">
<span class="product_quantity_show{if (int)$product['product_quantity'] > 1} red bold{/if}">{$product['product_quantity']}</span> <span class="product_quantity_show{if (int)$product['product_quantity'] > 1} red bold{/if}">{$product['product_quantity']}</span>
{if $can_edit} {if $can_edit}
<span class="product_quantity_edit" style="display:none;"> <span class="product_quantity_edit" style="display:none;">
<input type="text" name="product_quantity" class="edit_product_quantity" value="{$product['product_quantity']|htmlentities}" size="2" /> <input type="text" name="product_quantity" class="edit_product_quantity" value="{$product['product_quantity']|htmlentities}"/>
</span> </span>
{/if} {/if}
</td> </td>
{if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if} {if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
{if ($order->hasBeenPaid())} {if ($order->hasBeenPaid())}
<td align="center" class="productQuantity"> <td class="productQuantity">
{$product['product_quantity_refunded']} {$product['product_quantity_refunded']}
{if count($product['refund_history'])} {if count($product['refund_history'])}
<span class="tooltip"> <span class="tooltip">
@@ -74,7 +82,7 @@
</td> </td>
{/if} {/if}
{if $order->hasBeenDelivered() || $order->hasProductReturned()} {if $order->hasBeenDelivered() || $order->hasProductReturned()}
<td align="center" class="productQuantity"> <td class="productQuantity">
{$product['product_quantity_return']} {$product['product_quantity_return']}
{if count($product['return_history'])} {if count($product['return_history'])}
<span class="tooltip"> <span class="tooltip">
@@ -89,12 +97,12 @@
{/if} {/if}
</td> </td>
{/if} {/if}
{if $stock_management}<td align="center" class="productQuantity product_stock">{$product['current_stock']}</td>{/if} {if $stock_management}<td class="productQuantity product_stock">{$product['current_stock']}</td>{/if}
<td align="center" class="total_product"> <td class="total_product">
{displayPrice price=(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal'])) currency=$currency->id} {displayPrice price=(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal'])) currency=$currency->id}
</td> </td>
<td colspan="2" style="display: none;" class="add_product_fields">&nbsp;</td> <td colspan="2" style="display: none;" class="add_product_fields">&nbsp;</td>
<td align="center" class="cancelCheck standard_refund_fields current-edit" style="display:none"> <td class="cancelCheck standard_refund_fields current-edit" style="display:none">
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$product['product_quantity_return']}" /> <input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$product['product_quantity_return']}" />
<input type="hidden" name="totalQty" id="totalQty" value="{$product['product_quantity']}" /> <input type="hidden" name="totalQty" id="totalQty" value="{$product['product_quantity']}" />
<input type="hidden" name="productName" id="productName" value="{$product['product_name']}" /> <input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
@@ -108,7 +116,7 @@
{if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])} {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}
<input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" /> <input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" />
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))} {elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
<input type="text" id="cancelQuantity_{$product['id_order_detail']}" name="cancelQuantity[{$product['id_order_detail']}]" size="2" onclick="selectCheckbox(this);" value="" /> <input type="text" id="cancelQuantity_{$product['id_order_detail']}" name="cancelQuantity[{$product['id_order_detail']}]" onclick="selectCheckbox(this);" value="" />
{/if} {/if}
{if $product['customizationQuantityTotal']} {if $product['customizationQuantityTotal']}
@@ -125,29 +133,72 @@
0/{$productQuantity} 0/{$productQuantity}
{/if} {/if}
</td> </td>
<td class="partial_refund_fields current-edit" style="text-align:left;display:none"> <td class="partial_refund_fields current-edit" style="display:none;">
<div style="width:40%;margin-top:5px;float:left">{l s='Quantity:'}</div> <div style="width:60%;margin-top:2px;float:left"><input onchange="checkPartialRefundProductQuantity(this)" type="text" size="3" name="partialRefundProductQuantity[{{$product['id_order_detail']}}]" value="0" /> 0/{$productQuantity-$product['product_quantity_refunded']}</div> <div>
<div style="width:40%;margin-top:5px;float:left">{l s='Amount:'}</div> <div style="width:60%;margin-top:2px;float:left">{$currency->prefix}<input onchange="checkPartialRefundProductAmount(this)" type="text" size="3" name="partialRefundProduct[{$product['id_order_detail']}]" /> {$currency->suffix}</div> {if !empty($product['amount_refund']) && $product['amount_refund'] > 0}({l s='%s refund' sprintf=$product['amount_refund']}){/if} {l s='Quantity:'}
</div>
<div>
<input onchange="checkPartialRefundProductQuantity(this)" type="text" name="partialRefundProductQuantity[{{$product['id_order_detail']}}]" value="0" />
0/{$productQuantity-$product['product_quantity_refunded']}
</div>
<div>
{l s='Amount:'}
</div>
<div>
{$currency->prefix}
<input onchange="checkPartialRefundProductAmount(this)" type="text" name="partialRefundProduct[{$product['id_order_detail']}]" />
{$currency->suffix}
</div>
{if !empty($product['amount_refund']) && $product['amount_refund'] > 0}
({l s='%s refund' sprintf=$product['amount_refund']})
{/if}
<input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" /> <input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" />
<input type="hidden" value="{$product['amount_refundable']}" class="partialRefundProductAmount" /> <input type="hidden" value="{$product['amount_refundable']}" class="partialRefundProductAmount" />
</td> </td>
{if ($can_edit && !$order->hasBeenDelivered())} {if ($can_edit && !$order->hasBeenDelivered())}
<td class="product_invoice" colspan="2" style="display: none;text-align:center;"> <td class="product_invoice" colspan="2" style="display: none;">
{if sizeof($invoices_collection)} {if sizeof($invoices_collection)}
<select name="product_invoice" class="edit_product_invoice"> <select name="product_invoice" class="edit_product_invoice">
{foreach from=$invoices_collection item=invoice} {foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" {if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}>#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}</option> <option value="{$invoice->id}" {if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}>
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
</option>
{/foreach} {/foreach}
</select> </select>
{else} {else}
&nbsp; &nbsp;
{/if} {/if}
</td> </td>
<td class="product_action" style="text-align:right"> <td class="product_action">
<a href="#" class="edit_product_change_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a> {* edit/delete controls *}
<input type="submit" class="button" name="submitProductChange" value="{l s='Update'}" style="display: none;" /> <div class="btn-group">
<a href="#" class="cancel_product_change_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a> <button type="button" class="btn btn-default edit_product_change_link">
<a href="#" class="delete_product_line"><img src="../img/admin/delete.gif" alt="{l s='Delete'}" /></a> <i class="icon-pencil"></i>
{l s='Edit'}
</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#" class="delete_product_line">
<i class="icon-trash"></i>
{l s='Delete'}
</a>
</li>
</ul>
</div>
{* Update controls *}
<button type="button" class="btn btn-default submitProductChange" style="display: none;">
<i class="icon-ok"></i>
{l s='Update'}
</button>
<button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
<i class="icon-remove"></i>
{l s='Cancel'}
</button>
</td> </td>
{/if} {/if}
</tr> </tr>
@@ -69,7 +69,7 @@
<input type="submit" class="btn btn-default" name="submitShippingNumber" value="{l s='Update'}" /> <input type="submit" class="btn btn-default" name="submitShippingNumber" value="{l s='Update'}" />
</span> </span>
<a href="#" class="edit_shipping_number_link btn btn-default"> <a href="#" class="edit_shipping_number_link btn btn-default">
<i class="icon-search"></i> <i class="icon-pencil"></i>
{l s='Edit'} {l s='Edit'}
</a> </a>
<a href="#" class="cancel_shipping_number_link btn btn-default" style="display: none;"> <a href="#" class="cancel_shipping_number_link btn btn-default" style="display: none;">
@@ -62,109 +62,124 @@
<div>{$hook_invoice}</div> <div>{$hook_invoice}</div>
{/if} {/if}
<div class="panel">
{if (count($invoices_collection))}
<a class="btn btn-default" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id}" target="_blank">
<i class="icon-file"></i>
{l s='View invoice'}
</a>
{else}
<span class="icon-stack">
<i class="icon-file"></i>
<i class="icon-ban-circle icon-stack-base text-danger"></i>
</span>
{l s='No invoice'}
{/if}
{if (($currentState && $currentState->delivery) || $order->delivery_number)}
<a class="btn btn-default" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}" target="_blank">
<i class="icon-truck"></i>
{l s='View delivery slip'}
</a>
{else}
<span class="icon-stack">
<i class="icon-truck"></i>
<i class="icon-ban-circle icon-stack-base text-danger"></i>
</span>
{l s='No delivery slip'}
{/if}
<a class="btn btn-default" href="javascript:window.print()">
<i class="icon-print"></i>
{l s='Print order'}
</a>
<hr/>
<dl>
<dt>{l s='Date'} </dt>
<dd>{dateFormat date=$order->date_add full=true}</dd>
</dl>
<dl>
<dt>{l s='Messages:'}</dt>
<dd>{sizeof($messages)}</dd>
</dl>
<dl>
<dt>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{l s='New Customer Messages:'}</a>
</dt>
<dd>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{sizeof($customer_thread_message)}</a>
</dd>
</dl>
<dl>
<dt>{l s='Products:'}</dt>
<dd id="product_number">{sizeof($products)}</dd>
</dl>
<dl>
<dt>{l s='Total'}</dt>
<dd class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</dd>
</dl>
</div>
<div class="panel"> <div class="panel">
<h3> <div class="row">
<i class="icon-time"></i> <div class="col-lg-3 box-stats color3" >
{l s='Status'} <i class="icon-calendar-empty"></i>
</h3> <span class="title">{l s='Date'}<br /><small>sous-titre</small></span>
<!-- Change status form --> <span class="value">{dateFormat date=$order->date_add full=false}</span>
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post" class="form-horizontal"> </div>
<div class="form-group"> <div class="col-lg-3 box-stats color1" >
<div class="col-lg-3"> <i class="icon-comments"></i>
<select id="id_order_state" name="id_order_state"> <span class="title">{l s='Messages'}<br /><small>sous-titre</small></span>
{foreach from=$states item=state} <span class="value">{sizeof($messages)}</span>
<option value="{$state['id_order_state']}"{if $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|stripslashes}</option> </div>
{/foreach} <div class="col-lg-3 box-stats color1" >
</select> <i class="icon-ok"></i>
<input type="hidden" name="id_order" value="{$order->id}" /> <span class="title">{l s='Products'}<br /><small>sous-titre</small></span>
</div> <span class="value">{sizeof($products)}</span>
<div class="col-lg-3"> </div>
<button type="submit" name="submitState" class="btn btn-default"> <div class="col-lg-3 box-stats color4" >
<i class="icon-plus-sign"></i> <i class="icon-money"></i>
{l s='Add'} <span class="title">{l s='Total'}<br /><small>sous-titre</small></span>
</button> <span class="value">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</span>
</div> </div>
</div>
</form>
<!-- History of status -->
<table class="table history-status">
<tbody>
{foreach from=$history item=row key=key}
{if ($key == 0)}
<tr class="highlight">
<td><img src="../img/os/{$row['id_order_state']}.gif" /></td>
<td><span class="title_box ">{$row['ostate_name']|stripslashes}</span></td>
<td><span class="title_box ">{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if}</span></td>
<td><span class="title_box ">{dateFormat date=$row['date_add'] full=true}</span></td>
</tr>
{else}
<tr>
<td><img src="../img/os/{$row['id_order_state']}.gif" /></td>
<td>{$row['ostate_name']|stripslashes}</td>
<td>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else}&nbsp;{/if}</td>
<td>{dateFormat date=$row['date_add'] full=true}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div> </div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="panel">
<h3>
<i class="icon-time"></i>
{l s='Status'}
</h3>
<!-- Change status form -->
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post" class="form-horizontal">
<div class="form-group">
<div class="col-lg-9">
<select id="id_order_state" name="id_order_state">
{foreach from=$states item=state}
<option value="{$state['id_order_state']}"{if $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|stripslashes}</option>
{/foreach}
</select>
<input type="hidden" name="id_order" value="{$order->id}" />
</div>
<div class="col-lg-3">
<button type="submit" name="submitState" class="btn btn-default">
<i class="icon-plus-sign"></i>
{l s='Add'}
</button>
</div>
</div>
</form>
<!-- History of status -->
<table class="table history-status">
<tbody>
{foreach from=$history item=row key=key}
{if ($key == 0)}
<tr class="highlight">
<td><img src="../img/os/{$row['id_order_state']}.gif" /></td>
<td><span class="title_box ">{$row['ostate_name']|stripslashes}</span></td>
<td><span class="title_box ">{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if}</span></td>
<td><span class="title_box ">{dateFormat date=$row['date_add'] full=true}</span></td>
</tr>
{else}
<tr>
<td><img src="../img/os/{$row['id_order_state']}.gif" /></td>
<td>{$row['ostate_name']|stripslashes}</td>
<td>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else}&nbsp;{/if}</td>
<td>{dateFormat date=$row['date_add'] full=true}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div>
</div>
<div class="col-lg-6">
<div class="panel">
{if (count($invoices_collection))}
<a class="btn btn-default" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id}" target="_blank">
<i class="icon-file"></i>
{l s='View invoice'}
</a>
{else}
<span class="icon-stack">
<i class="icon-file"></i>
<i class="icon-ban-circle icon-stack-base text-danger"></i>
</span>
{l s='No invoice'}
{/if}
{if (($currentState && $currentState->delivery) || $order->delivery_number)}
<a class="btn btn-default" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}" target="_blank">
<i class="icon-truck"></i>
{l s='View delivery slip'}
</a>
{else}
<span class="icon-stack">
<i class="icon-truck"></i>
<i class="icon-ban-circle icon-stack-base text-danger"></i>
</span>
{l s='No delivery slip'}
{/if}
<a class="btn btn-default" href="javascript:window.print()">
<i class="icon-print"></i>
{l s='Print order'}
</a>
<hr/>
<dl>
<dt>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{l s='New Customer Messages:'}</a>
</dt>
<dd>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{sizeof($customer_thread_message)}</a>
</dd>
</dl>
</div>
</div>
</div>
<!-- Customer informations --> <!-- Customer informations -->
{if $customer->id} {if $customer->id}
@@ -173,30 +188,42 @@
<i class="icon-user"></i> <i class="icon-user"></i>
{l s='Customer information'} {l s='Customer information'}
</h3> </h3>
<span> <h4>
<a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$gender->name|escape:'htmlall':'UTF-8'} {$customer->firstname} {$customer->lastname}</a> <a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}">
</span> ({l s='#'}{$customer->id}) {$gender->name|escape:'htmlall':'UTF-8'}
(<a href="mailto:{$customer->email}">{$customer->email}</a>) {$customer->firstname}
{$customer->lastname}
</a>
<small>
({l s='#'}{$customer->id}) -
<a href="mailto:{$customer->email}">{$customer->email}</a>
</small>
</h4>
{if ($customer->isGuest())} {if ($customer->isGuest())}
{l s='This order has been placed by a guest.'} {l s='This order has been placed by a guest.'}
{if (!Customer::customerExists($customer->email))} {if (!Customer::customerExists($customer->email))}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}"> <form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$order->id_lang}" /> <input type="hidden" name="id_lang" value="{$order->id_lang}" />
<p class="center"> <input class="btn btn-default" type="submit" name="submitGuestToCustomer" value="{l s='Transform a guest into a customer'}" />
<input class="btn btn-default" type="submit" name="submitGuestToCustomer" value="{l s='Transform a guest into a customer'}" /> <p class="help-block">{l s='This feature will generate a random password and send an email to the customer.'}</p>
</p>
{l s='This feature will generate a random password and send an email to the customer.'}
</form> </form>
{else} {else}
<div> <div>
<b style="color:red;">{l s='A registered customer account has already claimed this email address'}</b> <b style="color:red;">
{l s='A registered customer account has already claimed this email address'}
</b>
</div> </div>
{/if} {/if}
{else} {else}
{l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br /> <ul>
{l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br /> <li>{l s='Account registered:'} <strong>{dateFormat date=$customer->date_add full=true}</strong></li>
{l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br /> <li>{l s='Valid orders placed:'} <strong>{$customerStats['nb_orders']}</strong></li>
<li>{l s='Total spent since registration:'} <strong>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</strong></li>
</ul>
{/if} {/if}
</fieldset> </fieldset>
{/if} {/if}
@@ -204,7 +231,7 @@
{if (sizeof($sources))} {if (sizeof($sources))}
<fieldset> <fieldset>
<h3> <h3>
<img src="../img/admin/tab-stats.gif" /> <i class="icon-globe"></i>
{l s='Sources'} {l s='Sources'}
</h3> </h3>
<ul {if sizeof($sources) > 3}style="height: 200px; overflow-y: scroll;"{/if}> <ul {if sizeof($sources) > 3}style="height: 200px; overflow-y: scroll;"{/if}>
@@ -242,7 +269,7 @@
{if count($order->getBrother()) > 0} {if count($order->getBrother()) > 0}
<fieldset> <fieldset>
<h3> <h3>
<img src="../img/admin/tab-orders.gif" /> <i class="icon-cart"></i>
{l s='Linked orders'} {l s='Linked orders'}
</h3> </h3>
<table class="table"> <table class="table">
@@ -273,7 +300,10 @@
{displayPrice price=$brother_order->total_paid_tax_incl currency=$currency->id} {displayPrice price=$brother_order->total_paid_tax_incl currency=$currency->id}
</td> </td>
<td> <td>
<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> <a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
<i class="icon-eye-open"></i>
{l s='See the order'}
</a>
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
@@ -285,7 +315,7 @@
<!-- Documents block --> <!-- Documents block -->
<fieldset> <fieldset>
<h3> <h3>
<i class="icon-file"></i> <i class="icon-file-text"></i>
{l s='Documents'} {l s='Documents'}
</h3> </h3>
@@ -297,27 +327,16 @@
<fieldset> <fieldset>
<h3> <h3>
<i class="icon-money"></i> <i class="icon-money"></i>
{l s='Payment: '} {l s='Payment'}
</h3> </h3>
{if (!$order->valid && sizeof($currencies) > 1)}
<form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
<p class="warn">{l s='Do not forget to update your exchange rate before making this change.'}</p>
<label>{l s='Do not forget to update your exchange rate before making this change.'}</label>
<select name="new_currency">
{foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency}
<option value="{$currency_change['id_currency']}">{$currency_change['name']} - {$currency_change['sign']}</option>
{/if}
{/foreach}
</select>
<input type="submit" class="btn btn-default" name="submitChangeCurrency" value="{l s='Change'}" />
</form>
{/if}
{if count($order->getOrderPayments()) > 0} {if count($order->getOrderPayments()) > 0}
<p class="error" style="{if round($orders_total_paid_tax_incl, 2) == round($total_paid, 2) || $currentState->id == 6}display: none;{/if}"> <p class="alert alert-warning" style="{if round($orders_total_paid_tax_incl, 2) == round($total_paid, 2) || $currentState->id == 6}display: none;{/if}">
{l s='Warning'} {displayPrice price=$total_paid currency=$currency->id} {l s='Warning'}
{l s='paid instead of'} <span class="total_paid">{displayPrice price=$orders_total_paid_tax_incl currency=$currency->id}</span> <strong>{displayPrice price=$total_paid currency=$currency->id}</strong>
{l s='paid instead of'}
<strong class="total_paid">{displayPrice price=$orders_total_paid_tax_incl currency=$currency->id}</strong>
{foreach $order->getBrother() as $brother_order} {foreach $order->getBrother() as $brother_order}
{if $brother_order@first} {if $brother_order@first}
@@ -327,7 +346,9 @@
<br />{l s='This warning also concerns the next orders:'} <br />{l s='This warning also concerns the next orders:'}
{/if} {/if}
{/if} {/if}
<a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">#{'%06d'|sprintf:$brother_order->id}</a> <a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
#{'%06d'|sprintf:$brother_order->id}
</a>
{/foreach} {/foreach}
</p> </p>
{/if} {/if}
@@ -359,7 +380,10 @@
{/if} {/if}
</td> </td>
<td> <td>
<a href="#" class="open_payment_information"><img src="../img/admin/details.gif" title="{l s='See payment information'}" alt="{l s='See payment information'}" /></a> <button class="btn btn-default open_payment_information">
<i class="icon-search"></i>
{l s='See payment information'}
</button>
</td> </td>
</tr> </tr>
<tr class="payment_information" style="display: none;"> <tr class="payment_information" style="display: none;">
@@ -372,7 +396,6 @@
<i>{l s='Not defined'}</i> <i>{l s='Not defined'}</i>
{/if} {/if}
</p> </p>
<p> <p>
<b>{l s='Card Brand'}</b>&nbsp; <b>{l s='Card Brand'}</b>&nbsp;
{if $payment->card_brand} {if $payment->card_brand}
@@ -381,7 +404,6 @@
<i>{l s='Not defined'}</i> <i>{l s='Not defined'}</i>
{/if} {/if}
</p> </p>
<p> <p>
<b>{l s='Card Expiration'}</b>&nbsp; <b>{l s='Card Expiration'}</b>&nbsp;
{if $payment->card_expiration} {if $payment->card_expiration}
@@ -390,7 +412,6 @@
<i>{l s='Not defined'}</i> <i>{l s='Not defined'}</i>
{/if} {/if}
</p> </p>
<p> <p>
<b>{l s='Card Holder'}</b>&nbsp; <b>{l s='Card Holder'}</b>&nbsp;
{if $payment->card_holder} {if $payment->card_holder}
@@ -403,14 +424,16 @@
</tr> </tr>
{foreachelse} {foreachelse}
<tr> <tr>
<td colspan="6" class="center"> <td class="text-center" colspan="6">
<i class="icon-warning-sign"></i> <i class="icon-warning-sign"></i>
{l s='No payments are available'} {l s='No payments are available'}
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
<tr class="current-edit"> <tr class="current-edit">
<td><input type="text" name="payment_date" class="datepicker" size="17" value="{date('Y-m-d H:i:s')}" /></td> <td>
<input type="text" name="payment_date" class="datepicker" value="{date('Y-m-d H:i:s')}" />
</td>
<td> <td>
<select name="payment_method" class="payment_method"> <select name="payment_method" class="payment_method">
{foreach from=$payment_methods item=payment_method} {foreach from=$payment_methods item=payment_method}
@@ -439,12 +462,35 @@
</td> </td>
{/if} {/if}
<td> <td>
<input class="btn btn-default" type="submit" name="submitAddPayment" value="{l s='Add'}" /> <button class="btn btn-default" type="submit" name="submitAddPayment">
<i class="icon-ok"></i>
{l s='Add'}
</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form> </form>
{if (!$order->valid && sizeof($currencies) > 1)}
<form class="form-horizontal" method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
<label class="control-label col-lg-3">{l s='Change currency'}</label>
<div class="col-lg-6">
<select name="new_currency">
{foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency}
<option value="{$currency_change['id_currency']}">{$currency_change['name']} - {$currency_change['sign']}</option>
{/if}
{/foreach}
</select>
<p class="help-block">{l s='Do not forget to update your exchange rate before making this change.'}</p>
</div>
<div class="col-lg-3">
<input type="submit" class="btn btn-default" name="submitChangeCurrency" value="{l s='Change'}" />
</div>
</form>
{/if}
</fieldset> </fieldset>
<!-- Shipping block --> <!-- Shipping block -->
@@ -668,36 +714,43 @@
<fieldset> <fieldset>
<h3> <h3>
<i class="icon-shopping-cart"></i> <i class="icon-shopping-cart"></i>
{l s='Products:'} {l s='Products'}
</h3> </h3>
{if $can_edit}
{if !$order->hasBeenDelivered()}
<div >
<a href="#" class="add_product btn btn-default">
<i class="icon-plus-sign"></i>
{l s='Add a product'}
</a>
</div>
{/if}
<div id="refundForm"> <div id="refundForm">
<!-- <!--
<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> <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>
<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> <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>
--> -->
</div> </div>
{/if}
{capture "TaxMethod"}
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{l s='tax excluded.'}
{else}
{l s='tax included.'}
{/if}
{/capture}
<table class="table" id="orderProducts"> <table class="table" id="orderProducts">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th><span class="title_box ">{l s='Product'}</span></th> <th><span class="title_box ">{l s='Product'}</span></th>
<th><span class="title_box ">{l s='Unit Price'} <sup>*</sup></span></th> <th>
<span class="title_box ">{l s='Unit Price'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th><span class="title_box ">{l s='Qty'}</th> <th><span class="title_box ">{l s='Qty'}</th>
{if $display_warehouse}<th><span class="title_box ">{l s='Warehouse'}</span></th>{/if} {if $display_warehouse}<th><span class="title_box ">{l s='Warehouse'}</span></th>{/if}
{if ($order->hasBeenPaid())}<th><span class="title_box ">{l s='Refunded'}</span></th>{/if} {if ($order->hasBeenPaid())}<th><span class="title_box ">{l s='Refunded'}</span></th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<th><span class="title_box ">{l s='Returned'}</span></th>{/if} {if ($order->hasBeenDelivered() || $order->hasProductReturned())}
<th><span class="title_box ">{l s='Returned'}</span></th>
{/if}
{if $stock_management}<th><span class="title_box ">{l s='Available quantity'}</span></th>{/if} {if $stock_management}<th><span class="title_box ">{l s='Available quantity'}</span></th>{/if}
<th><span class="title_box ">{l s='Total'} <sup>*</sup></span></th> <th>
<span class="title_box ">{l s='Total'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th colspan="2" style="display: none;" class="add_product_fields"></th> <th colspan="2" style="display: none;" class="add_product_fields"></th>
<th colspan="2" style="display: none;" class="edit_product_fields"></th> <th colspan="2" style="display: none;" class="edit_product_fields"></th>
<th colspan="2" style="display: none;" class="standard_refund_fields"> <th colspan="2" style="display: none;" class="standard_refund_fields">
@@ -732,55 +785,76 @@
</tbody> </tbody>
</table> </table>
<div class="alert alert-warning"> {if $can_edit}
<sup>*</sup> {l s='For this customer group, prices are displayed as:'} {if !$order->hasBeenDelivered()}
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} <div class="row-margin-bottom">
{l s='tax excluded.'} <a href="#" class="add_product btn btn-default">
{else} <i class="icon-plus-sign"></i>
{l s='tax included.'} {l s='Add a product'}
{/if} </a>
{if !Configuration::get('PS_ORDER_RETURN')}
{l s='Merchandise returns are disabled'}
{/if}
</div> </div>
{/if}
{/if}
<table class="table">
<tr id="total_products"> <div class="row">
<td>{l s='Products:'}</td> <div class="col-lg-6">
<td class="amount">{displayPrice price=$order->total_products_wt currency=$currency->id}</td> <div class="alert alert-warning">
<td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td> {l s='For this customer group, prices are displayed as:'}
</tr> <strong>{$smarty.capture.TaxMethod}</strong>
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}> {if !Configuration::get('PS_ORDER_RETURN')}
<td>{l s='Discounts'}</td> <br/><strong>{l s='Merchandise returns are disabled'}</strong>
<td class="amount">-{displayPrice price=$order->total_discounts_tax_incl currency=$currency->id}</td> {/if}
<td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td> </div>
</tr> </div>
<tr id="total_wrapping" {if $order->total_wrapping_tax_incl == 0}style="display: none;"{/if}> <div class="col-lg-6">
<td>{l s='Wrapping'}</td> <table class="table">
<td class="amount">{displayPrice price=$order->total_wrapping_tax_incl currency=$currency->id}</td> <tr id="total_products">
<td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td> <td class="text-right">{l s='Products:'}</td>
</tr> <td class="amount text-right">
<tr id="total_shipping"> {displayPrice price=$order->total_products_wt currency=$currency->id}
<td>{l s='Shipping'}</td> </td>
<td class="amount" >{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td> <td class="partial_refund_fields current-edit" style="display:none;"></td>
<td class="partial_refund_fields current-edit" style="display:none;"> </tr>
{$currency->prefix} <tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
<input type="text" size="3" name="partialRefundShippingCost" value="0" /> <td class="text-right">{l s='Discounts'}</td>
{$currency->suffix} <td class="amount text-right">
</td> -{displayPrice price=$order->total_discounts_tax_incl currency=$currency->id}
</tr> </td>
<tr id="total_order"> <td class="partial_refund_fields current-edit" style="display:none;"></td>
<td>{l s='Total'}</td> </tr>
<td class="amount"> <tr id="total_wrapping" {if $order->total_wrapping_tax_incl == 0}style="display: none;"{/if}>
{displayPrice price=$order->total_paid_tax_incl currency=$currency->id} <td class="text-right">{l s='Wrapping'}</td>
</td> <td class="amount text-right">
<td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td> {displayPrice price=$order->total_wrapping_tax_incl currency=$currency->id}
</tr> </td>
</table> <td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
<tr id="total_shipping">
<td class="text-right">{l s='Shipping'}</td>
<td class="amount text-right" >
{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;">
{$currency->prefix}
<input type="text" name="partialRefundShippingCost" value="0" />
{$currency->suffix}
</td>
</tr>
<tr id="total_order">
<td class="text-right">{l s='Total'}</td>
<td class="amount text-right">
{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
</table>
</div>
</div>
</fieldset> </fieldset>
<fieldset > <fieldset >
{if (sizeof($discounts) || $can_edit)} {if (sizeof($discounts) || $can_edit)}
<h3> <h3>
<i class="icon-ticket"></i> <i class="icon-ticket"></i>
{l s="Discounts"} {l s="Discounts"}
@@ -793,7 +867,11 @@
{l s='Discount name'} {l s='Discount name'}
</span> </span>
</th> </th>
<th><span class="title_box ">{l s='Value'}</span></th> <th>
<span class="title_box ">
{l s='Value'}
</span>
</th>
{if $can_edit}<th></th>{/if} {if $can_edit}<th></th>{/if}
</tr> </tr>
</thead> </thead>
@@ -819,31 +897,28 @@
{/foreach} {/foreach}
</tbody> </tbody>
</table> </table>
{if $can_edit}
{if $can_edit} <button id="add_voucher" class="btn btn-default" type="button" >
<button id="add_discount_btn" class="btn btn-default" type="button" id="add_voucher">
<i class="icon-plus-sign"></i> <i class="icon-plus-sign"></i>
{l s='Add a new discount'} {l s='Add a new discount'}
</button> </button>
<div class="current-edit" id="voucher_form" style="display:none;"> <div class="current-edit" id="voucher_form" style="display:none;">
{include file='controllers/orders/_discount_form.tpl'} {include file='controllers/orders/_discount_form.tpl'}
</div> </div>
{/if} {/if}
{/if}
{/if}
<div style="display: none;" class="standard_refund_fields"> <div style="display: none;" class="standard_refund_fields">
{if ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN'))} {if ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN'))}
<input type="checkbox" name="reinjectQuantities" class="btn btn-default" /> <input type="checkbox" name="reinjectQuantities"/>
<label for="reinjectQuantities" style="float:none; font-weight:normal;">{l s='Re-stock products'}</label> <label for="reinjectQuantities">{l s='Re-stock products'}</label>
{/if} {/if}
{if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))} {if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
<input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" class="btn btn-default" onclick="toggleShippingCost(this)" /> <input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" onclick="toggleShippingCost(this)" />
<label for="generateCreditSlip" style="float:none; font-weight:normal;">{l s='Generate a credit card slip'}</label> <label for="generateCreditSlip">{l s='Generate a credit card slip'}</label>
<input type="checkbox" id="generateDiscount" name="generateDiscount" onclick="toggleShippingCost(this)" />
<input type="checkbox" id="generateDiscount" name="generateDiscount" class="btn btn-default" onclick="toggleShippingCost(this)" /> <label for="generateDiscount">{l s='Generate a voucher'}</label>
<label for="generateDiscount" style="float:none; font-weight:normal;">{l s='Generate a voucher'}</label>
<span id="spanShippingBack" style="display:none;"> <span id="spanShippingBack" style="display:none;">
<input type="checkbox" id="shippingBack" name="shippingBack" class="btn btn-default" /> <input type="checkbox" id="shippingBack" name="shippingBack" class="btn btn-default" />
@@ -865,30 +940,35 @@
</fieldset> </fieldset>
</form> </form>
<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?'}');"> <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?'}');">
<fieldset > <fieldset>
<h3 style="cursor: pointer;" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false"> <h3>
<i class="icon-envelope"></i> <i class="icon-envelope"></i>
{l s='New message'} {l s='New message'}
</h3> </h3>
<button type="button" class="btn btn-default" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false">
{l s='New message'}
</button>
<div id="message_m" style="display: {if Tools::getValue('message')}none{else}block{/if}"> <div id="message_m" style="display: {if Tools::getValue('message')}none{else}block{/if}">
<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>
{l s='to add a comment or send a message to the customer.'}
</div> </div>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}"><b>{l s='Click here'}</b> {l s='to see all messages.'}</a><br> <a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">
<b>{l s='Click here'}</b> {l s='to see all messages.'}
</a>
<div id="message" style="display: {if Tools::getValue('message')}block{else}none{/if}"> <div id="message" style="display: {if Tools::getValue('message')}block{else}none{/if}">
<select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')"> <select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')">
<option value="0" selected="selected">-- {l s='Choose a standard message'} --</option> <option value="0" selected="selected">-- {l s='Choose a standard message'} --</option>
{foreach from=$orderMessages item=orderMessage} {foreach from=$orderMessages item=orderMessage}
<option value="{$orderMessage['message']|escape:'htmlall':'UTF-8'}">{$orderMessage['name']}</option> <option value="{$orderMessage['message']|escape:'htmlall':'UTF-8'}">{$orderMessage['name']}</option>
{/foreach} {/foreach}
</select> </select>
<b>{l s='Display to customer?'}</b>
<input type="radio" name="visibility" id="visibility" value="0" /> {l s='Yes'}
<input type="radio" name="visibility" value="1" checked="checked" /> {l s='No'}
<b>{l s='Display to customer?'}</b> <p id="nbchars"></p>
<input type="radio" name="visibility" id="visibility" value="0" /> {l s='Yes'}
<input type="radio" name="visibility" value="1" checked="checked" /> {l s='No'}
<p id="nbchars"></p>
<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 characters, max.'} (' + length + ')';">{Tools::getValue('message')|escape:'htmlall':'UTF-8'}</textarea> <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 characters, max.'} (' + length + ')';">{Tools::getValue('message')|escape:'htmlall':'UTF-8'}</textarea>
@@ -908,7 +988,9 @@
{foreach from=$messages item=message} {foreach from=$messages item=message}
<div {if $message['is_new_for_me']}class="new_message"{/if}> <div {if $message['is_new_for_me']}class="new_message"{/if}>
{if ($message['is_new_for_me'])} {if ($message['is_new_for_me'])}
<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> <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>
{/if} {/if}
{l s='At'} <i>{dateFormat date=$message['date_add']}</i> {l s='At'} <i>{dateFormat date=$message['date_add']}</i>
{l s='from'} <b>{if ($message['elastname']|escape:'htmlall':'UTF-8')}{$message['efirstname']|escape:'htmlall':'UTF-8'} {$message['elastname']|escape:'htmlall':'UTF-8'}{else}{$message['cfirstname']|escape:'htmlall':'UTF-8'} {$message['clastname']|escape:'htmlall':'UTF-8'}{/if}</b> {l s='from'} <b>{if ($message['elastname']|escape:'htmlall':'UTF-8')}{$message['efirstname']|escape:'htmlall':'UTF-8'} {$message['elastname']|escape:'htmlall':'UTF-8'}{else}{$message['cfirstname']|escape:'htmlall':'UTF-8'} {$message['clastname']|escape:'htmlall':'UTF-8'}{/if}</b>
@@ -921,9 +1003,4 @@
</fieldset> </fieldset>
{/if} {/if}
{/block}
<a class="btn btn-default" href="{$current_index}&token={$smarty.get.token}">
<i class="icon-arrow-left"></i>
{l s='Back to list'}
</a>
{/block}
@@ -65,10 +65,18 @@
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{foreach from=$languages item=language_flag} {foreach from=$languages item=language_flag}
<li><a href="javascript:hideOtherLanguage({$language_flag.id_lang});" tabindex="-1"><img src="{$base_url}/img/l/{$language_flag.id_lang|intval}.jpg" alt=""> {$language_flag.name}</a></li> <li>
<a href="javascript:hideOtherLanguage({$language_flag.id_lang});" tabindex="-1">
<img src="{$base_url}/img/l/{$language_flag.id_lang|intval}.jpg" alt="">
{$language_flag.name}
</a>
</li>
{/foreach} {/foreach}
</ul> </ul>
<button type="button" class="btn btn-default" onclick="viewTemplates('#template_select_{$language.id_lang}', '../mails/{$language.iso_code}/', '.html');"><i class="icon-eye-open"></i> {l s='Preview'}</button> <button type="button" class="btn btn-default" onclick="viewTemplates('#template_select_{$language.id_lang}', '../mails/{$language.iso_code}/', '.html');">
<i class="icon-eye-open"></i>
{l s='Preview'}
</button>
</div> </div>
</div> </div>
{/foreach} {/foreach}
@@ -93,8 +93,8 @@ class AdminStatusesControllerCore extends AdminController
'title' => $this->l('Send email to customer'), 'title' => $this->l('Send email to customer'),
'align' => 'center', 'align' => 'center',
'icon' => array( 'icon' => array(
'1' => 'enabled.gif', '1' => 'icon-ok text-success',
'0' => 'disabled.gif' '0' => 'icon-ban-circle text-danger'
), ),
'type' => 'bool', 'type' => 'bool',
'orderby' => false, 'orderby' => false,
@@ -104,8 +104,8 @@ class AdminStatusesControllerCore extends AdminController
'title' => $this->l('Delivery'), 'title' => $this->l('Delivery'),
'align' => 'center', 'align' => 'center',
'icon' => array( 'icon' => array(
'1' => 'enabled.gif', '1' => 'icon-ok text-success',
'0' => 'disabled.gif' '0' => 'icon-ban-circle text-danger'
), ),
'type' => 'bool', 'type' => 'bool',
'orderby' => false, 'orderby' => false,
@@ -116,8 +116,8 @@ class AdminStatusesControllerCore extends AdminController
'title' => $this->l('Invoice'), 'title' => $this->l('Invoice'),
'align' => 'center', 'align' => 'center',
'icon' => array( 'icon' => array(
'1' => 'enabled.gif', '1' => 'icon-ok text-success',
'0' => 'disabled.gif' '0' => 'icon-ban-circle text-danger'
), ),
'type' => 'bool', 'type' => 'bool',
'orderby' => false, 'orderby' => false,
+26 -36
View File
@@ -350,12 +350,12 @@ function init()
{ {
$('tr#new_product input, tr#new_product select').each(function() { $('tr#new_product input, tr#new_product select').each(function() {
if ($(this).attr('id') != 'add_product_product_name') if ($(this).attr('id') != 'add_product_product_name')
$('tr#new_product input, tr#new_product select').attr('disabled', true); $('tr#new_product input, tr#new_product select, tr#new_product button').attr('disabled', true);
}); });
} }
else else
{ {
$('tr#new_product input, tr#new_product select').removeAttr('disabled'); $('tr#new_product input, tr#new_product select, tr#new_product button').removeAttr('disabled');
// Keep product variable // Keep product variable
current_product = data; current_product = data;
$('#add_product_product_id').val(data.id_product); $('#add_product_product_id').val(data.id_product);
@@ -576,7 +576,7 @@ function init()
ajax: 1, ajax: 1,
token: token, token: token,
action: 'loadProductInformation', action: 'loadProductInformation',
id_order_detail: $(this).parent().parent().find('input.edit_product_id_order_detail').val(), id_order_detail: $(this).closest('tr.product-line-row').find('input.edit_product_id_order_detail').val(),
id_address: id_address, id_address: id_address,
id_order: id_order id_order: id_order
}, },
@@ -588,13 +588,13 @@ function init()
var element_list = $('.customized-' + element.parent().parent().find('.edit_product_id_order_detail').val()); var element_list = $('.customized-' + element.parent().parent().find('.edit_product_id_order_detail').val());
if (!element_list.length) if (!element_list.length)
element_list = element.parent().parent(); element_list = element.parent().parent().parent();
element_list.css('background-color', '#E8EDC2'); //element_list.css('background-color', '#E8EDC2');
element_list.find('td .product_price_show').hide(); element_list.find('td .product_price_show').hide();
element_list.find('td .product_quantity_show').hide(); element_list.find('td .product_quantity_show').hide();
element_list.find('td .product_price_edit').parent().attr('align', 'left'); //element_list.find('td .product_price_edit').parent().attr('align', 'left');
element_list.find('td .product_price_edit').show(); element_list.find('td .product_price_edit').show();
element_list.find('td .product_quantity_edit').show(); element_list.find('td .product_quantity_edit').show();
@@ -607,10 +607,11 @@ function init()
$('th.edit_product_fields').attr('colspan', 2); $('th.edit_product_fields').attr('colspan', 2);
element_list.find('td.product_action').attr('colspan', 1); element_list.find('td.product_action').attr('colspan', 1);
element.parent().children('.delete_product_line').hide(); //element.parent().children('.delete_product_line').hide();
element.parent().children('.edit_product_change_link').hide(); element.parent().children('.edit_product_change_link').parent().hide();
element.parent().children('input[name=submitProductChange]').show();
element.parent().children('.cancel_product_change_link').show(); element.parent().parent().find('button.submitProductChange').show();
element.parent().parent().find('.cancel_product_change_link').show();
$('.standard_refund_fields').hide(); $('.standard_refund_fields').hide();
$('.partial_refund_fields').hide(); $('.partial_refund_fields').hide();
@@ -631,11 +632,10 @@ function init()
if (!element_list.length) if (!element_list.length)
element_list = $($(this).parent().parent()); element_list = $($(this).parent().parent());
element_list.css('background-color', '#FFF'); //element_list.css('background-color', '#FFF');
element_list.find('td .product_price_show').show(); element_list.find('td .product_price_show').show();
element_list.find('td .product_quantity_show').show(); element_list.find('td .product_quantity_show').show();
element_list.find('td .product_price_edit').parent().attr('align', 'center'); //element_list.find('td .product_price_edit').parent().attr('align', 'center');
element_list.find('td .product_price_edit').hide(); element_list.find('td .product_price_edit').hide();
element_list.find('td .product_quantity_edit').hide(); element_list.find('td .product_quantity_edit').hide();
@@ -643,36 +643,35 @@ function init()
element_list.find('td.cancelCheck').show(); element_list.find('td.cancelCheck').show();
element_list.find('td.cancelQuantity').show(); element_list.find('td.cancelQuantity').show();
element_list.find('.delete_product_line').show(); //element_list.find('.delete_product_line').show();
element_list.find('.edit_product_change_link').show(); element_list.find('.edit_product_change_link').parent().show();
element_list.find('input[name=submitProductChange]').hide(); element_list.find('button[name=submitProductChange]').hide();
element_list.find('.cancel_product_change_link').hide(); element_list.find('.cancel_product_change_link').hide();
$('.standard_refund_fields').hide(); $('.standard_refund_fields').hide();
return false; return false;
}); });
$('input[name=submitProductChange]').unbind('click'); $('button.submitProductChange').unbind('click');
$('input[name=submitProductChange]').click(function() { $('button.submitProductChange').click(function(e) {
if ($(this).parent().parent().find('td .edit_product_quantity').val() <= 0) e.preventDefault();
//console.log($(this).closest('tr.product-line-row').find('td .edit_product_quantity').val());
//console.log($(this).closest('tr.product-line-row').find('td .edit_product_price').val());
//return false;
if ($(this).closest('tr.product-line-row').find('td .edit_product_quantity').val() <= 0)
{ {
jAlert(txt_add_product_no_product_quantity); jAlert(txt_add_product_no_product_quantity);
return false; return false;
} }
if ($(this).closest('tr.product-line-row').find('td .edit_product_price').val() <= 0)
if ($(this).parent().parent().find('td .edit_product_price').val() <= 0)
{ {
jAlert(txt_add_product_no_product_price); jAlert(txt_add_product_no_product_price);
return false; return false;
} }
if (confirm(txt_confirm)) if (confirm(txt_confirm))
{ {
var element = $(this); var element = $(this);
var element_list = $('.customized-' + $(this).parent().parent().find('.edit_product_id_order_detail').val()); var element_list = $('.customized-' + $(this).parent().parent().find('.edit_product_id_order_detail').val());
query = 'ajax=1&token='+token+'&action=editProductOnOrder&id_order='+id_order+'&'; query = 'ajax=1&token='+token+'&action=editProductOnOrder&id_order='+id_order+'&';
if (element_list.length) if (element_list.length)
query += element_list.parent().parent().find('input:visible, select:visible, .edit_product_id_order_detail').serialize(); query += element_list.parent().parent().find('input:visible, select:visible, .edit_product_id_order_detail').serialize();
else else
@@ -717,10 +716,8 @@ function init()
var price_tax_excl = parseFloat($(this).val()); var price_tax_excl = parseFloat($(this).val());
if (price_tax_excl < 0 || isNaN(price_tax_excl)) if (price_tax_excl < 0 || isNaN(price_tax_excl))
price_tax_excl = 0; price_tax_excl = 0;
var tax_rate = current_product.tax_rate / 100 + 1; var tax_rate = current_product.tax_rate / 100 + 1;
$('.edit_product_price_tax_incl:visible').val(ps_round(price_tax_excl * tax_rate, 2)); $('.edit_product_price_tax_incl:visible').val(ps_round(price_tax_excl * tax_rate, 2));
// Update total product // Update total product
editProductRefreshTotal($(this)); editProductRefreshTotal($(this));
}); });
@@ -733,7 +730,6 @@ function init()
var tax_rate = current_product.tax_rate / 100 + 1; var tax_rate = current_product.tax_rate / 100 + 1;
$('.edit_product_price_tax_excl:visible').val(ps_round(price_tax_incl / tax_rate, 2)); $('.edit_product_price_tax_excl:visible').val(ps_round(price_tax_incl / tax_rate, 2));
// Update total product // Update total product
editProductRefreshTotal($(this)); editProductRefreshTotal($(this));
}); });
@@ -743,7 +739,6 @@ function init()
var quantity = parseInt($(this).val()); var quantity = parseInt($(this).val());
if (quantity < 1 || isNaN(quantity)) if (quantity < 1 || isNaN(quantity))
quantity = 1; quantity = 1;
var stock_available = parseInt($(this).parent().parent().parent().find('td.product_stock').html()); var stock_available = parseInt($(this).parent().parent().parent().find('td.product_stock').html());
// total update // total update
editProductRefreshTotal($(this)); editProductRefreshTotal($(this));
@@ -753,9 +748,8 @@ function init()
$('.delete_product_line').click(function() { $('.delete_product_line').click(function() {
if (!confirm(txt_confirm)) if (!confirm(txt_confirm))
return false; return false;
var tr_product = $(this).closest('.product-line-row');
var tr_product = $(this).parent().parent(); var id_order_detail = $(this).closest('.product-line-row').find('td .edit_product_id_order_detail').val();
var id_order_detail = $(this).parent().parent().find('td .edit_product_id_order_detail').val();
var query = 'ajax=1&action=deleteProductLine&token='+token+'&id_order_detail='+id_order_detail+'&id_order='+id_order; var query = 'ajax=1&action=deleteProductLine&token='+token+'&id_order_detail='+id_order_detail+'&id_order='+id_order;
$.ajax({ $.ajax({
@@ -856,10 +850,6 @@ function init()
} }
/* Refund system script */ /* Refund system script */
var flagRefund = ''; var flagRefund = '';