[-] BO: don't display stock available if stock management is disabled #PSCFV-6029

This commit is contained in:
Rémi Gaillard
2012-12-11 16:59:26 +01:00
parent ef4b3576fc
commit 8d2f5d6e42
5 changed files with 31 additions and 21 deletions
@@ -45,8 +45,8 @@
</td>
<td align="center" class="productQuantity">{$product['customizationQuantityTotal']}</td>
{if ($order->hasBeenPaid())}<td align="center" class="productQuantity">{$product['customizationQuantityRefunded']}</td>{/if}
{if ($order->hasBeenDelivered())}<td align="center" class="productQuantity">{$product['customizationQuantityReturned']}</td>{/if}
<td align="center" class=""> - </td>
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<td align="center" class="productQuantity">{$product['customizationQuantityReturned']}</td>{/if}
{if $stock_management}<td align="center" class=""> - </td>{/if}
<td align="center" class="total_product">
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
@@ -88,7 +88,7 @@
{/if}
</td>
{/if}
<td align="center" class="productQuantity product_stock">{$product['current_stock']}</td>
{if $stock_management}<td align="center" class="productQuantity product_stock">{$product['current_stock']}</td>{/if}
<td align="center" class="total_product">
{displayPrice price=(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal'])) currency=$currency->id}
</td>
@@ -39,6 +39,7 @@
var priceDisplayPrecision = 2;
var use_taxes = {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}true{else}false{/if};
var token = "{$smarty.get.token|escape:'htmlall':'UTF-8'}";
var stock_management = {$stock_management|intval};
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}";
var txt_add_product_new_invoice = "{l s='Are you sure you want to create a new invoice?' js=1}";
@@ -594,7 +595,7 @@
<th style="width: 4%; text-align: center">{l s='Qty'}</th>
{if ($order->hasBeenPaid())}<th style="width: 3%; text-align: center">{l s='Refunded'}</th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<th style="width: 3%; text-align: center">{l s='Returned'}</th>{/if}
<th style="width: 10%; text-align: center">{l s='Available quantity'}</th>
{if $stock_management}<th style="width: 10%; text-align: center">{l s='Available quantity'}</th>{/if}
<th style="width: 10%; text-align: center">{l s='Total'} <sup>*</sup></th>
<th colspan="2" style="display: none;" class="add_product_fields">&nbsp;</th>
<th colspan="2" style="display: none;" class="edit_product_fields">&nbsp;</th>