From 6a55aedf594f8bd0a7e33a783805b07dd3c13937 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Mon, 21 Oct 2019 08:46:07 +0200 Subject: [PATCH 1/8] Create file. List of parcels details related to an expedition. --- .../mysql/tables/llx_expedition_package.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_expedition_package.sql diff --git a/htdocs/install/mysql/tables/llx_expedition_package.sql b/htdocs/install/mysql/tables/llx_expedition_package.sql new file mode 100644 index 00000000000..b897e2ab312 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_expedition_package.sql @@ -0,0 +1,18 @@ +--List of parcels details related to an expedition +create table llx_expedition_package +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_expedition integer NOT NULL, + description varchar(255), --Description of goods in the package (required by the custom) + value double(24,8) DEFAULT 0,--Value (Price of the content, for insurance & custom) + fk_parcel_type integer, -- Type or package, linked to llx_c_shipment_parcel_type (eg: 1=enveloppe, 2=package, 3=palette, 4=other) + height float, -- height + width float, -- width + size float, -- depth + size_units integer, -- unit of all sizes (height, width, depth) + weight float, -- weight + weight_units integer, -- unit of weight + dangerous_goods smallint DEFAULT 0, -- 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. + tail_lift smallint DEFAULT 0, -- 0 = no tail lift required to load/unload package(s), 1 = a tail lift is required to load/unload package(s). Sometime tail lift load can be different than tail lift delivery so maybe adding a new table line. + rang integer DEFAULT 0 +)ENGINE=innodb; From 16bd837dc7403c403cfcea671487a8165d6a70ae Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Mon, 21 Oct 2019 08:54:59 +0200 Subject: [PATCH 2/8] create file Dictionary of package type --- htdocs/install/mysql/tables/llx_c_shipment_package_type | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_c_shipment_package_type diff --git a/htdocs/install/mysql/tables/llx_c_shipment_package_type b/htdocs/install/mysql/tables/llx_c_shipment_package_type new file mode 100644 index 00000000000..e510352eba2 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_shipment_package_type @@ -0,0 +1,9 @@ +--Dictionary of package type +create table llx_c_shipment_package_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(50) NOT NULL, -- Short name + description varchar(255), -- Description + active integer DEFAULT 1 NOT NULL, -- Active or not + entity integer DEFAULT 1 NOT NULL -- Multi company id +)ENGINE=innodb; From c2357405445977d00db6039fd080decf158ec797 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Mon, 21 Oct 2019 08:58:13 +0200 Subject: [PATCH 3/8] parcel to package --- htdocs/install/mysql/tables/llx_expedition_package.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_expedition_package.sql b/htdocs/install/mysql/tables/llx_expedition_package.sql index b897e2ab312..2f8d97a26a9 100644 --- a/htdocs/install/mysql/tables/llx_expedition_package.sql +++ b/htdocs/install/mysql/tables/llx_expedition_package.sql @@ -5,7 +5,7 @@ create table llx_expedition_package fk_expedition integer NOT NULL, description varchar(255), --Description of goods in the package (required by the custom) value double(24,8) DEFAULT 0,--Value (Price of the content, for insurance & custom) - fk_parcel_type integer, -- Type or package, linked to llx_c_shipment_parcel_type (eg: 1=enveloppe, 2=package, 3=palette, 4=other) + fk_package_type integer, -- Type or package, linked to llx_c_shipment_parcel_type (eg: 1=enveloppe, 2=package, 3=palette, 4=other) height float, -- height width float, -- width size float, -- depth From af8f5948f0dd63520d5a372707ca06037a200f26 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:54:50 +0200 Subject: [PATCH 4/8] Package tables llx_expedition_package and llx_c_shipment_package_type --- .../install/mysql/migration/10.0.0-11.0.0.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 6d9f7f7c97f..ea818a1ab04 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -326,3 +326,33 @@ create table llx_fichinterdet_rec ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL AFTER product_type; ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL AFTER date_start; + +--List of parcels details related to an expedition +create table llx_expedition_package +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_expedition integer NOT NULL, + description varchar(255), --Description of goods in the package (required by the custom) + value double(24,8) DEFAULT 0,--Value (Price of the content, for insurance & custom) + fk_parcel_type integer, -- Type or package, linked to llx_c_shipment_parcel_type (eg: 1=enveloppe, 2=package, 3=palette, 4=other) + height float, -- height + width float, -- width + size float, -- depth + size_units integer, -- unit of all sizes (height, width, depth) + weight float, -- weight + weight_units integer, -- unit of weight + dangerous_goods smallint DEFAULT 0, -- 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. + tail_lift smallint DEFAULT 0, -- 0 = no tail lift required to load/unload package(s), 1 = a tail lift is required to load/unload package(s). Sometime tail lift load can be different than tail lift delivery so maybe adding a new table line. + rang integer DEFAULT 0 +)ENGINE=innodb; + +--Dictionary of package type +create table llx_c_shipment_package_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(50) NOT NULL, -- Short name + description varchar(255), -- Description + active integer DEFAULT 1 NOT NULL, -- Active or not + entity integer DEFAULT 1 NOT NULL -- Multi company id +)ENGINE=innodb; + From 4dd5c00ec0c0a732f881990fd5a8be8ee539f995 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 22 Oct 2019 16:25:10 +0200 Subject: [PATCH 5/8] Internationalization --- htdocs/don/class/don.class.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 70fabfcdc29..9707229393e 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France * * 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 @@ -61,8 +61,16 @@ class Don extends CommonObject * @var string String with name of icon for object don. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'generic'; - + + /** + * @var string Date of the donation + */ public $date; + + /** + * amount of donation + * @var double + */ public $amount; /** @@ -133,7 +141,7 @@ class Don extends CommonObject /** - * Retourne le libelle du statut d'un don (brouillon, validee, abandonnee, payee) + * Returns the donation status label (draft, valid, abandoned, paid) * * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @return string Libelle @@ -145,7 +153,7 @@ class Don extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi le libelle d'un statut donne + * Return the label of a given status * * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto From c17604437999e8a72bf63e560adc98b3555d29b1 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 22 Oct 2019 14:26:26 +0000 Subject: [PATCH 6/8] Fixing style errors. --- htdocs/don/class/don.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 9707229393e..fc95009846b 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -61,12 +61,12 @@ class Don extends CommonObject * @var string String with name of icon for object don. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'generic'; - + /** * @var string Date of the donation */ public $date; - + /** * amount of donation * @var double From 9b2905fb434595339d71d2ea1c40269fe1fab258 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 22 Oct 2019 17:10:52 +0200 Subject: [PATCH 7/8] Typo and comment --- htdocs/don/class/donstats.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index dc12f5a1d68..039a85e6c26 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/don/class/dontats.class.php + * \file htdocs/don/class/donstats.class.php * \ingroup donations * \brief File of class to manage donations statistics */ @@ -39,11 +39,22 @@ class DonationStats extends Stats */ public $table_element; - public $socid; + public $socid; public $userid; - + + /** + * @var string FROM + */ public $from; + + /** + * @var string field + */ public $field; + + /** + * @var string WHERE + */ public $where; From 5ab6228adbf75168a506ecbc1812cb96c879f568 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 22 Oct 2019 15:12:42 +0000 Subject: [PATCH 8/8] Fixing style errors. --- htdocs/don/class/donstats.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index 039a85e6c26..607d6555337 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -41,17 +41,17 @@ class DonationStats extends Stats public $socid; public $userid; - + /** - * @var string FROM + * @var string FROM */ public $from; - + /** * @var string field */ public $field; - + /** * @var string WHERE */