From 506ba822e97969b7e1c018df5c39e179962b6402 Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 2 Feb 2021 11:06:01 +0100 Subject: [PATCH] FIX: Select transport mode function when create a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql --- htdocs/fourn/facture/card.php | 2 +- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 00e0e33ea1e..3ff3d72e810 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2095,7 +2095,7 @@ if ($action == 'create') { $langs->loadLangs(array("intracommreport")); print ''.$langs->trans('IntracommReportTransportMode').''; - $form->selectModeTransport(isset($_POST['transport_mode_id']) ? $_POST['transport_mode_id'] : $transport_mode_id, 'transport_mode_id'); + $form->selectTransportMode(isset($_POST['transport_mode_id']) ? $_POST['transport_mode_id'] : $transport_mode_id, 'transport_mode_id'); print ''; } diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 96a681d4c56..ae9f1f901b7 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -123,6 +123,7 @@ CREATE TABLE llx_c_transport_mode ( label varchar(255) NOT NULL, active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; +ALTER TABLE llx_c_transport_mode ADD UNIQUE INDEX uk_c_transport_mode (code, entity); INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('MAR', 'Transport maritime (y compris camions ou wagons sur bateau)', 1); INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('TRA', 'Transport par chemin de fer (y compris camions sur wagon)', 1);