From 925def53907ae31c434551c900381c896a414640 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Mar 2019 13:37:00 +0100 Subject: [PATCH] Work on BOM module --- htdocs/admin/bom.php | 4 ++-- htdocs/core/modules/bom/mod_bom_advanced.php | 17 +---------------- htdocs/core/modules/bom/mod_bom_standard.php | 15 --------------- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 ++- htdocs/install/mysql/tables/llx_bom_bom.sql | 3 ++- 5 files changed, 7 insertions(+), 35 deletions(-) diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 1bff53424da..e7b1e4fc3d6 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -47,8 +47,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstbom=GETPOST('maskconstbom', 'alpha'); - $maskbom=GETPOST('maskbom', 'alpha'); + $maskconstbom=GETPOST('maskconstBom', 'alpha'); + $maskbom=GETPOST('maskBom', 'alpha'); if ($maskconstbom) $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 50cafb276ca..373fd5ffa8b 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -138,23 +138,8 @@ class mod_bom_advanced extends ModeleNumRefboms $date = ($object->date_bom ? $object->date_bom : $object->date); - $numFinal=get_next_value($db, $mask, 'bom', 'ref', '', $objsoc, $date); + $numFinal=get_next_value($db, $mask, 'bom_bom', 'ref', '', $objsoc, $date); return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function bom_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 4bfa3173fd4..00a20898712 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -146,19 +146,4 @@ class mod_bom_standard extends ModeleNumRefboms dol_syslog("mod_bom_standard::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function bom_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index fe7cdb9faf6..5154d7311a9 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -175,7 +175,8 @@ ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp; CREATE TABLE llx_bom_bom( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer DEFAULT 1 NOT NULL, ref varchar(128) NOT NULL, label varchar(255), description text, diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql index bb8da0726bf..2bca889c970 100644 --- a/htdocs/install/mysql/tables/llx_bom_bom.sql +++ b/htdocs/install/mysql/tables/llx_bom_bom.sql @@ -16,7 +16,8 @@ CREATE TABLE llx_bom_bom( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer DEFAULT 1 NOT NULL, ref varchar(128) NOT NULL, label varchar(255), description text,