From 12e7f3a0b4191d634c5f7d60ecd8b5fc369c8701 Mon Sep 17 00:00:00 2001 From: dSevere Date: Fri, 18 Nov 2011 16:29:50 +0000 Subject: [PATCH] // Suppliers : Manage multiple suppliers for a product / product attribute + integration with supply orders --- .../themes/template/products/combinations.tpl | 27 +- .../themes/template/products/informations.tpl | 104 ++-- .../themes/template/products/quantities.tpl | 223 +++++++ .../themes/template/products/suppliers.tpl | 95 +++ admin-dev/themes/template/suppliers/view.tpl | 10 +- .../themes/template/supply_orders/form.tpl | 8 +- .../themes/template/supply_orders/view.tpl | 4 + classes/Product.php | 296 +++++++--- classes/ProductSupplier.php | 142 +++++ classes/Supplier.php | 205 ++++--- classes/stock/StockAvailable.php | 6 +- classes/stock/SupplyOrder.php | 8 + classes/stock/SupplyOrderDetail.php | 12 +- controllers/admin/AdminProductsController.php | 556 ++++++++---------- .../admin/AdminSupplyOrdersController.php | 41 +- install-dev/sql/db.sql | 18 +- install-dev/sql/db_settings_extends.sql | 6 + js/attributesBack.js | 3 +- 18 files changed, 1196 insertions(+), 568 deletions(-) create mode 100644 admin-dev/themes/template/products/quantities.tpl create mode 100644 admin-dev/themes/template/products/suppliers.tpl create mode 100644 classes/ProductSupplier.php diff --git a/admin-dev/themes/template/products/combinations.tpl b/admin-dev/themes/template/products/combinations.tpl index 883afec07..d061f0185 100644 --- a/admin-dev/themes/template/products/combinations.tpl +++ b/admin-dev/themes/template/products/combinations.tpl @@ -7,7 +7,7 @@ updateMvtStatus($(this).val()); }); updateMvtStatus($(this).val()); - + if ( $("input[name=is_virtual_file]:checked").val() == 1) { $("#virtual_good_attributes").show(); @@ -18,7 +18,7 @@ $("#virtual_good_attributes").hide(); $("#is_virtual_file_product").hide(); } - + $("input[name=is_virtual_file]").live("change", function() { if($(this).val() == "1") { @@ -31,7 +31,7 @@ $("#is_virtual_file_product").hide(); } }); - }); + }); - + {$currency->suffix} + onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix} {l s='per'} {if $ps_tax && $country_display_tax_label} - {l s='or'} + {l s='or'} {$currency->prefix}0.00{$currency->suffix} {l s='per'} {$product->unity} {l s='with tax'} @@ -697,7 +695,7 @@ $(document).ready(function(){ {* [end] prices *} - +
{if !$ps_stock_management} @@ -716,7 +714,7 @@ $(document).ready(function(){
- {$currency->prefix}{$currency->prefix}{$currency->suffix} {if $country_display_tax_label}{l s='tax excl.'}{/if}

{l s='Carrier tax will be applied.'}

@@ -725,9 +723,9 @@ $(document).ready(function(){ - {include file="products/input_text_lang.tpl" - languages=$languages - input_value=$product->available_now + {include file="products/input_text_lang.tpl" + languages=$languages + input_value=$product->available_now input_name='available_now'} {l s='Forbidden characters:'} <>;=#{}  @@ -735,15 +733,15 @@ $(document).ready(function(){ - {include file="products/input_text_lang.tpl" - languages=$languages + {include file="products/input_text_lang.tpl" + languages=$languages input_value=$product->available_later input_name='available_later'} {l s='Forbidden characters:'} <>;=#{}  {if $countAttributes} - + {* .(($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities(Tools::displayDate($this->getFieldValue($product, 'available_date'), $language['id_lang']))) : '0000-00-00').'" *} @@ -760,13 +758,13 @@ $(document).ready(function(){ - out_of_stock == 0}checked="checked"{/if} /> + out_of_stock == 0}checked="checked"{/if} /> -
out_of_stock == 1}checked="checked"{/if} /> +
out_of_stock == 1}checked="checked"{/if} /> -
out_of_stock == 2}checked="checked"{/if} /> - @@ -775,7 +773,7 @@ $(document).ready(function(){
- +