From a672673319dfc7216c8236f4569df1475dc41ba6 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 17 Dec 2019 11:24:48 +0100 Subject: [PATCH 01/33] FIX : units traductions for selectUnits() function --- htdocs/langs/en_US/products.lang | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c7e98972fda..c906bcc1d66 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -188,13 +188,38 @@ unitSET=Set unitS=Second unitH=Hour unitD=Day -unitKG=Kilogram unitG=Gram unitM=Meter unitLM=Linear meter unitM2=Square meter unitM3=Cubic meter unitL=Liter +unitT=tonne +unitKG=kg +unitG=g +unitMG=mg +unitLB=pound +unitOZ=ounce +unitM=m +unitDM=dm +unitCM=cm +unitMM=mm +unitFT=ft +unitIN=in +unitM2=m² +unitDM2=dm² +unitCM2=cm² +unitMM2=mm² +unitFT2=ft² +unitIN2=in² +unitM3=m³ +unitDM3=dm³ +unitCM3=cm³ +unitMM3=mm³ +unitFT3=ft³ +unitIN3=in³ +unitOZ3=ounce +unitgallon=gallon ProductCodeModel=Product ref template ServiceCodeModel=Service ref template CurrentProductPrice=Current price @@ -341,4 +366,4 @@ ErrorCopyProductCombinations=There was an error while copying the product varian ErrorDestinationProductNotFound=Destination product not found ErrorProductCombinationNotFound=Product variant not found ActionAvailableOnVariantProductOnly=Action only available on the variant of product -ProductsPricePerCustomer=Product prices per customers \ No newline at end of file +ProductsPricePerCustomer=Product prices per customers From 7b1bf32cd9087c7c40a10207eac40931e6ebae97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Dec 2019 12:19:32 +0100 Subject: [PATCH 02/33] Update products.lang --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c906bcc1d66..9595378b084 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -194,7 +194,7 @@ unitLM=Linear meter unitM2=Square meter unitM3=Cubic meter unitL=Liter -unitT=tonne +unitT=ton unitKG=kg unitG=g unitMG=mg From 95b56f05183027eaa3ae6136be5c28e803169800 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 17 Dec 2019 12:19:35 +0100 Subject: [PATCH 03/33] Update 6.0.0-7.0.0.sql timestamp NOT NULL can cause SQL error. --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index d2879e5bb3c..ff6a1fe03fb 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -285,7 +285,7 @@ CREATE TABLE llx_website_account( date_last_login datetime, date_previous_login datetime, date_creation datetime NOT NULL, - tms timestamp NOT NULL, + tms timestamp, fk_user_creat integer NOT NULL, fk_user_modif integer, import_key varchar(14), From 3e19702e392ee26a6dfbf36e700fd474805f2736 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 17 Dec 2019 18:05:59 +0100 Subject: [PATCH 04/33] Fix prevent double action on shipment close --- htdocs/expedition/class/expedition.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ea6e003d326..81c7cb55fc4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1902,6 +1902,12 @@ class Expedition extends CommonObject $error=0; + // Protection. This avoid to move stock later when we should not + if ($this->statut == self::STATUS_CLOSED) + { + return 0; + } + $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut='.self::STATUS_CLOSED; From 3fb72c349f47179d088d78201faac965e77da80a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 18 Dec 2019 03:25:19 +0100 Subject: [PATCH 05/33] Fix language traduction on import/export tools --- htdocs/core/modules/modProduct.class.php | 8 ++++---- htdocs/core/modules/modSociete.class.php | 6 +++--- htdocs/core/modules/modUser.class.php | 6 +++--- htdocs/langs/en_US/companies.lang | 3 ++- htdocs/langs/en_US/products.lang | 5 ++++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index e5c1e91b973..ff0a814f3ec 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -175,7 +175,7 @@ class modProduct extends DolibarrModules 'p.accountancy_code_sell'=>"ProductAccountancySellCode", 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', - 'p.weight'=>"Weight", 'p.weight_units'=>"WeightUnits", 'p.length'=>"Length", 'p.width'=>"Width", 'p.height'=>"Height", 'p.length_units'=>"SizeUnits", + 'p.weight'=>"Weight", 'p.weight_units'=>"WeightUnits", 'p.length'=>"Length", 'p.length_units'=>"LengthUnits", 'p.width'=>"Width", 'p.width_units'=>"WidthUnits", 'p.height'=>"Height", 'p.height_units'=>"HeightUnits", 'p.surface'=>"Surface", 'p.surface_units'=>"SurfaceUnits", 'p.volume'=>"Volume", 'p.volume_units'=>"VolumeUnits", 'p.duration'=>"Duration", 'p.finished' => 'Nature', @@ -382,13 +382,13 @@ class modProduct extends DolibarrModules 'p.weight' => "Weight", 'p.weight_units' => "WeightUnits", 'p.length' => "Length", - 'p.length_units' => "LengthUnit", + 'p.length_units' => "LengthUnits", 'p.width' => "Width", 'p.width_units' => "WidthUnits", 'p.height' => "Height", - 'p.height_units' => "HeightUnit", + 'p.height_units' => "HeightUnits", 'p.surface' => "Surface", - 'p.surface_units' => "SurfaceUnit", + 'p.surface_units' => "SurfaceUnits", 'p.volume' => "Volume", 'p.volume_units' => "VolumeUnits", 'p.duration' => "Duration",//duration of service diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 8d6490becfe..23d92f53cb7 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -71,7 +71,7 @@ class modSociete extends DolibarrModules $this->requiredby = array("modExpedition","modFacture","modFournisseur","modFicheinter","modPropale","modContrat","modCommande"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->phpmin = array(5,4); // Minimum version of PHP required by module - $this->langfiles = array("companies",'bills'); + $this->langfiles = array("companies","bills","compta","admin","banks"); // Constants $this->const = array(); @@ -412,7 +412,7 @@ class modSociete extends DolibarrModules 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", - 's.fk_departement' => "StateId", + 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.phone' => "Phone", 's.fax' => "Fax", @@ -583,7 +583,7 @@ class modSociete extends DolibarrModules 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", - 's.fk_departement' => "StateId", + 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.birthday' => "BirthdayDate", 's.poste' => "Role", diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 7e31400f1ab..a6daef60ebe 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -69,7 +69,7 @@ class modUser extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->phpmin = array(5,4); // Minimum version of PHP required by module - $this->langfiles = array("main","users","companies","members",'salaries'); + $this->langfiles = array("main","users","companies","members","salaries","hrm"); $this->always_enabled = true; // Can't be disabled // Constants @@ -225,7 +225,7 @@ class modUser extends DolibarrModules 'u.address'=>"Address",'u.zip'=>"Zip",'u.town'=>"Town", 'u.office_phone'=>'Phone','u.user_mobile'=>"Mobile",'u.office_fax'=>'Fax', 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', - 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.fk_user'=>'HierarchicalResponsible','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', 'u.birth'=>'BirthdayDate', 'u.datec'=>"DateCreation",'u.tms'=>"DateLastModification", @@ -281,7 +281,7 @@ class modUser extends DolibarrModules 'u.fk_state'=>"StateId",'u.fk_country'=>"CountryCode", 'u.office_phone'=>"Phone",'u.user_mobile'=>"Mobile",'u.office_fax'=>"Fax", 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', - 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.fk_user'=>'HierarchicalResponsible','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', 'u.birth'=>'BirthdayDate', 'u.datec'=>"DateCreation", diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 532fbf14cb7..e6560673942 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -57,6 +57,7 @@ NatureOfThirdParty=Nature of Third party NatureOfContact=Nature of Contact Address=Address State=State/Province +StateCode=State/Province code StateShort=State Region=Region Region-State=Region - State @@ -438,4 +439,4 @@ PaymentTermsCustomer=Payment Terms - Customer PaymentTypeSupplier=Payment Type - Vendor PaymentTermsSupplier=Payment Term - Vendor MulticurrencyUsed=Use Multicurrency -MulticurrencyCurrency=Currency \ No newline at end of file +MulticurrencyCurrency=Currency diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c7e98972fda..c11cf5f3037 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -287,6 +287,9 @@ ProductWeight=Weight for 1 product ProductVolume=Volume for 1 product WeightUnits=Weight unit VolumeUnits=Volume unit +WidthUnits=Width unit +LengthUnits=Length unit +HeightUnits=Height unit SurfaceUnits=Surface unit SizeUnits=Size unit DeleteProductBuyPrice=Delete buying price @@ -341,4 +344,4 @@ ErrorCopyProductCombinations=There was an error while copying the product varian ErrorDestinationProductNotFound=Destination product not found ErrorProductCombinationNotFound=Product variant not found ActionAvailableOnVariantProductOnly=Action only available on the variant of product -ProductsPricePerCustomer=Product prices per customers \ No newline at end of file +ProductsPricePerCustomer=Product prices per customers From 451b32674e2a0e1a516b2e251393ca7d0013cc5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Dec 2019 12:15:34 +0100 Subject: [PATCH 06/33] Removed duplicate record --- htdocs/install/mysql/data/llx_c_units.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_units.sql b/htdocs/install/mysql/data/llx_c_units.sql index 30484471ca8..f055561f633 100644 --- a/htdocs/install/mysql/data/llx_c_units.sql +++ b/htdocs/install/mysql/data/llx_c_units.sql @@ -49,10 +49,6 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('L', '98','VolumeUnitlitre','L', 'volume', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); - INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('P', '0','Piece','p', 'qty', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('SET', '0','Set','set', 'qty', 1); From 6789b7bd1ef54e32142997b4bf16e0c75b121fbf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 18 Dec 2019 18:23:31 +0100 Subject: [PATCH 07/33] Fix day scale unit --- htdocs/install/mysql/data/llx_c_units.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_units.sql b/htdocs/install/mysql/data/llx_c_units.sql index f055561f633..905f3d344be 100644 --- a/htdocs/install/mysql/data/llx_c_units.sql +++ b/htdocs/install/mysql/data/llx_c_units.sql @@ -55,7 +55,7 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('S', '0','second','s', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MI', '60','minute','i', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('H', '3600','hour','h', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D','12960000','day','d', 'time', 1); +INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D', '86400','day','d', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('W', '604800','week','w', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MO','2629800','month','m', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('Y','31557600','year','y', 'time', 1); From 538921f47977c56cbf9aadbdb87bc60b705f6f5a Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 10:35:38 +0100 Subject: [PATCH 08/33] #FIX Error Margin with Situation Invoice Fix an issue that show a negative margin when $line->situation_percent is not 100% Now, the margin price take progress into account. --- htdocs/core/class/html.formmargin.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index ea038fa8131..6b7ba7348ff 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -98,7 +98,11 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign - $pa = $line->qty * $pa_ht; + if ($object->type == Facture::TYPE_SITUATION) { + $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); + } else { + $pa = $line->qty * $pa_ht; + } // calcul des marges if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise From 063c139feefe0a7d6552a14c0649aa3c83aa5ca0 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 11:52:30 +0100 Subject: [PATCH 09/33] Situation Invoice Compatibility take progress percent into account in buying price --- htdocs/margin/productMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 22dfd0146b1..8ec46c3e8ed 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -181,8 +181,8 @@ if ($id > 0) $sql.= " d.fk_product,"; if ($id > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " SUM(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) -$sql.= " SUM(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " SUM(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " SUM(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " SUM(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 14cf295f22b10269cbb5a111c32f0f8ccb7c4714 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 11:58:25 +0100 Subject: [PATCH 10/33] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/tabs/productMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index afb1dda37a9..9b62c1b1bca 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -137,8 +137,8 @@ if ($id > 0 || ! empty($ref)) if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty) as qty,"; // not always positive in case of Credit note - $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty * d.buy_price_ht) as buying_price,"; // not always positive in case of Credit note - $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge" ; // not always positive in case of Credit note + $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(d.qty * d.buy_price_ht * (d.situation_percent / 100)) as buying_price,"; // not always positive in case of Credit note + $sql.= " ".$db->ifsql('f.type = 2', -1, 1)." * sum(abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100))) as marge" ; // not always positive in case of Credit note $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 347eae05acf9b5cc613bb6c946648ddabde28053 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:03:09 +0100 Subject: [PATCH 11/33] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/customerMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 78d105ad5cb..36e033a5e50 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -205,8 +205,8 @@ $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; if ($client) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) -$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From a82f996fcf63d35cb3eb455635cd728f802f3eba Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:04:48 +0100 Subject: [PATCH 12/33] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/tabs/thirdpartyMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1d0897a72b0..337190b6c15 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -147,8 +147,8 @@ if ($socid > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive - $sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive - $sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge"; // always positive + $sql.= " sum(d.qty * d.buy_price_ht * (d.situation_percent / 100)) as buying_price,"; // always positive + $sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100))) as marge"; // always positive $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 91e2fe9a9997f52d901a6cd964d97ac7b48705e9 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 19 Dec 2019 12:06:18 +0100 Subject: [PATCH 13/33] Update to integer situation invoice Before : Situation invoice with situation_percent < 100 => Negative and Bad margin (not proportional) Now : Situation invoice with situation_percent < 100 => Correct and proportional. --- htdocs/margin/agentMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index b4e323a54c0..96787b1231b 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -139,8 +139,8 @@ $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; $sql.= " u.rowid as agent, u.login, u.lastname, u.firstname,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) -$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht').") as buying_price,"; -$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)').") as marge" ; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1 * (d.situation_percent / 100)', 'd.qty * d.buy_price_ht * (d.situation_percent / 100)').") as buying_price,"; +$sql.= " sum(".$db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty * (d.situation_percent / 100)))', 'd.total_ht - (d.buy_price_ht * d.qty * (d.situation_percent / 100))').") as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); From 8321fe6ad2b36623600b00f877111be92f8c0661 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 22 Dec 2019 09:13:34 +0100 Subject: [PATCH 14/33] FIX missing nl2br conversion --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 9b1a5a69525..4d796bbcd07 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -444,7 +444,7 @@ class CMailFile } else { $this->message->setBody($msg, 'text/plain'); // And optionally an alternative body - $this->message->addPart($msg, 'text/html'); + $this->message->addPart(dol_nl2br($msg), 'text/html'); } if ($this->atleastonefile) From e60ae67acafe3a7b1a26c8e74197432b9d36d91f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 16:23:52 +0100 Subject: [PATCH 15/33] Fix stats page --- htdocs/salaries/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 6e7a6826760..e96b6776664 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -22,7 +22,7 @@ * \brief Page for statistics of module salaries */ -require '../../../main.inc.php'; +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salariesstats.class.php'; From dd9f25b13a8db2805a7b2e98d12c678be6112fd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 16:33:15 +0100 Subject: [PATCH 16/33] CSS --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/takepos/takepos.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 57138424465..370bfe9a8b9 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -328,7 +328,7 @@ if ($resql) print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); - print $langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'

'; + print ''.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'

'; $i = 0; diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 0ea892eca8e..fed82019d62 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -765,7 +765,7 @@ $menus[$r++]=array('title'=>'< print ''."\n"; print '
'; - print ' '; + print ' '; print ''.img_picto('', 'searchclear').''; print '
'; ?> From 3ae5901a6434e6da8f30a6f0ab81870586f24ba6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 19:46:36 +0100 Subject: [PATCH 17/33] Fix look and feel v11 --- htdocs/compta/prelevement/bons.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 7f38df2ef39..c623d660aaa 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -148,13 +148,23 @@ if ($result) print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print "\n"; + $directdebitorder = new BonPrelevement($db); + while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); - print ''; + $directdebitorder->id = $obj->rowid; + $directdebitorder->ref = $obj->ref; + $directdebitorder->datec = $obj->datec; + $directdebitorder->amount = $obj->amount; + $directdebitorder->statut = $obj->statut; - print ''.$obj->ref."\n"; + print ''; + + print ''; + print $directdebitorder->getNomUrl(1); + print "\n"; print ''.dol_print_date($db->jdate($obj->datec), 'day')."\n"; From 3036ff637f498b37ba5322246958a500f79fd251 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 19:49:39 +0100 Subject: [PATCH 18/33] Fix bad url --- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 6bb57a348da..5bf48189c4a 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -338,7 +338,7 @@ print ''; $permforcashfence = 1; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit); From daae053e395be4add2ec72b407f61c1cd52d83a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 20:02:18 +0100 Subject: [PATCH 19/33] Debug CashFence feature --- .../compta/cashcontrol/cashcontrol_card.php | 171 +++++++++--------- 1 file changed, 90 insertions(+), 81 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index c240495c4a2..0a7e2fa2d17 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -256,7 +256,7 @@ if ($action == "create" || $action == "start") $sql .= " WHERE fk_account = ".$bankid; if ($syear && !$smonth) $sql .= " AND dateo < '".$db->idate(dol_get_first_day($syear, 1))."'"; elseif ($syear && $smonth && !$sday) $sql .= " AND dateo < '".$db->idate(dol_get_first_day($syear, $smonth))."'"; - elseif ($syear && $smonth && $sday) $sql .= " AND dateo < '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."'"; + elseif ($syear && $smonth && $sday) $sql .= " AND dateo < '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."'"; else dol_print_error('', 'Year not defined'); $resql = $db->query($sql); @@ -296,7 +296,7 @@ if ($action == "create" || $action == "start") } if ($syear && !$smonth) $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; elseif ($syear && $smonth && !$sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; - elseif ($syear && $smonth && $sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; + elseif ($syear && $smonth && $sday) $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; else dol_print_error('', 'Year not defined'); $resql = $db->query($sql); @@ -330,7 +330,7 @@ if ($action == "create" || $action == "start") print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -343,7 +343,11 @@ if ($action == "create" || $action == "start") print ''; print ''; print ''; + global $langs; + + print ''; print ''; + print ''; print ''."\n"; + // Line text + if (!empty($formquestion['text'])) { + $formconfirm .= ''."\n"; + } + // Line form fields if ($more) { From 558d57730997ce7df837a2fd2423ca6a64708c29 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 11:53:19 +0100 Subject: [PATCH 25/33] FIX add and modify category translate form with posted values on errors --- htdocs/categories/traduction.php | 126 +++++++++++++++++++------------ 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 7e14aaff68e..202d128182f 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -62,6 +62,7 @@ $object = new Categorie($db); /* * Actions */ +$error = 0; // retour a l'affichage des traduction si annulation if ($cancel == $langs->trans("Cancel")) @@ -78,28 +79,44 @@ $cancel != $langs->trans("Cancel") && $object->fetch($id); $current_lang = $langs->getDefaultLang(); - // update de l'objet - if ( $_POST["forcelangprod"] == $current_lang ) - { - $object->label = $_POST["libelle"]; - $object->description = dol_htmlcleanlastbr($_POST["desc"]); - } - else - { - $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; - $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); - } + // check parameters + $forcelangprod = GETPOST('forcelangprod', 'alpha'); + $libelle = GETPOST('libelle', 'alpha'); + $desc = GETPOST('desc', 'none'); - // sauvegarde en base - if ( $object->setMultiLangs($user) > 0 ) - { - $action = ''; - } - else - { - $action = 'add'; - setEventMessages($object->error, $object->errors, 'errors'); - } + if (empty($forcelangprod)) { + $error++; + $object->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Translation')); + } + + if (!$error) { + if (empty($libelle)) { + $error++; + $object->errors[] = $langs->trans('Language_' . $forcelangprod) . ' : ' . $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Label')); + } + + if (!$error) { + // update de l'objet + if ($forcelangprod == $current_lang) { + $object->label = $libelle; + $object->description = dol_htmlcleanlastbr($desc); + } else { + $object->multilangs[$forcelangprod]["label"] = $libelle; + $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc); + } + + // sauvegarde en base + $res = $object->setMultiLangs($user); + if ($res < 0) $error++; + } + } + + if ($error) { + $action = 'add'; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $action = ''; + } } // Validation de l'edition @@ -112,27 +129,34 @@ $cancel != $langs->trans("Cancel") && foreach ($object->multilangs as $key => $value) // enregistrement des nouvelles valeurs dans l'objet { - if ( $key == $current_lang ) - { - $object->label = $_POST["libelle-".$key]; - $object->description = dol_htmlcleanlastbr($_POST["desc-".$key]); - } - else - { - $object->multilangs[$key]["label"] = $_POST["libelle-".$key]; - $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]); + $libelle = GETPOST('libelle-'. $key, 'alpha'); + $desc = GETPOST('desc-' . $key); + + if (empty($libelle)) { + $error++; + $object->errors[] = $langs->trans('Language_' . $key) . ' : ' . $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Label')); + } + + if ( $key == $current_lang ) { + $object->label = $libelle; + $object->description = dol_htmlcleanlastbr($desc); + } else { + $object->multilangs[$key]["label"] = $libelle; + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($desc); } } - if ( $object->setMultiLangs($user) > 0 ) - { - $action = ''; - } - else - { - $action = 'edit'; - setEventMessages($object->error, $object->errors, 'errors'); - } + if (!$error) { + $res = $object->setMultiLangs($user); + if ($res < 0) $error++; + } + + if ($error) { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $action = ''; + } } $result = $object->fetch($id, $ref); @@ -224,8 +248,8 @@ if ($action == '') { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.$langs->trans("Add").''; - if ($cnt_trans > 0) print ''.$langs->trans("Update").''; + print ''.$langs->trans('Add').''; + if ($cnt_trans > 0) print ''.$langs->trans('Update').''; } } @@ -242,6 +266,7 @@ if ($action == 'edit') print ''; print ''; print ''; + print ''; if (! empty($object->multilangs)) { @@ -249,9 +274,14 @@ if ($action == 'edit') { print "
".$langs->trans('Language_'.$key)." :
"; print '
'.$langs->trans("Module").''.$langs->trans("CashDesk").' ID'.$langs->trans("Terminal").''.$langs->trans("Year").''.$langs->trans("Month").''.$langs->trans("Day").'
'.$form->selectarray('posmodule', $arrayofposavailable, GETPOST('posmodule', 'alpha'), (count($arrayofposavailable) > 1 ? 1 : 0)).''; - $array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9"); + + $array = array(); + for($i = 1; $i <= max(1, $conf->global->TAKEPOS_NUM_TERMINALS); $i++) { + $array[$i] = $i; + } $selectedposnumber = 0; $showempty = 1; if ($conf->global->TAKEPOS_NUM_TERMINALS == '1') { @@ -502,92 +506,97 @@ if ($action == "create" || $action == "start") if (empty($action) || $action == "view") { - $object->fetch($id); + $result = $object->fetch($id); llxHeader('', $langs->trans("CashControl")); - $head = array(); - $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id; - $head[0][1] = $langs->trans("Card"); - $head[0][2] = 'cashcontrol'; - - dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'cashcontrol'); - - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - $morehtmlref .= '
'; - - - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); - - print '
'; - print '
'; - print '
'; - print ''; - - print ''; - - print '"; - - print '"; - - print ''; - - print '
'; - print $langs->trans("Ref"); - print ''; - print $id; - print '
'.$langs->trans("Module").''; - print $object->posmodule; - print "
'.$langs->trans("CashDesk").' ID'; - print $object->posnumber; - print "
'; - print $langs->trans("Period"); - print ''; - print $object->year_close."-".$object->month_close."-".$object->day_close; - print '
'; - print '
'; - - print '
'; - print '
'; - print ''; - - print ''; - - print '"; - - foreach ($arrayofpaymentmode as $key => $val) - { - print '"; + if ($result <= 0) { + print $langs->trans("ErrorRecordNotFound"); } + else { + $head = array(); + $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id; + $head[0][1] = $langs->trans("Card"); + $head[0][2] = 'cashcontrol'; - print "
'; - print $langs->trans("DateCreationShort"); - print ''; - print dol_print_date($object->date_creation, 'dayhour'); - print '
'.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").''; - print price($object->opening, 0, $langs, 1, -1, -1, $conf->currency); - print "
'.$langs->trans($val).''; - print price($object->$key, 0, $langs, 1, -1, -1, $conf->currency); - print "
\n"; - print '
'; - print '
'; - print '
'; + dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'cashcontrol'); - dol_fiche_end(); + $linkback = ''.$langs->trans("BackToList").''; - print '
'; - print ''; - if ($object->status == CashControl::STATUS_DRAFT) - { - print ''; + $morehtmlref = '
'; + $morehtmlref .= '
'; - print ''; - } - print '
'; - print '
'; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
'; + print '
'; + print '
'; + print ''; + + print ''; + + print '"; + + print '"; + + print ''; + + print '
'; + print $langs->trans("Ref"); + print ''; + print $id; + print '
'.$langs->trans("Module").''; + print $object->posmodule; + print "
'.$langs->trans("CashDesk").' ID'; + print $object->posnumber; + print "
'; + print $langs->trans("Period"); + print ''; + print $object->year_close."-".$object->month_close."-".$object->day_close; + print '
'; + print '
'; + + print '
'; + print '
'; + print ''; + + print ''; + + print '"; + + foreach ($arrayofpaymentmode as $key => $val) + { + print '"; + } + + print "
'; + print $langs->trans("DateCreationShort"); + print ''; + print dol_print_date($object->date_creation, 'dayhour'); + print '
'.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").''; + print price($object->opening, 0, $langs, 1, -1, -1, $conf->currency); + print "
'.$langs->trans($val).''; + print price($object->$key, 0, $langs, 1, -1, -1, $conf->currency); + print "
\n"; + print '
'; + print '
'; + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + if ($object->status == CashControl::STATUS_DRAFT) + { + print ''; + + print ''; + } + print '
'; + + print '
'; + } } // End of page From 693551069b5c014ca4f01670158ab4383be75001 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 21:32:19 +0100 Subject: [PATCH 20/33] Fix look and feel v11 --- htdocs/admin/facture_situation.php | 38 +++++++++++++++++------------- htdocs/admin/payment.php | 4 ++++ htdocs/core/lib/invoice.lib.php | 2 +- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 459fc801bae..3a4949b99a4 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -73,20 +73,26 @@ print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); dol_fiche_head($head, 'situation', $langs->trans("InvoiceSituation"), -1, 'invoice'); + +print ''.$langs->trans("SituationInvoiceDesc").'

'; + + /* * Numbering module */ -print load_fiche_titre($langs->trans("InvoiceSituation"), '', ''); -$var=0; - print '
'; print ''; -_updateBtn(); +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; _printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); _printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote')); @@ -100,12 +106,9 @@ $metas = array( ); _printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans('RetainedwarrantyDefaultPercent'), '', $metas); - - - // Conditions paiements $inputCount = empty($inputCount)?1:($inputCount+1); -print ''; +print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans('PaymentConditionsShortRetainedWarranty').' '; @@ -115,6 +118,9 @@ print '
'; +print '
'; + +print '
'; _updateBtn(); @@ -134,8 +140,8 @@ $db->close(); function _updateBtn() { global $langs; - print '
'; - print ''; + print '
'; + print ''; print '
'; } @@ -150,9 +156,9 @@ function _updateBtn() */ function _printOnOff($confkey, $title = false, $desc = '') { - global $var, $bc, $langs; - $var=!$var; - print '
'.($title?$title:$langs->trans($confkey)); if (!empty($desc)) { print '
'.$langs->trans($desc).''; @@ -179,8 +185,8 @@ function _printOnOff($confkey, $title = false, $desc = '') */ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = array(), $type = 'input', $help = false) { - global $var, $bc, $langs, $conf, $db, $inputCount; - $var=!$var; + global $langs, $conf, $db, $inputCount; + $inputCount = empty($inputCount)?1:($inputCount+1); $form=new Form($db); @@ -200,7 +206,7 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra $metascompil .= ' '.$key.'="'.$values.'" '; } - print '
'; if (!empty($help)) { diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index a62aa14764c..dddf914a957 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -109,6 +109,7 @@ dol_fiche_head($head, 'payment', $langs->trans("Invoices"), -1, 'invoice'); print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', ''); +print '
'; print ''; print ''; print ''; @@ -226,6 +227,7 @@ foreach ($dirmodels as $reldir) } print '
'.$langs->trans("Name").'
'; +print '
'; print "
"; @@ -235,6 +237,7 @@ print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; @@ -251,6 +254,7 @@ print '\n"; print '
'.$langs->trans("Parameter").''; print "
'; +print '
'; dol_fiche_end(); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index f2818f72872..de1334c37a5 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -137,7 +137,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'payment'; $h++; - if ($conf->global->INVOICE_USE_SITUATION) { + if ($conf->global->INVOICE_USE_SITUATION || $conf->global->MAIN_FEATURES_LEVEL >= 1) { $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; From d59357d88dbc44e1933b1277fc97fed8c7c9f8fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 21:34:52 +0100 Subject: [PATCH 21/33] Fix help --- htdocs/admin/facture_situation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 3a4949b99a4..408b762358e 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -74,7 +74,7 @@ $head = invoice_admin_prepare_head(); dol_fiche_head($head, 'situation', $langs->trans("InvoiceSituation"), -1, 'invoice'); -print ''.$langs->trans("SituationInvoiceDesc").'

