Merge branch 'altairisfr-batch_status_dict' into develop

This commit is contained in:
Laurent Destailleur
2021-05-06 17:30:01 +02:00
9 changed files with 111 additions and 4 deletions

View File

@@ -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_qcstatus";
// 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_qcstatus";
// 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);
@@ -1968,6 +1979,9 @@ if ($id) {
} elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_product_nature') {
$langs->load("products");
$valuetoshow = $langs->trans($obj->{$value});
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') {
$langs->load("productbatch");
$valuetoshow = $langs->trans($obj->{$value});
}
$class .= ($class ? ' ' : '').'tddict';
if ($value == 'note' && $id == 10) {

View File

@@ -0,0 +1,28 @@
-- Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
--
-- 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 <https://www.gnu.org/licenses/>.
--
--
--
-- 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_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1);
INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1);

View File

@@ -157,6 +157,18 @@ CREATE TABLE llx_workstation_workstation_usergroup(
fk_workstation integer
) ENGINE=innodb;
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, 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);
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);

View File

@@ -0,0 +1,19 @@
-- ========================================================================
-- Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
--
-- 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 <https://www.gnu.org/licenses/>.
--
-- ========================================================================
ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code, entity);

View File

@@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2012-2017 Noé Cendrier <noe.cendrier@altairis.fr>
--
-- 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 <http://www.gnu.org/licenses/>.
--
-- ========================================================================
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
)ENGINE=innodb;

View File

@@ -1047,6 +1047,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 lot/serial Quality Control status
TypeOfUnit=Type of unit
SetupSaved=Setup saved
SetupNotSaved=Setup not saved

View File

@@ -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,8 @@ ManageLotMask=Custom mask
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
QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned
#Traceability - qc status
OutOfOrder=Out of order
InWorkingOrder=In working order

View File

@@ -1044,6 +1044,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 de qualité du lot/série (produits)
TypeOfUnit=Type d'unité
SetupSaved=Configuration sauvegardée
SetupNotSaved=Configuration non enregistrée

View File

@@ -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=Oui (Lot/Série requis)
ProductStatusOnSerial=Oui (numéro de série unique requis)
@@ -33,3 +33,5 @@ CustomMasks=Ajoute une option pour définir le masque dans la fiche produit
LotProductTooltip=Ajoute une option dans la fiche produit pour définir un masque de numéro de lot dédié
SNProductTooltip=Ajoute une option dans la fiche produit pour définir un masque de numéro de série dédié
QtyToAddAfterBarcodeScan=Quantité à ajouter pour chaque code à barres/lot/série scanné
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