From e365a14b5a8d17b2d441279563a1139049bde5e3 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 15 Nov 2021 14:41:16 +0100 Subject: [PATCH 01/25] FIX filter on region in company list --- htdocs/societe/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1df7c38d6c5..5299b4ece95 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -294,6 +294,7 @@ if (empty($reshook)) $search_town = ""; $search_zip = ""; $search_state = ""; + $search_region = ""; $search_country = ''; $search_email = ''; $search_phone = ''; @@ -421,7 +422,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_effectif)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region.code_region = state.fk_region)"; // We'll need this table joined to the select in order to filter by categ if (!empty($search_categ_cus)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ if (!empty($search_categ_sup)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ @@ -554,6 +555,7 @@ if ($search_fax != '') $param .= "&search_fax=".urlencode($search_fax); if ($search_email != '') $param .= "&search_email=".urlencode($search_email); if ($search_url != '') $param .= "&search_url=".urlencode($search_url); if ($search_state != '') $param .= "&search_state=".urlencode($search_state); +if ($search_region != '') $param .= "&search_region=".urlencode($search_region); if ($search_country != '') $param .= "&search_country=".urlencode($search_country); if ($search_customer_code != '') $param .= "&search_customer_code=".urlencode($search_customer_code); if ($search_supplier_code != '') $param .= "&search_supplier_code=".urlencode($search_supplier_code); From 7af883abc1641e65944009b5fc938233978aaaef Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 15 Nov 2021 16:43:54 +0100 Subject: [PATCH 02/25] Fix: Bad date conversion --- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++++++------ htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 08516fbc7d2..f31d5c174f1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2021 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2904,11 +2904,11 @@ class CommandeFournisseur extends CommonOrder if ($obj->fk_user_approve) $this->user_approve_id = $obj->fk_user_approve; if ($obj->fk_user_approve2) $this->user_approve_id2 = $obj->fk_user_approve2; - $this->date_creation = $this->db->idate($obj->datec); - $this->date_modification = $this->db->idate($obj->datem); - $this->date_approve = $this->db->idate($obj->datea); - $this->date_approve2 = $this->db->idate($obj->datea2); - $this->date_validation = $this->db->idate($obj->date_validation); + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_approve = $this->db->jdate($obj->datea); + $this->date_approve2 = $this->db->jdate($obj->datea2); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($result); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 72d040583b2..599e923baa5 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes - * Copyright (C) 2015-2019 Ferran Marcet + * Copyright (C) 2015-2021 Ferran Marcet * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2020 Frédéric France @@ -2144,8 +2144,8 @@ class FactureFournisseur extends CommonInvoice $muser->fetch($obj->fk_user_modif); $this->user_modification = $muser; } - $this->date_creation = $this->db->idate($obj->datec); - $this->date_modification = $this->db->idate($obj->datem); + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); //$this->date_validation = $obj->datev; // This field is not available. Should be store into log table and using this function should be replaced with showing content of log (like for supplier orders) } $this->db->free($result); From db975bbcc2847d0f7853fd5ee3af4722f1d14f87 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 18 Nov 2021 17:17:00 +0100 Subject: [PATCH 03/25] Fix: The error not correctly collected on insertation line failure --- htdocs/expedition/class/expedition.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d14a34515c4..845aaa194fa 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2014-2017 Francis Appels * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016-2021 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Frédéric France * Copyright (C) 2020 Lenin Rivas @@ -364,14 +364,14 @@ class Expedition extends CommonObject { if (!isset($this->lines[$i]->detail_batch)) { // no batch management - if (!$this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) > 0) + if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) < 0) { $error++; } } else { // with batch management - if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0) + if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) < 0) { $error++; } @@ -423,7 +423,6 @@ class Expedition extends CommonObject else { $error++; - $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } From 8f9638318647a690fc634ceb23c26ea74cf5d628 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Nov 2021 20:10:04 +0100 Subject: [PATCH 04/25] Update expedition.class.php --- htdocs/expedition/class/expedition.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 845aaa194fa..bcccd2aee2a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -364,14 +364,14 @@ class Expedition extends CommonObject { if (!isset($this->lines[$i]->detail_batch)) { // no batch management - if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) < 0) + if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) { $error++; } } else { // with batch management - if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) < 0) + if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) { $error++; } From cdc160b9a9d036b2af0da760c1e78d3a64946e22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Nov 2021 11:12:53 +0100 Subject: [PATCH 05/25] FIX column alignement on valid confirm page of shipment --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 888d9f66114..e8a8eb2843e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7522,7 +7522,7 @@ abstract class CommonObject if ($display_type == 'card') { $out .= ''; - if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'editline')) { + if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'valid' || $action == 'editline')) { $out .= ''; } $out .= 'db->idate($now)."', ".$this->product_id.", "; + $sql .= " VALUES ('".$this->db->idate($this->datem)."', ".$this->product_id.", "; $sql .= " ".($batch ? "'".$this->db->escape($batch)."'" : "null").", "; $sql .= " ".($eatby ? "'".$this->db->idate($eatby)."'" : "null").", "; $sql .= " ".($sellby ? "'".$this->db->idate($sellby)."'" : "null").", "; @@ -755,19 +755,19 @@ class MouvementStock extends CommonObject /** * Decrease stock for product and subproducts * - * @param User $user Object user - * @param int $fk_product Id product - * @param int $entrepot_id Warehouse id - * @param int $qty Quantity - * @param int $price Price - * @param string $label Label of stock movement - * @param string $datem Force date of movement - * @param integer $eatby eat-by date - * @param integer $sellby sell-by date - * @param string $batch batch number - * @param int $id_product_batch Id product_batch - * @param string $inventorycode Inventory code - * @return int <0 if KO, >0 if OK + * @param User $user Object user + * @param int $fk_product Id product + * @param int $entrepot_id Warehouse id + * @param int $qty Quantity + * @param int $price Price + * @param string $label Label of stock movement + * @param integer|string $datem Force date of movement + * @param integer $eatby eat-by date + * @param integer $sellby sell-by date + * @param string $batch batch number + * @param int $id_product_batch Id product_batch + * @param string $inventorycode Inventory code + * @return int <0 if KO, >0 if OK */ public function livraison($user, $fk_product, $entrepot_id, $qty, $price = 0, $label = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $id_product_batch = 0, $inventorycode = '') { @@ -790,7 +790,7 @@ class MouvementStock extends CommonObject * @param integer|string $eatby eat-by date * @param integer|string $sellby sell-by date * @param string $batch batch number - * @param string $datem Force date of movement + * @param integer|string $datem Force date of movement * @param int $id_product_batch Id product_batch * @param string $inventorycode Inventory code * @return int <0 if KO, >0 if OK @@ -804,28 +804,6 @@ class MouvementStock extends CommonObject return $this->_create($user, $fk_product, $entrepot_id, $qty, 3, $price, $label, $inventorycode, $datem, $eatby, $sellby, $batch, $skip_batch, $id_product_batch); } - - // /** - // * Return nb of subproducts lines for a product - // * - // * @param int $id Id of product - // * @return int <0 if KO, nb of subproducts if OK - // * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class. - // */ - // public function nbOfSubProducts($id) - // { - // $nbSP=0; - - // $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association"; - // $resql.= " WHERE fk_product_pere = ".((int) $id); - // if ($this->db->query($resql)) - // { - // $obj=$this->db->fetch_object($resql); - // $nbSP=$obj->nb; - // } - // return $nbSP; - // } - /** * Count number of product in stock before a specific date * diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 644bd115d4b..1de719796d2 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1640,7 +1640,14 @@ if ($action == 'create') { } print ''; } else { - if ($object->statut <= 1) { + $statusreceived = $object::STATUS_CLOSED; + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION")) { + $statusreceived = $object::STATUS_VALIDATED; + } + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION_CLOSE")) { + $statusreceived = $object::STATUS_CLOSED; + } + if ($object->statut < $statusreceived) { print ''.$langs->trans("QtyToReceive").''; } else { print ''.$langs->trans("QtyReceived").''; @@ -1979,14 +1986,14 @@ if ($action == 'create') { if ($object->statut == Reception::STATUS_DRAFT && $num_prod > 0) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { print ''.$langs->trans("Validate").''; } } - // Edit + // Back to draft if ($object->statut == Reception::STATUS_VALIDATED && $user->rights->reception->creer) { - print ''; + print ''; } // TODO add alternative status diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e1e2c857bc0..540bb17b9e1 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -138,7 +138,14 @@ class Reception extends CommonObject $this->statuts = array(); $this->statuts[-1] = 'StatusReceptionCanceled'; $this->statuts[0] = 'StatusReceptionDraft'; + // product to receive if stock increase is on close or already received if stock increase is on validation $this->statuts[1] = 'StatusReceptionValidated'; + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION")) { + $this->statuts[1] = 'StatusReceptionValidatedReceived'; + } + if (getDolGlobalInt("STOCK_CALCULATE_ON_RECEPTION_CLOSE")) { + $this->statuts[1] = 'StatusReceptionValidatedToReceive'; + } $this->statuts[2] = 'StatusReceptionProcessed'; // List of short language codes for status @@ -589,7 +596,8 @@ class Reception extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), '', '', '', '', 0, $inventorycode); if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -601,7 +609,8 @@ class Reception extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. // Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version) - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode); if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -1432,7 +1441,7 @@ class Reception extends CommonObject } /** - * Classify the reception as closed. + * Classify the reception as closed (this record also the stock movement) * * @return int <0 if KO, >0 if OK */ @@ -1514,7 +1523,8 @@ class Reception extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $numref)); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $this->ref), '', '', '', '', 0, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1524,7 +1534,8 @@ class Reception extends CommonObject // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $this->ref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; @@ -1676,7 +1687,8 @@ class Reception extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref)); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), '', '', '', '', 0, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1686,7 +1698,8 @@ class Reception extends CommonObject // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', $obj->fk_origin_stock, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1798,7 +1811,8 @@ class Reception extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref)); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref), '', '', '', '', 0, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1809,7 +1823,8 @@ class Reception extends CommonObject // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + $inventorycode = ''; + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode); if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; From 35b1868693cdb41506f5958a58f2a77944a6cea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Nov 2021 14:01:31 +0100 Subject: [PATCH 07/25] FIX Missing trans --- htdocs/langs/en_US/receptions.lang | 4 +++- htdocs/reception/class/reception.class.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index ca836137226..d60487c439f 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -47,4 +47,6 @@ ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions NoMorePredefinedProductToDispatch=No more predefined products to dispatch ReceptionExist=A reception exists -ReceptionBackToDraftInDolibarr=Reception %s back to draft \ No newline at end of file +ReceptionBackToDraftInDolibarr=Reception %s back to draft +ReceptionClassifyClosedInDolibarr=Reception %s classified Closed +ReceptionUnClassifyCloseddInDolibarr=Reception %s re-open \ No newline at end of file diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 540bb17b9e1..5fb8e3b8af0 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1689,6 +1689,7 @@ class Reception extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record $inventorycode = ''; $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), '', '', '', '', 0, $inventorycode); + if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1721,10 +1722,15 @@ class Reception extends CommonObject } } - if ($this->origin == 'order_supplier') { + if (!$error && $this->origin == 'order_supplier') { $commande = new CommandeFournisseur($this->db); $commande->fetch($this->origin_id); - $commande->setStatus($user, 4); + $result = $commande->setStatus($user, 4); + if ($result < 0) { + $error++; + $this->error = $commande->error; + $this->errors = $commande->errors; + } } } else { $error++; From 3dbab220609a7e0b21875f5d8241dbd5ef8ad39f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Nov 2021 18:08:49 +0100 Subject: [PATCH 08/25] Prepare 14.0.4 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 1ac8978bbb8..40f3f124ae8 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '14.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 60ef230447145294ea7c2766aa17b0c12d2638f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Nov 2021 12:37:47 +0100 Subject: [PATCH 09/25] Fix html content --- .../admin/dolistore/class/dolistore.class.php | 22 +++++++++++++------ htdocs/admin/modules.php | 4 +++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 5e7a229fee3..546ef1d57a6 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -284,7 +284,8 @@ class Dolistore $download_link .= '