'; +print ''.$langs->trans("InvoiceFirstSituationDesc").'

'; /* From 78fa75c6b044a78c81c12c6992533c3ff9692b3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Dec 2019 21:58:08 +0100 Subject: [PATCH 22/33] css --- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 575b73c15f1..ffa0e1c0c2d 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,103,111'; // 140,80,10 or 10,140,80 +$colortexttitlenotab = '0,133,151'; // 140,80,10 or 10,140,80 $colortexttitle = '0,0,0'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; From c39e45b81a23eb12359c009b628bccc5b3fe5e6e Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 10:57:51 +0100 Subject: [PATCH 23/33] FIX set due date in object in create invoice --- htdocs/compta/facture/class/facture.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4204fa0c96b..3bbf150d72f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -445,7 +445,16 @@ class Facture extends CommonInvoice } // Define due date if not already defined - $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); + if (empty($forceduedate)) { + $duedate = $this->calculate_date_lim_reglement(); + /*if ($duedate < 0) { Regression, a date can be negative if before 1970. + dol_syslog(__METHOD__ . ' Error in calculate_date_lim_reglement. We got ' . $duedate, LOG_ERR); + return -1; + }*/ + $this->date_lim_reglement = $duedate; + } else { + $this->date_lim_reglement = $forceduedate; + } // Insert into database $socid = $this->socid; @@ -497,7 +506,7 @@ class Facture extends CommonInvoice $sql.= ", ".($this->fk_project?$this->fk_project:"null"); $sql.= ", ".$this->cond_reglement_id; $sql.= ", ".$this->mode_reglement_id; - $sql.= ", '".$this->db->idate($datelim)."', '".$this->db->escape($this->modelpdf)."'"; + $sql.= ", '".$this->db->idate($this->date_lim_reglement)."', '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->situation_cycle_ref?"'".$this->db->escape($this->situation_cycle_ref)."'":"null"); $sql.= ", ".($this->situation_counter?"'".$this->db->escape($this->situation_counter)."'":"null"); $sql.= ", ".($this->situation_final?$this->situation_final:0); @@ -1652,7 +1661,7 @@ class Facture extends CommonInvoice $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; $sql.= " date_pointoftax=".(strval($this->date_pointoftax)!='' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null').","; $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; - $sql.= " paye=".(isset($this->paye)?$this->db->escape($this->paye):"null").","; + $sql.= " paye=".(isset($this->paye)?$this->db->escape($this->paye):0).","; $sql.= " remise_percent=".(isset($this->remise_percent)?$this->db->escape($this->remise_percent):"null").","; $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->db->escape($this->remise_absolue):"null").","; $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; From d4138876af8572b3e292a6e8bcbd2f50f28ceee8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 11:10:55 +0100 Subject: [PATCH 24/33] Fix alignement in validation popup --- htdocs/core/class/html.form.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 614b17a4967..88e7f9b5b43 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4130,9 +4130,6 @@ class Form // Now add questions $more .= '
'."\n"; - if (!empty($formquestion['text'])) { - $more .= '
'.$formquestion['text'].'
'."\n"; - } foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) @@ -4246,8 +4243,11 @@ class Form } // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template $formconfirm .= ''."\n"; @@ -4339,6 +4339,11 @@ class Form // Line title $formconfirm .= '
'.img_picto('', 'recent').' '.$title.'
'.$formquestion['text'].'
'; - print ''; + + // Label + $libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']); + print ''; + // Desc + $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''; @@ -280,7 +310,7 @@ elseif ($action != 'add') { $s=picto_from_langcode($key); print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); print '
'; - print ''; + print ''; print ''; print ''; if (! empty($conf->global->CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION)) @@ -308,14 +338,16 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; print ''; + print ''; print '
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'; print ''; - print ''; + print ''; + print ''; print ''; From e59514600b6c9e8ada4e89a0a558b5a605c31ffc Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 23 Dec 2019 12:10:51 +0100 Subject: [PATCH 26/33] FIX contact card state address selected after filling address --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 909dfd9e2e2..f013cd7e8aa 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -967,7 +967,7 @@ else print ''; } From 2df9df2db031018ead4d14710ab6b0e77bee760d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 12:24:27 +0100 Subject: [PATCH 27/33] Debug v11 --- htdocs/core/class/html.formother.class.php | 24 ++++++++--- htdocs/core/commonfieldsinexport.inc.php | 2 + htdocs/core/lib/functions.lib.php | 42 +++++++++---------- htdocs/core/modules/modFacture.class.php | 6 ++- htdocs/exports/class/export.class.php | 11 +++-- htdocs/exports/export.php | 33 +++++++++++---- htdocs/imports/import.php | 23 ++++------ htdocs/langs/en_US/bills.lang | 2 + htdocs/langs/en_US/cashdesk.lang | 2 + .../core/modules/modMyModule.class.php | 5 ++- htdocs/theme/eldy/global.inc.php | 3 ++ htdocs/theme/md/style.css.php | 3 ++ 12 files changed, 101 insertions(+), 55 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index e5b3f8fbb6e..ee8ca51ac90 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -71,7 +71,9 @@ class FormOther public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) { // phpcs:enable - $sql = "SELECT rowid, label"; + global $conf, $langs, $user; + + $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; $sql .= " WHERE type = '".$type."'"; if (!empty($fk_user)) $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model @@ -79,7 +81,7 @@ class FormOther $result = $this->db->query($sql); if ($result) { - print ''; if ($useempty) { print ''; @@ -90,19 +92,28 @@ class FormOther while ($i < $num) { $obj = $this->db->fetch_object($result); + + $label = $obj->label; + if (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { + $tmpuser = new User($this->db); + $tmpuser->fetch($obj->fk_user); + $label .= ' ('.$tmpuser->getFullName($langs).')'; + } + if ($selected == $obj->rowid) { - print ''; $i++; } print ""; + print ajax_combobox($htmlname); } else { dol_print_error($this->db); @@ -130,7 +141,7 @@ class FormOther $result = $this->db->query($sql); if ($result) { - print ''; if ($useempty) { print ''; @@ -154,6 +165,7 @@ class FormOther $i++; } print ""; + print ajax_combobox($htmlname); } else { dol_print_error($this->db); diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php index d68954fc568..034fbcd4679 100644 --- a/htdocs/core/commonfieldsinexport.inc.php +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -47,10 +47,12 @@ if (class_exists($keyforclass)) * break; */ } + $helpfield=preg_replace('/\(.*$/', '', $valuefield['help']); if ($valuefield['enabled']) { $this->export_fields_array[$r][$fieldname] = $fieldlabel; $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; $this->export_entities_array[$r][$fieldname] = $keyforelement; + $this->export_help_array[$r][$fieldname] = $helpfield; } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1e6e8d2fc41..4e6a5b6b48a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3349,7 +3349,7 @@ function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0 */ function img_action($titlealt, $numaction) { - global $conf, $langs; + global $langs; if (empty($titlealt) || $titlealt == 'default') { @@ -3374,7 +3374,7 @@ function img_action($titlealt, $numaction) */ function img_pdf($titlealt = 'default', $size = 3) { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Show'); @@ -3390,7 +3390,7 @@ function img_pdf($titlealt = 'default', $size = 3) */ function img_edit_add($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Add'); @@ -3405,7 +3405,7 @@ function img_edit_add($titlealt = 'default', $other = '') */ function img_edit_remove($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Remove'); @@ -3422,7 +3422,7 @@ function img_edit_remove($titlealt = 'default', $other = '') */ function img_edit($titlealt = 'default', $float = 0, $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Modify'); @@ -3439,7 +3439,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '') */ function img_view($titlealt = 'default', $float = 0, $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('View'); @@ -3457,7 +3457,7 @@ function img_view($titlealt = 'default', $float = 0, $other = '') */ function img_delete($titlealt = 'default', $other = 'class="pictodelete"') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Delete'); @@ -3474,7 +3474,7 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"') */ function img_printer($titlealt = "default", $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == "default") $titlealt = $langs->trans("Print"); return img_picto($titlealt, 'printer.png', $other); } @@ -3488,7 +3488,7 @@ function img_printer($titlealt = "default", $other = '') */ function img_split($titlealt = 'default', $other = 'class="pictosplit"') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Split'); @@ -3504,7 +3504,7 @@ function img_split($titlealt = 'default', $other = 'class="pictosplit"') */ function img_help($usehelpcursor = 1, $usealttitle = 1) { - global $conf, $langs; + global $langs; if ($usealttitle) { @@ -3523,7 +3523,7 @@ function img_help($usehelpcursor = 1, $usealttitle = 1) */ function img_info($titlealt = 'default') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Informations'); @@ -3540,7 +3540,7 @@ function img_info($titlealt = 'default') */ function img_warning($titlealt = 'default', $moreatt = '', $morecss = 'pictowarning') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); @@ -3556,11 +3556,11 @@ function img_warning($titlealt = 'default', $moreatt = '', $morecss = 'pictowarn */ function img_error($titlealt = 'default') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Error'); - return img_picto($titlealt, 'error.png', 'class="valigntextbottom"'); + return img_picto($titlealt, 'error.png'); } /** @@ -3572,7 +3572,7 @@ function img_error($titlealt = 'default') */ function img_next($titlealt = 'default', $moreatt = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Next'); @@ -3589,7 +3589,7 @@ function img_next($titlealt = 'default', $moreatt = '') */ function img_previous($titlealt = 'default', $moreatt = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Previous'); @@ -3607,7 +3607,7 @@ function img_previous($titlealt = 'default', $moreatt = '') */ function img_down($titlealt = 'default', $selected = 0, $moreclass = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Down'); @@ -3624,7 +3624,7 @@ function img_down($titlealt = 'default', $selected = 0, $moreclass = '') */ function img_up($titlealt = 'default', $selected = 0, $moreclass = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Up'); @@ -3641,7 +3641,7 @@ function img_up($titlealt = 'default', $selected = 0, $moreclass = '') */ function img_left($titlealt = 'default', $selected = 0, $moreatt = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Left'); @@ -3658,7 +3658,7 @@ function img_left($titlealt = 'default', $selected = 0, $moreatt = '') */ function img_right($titlealt = 'default', $selected = 0, $moreatt = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Right'); @@ -3674,7 +3674,7 @@ function img_right($titlealt = 'default', $selected = 0, $moreatt = '') */ function img_allow($allow, $titlealt = 'default') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Active'); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 01c80265e46..b0f7dd94ae8 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -216,7 +216,7 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT", @@ -300,12 +300,13 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', 'p.amount'=>'AmountPayment', 'pf.amount'=>'AmountPaymentDistributedOnInvoice', 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef' ); + $this->export_help_array[$r] = array('f.paye'=>'InvoicePaidCompletelyHelp'); if (! empty($conf->multicurrency->enabled)) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; @@ -313,6 +314,7 @@ class modFacture extends DolibarrModules $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; $this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; + $this->export_examplevalues_array[$r]['f.multicurrency_code'] = 'EUR'; } if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS)) { diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index d6b6a8676ae..0274e493170 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -43,12 +43,13 @@ class Export public $array_export_sql_order=array(); // Tableau des "requetes sql" public $array_export_fields=array(); // Tableau des listes de champ+libelle a exporter - public $array_export_TypeFields=array(); // Tableau des listes de champ+Type de filtre - public $array_export_FilterValue=array(); // Tableau des listes de champ+Valeur a filtrer + public $array_export_TypeFields=array(); // Tableau des listes de champ+Type de filtre + public $array_export_FilterValue=array(); // Tableau des listes de champ+Valeur a filtrer public $array_export_entities=array(); // Tableau des listes de champ+alias a exporter public $array_export_dependencies=array(); // array of list of entities that must take care of the DISTINCT if a field is added into export - public $array_export_special=array(); // Tableau des operations speciales sur champ - public $array_export_examplevalues=array(); // array with examples + public $array_export_special=array(); // array of special operations to do on field + public $array_export_examplevalues=array(); // array with examples for fields + public $array_export_help=array(); // array with tooltip help for fields // To store export modules public $hexa; @@ -186,6 +187,8 @@ class Export $this->array_export_special[$i]=(! empty($module->export_special_array[$r])?$module->export_special_array[$r]:''); // Array of examples $this->array_export_examplevalues[$i]=$module->export_examplevalues_array[$r]; + // Array of help tooltips + $this->array_export_help[$i]=(! empty($module->export_help_array[$r])?$module->export_help_array[$r]:''); // Requete sql du dataset $this->array_export_sql_start[$i]=$module->export_sql_start[$r]; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 166551fecb8..20ffcf221f3 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -543,8 +543,12 @@ if ($step == 2 && $datatoexport) print ''; print '
'; print ''.$langs->trans("SelectExportFields").' '; - if (empty($conf->global->EXPORTS_SHARE_MODELS))$htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); - else $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1); + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { + $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); + } + else { + $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1); + } print ' '; print ''; print '
'; @@ -622,6 +626,10 @@ if ($step == 2 && $datatoexport) { $htmltext .= ''.$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; } + if (!empty($objexport->array_export_help[0][$code])) + { + $htmltext .= ''.$langs->trans("Help").': '.$langs->trans($objexport->array_export_help[0][$code]).'
'; + } if (isset($array_selected[$code]) && $array_selected[$code]) { @@ -808,11 +816,15 @@ if ($step == 3 && $datatoexport) } if (!empty($objexport->array_export_examplevalues[0][$code])) { - $htmltext .= $langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; + $htmltext .= ''.$langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; } if (!empty($objexport->array_export_TypeFields[0][$code])) { - $htmltext .= $langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; + $htmltext .= ''.$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; + } + if (!empty($objexport->array_export_help[0][$code])) + { + $htmltext .= ''.$langs->trans("Help").': '.$langs->trans($objexport->array_export_help[0][$code]).'
'; } print '
'.$langs->trans('Translation').''; - print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs); + print $formadmin->select_language(GETPOST('forcelangprod', 'alpha'), 'forcelangprod', 0, $object->multilangs); print '
'.$langs->trans('Label').'
' . $langs->trans('Label') . '
'.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'none'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); print '
'; } - print $formcompany->select_state($object->state_id, isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id, 'state_id'); + print $formcompany->select_state(GETPOSTISSET('state_id')?GETPOST('state_id', 'alpha'):$object->state_id, $object->country_code, 'state_id'); print '
'; @@ -999,11 +1011,15 @@ if ($step == 4 && $datatoexport) } if (!empty($objexport->array_export_examplevalues[0][$code])) { - $htmltext .= $langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; + $htmltext .= ''.$langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; } if (!empty($objexport->array_export_TypeFields[0][$code])) { - $htmltext .= $langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; + $htmltext .= ''.$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; + } + if (!empty($objexport->array_export_help[0][$code])) + { + $htmltext .= ''.$langs->trans("Help").': '.$langs->trans($objexport->array_export_help[0][$code]).'
'; } print '
'; @@ -1047,7 +1063,10 @@ if ($step == 4 && $datatoexport) if (count($array_selected)) { print '
'; - print $langs->trans("SaveExportModel"); + + print '
'; + print ''.$langs->trans("SaveExportModel").''; + print '
'; print ''; print ''; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index b5cdc05206d..606eddeeb20 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -519,14 +519,12 @@ if ($step == 3 && $datatoimport) print '
'; print ''; - print '
'; - print ''.$langs->trans("InformationOnSourceFile").''; + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); print '
'; print '
'; print ''; - //print ''; // Source file format print ''; @@ -798,13 +796,12 @@ if ($step == 4 && $datatoimport) print '
'.$langs->trans("InformationOnSourceFile").'
'.$langs->trans("SourceFileFormat").'
'; print '
'; - print '
'; - print ''.$langs->trans("InformationOnSourceFile").''; + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print '
'; print '
'; print ''; - //print ''; // Source file format print ''; @@ -1273,13 +1270,12 @@ if ($step == 5 && $datatoimport) print '
'.$langs->trans("InformationOnSourceFile").'
'.$langs->trans("SourceFileFormat").'
'; print '
'; - print '
'; - print ''.$langs->trans("InformationOnSourceFile").''; + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print '
'; print '
'; print ''; - //print ''; // Source file format print ''; @@ -1378,9 +1374,9 @@ if ($step == 5 && $datatoimport) print '
'.$langs->trans("InformationOnSourceFile").'
'.$langs->trans("SourceFileFormat").'
'; print '
'; - print '
'; - print ''.$langs->trans("InformationOnTargetTables").''; + print load_fiche_titre($langs->trans("InformationOnTargetTables"), '', ''); + print '
'; print '
'; @@ -1717,13 +1713,12 @@ if ($step == 6 && $datatoimport) print ''; print '
'; - print '
'; - print ''.$langs->trans("InformationOnSourceFile").''; + print load_fiche_titre($langs->trans("InformationOnSourceFile"), '', ''); + print '
'; print '
'; print ''; - //print ''; // Source file format print ''; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index f7ed7bcade0..902790cc23a 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -334,6 +334,8 @@ InvoiceDateCreation=Invoice creation date InvoiceStatus=Invoice status InvoiceNote=Invoice note InvoicePaid=Invoice paid +InvoicePaidCompletely=Paid completely +InvoicePaidCompletelyHelp=Invoice that are paid completely. This excludes invoices that are paid partially. To get list of all 'Closed' or non 'Closed' invoices, prefer to use a filter on the invoice status. OrderBilled=Order billed DonationPaid=Donation paid PaymentNumber=Payment number diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 0516de208fc..e33d1112deb 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -69,6 +69,8 @@ Terminal=Terminal NumberOfTerminals=Number of Terminals TerminalSelect=Select terminal you want to use: POSTicket=POS Ticket +POSTerminal=POS Terminal +POSModule=POS Module BasicPhoneLayout=Use basic layout for phones SetupOfTerminalNotComplete=Setup of terminal %s is not complete DirectPayment=Direct payment diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 7cabc1415ef..79482128362 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -342,7 +342,10 @@ class modMyModule extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; //$keyforselect='myobjectline'; $keyforaliasextra='extraline'; $keyforelement='myobjectline'; //include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - //$this->export_dependencies_array[$r]=array('myobjectline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + //$this->export_dependencies_array[$r] = array('myobjectline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + //$this->export_special_array[$r] = array('t.field'=>'...'); + //$this->export_examplevalues_array[$r] = array('t.field'=>'Example'); + //$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp'); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'myobject as t'; //$this->export_sql_end[$r] =' LEFT JOIN '.MAIN_DB_PREFIX.'myobject_line as tl ON tl.fk_myobject = t.rowid'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9cd5a8efd3a..16902818146 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1408,6 +1408,9 @@ div.nopadding { /* vertical-align: text-bottom; */ color: ; } +.pictoerror { + color: ; +} .pictomodule { width: 14px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2df7fd86042..604bc743f93 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1613,6 +1613,9 @@ div.nopadding { /* vertical-align: text-bottom; */ color: ; } +.pictoerror { + color: ; +} .pictomodule { width: 14px; } From 89528e46f1a54e09537909d13cd868b958a43b99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 12:47:00 +0100 Subject: [PATCH 28/33] css --- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index ffa0e1c0c2d..058c253c74a 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,133,151'; // 140,80,10 or 10,140,80 +$colortexttitlenotab = '0,123,141'; // 140,80,10 or 10,140,80 $colortexttitle = '0,0,0'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; From a92db7db399a29e784a8d9e1e8a09a37be8653fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:02:30 +0100 Subject: [PATCH 29/33] Look and feel v11 --- htdocs/core/class/html.formother.class.php | 36 ++++++++++++++++------ htdocs/imports/import.php | 4 +-- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ee8ca51ac90..a73621faa32 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -75,7 +75,7 @@ class FormOther $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; - $sql .= " WHERE type = '".$type."'"; + $sql .= " WHERE type = '".$this->db->escape($type)."'"; if (!empty($fk_user)) $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model $sql .= " ORDER BY rowid"; $result = $this->db->query($sql); @@ -94,10 +94,13 @@ class FormOther $obj = $this->db->fetch_object($result); $label = $obj->label; - if (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { + if ($obj->fk_user == 0) { + $label .= ' ('.$langs->trans("Everybody").')'; + } + elseif (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { $tmpuser = new User($this->db); $tmpuser->fetch($obj->fk_user); - $label .= ' ('.$tmpuser->getFullName($langs).')'; + $label .= ' ('.$tmpuser->getFullName($langs).')'; } if ($selected == $obj->rowid) @@ -129,14 +132,18 @@ class FormOther * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches * @param int $useempty Affiche valeur vide dans liste + * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) * @return void */ - public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0) + public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0, $fk_user = null) { // phpcs:enable - $sql = "SELECT rowid, label"; + global $conf, $langs, $user; + + $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."import_model"; - $sql .= " WHERE type = '".$type."'"; + $sql .= " WHERE type = '".$this->db->escape($type)."'"; + if (!empty($fk_user)) $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model $sql .= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) @@ -152,15 +159,26 @@ class FormOther while ($i < $num) { $obj = $this->db->fetch_object($result); + + $label = $obj->label; + if ($obj->fk_user == 0) { + $label .= ' ('.$langs->trans("Everybody").')'; + } + elseif (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { + $tmpuser = new User($this->db); + $tmpuser->fetch($obj->fk_user); + $label .= ' ('.$tmpuser->getFullName($langs).')'; + } + if ($selected == $obj->rowid) { - print ''; $i++; } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 606eddeeb20..6f4a1092194 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -862,8 +862,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; - print '
'; - print $langs->trans("SelectImportFields", img_picto('', 'grip_title', '', false, 0, 0, '', '', 0)).' '; + print '
'; + print ''.$langs->trans("SelectImportFields", img_picto('', 'grip_title', '', false, 0, 0, '', '', 0)).' '; $htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1); print ''; print '
'; From b525025f9d7fd87bbd884da1a9f867a455ef6aaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:13:59 +0100 Subject: [PATCH 30/33] CSS --- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 058c253c74a..2f8b7ac08e4 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,123,141'; // 140,80,10 or 10,140,80 +$colortexttitlenotab = '0,113,121'; // 140,80,10 or 10,140,80 $colortexttitle = '0,0,0'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; From b1a99c1e231ca866b18facff37b33fcb6e5636e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:28:20 +0100 Subject: [PATCH 31/33] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 16902818146..55a4f3813e9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1452,7 +1452,7 @@ div.heightref { min-height: 80px; } div.divphotoref { - padding-: 10px; + padding-: 20px; } div.paginationref { padding-bottom: 10px; From 4d12ecb072e20db60817547455aa7d9d53d8c484 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:40:35 +0100 Subject: [PATCH 32/33] FIX #12745 --- .../fourn/class/fournisseur.product.class.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 4dbd2365c6f..9f49fb31b83 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -434,7 +434,7 @@ class ProductFournisseur extends Product $sql .= ")"; $this->product_fourn_price_id = 0; - + $resql = $this->db->query($sql); if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); @@ -939,8 +939,6 @@ class ProductFournisseur extends Product */ public function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) { - global $conf; - $sql = "SELECT"; $sql.= " pfpl.rowid, pfp.ref_fourn as supplier_ref, pfpl.datec, u.lastname,"; $sql.= " pfpl.price, pfpl.quantity"; @@ -961,9 +959,17 @@ class ProductFournisseur extends Product { $retarray = array(); - while ($record = $this->db->fetch_array($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $retarray[]=$record; + $tmparray = array(); + $tmparray['rowid'] = $obj->rowid; + $tmparray['supplier_ref'] = $obj->supplier_ref; + $tmparray['datec'] = $this->db->jdate($obj->datec); + $tmparray['lastname'] = $obj->lastname; + $tmparray['price'] = $obj->price; + $tmparray['quantity'] = $obj->quantity; + + $retarray[]=$tmparray; } $this->db->free($resql); @@ -991,7 +997,7 @@ class ProductFournisseur extends Product $langs->load("suppliers"); if (count($productFournLogList) > 0) { $out .= '
'.$langs->trans("InformationOnSourceFile").'
'.$langs->trans("SourceFileFormat").'
'; - $out .= ''; + $out .= ''; $out .= ''; //$out .= ''; $out .= ''; @@ -1032,7 +1038,7 @@ class ProductFournisseur extends Product $logPrices = $this->listProductFournisseurPriceLog($this->product_fourn_price_id, 'pfpl.datec', 'DESC'); // set sort order here if (is_array($logPrices) && count($logPrices) > 0) { - $label.= '
'; + $label.= '

'; $label.= '' . $langs->trans("History") . ''; $label.= $this->displayPriceProductFournisseurLog($logPrices); } From 0ea5df36c19798cfa1028e3372002388f9bd591f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 13:55:58 +0100 Subject: [PATCH 33/33] Disable ping for alpha versions --- htdocs/main.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a4751f98e51..f117dce2509 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2561,7 +2561,10 @@ if (!function_exists("llxFooter")) || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled')) || GETPOST('forceping', 'alpha')) { - if (empty($_COOKIE['DOLINSTALLNOPING_'.$hash_unique_id])) + if (strpos('alpha', DOL_VERSION) > 0) { + print "\n\n"; + } + elseif (empty($_COOKIE['DOLINSTALLNOPING_'.$hash_unique_id])) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
'.$langs->trans("Date").'
'.$langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("QtyMin").''.$langs->trans("User").'