// Fixed #PSTEST-501

This commit is contained in:
bMancone
2012-01-17 17:13:57 +00:00
parent 62e0a2d78b
commit 1dd6787e86
6 changed files with 33 additions and 8 deletions
+4 -1
View File
@@ -157,7 +157,10 @@ class ProductSupplierCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
return $res[0];
if (isset($res[0]))
return $res[0];
return $res;
}
/**
@@ -2356,10 +2356,10 @@ class AdminProductsControllerCore extends AdminController
}
}
// Manage defaut supplier for product
if ($new_default_supplier != 0 && $new_default_supplier != $product->id_supplier && Supplier::supplierExists($new_default_supplier))
if ($new_default_supplier != $product->id_supplier)
{
$product->id_supplier = $new_default_supplier;
$product->update();
$this->object->id_supplier = $new_default_supplier;
$this->object->update();
}
}
}
@@ -300,6 +300,13 @@ class AdminSupplyOrdersControllerCore extends AdminController
//specific discount display
$this->object->discount_rate = Tools::ps_round($this->object->discount_rate, 4);
$this->displayInformation(
$this->l('Please note that if you wish to order products, they have to be available for the specified Supplier/Warehouse.')
.' '.
$this->l('See Catalog/Products/Your Product/Suppliers & Warehouses')
.'<br />'.
$this->l('Also, changing the currency or the supplier will reset the order.')
);
return parent::renderForm();
}
@@ -1560,9 +1567,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
{
$ids = explode('_', $item['id']);
$prices = ProductSupplier::getProductSupplierPrice($ids[0], $ids[1], $id_supplier, true);
$item['unit_price_te'] = Tools::convertPriceFull($prices['product_supplier_price_te'],
new Currency((int)$prices['id_currency']),
new Currency($id_currency));
if (count($prices))
$item['unit_price_te'] = Tools::convertPriceFull($prices['product_supplier_price_te'],
new Currency((int)$prices['id_currency']),
new Currency($id_currency));
}
if ($items)
die(Tools::jsonEncode($items));
+11
View File
@@ -8,3 +8,14 @@ ALTER TABLE `PREFIX_category` ADD COLUMN `is_root_category` tinyint(1) NOT NULL
UPDATE `PREFIX_category` SET `is_root_category` = 1 WHERE `id_category` = 1;
ALTER TABLE `PREFIX_image_type` DROP `id_theme`;
ALTER TABLE `PREFIX_specific_price_rule_condition` CHANGE `id_specific_price_rule_condition` `id_specific_price_rule_condition` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREFIX_specific_price_rule_condition_group` CHANGE `id_specific_price_rule_condition_group` `id_specific_price_rule_condition_group` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
UPDATE `PREFIX_supply_order_state_lang`
SET `name` = "order canceled"
WHERE `name` = "order fenced" AND (`id_lang` = 1 OR `id_lang` = 3 OR `id_lang` = 4 OR `id_lang` = 5);
UPDATE `PREFIX_supply_order_state_lang`
SET `name` = "Commande cloturée"
WHERE `name` = "order fenced" AND id_lang = 2;
+1 -1
View File
@@ -62,7 +62,7 @@ $_LANGPDF['PDF66f6e4bbd0a0af1af6b54763871dd280'] = 'Produits commandés :';
$_LANGPDF['PDF63d5049791d9d79d86e9a108b0a999ca'] = 'Référence';
$_LANGPDF['PDFf107f5a9ee4ecea58d0f29ae7959baa8'] = 'Nom';
$_LANGPDF['PDFc8ba77264f6e923f5ee35abf3108ae7c'] = 'P.U HT';
$_LANGPDF['PDF9b8362e5321f70746e9cb8f615c28d05'] = 'Prix HT (HR)';
$_LANGPDF['PDF9b8362e5321f70746e9cb8f615c28d05'] = 'Prix HT (HR))';
$_LANGPDF['PDF6703aa9936582b4381418f7d523370b4'] = 'Taux de remise';
$_LANGPDF['PDFa86dc2fff006afd2deb243d7e26b30e7'] = 'Prix HT (RC)';
$_LANGPDF['PDF20a34c4e30c5bbe1d3f870ac55f0d831'] = 'Taux TVA';
+3
View File
@@ -3292,6 +3292,9 @@ $_LANGADM['AdminSupplyOrders50cbe532b5b2f6496f426edaffe954c8'] = 'Charger automa
$_LANGADM['AdminSupplyOrders3087c43f492d4127a9e129d86948cdc7'] = 'Cela va ré-initialiser la commande';
$_LANGADM['AdminSupplyOrders170c10b41413aca5c14afad4bf2b187a'] = 'Si spécifié, chaque produit dont la quantité est inférieur ou égale à cette valeur sera chargé.';
$_LANGADM['AdminSupplyOrders4bac509e41b304aae6e91e4d40015c0b'] = 'Enregistrer la commande';
$_LANGADM['AdminSupplyOrdersfb010d572a73e208307bb7b7037fbd58'] = 'Notez que si vous voulez ajouter des produits à votre commande, ils doivent être disponibles pour le fournisseur et l\'entrepôt spécifiés ci-dessous.';
$_LANGADM['AdminSupplyOrders76531b34e5462644fa2fd92891d02e30'] = 'Voir Catalogue/Produits/Votre produit/Fournisseurs & Enrepôts.';
$_LANGADM['AdminSupplyOrdersabae8de803e3505ebf82c0b2be7e6b11'] = 'Par ailleurs, changer de devise ou de fournisseur ré-initialise la commande.';
$_LANGADM['AdminSupplyOrders41e96bfadfdd83863b899b6609b59902'] = 'Exporter les commandes (CSV)';
$_LANGADM['AdminSupplyOrdersb265176ea29e777067908c30b2cf4300'] = 'Exporter le détail des commandes (CSV)';
$_LANGADM['AdminSupplyOrdersef61fb324d729c341ea8ab9901e23566'] = 'Créer une commande';