'; } - //checking versions + // Set and check version + $version = ''; if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { //compatible @@ -319,14 +320,21 @@ class Dolistore //.'
'.$langs->trans("SeeInMarkerPlace").' //output template - $html .= ' -
'.dol_escape_htmltag($newapp.$images).'
-

'.dol_escape_htmltag($product->name->language[$this->lang - 1]) - .'
'.dol_escape_htmltag($version).'

- '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'

'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).''; + $html .= ''; + $html .= '
'; + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html + $html .= '
'; + $html .= '

'; + $html .= dol_escape_htmltag($product->name->language[$this->lang - 1]); + $html .= '
'; + $html .= $version; // No dol_escape_htmltag, it is already escape html + $html .= '

'; + $html .= ' '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'

'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).''; // do not load if display none //$html .= ''.$product->description->language[$this->lang - 1].''; - $html .= ''.dol_escape_htmltag($price).''; + $html .= ''; + $html .= $price; + $html .= ''; $html .= ''.$download_link.''; $html .= ''; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 00142deb9e8..c72456b2306 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1051,7 +1051,9 @@ if ($mode == 'marketplace') {
    - get_categories()); ?> + get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content + ?>
From 34ac517d62fc1ac2f880539aa27560fdc3f79542 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Nov 2021 17:54:29 +0100 Subject: [PATCH 10/25] CSS --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c72456b2306..236c8c0b28e 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -526,7 +526,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter = '
'; - $moreforfilter .= '