From bb2c33e2c11c563c583abb80237d2f30335dcb80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Feb 2015 22:49:53 +0100 Subject: [PATCH 1/8] Trad --- htdocs/langs/en_US/main.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index e53f0df5585..5fad3a3fd20 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -291,10 +291,10 @@ DefaultGlobalValue=Global value Price=Price UnitPrice=Unit price UnitPriceHT=Unit price (net) -UnitPriceTTC=Unit price +UnitPriceTTC=Unit price (inc. tac) PriceU=U.P. PriceUHT=U.P. (net) -PriceUTTC=U.P. +PriceUTTC=U.P. (inc. tax) Amount=Amount AmountInvoice=Invoice amount AmountPayment=Payment amount From 9ab48b3d90a8427b2965ae4e60e3e0ce28ba0016 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Feb 2015 22:51:18 +0100 Subject: [PATCH 2/8] Revert "Trad" This reverts commit bb2c33e2c11c563c583abb80237d2f30335dcb80. --- htdocs/langs/en_US/main.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5fad3a3fd20..e53f0df5585 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -291,10 +291,10 @@ DefaultGlobalValue=Global value Price=Price UnitPrice=Unit price UnitPriceHT=Unit price (net) -UnitPriceTTC=Unit price (inc. tac) +UnitPriceTTC=Unit price PriceU=U.P. PriceUHT=U.P. (net) -PriceUTTC=U.P. (inc. tax) +PriceUTTC=U.P. Amount=Amount AmountInvoice=Invoice amount AmountPayment=Payment amount From 2045fb22e9001c444d685d0eb5242c53ed3b0bbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Feb 2015 23:39:30 +0100 Subject: [PATCH 3/8] Lock 5.5.40 --- htdocs/install/upgrade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 8f62a755518..89e54ef4443 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -193,9 +193,9 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) // Test database version is not forbidden for migration $dbversion_disallowed=array( array('type'=>'mysql','version'=>array(5,5,40)), - array('type'=>'mysqli','version'=>array(5,5,40)), - array('type'=>'mysql','version'=>array(5,5,41)), - array('type'=>'mysqli','version'=>array(5,5,41)) + array('type'=>'mysqli','version'=>array(5,5,40)) + //,array('type'=>'mysql','version'=>array(5,5,41)), + //array('type'=>'mysqli','version'=>array(5,5,41)) ); $listofforbiddenversion=''; foreach ($dbversion_disallowed as $dbversion_totest) From 3cf4b80baaf8dd8210bbb1d571bb716b17b7f6eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2015 02:02:11 +0100 Subject: [PATCH 4/8] Fix missing test of action when using canvas --- dev/skeletons/modMyModule.class.php | 6 +++--- htdocs/core/class/canvas.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 4c09e379d9b..bf78c7cc161 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -113,9 +113,9 @@ class modMyModule extends DolibarrModules $this->const = array(); // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 - // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 + // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname // where objecttype can be // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) // 'contact' to add a tab in contact view diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 959decc581c..a8bb07e6ec6 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -67,7 +67,7 @@ class Canvas $newaction = $action; if ($newaction == 'add') $newaction='create'; if ($newaction == 'update') $newaction='edit'; - if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user') $newaction='view'; + if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user' || $newaction == 'presend' || $newaction == 'send') $newaction='view'; return $newaction; } From 118ae7e8f812582540aa5fbd68f240c7d398e31a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2015 17:55:53 +0100 Subject: [PATCH 5/8] Backport fix done into dev. --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 4421ad032eb..22a65167e6f 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1155,3 +1155,6 @@ ALTER TABLE llx_resource MODIFY COLUMN entity integer DEFAULT 1 NOT NULL; -- This request make mysql drop (mysql bug, so we add it at end): ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); +-- this update change the old formated url on llx_bank_url +UPDATE llx_bank_url set url = REPLACE( url, 'fiche.php', 'card.php'); + From 03d19bf77fc335032ee1ee92a8cd4587518f7e0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2015 18:02:25 +0100 Subject: [PATCH 6/8] Fix: Sort criteria --- htdocs/opensurvey/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index d21a08007a4..d13c9884e89 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -43,8 +43,8 @@ if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield="p.titre"; -if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="p.date_fin"; +if (! $sortorder) $sortorder="DESC"; if ($page < 0) { $page = 0; } From 1e78d0e8d499e694545c698b3807af9d83f1b294 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2015 20:46:54 +0100 Subject: [PATCH 7/8] New: Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve, with no risk, a missing control on missing warehouse. --- ChangeLog | 2 ++ htdocs/core/lib/order.lib.php | 2 +- htdocs/expedition/class/expedition.class.php | 26 ++++++++++++++------ htdocs/langs/en_US/productbatch.lang | 2 +- htdocs/langs/en_US/sendings.lang | 2 +- htdocs/langs/en_US/stocks.lang | 2 +- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bdae25eac7..0eac6781fc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -85,6 +85,8 @@ For users: - New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export. - New : Option on extrafields to have them always editable regardless of the document status. - New : New module PrintIPP to print without opening document is available as stable. +- New : Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve at no risk + a missing control on missing warehouse. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index abdf1b648a5..1e0f2f50139 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -52,7 +52,7 @@ function commande_prepare_head($object) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) { $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; - if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment"); + if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipments"); if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/'; if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings"); $head[$h][1] = $text; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e6cc0e86d09..0113a582dfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -732,10 +732,12 @@ class Expedition extends CommonObject } /** - * Add a expedition line + * Add a expedition line. + * If STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS is set, you can add a shipment line, with no stock source defined + * If STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT is not set, you can add a shipment line, even if not enough into stock * * @param int $entrepot_id Id of warehouse - * @param int $id Id of source line + * @param int $id Id of source line (order line) * @param int $qty Quantity * @return int <0 if KO, >0 if OK */ @@ -750,18 +752,26 @@ class Expedition extends CommonObject $line->origin_line_id = $id; $line->qty = $qty; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) { - $orderline = new OrderLine($this->db); - $orderline->fetch($id); - $fk_product = $orderline->fk_product; + $orderline = new OrderLine($this->db); + $orderline->fetch($id); + $fk_product = $orderline->fk_product; - if (!empty($orderline->fk_product)) + if (! empty($orderline->fk_product)) + { + if (! ($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) + { + $this->error=$langs->trans("ErrorWarehouseRequiredIntoShipmentLine"); + return -1; + } + + if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined { $product=new Product($this->db); $result=$product->fetch($fk_product); $product_type=$product->type; - if($product_type == 0 && $product->stock_reel < $qty) { + if ($product_type == 0 && $product->stock_reel < $qty) + { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); return -3; diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 0102f688b1b..ded965131de 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -11,7 +11,7 @@ batch_number=Batch/Serial number l_eatby=Eat-by date l_sellby=Sell-by date DetailBatchNumber=Batch/Serial details -DetailBatchFormat=Batch/Serial: %s - E:%s - S: %s (Qty : %d) +DetailBatchFormat=Batch/Serial: %s - Eat by: %s - Sell by: %s (Qty : %d) printBatch=Batch: %s printEatby=Eat-by: %s printSellby=Sell-by: %s diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index f1489508ec6..faf41d116b9 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -22,7 +22,7 @@ QtyOrdered=Qty ordered QtyShipped=Qty shipped QtyToShip=Qty to ship QtyReceived=Qty received -KeepToShip=Keep to ship +KeepToShip=Remain to ship OtherSendingsForSameOrder=Other shipments for this order DateSending=Date sending order DateSendingShort=Date sending order diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index d77c65a9a13..0e3e7dd6c27 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -122,4 +122,4 @@ RuleForStockAvailability=Rules on stock requirements StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice StockMustBeEnoughForOrder=Stock level must be enough to add product/service into order StockMustBeEnoughForShipment= Stock level must be enough to add product/service into shipment - +WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn=Source warehouse must be defined here when batch module is on. It will be used to list wich lot/serial is available for product that required lot/serial data for movement. If you want to send products from different warehouses, just make the shipment into several steps. From 5688e8ecd815c5eb7e3d45b8cf1f3b94ff336dd7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2015 20:51:05 +0100 Subject: [PATCH 8/8] Add todo to show code is missing here --- htdocs/expedition/class/expedition.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 0113a582dfb..2eb5a61e3fc 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -804,6 +804,12 @@ class Expedition extends CommonObject } $linebatch->dluo_qty=$value['q']; $tab[]=$linebatch; + + if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) + { + // TODO + } + } } $line->entrepot_id = $linebatch->entrepot_id;