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