From 5035ad9be190a002069c0c74b2aff58db0aeea6a Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:32:18 +0200 Subject: [PATCH 01/27] Explicit date_creation instead of date --- htdocs/fourn/class/fournisseur.commande.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 09a43fb95ab..2a8051e818c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -111,7 +111,7 @@ class CommandeFournisseur extends CommonOrder public $socid; public $fourn_id; - public $date; + public $date_creation; public $date_valid; public $date_approve; public $date_approve2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set @@ -375,7 +375,7 @@ class CommandeFournisseur extends CommonOrder $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total_ttc; - $this->date = $this->db->jdate($obj->date_creation); + $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_valid = $this->db->jdate($obj->date_valid); $this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve2 = $this->db->jdate($obj->date_approve2); @@ -1282,7 +1282,7 @@ class CommandeFournisseur extends CommonOrder $now = dol_now(); // set tmp vars - $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set + $date = ($this->date_commande ? $this->date_commande : $this->date_creation); // in case of date is set if (empty($date)) { $date = $now; } @@ -2847,9 +2847,9 @@ class CommandeFournisseur extends CommonOrder $this->ref = 'SPECIMEN'; $this->specimen = 1; $this->socid = 1; - $this->date = $now; + $this->date_creation = $now; $this->date_commande = $now; - $this->date_lim_reglement = $this->date + 3600 * 24 * 30; + $this->date_lim_reglement = $this->date_creation + 3600 * 24 * 30; $this->cond_reglement_code = 'RECEP'; $this->mode_reglement_code = 'CHQ'; From 736194142044e64522df1fe35386f46dabfade00 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 22 Sep 2021 14:56:44 +0200 Subject: [PATCH 02/27] Close #18770 : Can enter buying price on line --- .../fournisseur.commande.dispatch.class.php | 7 +++++-- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ .../llx_commande_fournisseur_dispatch.sql | 3 ++- htdocs/langs/en_US/receptions.lang | 1 + htdocs/langs/fr_FR/receptions.lang | 1 + htdocs/reception/card.php | 18 +++++++++++++++-- htdocs/reception/class/reception.class.php | 20 +++++++++++++++---- 7 files changed, 43 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index a83795996e4..a73be8ac43b 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -103,6 +103,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine public $batch; public $eatby = ''; public $sellby = ''; + public $cost_price = 0; @@ -189,7 +190,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= "batch,"; $sql .= "eatby,"; $sql .= "sellby,"; - $sql .= "fk_reception"; + $sql .= "fk_reception,"; + $sql .= "cost_price"; $sql .= ") VALUES ("; @@ -205,7 +207,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").","; $sql .= " ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").","; $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").","; - $sql .= " ".(!isset($this->fk_reception) ? 'NULL' : "'".$this->db->escape($this->fk_reception)."'").""; + $sql .= " ".(!isset($this->fk_reception) ? 'NULL' : "'".$this->db->escape($this->fk_reception)."'").","; + $sql .= " ".(!isset($this->cost_price) ? '0' : "'".$this->db->escape($this->cost_price)."'").""; $sql .= ")"; $this->db->begin(); diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index fb0969dc7ef..51610ee8557 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -111,3 +111,5 @@ ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL; ALTER TABLE llx_projet ADD COLUMN max_attendees integer DEFAULT 0; + +ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN cost_price double(24,8) DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql index b5f85fea250..974e10c09ff 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql @@ -36,5 +36,6 @@ create table llx_commande_fournisseur_dispatch sellby date DEFAULT NULL, status integer, datec datetime, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + cost_price double(24,8) DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 4ee0555c396..46b2d689609 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -45,3 +45,4 @@ ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions NoMorePredefinedProductToDispatch=No more predefined products to dispatch ReceptionExist=A reception exists +ByingPrice=Bying price diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 2becadf52c4..5d01e6a75bd 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -45,3 +45,4 @@ ReceptionsNumberingModules=Module de numérotation pour les réceptions ReceptionsReceiptModel=Modèles de document pour les réceptions NoMorePredefinedProductToDispatch=Plus de produits prédéfinis à expédier ReceptionExist=Une réception existe +ByingPrice=Prix d'achat diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index fbb9d246431..520214f0d5c 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -340,6 +340,7 @@ if (empty($reshook)) { $eatby = "dlc".$i; $sellby = "dluo".$i; $batch = "batch".$i; + $cost_price = "cost_price".$i; if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; @@ -364,8 +365,11 @@ if (empty($reshook)) { $sellby = GETPOST($sellby, 'alpha'); $eatbydate = str_replace('/', '-', $eatby); $sellbydate = str_replace('/', '-', $sellby); - - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOST($cost_price, 'double')); + } else { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + } if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -989,6 +993,9 @@ if ($action == 'create') { print ''.$langs->trans("QtyOrdered").''; print ''.$langs->trans("QtyReceived").''; print ''.$langs->trans("QtyToReceive"); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + print ''.$langs->trans("ByingPrice").''; + } if (empty($conf->productbatch->enabled)) { print '
('.$langs->trans("Fill").''; print ' / '.$langs->trans("Reset").')'; @@ -1118,6 +1125,7 @@ if ($action == 'create') { $stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number $deliverableQty = $dispatchLines[$indiceAsked]['qty']; + $cost_price = $dispatchLines[$indiceAsked]['pu']; // Quantity to send print ''; @@ -1132,6 +1140,12 @@ if ($action == 'create') { } print ''; + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + print ''; + print ''; + print ''; + } + // Stock if (!empty($conf->stock->enabled)) { print ''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index add1be5e831..0b53c6fd17d 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -562,6 +562,9 @@ class Reception extends CommonObject $sql = "SELECT cd.fk_product, cd.subprice,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; $sql .= " ed.eatby, ed.sellby, ed.batch"; + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $sql .= ", ed.cost_price"; + } $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " WHERE ed.fk_reception = ".((int) $this->id); @@ -589,7 +592,11 @@ 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)); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + } else { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + } if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -601,7 +608,11 @@ 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); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + } else { + $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); + } if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -704,9 +715,10 @@ class Reception extends CommonObject * @param integer $eatby eat-by date * @param integer $sellby sell-by date * @param string $batch Lot number + * @param double $cost_price Line cost * @return int <0 if KO, index of line if OK */ - public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '') + public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '', $cost_price = 0) { global $conf, $langs, $user; @@ -746,8 +758,8 @@ class Reception extends CommonObject $line->eatby = $eatby; $line->sellby = $sellby; $line->status = 1; + $line->cost_price = $cost_price; $line->fk_reception = $this->id; - $this->lines[$num] = $line; return $num; From c1e1a535039eb0e5626801371f578cc8c880823b Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:23:16 +0200 Subject: [PATCH 03/27] Update Explicit date_creation instead of date --- htdocs/fourn/class/fournisseur.commande.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2a8051e818c..1f2f10d9991 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -111,6 +111,7 @@ class CommandeFournisseur extends CommonOrder public $socid; public $fourn_id; + public $date; public $date_creation; public $date_valid; public $date_approve; @@ -380,6 +381,11 @@ class CommandeFournisseur extends CommonOrder $this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier + if (isset($this->date_commande)) { + $this->date = $this->date_commande; + } else { + $this->date = $this->date_creation; + } $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->remise_percent = $obj->remise_percent; @@ -1282,7 +1288,7 @@ class CommandeFournisseur extends CommonOrder $now = dol_now(); // set tmp vars - $date = ($this->date_commande ? $this->date_commande : $this->date_creation); // in case of date is set + $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set if (empty($date)) { $date = $now; } @@ -2847,9 +2853,9 @@ class CommandeFournisseur extends CommonOrder $this->ref = 'SPECIMEN'; $this->specimen = 1; $this->socid = 1; - $this->date_creation = $now; + $this->date = $now; $this->date_commande = $now; - $this->date_lim_reglement = $this->date_creation + 3600 * 24 * 30; + $this->date_lim_reglement = $this->date + 3600 * 24 * 30; $this->cond_reglement_code = 'RECEP'; $this->mode_reglement_code = 'CHQ'; @@ -3295,7 +3301,6 @@ class CommandeFournisseur extends CommonOrder $keysinwishednotindelivered = array_diff(array_keys($qtywished), array_keys($qtydelivered)); // To check we also have same number of keys $keysindeliverednotinwished = array_diff(array_keys($qtydelivered), array_keys($qtywished)); // To check we also have same number of keys /*var_dump(array_keys($qtydelivered)); - var_dump(array_keys($qtywished)); var_dump($diff_array); var_dump($keysinwishednotindelivered); From 5cf90d0247448a93fe5bb2955827735426d0ba1f Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Fri, 24 Sep 2021 14:10:19 +0200 Subject: [PATCH 04/27] Correct date format --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1f2f10d9991..90c9d88a533 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -382,9 +382,9 @@ class CommandeFournisseur extends CommonOrder $this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier if (isset($this->date_commande)) { - $this->date = $this->date_commande; + $this->date = $this->db->jdate($obj->date_commande); } else { - $this->date = $this->date_creation; + $this->date = $this->db->jdate($obj->date_creation); } $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $this->delivery_date = $this->db->jdate($obj->delivery_date); From 14bcb124fe09d81d953b52950549afccae6d3777 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 24 Sep 2021 14:46:52 +0200 Subject: [PATCH 05/27] update reception class and card --- htdocs/reception/card.php | 2 +- htdocs/reception/class/reception.class.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 520214f0d5c..aa7a85c2464 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -366,7 +366,7 @@ if (empty($reshook)) { $eatbydate = str_replace('/', '-', $eatby); $sellbydate = str_replace('/', '-', $sellby); if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOST($cost_price, 'double')); + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), price2num(GETPOST($cost_price, 'double'), 'MU')); } else { $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0b53c6fd17d..d8ca28bd456 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -562,9 +562,7 @@ class Reception extends CommonObject $sql = "SELECT cd.fk_product, cd.subprice,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; $sql .= " ed.eatby, ed.sellby, ed.batch"; - if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { - $sql .= ", ed.cost_price"; - } + $sql .= ", ed.cost_price"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " WHERE ed.fk_reception = ".((int) $this->id); From 372ba6cf0b4d74dc603a6882250a96dbfe23f380 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 25 Sep 2021 07:49:08 +0200 Subject: [PATCH 06/27] NEW #18820 Accountancy - Add product account in import/export of thirdparty (level 3) --- htdocs/core/modules/modSociete.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index eed6871c465..c3eba65673b 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -281,6 +281,9 @@ class modSociete extends DolibarrModules if (!empty($conf->global->PRODUIT_MULTIPRICES)) { $this->export_fields_array[$r]['s.price_level'] = 'PriceLevel'; } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + $this->export_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); + } // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('societe'))); // If project are shared, nb will be > 1 @@ -317,7 +320,8 @@ class modSociete extends DolibarrModules 'payterm.libelle'=>'Text', 'paymode.libelle'=>'Text', 's.outstanding_limit'=>'Numeric', 'pbacc.ref'=>'Text', 'incoterm.code'=>'Text', 'u.login'=>'Text', 'u.firstname'=>'Text', 'u.lastname'=>'Text', - 's.entity'=>'Numeric', 's.price_level'=>'Numeric' + 's.entity'=>'Numeric', 's.price_level'=>'Numeric', + 's.accountancy_code_sell'=>'Text', 's.accountancy_code_buy'=>'Text' ); $this->export_entities_array[$r] = array('u.login'=>'user', 'u.firstname'=>'user', 'u.lastname'=>'user'); // We define here only fields that use another picto @@ -488,6 +492,9 @@ class modSociete extends DolibarrModules if (!empty($conf->global->PRODUIT_MULTIPRICES)) { $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel'; } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + $this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); + } // Add extra fields $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); @@ -621,7 +628,9 @@ class modSociete extends DolibarrModules 's.canvas' => "empty / a custom canvas form layout url e.g. mycanvas@mymodule", 's.datec' => 'formatted as '.dol_print_date(dol_now(), '%Y-%m-%d'), 's.fk_multicurrency' => '0 (use system default currency) / 1 (use local currency)', - 's.multicurrency_code' => 'GBP/USD etc... matches field "code_iso" in table "'.MAIN_DB_PREFIX.'c_currencies"' + 's.multicurrency_code' => 'GBP/USD etc... matches field "code_iso" in table "'.MAIN_DB_PREFIX.'c_currencies"', + 's.accountancy_code_sell' => '707', + 's.accountancy_code_buy' => '607', ); $this->import_updatekeys_array[$r] = array( 's.nom' => 'Name', From 1cdba9fb807fcfa58e124509218b2b8987363e58 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 25 Sep 2021 12:46:27 +0200 Subject: [PATCH 07/27] NEW API get list of legal form of business --- htdocs/api/class/api_setup.class.php | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index f5f301e9c16..61c3f9b5c58 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1278,6 +1278,69 @@ class Setup extends DolibarrApi return $list; } + + /** + * Get the list of legal form of business. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number (starting from zero) + * @param string $country To filter on country + * @param int $active Lega form is active or not {@min 0} {@max 1} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" + * @return array List of legal form + * + * @url GET dictionary/legal_form + * + * @throws RestException + */ + public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = '', $active = 1, $sqlfilters = '') + { + $list = array(); + + //TODO link with multicurrency module + $sql = "SELECT t.rowid, t.code, t.fk_pays, t.libelle, t.isvatexempted, t.active, t.module, t.position"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as t"; + $sql .= " WHERE t.active = ".((int) $active); + if ($country) { + $sql .= " AND t.fk_pays = '".$this->db->escape($country)."'"; + } + // Add sql filters + if ($sqlfilters) { + if (!DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)'; + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + + $sql .= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of legal form: '.$this->db->lasterror()); + } + + return $list; + } /** * Get the list of social networks. From 509e1f5636133f83925acd0a350553a904cbeb8f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 25 Sep 2021 10:48:39 +0000 Subject: [PATCH 08/27] Fixing style errors. --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 61c3f9b5c58..8075861a15c 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1278,7 +1278,7 @@ class Setup extends DolibarrApi return $list; } - + /** * Get the list of legal form of business. * From f8609a4619851ac12c4c96eb18498d3765291003 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 16:09:34 +0200 Subject: [PATCH 09/27] fix : warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\core\boxes\box_members_last_modified.php on line 70 --- htdocs/core/boxes/box_members_last_modified.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 9de6a3af12f..3f53d679adc 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !($user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); } /** From d9110a81145477abe46985aeaa0104ea53ea78ae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 16:13:35 +0200 Subject: [PATCH 10/27] fix : warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\core\boxes\box_members_last_subscriptions.php on line 70 --- htdocs/core/boxes/box_members_last_subscriptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 3cea44c2dc3..5472bbbbcc7 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !($user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); } /** From 6b3cf5d482a072196b5b10d47d07f3d4773c0e65 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 16:15:31 +0200 Subject: [PATCH 11/27] fix : warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\core\boxes\box_members_last_subscriptions_by_year.php on line 70 --- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index be835511c6b..dcd9da40ac7 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !($user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); } /** From 1feb6e676cdd4aaafc63ff5f7d765d7408b1704f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 16:17:24 +0200 Subject: [PATCH 12/27] fix : warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\core\boxes\box_members_by_type.php on line 70 --- htdocs/core/boxes/box_members_by_type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 5b95b58d29d..1b8c09acc3f 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !($user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); } /** From 67cc5155b1ffaee23f0070ea6011892b2c555e4d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 18:15:44 +0200 Subject: [PATCH 13/27] fix :Warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\core\lib\barcode.lib.php on line 62 --- htdocs/core/lib/barcode.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 12022ed178c..f0604400525 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -59,7 +59,9 @@ if (empty($font_loc)) { if (defined('PHP-BARCODE_PATH_COMMAND')) { $genbarcode_loc = constant('PHP-BARCODE_PATH_COMMAND'); } else { - $genbarcode_loc = $conf->global->GENBARCODE_LOCATION; + if (!empty($conf->global->GENBARCODE_LOCATION)) { + $genbarcode_loc = $conf->global->GENBARCODE_LOCATION; + } } From 661f13adb371a2131beb41ad8409d28c9eebab41 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 25 Sep 2021 18:58:06 +0200 Subject: [PATCH 14/27] fix :Warning: Undefined property: stdClass:: in C:\wamp64\www\dolibarr-dev\htdocs\admin\barcode.php on line 376 --- htdocs/admin/barcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index de05203f5f6..0c168ad27d2 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -373,7 +373,7 @@ if ($conf->product->enabled) { print ''; print ''.$modBarCode->getExample($langs)."\n"; - if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { + if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) &&$conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; From dbe459bc3ffb4602b7aad7bb80b07974ebc40fc8 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 25 Sep 2021 18:59:39 +0200 Subject: [PATCH 15/27] Update box_members_subscriptions_by_year.php --- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index dcd9da40ac7..fe64f37c805 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); } /** From a29ed0229bf31d2a9f812024f31acac81ea14a0f Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 25 Sep 2021 19:00:47 +0200 Subject: [PATCH 16/27] Update barcode.php --- htdocs/admin/barcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 0c168ad27d2..5b48301c30d 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -373,7 +373,7 @@ if ($conf->product->enabled) { print ''; print ''.$modBarCode->getExample($langs)."\n"; - if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) &&$conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { + if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; From 694754267cd2449359595ffc1eba249bbdecc5da Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 25 Sep 2021 19:01:54 +0200 Subject: [PATCH 17/27] Update box_members_by_type.php --- htdocs/core/boxes/box_members_by_type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 1b8c09acc3f..0a5e4548e3f 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); } /** From 2edad621b8a1e50648d57a541a7e79262e8d2ad7 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 25 Sep 2021 19:02:28 +0200 Subject: [PATCH 18/27] Update box_members_last_modified.php --- htdocs/core/boxes/box_members_last_modified.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 3f53d679adc..cf70bcafcb1 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); } /** From f7041ef1fcb5dc9ff61cc82e57dc3884c389f347 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 25 Sep 2021 19:03:08 +0200 Subject: [PATCH 19/27] Update box_members_last_subscriptions.php --- htdocs/core/boxes/box_members_last_subscriptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 5472bbbbcc7..949edd567f3 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) &&$user->rights->adherent->lire); + $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); } /** From b7c577b762ebd5e7939d5f98454f1b290ff91615 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 26 Sep 2021 05:17:03 +0200 Subject: [PATCH 20/27] NEW #18814 Add legal form for Sweden --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 13 +++++++++++++ htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index 07a09724ed2..7af5d28df8c 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -356,3 +356,16 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (13, '1306','S insert into llx_c_forme_juridique (fk_pays, code, libelle) values (13, '1307','Société en participation'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (13, '1308','Groupe de sociétés'); +-- Sweden (id country=20) +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2001', 'Aktiebolag'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2002', 'Publikt aktiebolag (AB publ)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2003', 'Ekonomisk förening (ek. för.)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2004', 'Bostadsrättsförening (BRF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2005', 'Hyresrättsförening (HRF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2006', 'Kooperativ'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2007', 'Enskild firma (EF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2008', 'Handelsbolag (HB)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2009', 'Kommanditbolag (KB)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', 'Enkelt bolag'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse'); diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 9555bcd15da..56655d05301 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -128,3 +128,16 @@ ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL; ALTER TABLE llx_projet ADD COLUMN max_attendees integer DEFAULT 0; + +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2001', 'Aktiebolag'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2002', 'Publikt aktiebolag (AB publ)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2003', 'Ekonomisk förening (ek. för.)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2004', 'Bostadsrättsförening (BRF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2005', 'Hyresrättsförening (HRF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2006', 'Kooperativ'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2007', 'Enskild firma (EF)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2008', 'Handelsbolag (HB)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2009', 'Kommanditbolag (KB)'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', 'Enkelt bolag'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse'); From 5623e5f98afe77d1fffbc71b43278bccca3d11c9 Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Sun, 26 Sep 2021 19:09:09 +0200 Subject: [PATCH 21/27] Correct isset --- htdocs/fourn/class/fournisseur.commande.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 90c9d88a533..99ef4e54e87 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -381,10 +381,10 @@ class CommandeFournisseur extends CommonOrder $this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier - if (isset($this->date_commande)) { - $this->date = $this->db->jdate($obj->date_commande); + if (isset($obj->date_commande)) { + $this->date = $this->date_commande; } else { - $this->date = $this->db->jdate($obj->date_creation); + $this->date = $this->date_creation; } $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated $this->delivery_date = $this->db->jdate($obj->delivery_date); From ef7d3ec72dbb9c0acbbd75535290fea1a9201ce3 Mon Sep 17 00:00:00 2001 From: Muhammad Habib Ulil A Date: Tue, 28 Sep 2021 07:44:26 +0700 Subject: [PATCH 22/27] Update llx_categorie_knowledgemanagement.sql --- .../install/mysql/tables/llx_categorie_knowledgemanagement.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_categorie_knowledgemanagement.sql b/htdocs/install/mysql/tables/llx_categorie_knowledgemanagement.sql index 9489cca9652..a693fb19c41 100644 --- a/htdocs/install/mysql/tables/llx_categorie_knowledgemanagement.sql +++ b/htdocs/install/mysql/tables/llx_categorie_knowledgemanagement.sql @@ -13,7 +13,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. -create table llx_categorie_knowledgemanagement +create table llx_categorie_knowledgemanagement( fk_categorie integer NOT NULL, fk_knowledgemanagement integer NOT NULL, import_key varchar(14) From c857dc1904551ea97a487ebfb0bd617605dac183 Mon Sep 17 00:00:00 2001 From: Muhammad Habib Ulil A Date: Tue, 28 Sep 2021 07:52:12 +0700 Subject: [PATCH 23/27] Update llx_product.sql --- htdocs/install/mysql/tables/llx_product.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 78560c5a05e..80e3f90b828 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -104,8 +104,7 @@ create table llx_product fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, fk_project integer DEFAULT NULL, -- Used when product was generated by a project or is specifif to a project - mandatory_period tinyint DEFAULT 0 -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action) + mandatory_period tinyint DEFAULT 0, -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action) - fk_default_bom integer DEFAULT NULL, - fk_project integer DEFAULT NULL -- Used when the product was generated by a project or is specific to a project + fk_default_bom integer DEFAULT NULL )ENGINE=innodb; From 8f4fb9fd3cd47d5b25a2cb85c68095ec4649733c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 12:56:33 +0200 Subject: [PATCH 24/27] Update barcode.lib.php --- htdocs/core/lib/barcode.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index f0604400525..702d6673527 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -59,6 +59,7 @@ if (empty($font_loc)) { if (defined('PHP-BARCODE_PATH_COMMAND')) { $genbarcode_loc = constant('PHP-BARCODE_PATH_COMMAND'); } else { + $genbarcode_loc = ''; if (!empty($conf->global->GENBARCODE_LOCATION)) { $genbarcode_loc = $conf->global->GENBARCODE_LOCATION; } From b795d6b430fb48219cf4731f132d3e429ead5622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 12:58:19 +0200 Subject: [PATCH 25/27] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 8075861a15c..4e4b1f678dc 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1299,7 +1299,6 @@ class Setup extends DolibarrApi { $list = array(); - //TODO link with multicurrency module $sql = "SELECT t.rowid, t.code, t.fk_pays, t.libelle, t.isvatexempted, t.active, t.module, t.position"; $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as t"; $sql .= " WHERE t.active = ".((int) $active); From 4f660343aabd382661d7abe92723a4c3433faada Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 12:59:00 +0200 Subject: [PATCH 26/27] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 4e4b1f678dc..a0a31fe608d 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1239,7 +1239,6 @@ class Setup extends DolibarrApi { $list = array(); - //TODO link with multicurrency module $sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_units as t"; $sql .= " WHERE t.active = ".((int) $active); From a8c4132a23cc7448b994a40d832baa844bbfbd2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 13:22:44 +0200 Subject: [PATCH 27/27] Update reception.class.php --- htdocs/reception/class/reception.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index d8ca28bd456..278263669ea 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -561,8 +561,8 @@ class Reception extends CommonObject // TODO in future, reception lines may not be linked to order line $sql = "SELECT cd.fk_product, cd.subprice,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; - $sql .= " ed.eatby, ed.sellby, ed.batch"; - $sql .= ", ed.cost_price"; + $sql .= " ed.eatby, ed.sellby, ed.batch,"; + $sql .= " ed.cost_price"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " WHERE ed.fk_reception = ".((int) $this->id);