| ';
@@ -549,7 +578,7 @@ if ($id > 0 || ! empty($ref))
}
// Qty ordered
- print ' | '.$objp->qty.' | ';
+ print '' . ($objp->qty!=1?''.$objp->qty.'':$objp->qty) . ' | ';
// Qty already shipped
$qtyProdCom=$objp->qty;
@@ -697,7 +726,7 @@ if ($id > 0 || ! empty($ref))
print ''.$langs->trans("WarehouseSource").' | ';
print '';
- print $formproduct->selectWarehouses(-1,'entrepot_id','',1);
+ print $formproduct->selectWarehouses(! empty($commande->warehouse_id)?$commande->warehouse_id:-1,'entrepot_id','',1);
if (count($formproduct->cache_warehouses) <= 0)
{
print ' '.$langs->trans("WarehouseSourceNotDefined").' '.$langs->trans("AddOne").'';
diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
index b97c9a99fe9..4ee34132279 100755
--- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
+++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@@ -67,7 +67,7 @@ ALTER TABLE llx_prelevement_lignes MODIFY COLUMN code_banque varchar(128);
ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128);
ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30);
-
+ALTER TABLE llx_commande ADD COLUMN fk_warehouse integer DEFAULT NULL after fk_shipping_method;
ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750);
diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql
index 3511aa7ec78..553b2facad7 100644
--- a/htdocs/install/mysql/tables/llx_commande.sql
+++ b/htdocs/install/mysql/tables/llx_commande.sql
@@ -63,6 +63,7 @@ create table llx_commande
date_livraison date default NULL,
fk_shipping_method integer, -- shipping method id
+ fk_warehouse integer default NULL,
fk_availability integer NULL,
fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined
fk_delivery_address integer, -- delivery address (deprecated)
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index ed2eb3cdffa..28a6514328c 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1204,6 +1204,7 @@ AskPriceSupplierPDFModules=Price requests suppliers documents models
FreeLegalTextOnAskPriceSupplier=Free text on price requests suppliers
WatermarkOnDraftAskPriceSupplier=Watermark on draft price requests suppliers (none if empty)
BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER=Ask for bank account destination of price request
+WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order
##### Orders #####
OrdersSetup=Order management setup
OrdersNumberingModules=Orders numbering models
@@ -1699,4 +1700,3 @@ TitleExampleForMajorRelease=Example of message you can use to announce this majo
TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites)
ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes.
ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so it contains only fixes of bugs. We recommend everybody using an older version to upgrade to this one. As any maintenance release, no new features, nor data structure change is present into this version. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes.
-
\ No newline at end of file
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 0215f20e3c6..f08143c443c 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -134,6 +134,40 @@ class FormProduct
return $out;
}
+ /**
+ * Display form to select warehouse
+ *
+ * @param string $page Page
+ * @param int $selected Id of warehouse
+ * @param string $htmlname Name of select html field
+ * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
+ * @return void
+ */
+ function formSelectWarehouses($page, $selected='', $htmlname='warehouse_id', $addempty=0)
+ {
+ global $langs;
+ if ($htmlname != "none") {
+ print '';
+ } else {
+ if ($selected) {
+ require_once DOL_DOCUMENT_ROOT .'/product/stock/class/entrepot.class.php';
+ $warehousestatic=new Entrepot($this->db);
+ $warehousestatic->fetch($selected);
+ print $warehousestatic->getNomUrl();
+ } else {
+ print " ";
+ }
+ }
+ }
+
/**
* Output a combo box with list of units
* pour l'instant on ne definit pas les unites dans la base
|