From 07cd751c59046fb837bece52a4cbb9d5c25cd73c Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Tue, 20 Apr 2021 15:51:02 +0200 Subject: [PATCH 1/9] batch status dictionnary --- htdocs/admin/dict.php | 13 ++++++++- .../mysql/data/llx_c_productbatch_status.sql | 28 +++++++++++++++++++ .../tables/llx_c_productbatch_status.key.sql | 19 +++++++++++++ .../tables/llx_c_productbatch_status.sql | 25 +++++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/productbatch.lang | 5 ++-- htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/productbatch.lang | 6 ++-- 8 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 htdocs/install/mysql/data/llx_c_productbatch_status.sql create mode 100644 htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql create mode 100644 htdocs/install/mysql/tables/llx_c_productbatch_status.sql diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9061fd150b7..8efbbf4cbfa 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0); +$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0, 43, 0); // Name of SQL tables of dictionaries $tabname = array(); @@ -146,6 +146,7 @@ $tabname[39] = MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabname[40] = MAIN_DB_PREFIX."c_stcommcontact"; $tabname[41] = MAIN_DB_PREFIX."c_transport_mode"; $tabname[42] = MAIN_DB_PREFIX."c_product_nature"; +$tabname[43] = MAIN_DB_PREFIX."c_productbatch_status"; // Dictionary labels $tablib = array(); @@ -191,6 +192,7 @@ $tablib[39] = "DictionaryProspectContactLevel"; $tablib[40] = "DictionaryProspectContactStatus"; $tablib[41] = "DictionaryTransportMode"; $tablib[42] = "DictionaryProductNature"; +$tablib[43] = "DictionaryBatchStatus"; // Requests to extract data $tabsql = array(); @@ -236,6 +238,7 @@ $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_P $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; $tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode"; $tabsql[42] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_product_nature"; +$tabsql[43] = "SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_productbatch_status"; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -281,6 +284,7 @@ $tabsqlsort[39] = "sortorder ASC"; $tabsqlsort[40] = "code ASC"; $tabsqlsort[41] = "code ASC"; $tabsqlsort[42] = "code ASC"; +$tabsqlsort[43] = "code ASC"; // Field names in select result for dictionary display $tabfield = array(); @@ -326,6 +330,7 @@ $tabfield[39] = "code,libelle,sortorder"; $tabfield[40] = "code,libelle,picto"; $tabfield[41] = "code,label"; $tabfield[42] = "code,label"; +$tabfield[43] = "code,label"; // Edit field names for editing a record $tabfieldvalue = array(); @@ -371,6 +376,7 @@ $tabfieldvalue[39] = "code,libelle,sortorder"; $tabfieldvalue[40] = "code,libelle,picto"; $tabfieldvalue[41] = "code,label"; $tabfieldvalue[42] = "code,label"; +$tabfieldvalue[43] = "code,label"; // Field names in the table for inserting a record $tabfieldinsert = array(); @@ -417,6 +423,7 @@ $tabfieldinsert[39] = "code,label,sortorder"; $tabfieldinsert[40] = "code,libelle,picto"; $tabfieldinsert[41] = "code,label"; $tabfieldinsert[42] = "code,label"; +$tabfieldinsert[43] = "code,label"; // Rowid name of field depending if field is autoincrement on or off.. // Use "" if id field is "rowid" and has autoincrement on @@ -464,6 +471,7 @@ $tabrowid[39] = "code"; $tabrowid[40] = "id"; $tabrowid[41] = ""; $tabrowid[42] = "rowid"; +$tabrowid[43] = "rowid"; // Condition to show dictionary in setup page $tabcond = array(); @@ -509,6 +517,7 @@ $tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_ $tabcond[40] = (!empty($conf->societe->enabled) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[41] = !empty($conf->intracommreport->enabled); $tabcond[42] = !empty($conf->product->enabled); +$tabcond[43] = !empty($conf->product->enabled && !empty($conf->productbatch->enabled)); // List of help for fields $tabhelp = array(); @@ -554,6 +563,7 @@ $tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp")); $tabhelp[41] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[42] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[43] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck = array(); @@ -599,6 +609,7 @@ $tabfieldcheck[39] = array(); $tabfieldcheck[40] = array(); $tabfieldcheck[41] = array(); $tabfieldcheck[42] = array(); +$tabfieldcheck[43] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); diff --git a/htdocs/install/mysql/data/llx_c_productbatch_status.sql b/htdocs/install/mysql/data/llx_c_productbatch_status.sql new file mode 100644 index 00000000000..a4628e0bd91 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_productbatch_status.sql @@ -0,0 +1,28 @@ +-- Copyright (C) 2021 Noé Cendrier +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- + +-- +-- Do not place a comment at the end of the line, this file is parsed when +-- from the install and all '--' are removed. +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'ProductCanBeUsed', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); + diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql b/htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql new file mode 100644 index 00000000000..fc72f556a97 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2021 Noé Cendrier +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_productbatch_status ADD UNIQUE INDEX uk_c_productbatch_status(code); diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_status.sql b/htdocs/install/mysql/tables/llx_c_productbatch_status.sql new file mode 100644 index 00000000000..2ffad7f5939 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_productbatch_status.sql @@ -0,0 +1,25 @@ +-- ======================================================================== +-- Copyright (C) 2012-2017 Noé Cendrier +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +create table llx_c_productbatch_status +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(16) NOT NULL, + label varchar(50) NOT NULL, + active integer DEFAULT 1 NOT NULL +)ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b103d0082ba..5d336524798 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1043,6 +1043,7 @@ DictionaryOpportunityStatus=Lead status for project/lead DictionaryExpenseTaxCat=Expense report - Transportation categories DictionaryExpenseTaxRange=Expense report - Range by transportation category DictionaryTransportMode=Intracomm report - Transport mode +DictionaryBatchStatus=Product batch status TypeOfUnit=Type of unit SetupSaved=Setup saved SetupNotSaved=Setup not saved diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 4414b6ad8d8..dc1cccd7d7b 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -1,4 +1,4 @@ -# ProductBATCH language file - en_US - ProductBATCH +# ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=Use lot/serial number ProductStatusOnBatch=Yes (lot required) ProductStatusOnSerial=Yes (unique serial number required) @@ -32,4 +32,5 @@ CustomMasks=Adds an option to define mask in the product card LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned - +OutOfOrder=Out of order +ProductCanBeUsed=Functional diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ef48fc0a82d..a9a5327e924 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1034,6 +1034,7 @@ DictionaryOpportunityStatus=Statut d'opportunités pour les affaires/projets DictionaryExpenseTaxCat=Note de frais - catégories de déplacement DictionaryExpenseTaxRange=Note de frais - Tri par catégorie de déplacement DictionaryTransportMode=Déclaration d'échanges intracommunautaires - Mode de transport +DictionaryBatchStatus=État du lot (produits) TypeOfUnit=Type d'unité SetupSaved=Configuration sauvegardée SetupNotSaved=Configuration non enregistrée diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index cd38ac89278..ce8eae07253 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -1,4 +1,4 @@ -# ProductBATCH language file - en_US - ProductBATCH +# ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=Utiliser les numéros de lots/série ProductStatusOnBatch=Lot (requis) ProductStatusOnSerial=Numéro de série (doit être unique pour chaque équipement) @@ -30,4 +30,6 @@ BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lo BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série CustomMasks=Ajoute une option pour définir le masque dans la fiche produit LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot -SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série \ No newline at end of file +SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série +OutOfOrder=Hors d'usage +ProductCanBeUsed=En état de marche \ No newline at end of file From d340e21cb3ba468f24bdd04cdc21bdc46d4e00c7 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Tue, 20 Apr 2021 16:13:36 +0200 Subject: [PATCH 2/9] No translation for dictionary labels --- htdocs/install/mysql/data/llx_c_productbatch_status.sql | 4 ++-- htdocs/langs/en_US/productbatch.lang | 2 -- htdocs/langs/fr_FR/productbatch.lang | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_productbatch_status.sql b/htdocs/install/mysql/data/llx_c_productbatch_status.sql index a4628e0bd91..ebe64ff3a26 100644 --- a/htdocs/install/mysql/data/llx_c_productbatch_status.sql +++ b/htdocs/install/mysql/data/llx_c_productbatch_status.sql @@ -23,6 +23,6 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'ProductCanBeUsed', 1); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'En état de marche', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', "Hors d'usage", 1); diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index dc1cccd7d7b..92c224b55f5 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -32,5 +32,3 @@ CustomMasks=Adds an option to define mask in the product card LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned -OutOfOrder=Out of order -ProductCanBeUsed=Functional diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index ce8eae07253..c3e48ddbeb1 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -30,6 +30,4 @@ BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lo BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série CustomMasks=Ajoute une option pour définir le masque dans la fiche produit LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot -SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série -OutOfOrder=Hors d'usage -ProductCanBeUsed=En état de marche \ No newline at end of file +SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série \ No newline at end of file From f1d68c201b6169bc6f8d19df2e7806e96f003cf2 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Tue, 20 Apr 2021 16:56:15 +0200 Subject: [PATCH 3/9] conflict resolution --- htdocs/langs/en_US/productbatch.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 92c224b55f5..aedf85a4fb8 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -32,3 +32,4 @@ CustomMasks=Adds an option to define mask in the product card LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned + From 86812c13ee4e1dbef605568ab2da0d2af4af93cc Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 21 Apr 2021 09:18:40 +0200 Subject: [PATCH 4/9] no double quote --- htdocs/install/mysql/data/llx_c_productbatch_status.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_productbatch_status.sql b/htdocs/install/mysql/data/llx_c_productbatch_status.sql index ebe64ff3a26..c925c0cd937 100644 --- a/htdocs/install/mysql/data/llx_c_productbatch_status.sql +++ b/htdocs/install/mysql/data/llx_c_productbatch_status.sql @@ -24,5 +24,5 @@ -- INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'En état de marche', 1); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', "Hors d'usage", 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'Hors d’usage', 1); From 9fc67275fd7ce174a9ca2c50dfcef41de1e72137 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Tue, 27 Apr 2021 15:55:51 +0200 Subject: [PATCH 5/9] llx_c_productbatch_status to migration and translatable strings --- .../install/mysql/data/llx_c_productbatch_status.sql | 4 ++-- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_productbatch_status.sql b/htdocs/install/mysql/data/llx_c_productbatch_status.sql index c925c0cd937..cd57bbb504b 100644 --- a/htdocs/install/mysql/data/llx_c_productbatch_status.sql +++ b/htdocs/install/mysql/data/llx_c_productbatch_status.sql @@ -23,6 +23,6 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'En état de marche', 1); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'Hors d’usage', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 3f17d23b51f..818381588c4 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -141,6 +141,17 @@ CREATE TABLE llx_workstation_workstation_usergroup( fk_workstation integer ) ENGINE=innodb; +CREATE TABLE llx_c_producbatch_status( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + code varchar(16) NOT NULL, + label varchar(50) NOT NULL, + active integer DEFAULT 1 NOT NULL +) ENGINE=innodb; + +ALTER TABLE llx_c_productbatch_status ADD UNIQUE INDEX uk_c_productbatch_status(code); + +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); +INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); ALTER TABLE llx_product_customer_price ADD COLUMN ref_customer varchar(30); ALTER TABLE llx_product_customer_price_log ADD COLUMN ref_customer varchar(30); From 762f41ea861018239eaa16cc88ca952960f107ef Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 29 Apr 2021 12:49:15 +0200 Subject: [PATCH 6/9] llx_c_productbatch_qcstatus as dictionnary name --- htdocs/admin/dict.php | 7 +++++-- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 8 ++++---- ...status.key.sql => llx_c_productbatch_qcstatus.key.sql} | 2 +- ...ctbatch_status.sql => llx_c_productbatch_qcstatus.sql} | 2 +- htdocs/langs/en_US/productbatch.lang | 3 +++ htdocs/langs/fr_FR/productbatch.lang | 6 +++++- 6 files changed, 19 insertions(+), 9 deletions(-) rename htdocs/install/mysql/tables/{llx_c_productbatch_status.key.sql => llx_c_productbatch_qcstatus.key.sql} (90%) rename htdocs/install/mysql/tables/{llx_c_productbatch_status.sql => llx_c_productbatch_qcstatus.sql} (96%) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8efbbf4cbfa..2b331c0c175 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -146,7 +146,7 @@ $tabname[39] = MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabname[40] = MAIN_DB_PREFIX."c_stcommcontact"; $tabname[41] = MAIN_DB_PREFIX."c_transport_mode"; $tabname[42] = MAIN_DB_PREFIX."c_product_nature"; -$tabname[43] = MAIN_DB_PREFIX."c_productbatch_status"; +$tabname[43] = MAIN_DB_PREFIX."c_productbatch_qcstatus"; // Dictionary labels $tablib = array(); @@ -238,7 +238,7 @@ $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_P $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; $tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode"; $tabsql[42] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_product_nature"; -$tabsql[43] = "SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_productbatch_status"; +$tabsql[43] = "SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_productbatch_qcstatus"; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -1979,6 +1979,9 @@ if ($id) { } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_product_nature') { $langs->load("products"); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') { + $langs->load("productbatch"); + $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); } $class .= ($class ? ' ' : '').'tddict'; if ($fieldlist[$field] == 'note' && $id == 10) { diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 818381588c4..9eedc2872c6 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -141,17 +141,17 @@ CREATE TABLE llx_workstation_workstation_usergroup( fk_workstation integer ) ENGINE=innodb; -CREATE TABLE llx_c_producbatch_status( +CREATE TABLE llx_c_producbatch_qcstatus( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, code varchar(16) NOT NULL, label varchar(50) NOT NULL, active integer DEFAULT 1 NOT NULL ) ENGINE=innodb; -ALTER TABLE llx_c_productbatch_status ADD UNIQUE INDEX uk_c_productbatch_status(code); +ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); +INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); +INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1); ALTER TABLE llx_product_customer_price ADD COLUMN ref_customer varchar(30); ALTER TABLE llx_product_customer_price_log ADD COLUMN ref_customer varchar(30); diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql similarity index 90% rename from htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql rename to htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql index fc72f556a97..1c00ac13deb 100644 --- a/htdocs/install/mysql/tables/llx_c_productbatch_status.key.sql +++ b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql @@ -16,4 +16,4 @@ -- -- ======================================================================== -ALTER TABLE llx_c_productbatch_status ADD UNIQUE INDEX uk_c_productbatch_status(code); +ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code); diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_status.sql b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql similarity index 96% rename from htdocs/install/mysql/tables/llx_c_productbatch_status.sql rename to htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql index 2ffad7f5939..35a9581bf8e 100644 --- a/htdocs/install/mysql/tables/llx_c_productbatch_status.sql +++ b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql @@ -16,7 +16,7 @@ -- -- ======================================================================== -create table llx_c_productbatch_status +create table llx_c_productbatch_qcstatus ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(16) NOT NULL, diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index aedf85a4fb8..2a19be96cf6 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -33,3 +33,6 @@ LotProductTooltip=Adds an option in the product card to define a dedicated batch SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned +#Traceability - qc status +OutOfOrder=Out of order +InWorkingOrder=In working order \ No newline at end of file diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index c3e48ddbeb1..49a249ce0e5 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -30,4 +30,8 @@ BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lo BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série CustomMasks=Ajoute une option pour définir le masque dans la fiche produit LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot -SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série \ No newline at end of file +SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série + +#Traceability - qc status +OutOfOrder=Hors d'usage +InWorkingOrder=En état de marche \ No newline at end of file From f7182d43fdd0c72cc9f49d97bf35926b36795763 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 29 Apr 2021 13:00:47 +0200 Subject: [PATCH 7/9] add entity in c_productbatch_qcstatus key --- ...roductbatch_status.sql => llx_c_productbatch_qcstatus.sql} | 4 ++-- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 ++- .../install/mysql/tables/llx_c_productbatch_qcstatus.key.sql | 2 +- htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) rename htdocs/install/mysql/data/{llx_c_productbatch_status.sql => llx_c_productbatch_qcstatus.sql} (83%) diff --git a/htdocs/install/mysql/data/llx_c_productbatch_status.sql b/htdocs/install/mysql/data/llx_c_productbatch_qcstatus.sql similarity index 83% rename from htdocs/install/mysql/data/llx_c_productbatch_status.sql rename to htdocs/install/mysql/data/llx_c_productbatch_qcstatus.sql index cd57bbb504b..7e0bb6661f6 100644 --- a/htdocs/install/mysql/data/llx_c_productbatch_status.sql +++ b/htdocs/install/mysql/data/llx_c_productbatch_qcstatus.sql @@ -23,6 +23,6 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); -INSERT INTO llx_c_productbatch_status (code, label, active) VALUES ('KO', 'OutOfOrder', 1); +INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); +INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 9eedc2872c6..81b5f8b96f7 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -143,12 +143,13 @@ CREATE TABLE llx_workstation_workstation_usergroup( CREATE TABLE llx_c_producbatch_qcstatus( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer NOT NULL DEFAULT 1, code varchar(16) NOT NULL, label varchar(50) NOT NULL, active integer DEFAULT 1 NOT NULL ) ENGINE=innodb; -ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code); +ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code, entity); INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1); INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1); diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql index 1c00ac13deb..9ffa27bc3a5 100644 --- a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql +++ b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.key.sql @@ -16,4 +16,4 @@ -- -- ======================================================================== -ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code); +ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code, entity); diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql index 35a9581bf8e..73daa56067a 100644 --- a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql +++ b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql @@ -16,9 +16,10 @@ -- -- ======================================================================== -create table llx_c_productbatch_qcstatus +CREATE TABLE llx_c_productbatch_qcstatus ( rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, code varchar(16) NOT NULL, label varchar(50) NOT NULL, active integer DEFAULT 1 NOT NULL From b04afc17538981a8b259b5cf0d1e397fd645eb4d Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 29 Apr 2021 13:08:24 +0200 Subject: [PATCH 8/9] merge conflict resolution --- htdocs/admin/dict.php | 4 ++-- htdocs/langs/en_US/productbatch.lang | 2 +- htdocs/langs/fr_FR/productbatch.lang | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2b331c0c175..06aad44d123 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1978,10 +1978,10 @@ if ($id) { $valuetoshow = $obj->state_code; } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_product_nature') { $langs->load("products"); - $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); + $valuetoshow = $langs->trans($obj->{$value}); } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') { $langs->load("productbatch"); - $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); + $valuetoshow = $langs->trans($obj->{$value}); } $class .= ($class ? ' ' : '').'tddict'; if ($fieldlist[$field] == 'note' && $id == 10) { diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 2a19be96cf6..756eb0a5947 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -35,4 +35,4 @@ QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned #Traceability - qc status OutOfOrder=Out of order -InWorkingOrder=In working order \ No newline at end of file +InWorkingOrder=In working order diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 49a249ce0e5..37ebb65135b 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -34,4 +34,4 @@ SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle s #Traceability - qc status OutOfOrder=Hors d'usage -InWorkingOrder=En état de marche \ No newline at end of file +InWorkingOrder=En état de marche From f3ede35b4fa66d79132f7c672ac7106533447878 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 29 Apr 2021 13:18:14 +0200 Subject: [PATCH 9/9] lang correction --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f93b416668..85bc7871a74 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1043,7 +1043,7 @@ DictionaryOpportunityStatus=Lead status for project/lead DictionaryExpenseTaxCat=Expense report - Transportation categories DictionaryExpenseTaxRange=Expense report - Range by transportation category DictionaryTransportMode=Intracomm report - Transport mode -DictionaryBatchStatus=Product batch status +DictionaryBatchStatus=Product lot/serial Quality Control status TypeOfUnit=Type of unit SetupSaved=Setup saved SetupNotSaved=Setup not saved diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ff8531e1809..9d33eb2b74a 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1043,7 +1043,7 @@ DictionaryOpportunityStatus=Statut d'opportunités pour les affaires/projets DictionaryExpenseTaxCat=Note de frais - catégories de déplacement DictionaryExpenseTaxRange=Note de frais - Tri par catégorie de déplacement DictionaryTransportMode=Déclaration d'échanges intracommunautaires - Mode de transport -DictionaryBatchStatus=État du lot (produits) +DictionaryBatchStatus=État de qualité du lot/série (produits) TypeOfUnit=Type d'unité SetupSaved=Configuration sauvegardée SetupNotSaved=Configuration non enregistrée