From c860c0dc4a72c35b38dfc5aee34ba968a1e1a13b Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 11:47:45 +0100 Subject: [PATCH 001/112] Add default BOM --- htdocs/install/mysql/tables/llx_product.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 2431c884c62..a1ccf065ffa 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -100,5 +100,6 @@ create table llx_product desiredstock float DEFAULT 0, fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, + fk_default_bom integer DEFAULT NULL, fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project )ENGINE=innodb; From c2bd30a7e92445e10b6ffd0cc90b3121178d8816 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 11:59:00 +0100 Subject: [PATCH 002/112] working progress --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + htdocs/product/class/product.class.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index c83755009ae..95d6d208145 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -29,6 +29,7 @@ -- Missing in v12 or lower +ALTER TABLE llx_product ADD COLUMN fk_default_bom integer DEFAULT NULL; ALTER TABLE llx_payment_salary MODIFY COLUMN ref varchar(30) NULL; ALTER TABLE llx_payment_various MODIFY COLUMN ref varchar(30) NULL; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 03d81d4fd64..40d63c4643f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -248,6 +248,13 @@ class Product extends CommonObject */ public $finished; + /** + * fk_default_bom indicates the default bom + * + * @var int + */ + public $fk_default_bom; + /** * We must manage lot/batch number, sell-by date and so on : '1':yes '0':no * @@ -996,6 +1003,7 @@ class Product extends CommonObject $sql .= ", tobuy = ".(int) $this->status_buy; $sql .= ", tobatch = ".((empty($this->status_batch) || $this->status_batch < 0) ? '0' : (int) $this->status_batch); $sql .= ", finished = ".((!isset($this->finished) || $this->finished < 0 || $this->finished == '') ? "null" : (int) $this->finished); + $sql .= ", fk_default_bom = ".((!isset($this->fk_default_bom) || $this->fk_default_bom < 0 || $this->fk_default_bom == '') ? "null" : (int) $this->fk_default_bom); $sql .= ", net_measure = ".($this->net_measure != '' ? "'".$this->db->escape($this->net_measure)."'" : 'null'); $sql .= ", net_measure_units = ".($this->net_measure_units != '' ? "'".$this->db->escape($this->net_measure_units)."'" : 'null'); $sql .= ", weight = ".($this->weight != '' ? "'".$this->db->escape($this->weight)."'" : 'null'); @@ -2046,7 +2054,7 @@ class Product extends CommonObject $sql .= " price_min, price_min_ttc, price_base_type, cost_price, default_vat_code, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, tosell,"; $sql .= " tobuy, fk_product_type, duration, fk_default_warehouse, seuil_stock_alerte, canvas, net_measure, net_measure_units, weight, weight_units,"; $sql .= " length, length_units, width, width_units, height, height_units,"; - $sql .= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; + $sql .= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,fk_default_bom,"; $sql .= " accountancy_code_buy, accountancy_code_buy_intra, accountancy_code_buy_export,"; $sql .= " accountancy_code_sell, accountancy_code_sell_intra, accountancy_code_sell_export, stock, pmp,"; $sql .= " datec, tms, import_key, entity, desiredstock, tobatch, fk_unit,"; @@ -2107,8 +2115,10 @@ class Product extends CommonObject $this->localtax2_tx = $obj->localtax2_tx; $this->localtax1_type = $obj->localtax1_type; $this->localtax2_type = $obj->localtax2_type; - + $this->finished = $obj->finished; + $this->fk_default_bom = $obj->fk_default_bom; + $this->duration = $obj->duration; $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1); $this->duration_unit = substr($obj->duration, -1); From 5b40950f500f5a2de2e3a7bc58c8f12b42bd70af Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 12:45:06 +0100 Subject: [PATCH 003/112] Update card.php add on card --- htdocs/product/card.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 6fdfb82e354..5fed4bc4ca1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019-2020 Thibault FOUCART + * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * * This program is free software; you can redistribute it and/or modify @@ -59,6 +59,7 @@ if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/command if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +if (!empty($conf->bom->enabled)) require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; // Load translation files required by the page $langs->loadLangs(array('products', 'other')); @@ -454,6 +455,13 @@ if (empty($reshook)) $object->finished = null; } + $fk_default_bom = GETPOST('fk_default_bom', 'int'); + if ($fk_default_bom >= 0) { + $object->fk_default_bom = $fk_default_bom; + } else { + $object->fk_default_bom = null; + } + $units = GETPOST('units', 'int'); if ($units > 0) { $object->fk_unit = $units; @@ -1567,6 +1575,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print $formproduct->selectProductNature('finished', $object->finished); print ''; + if ($conf->bom->enabled) { + print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id; + print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); + print ''; + } + // Brut Weight print ''.$langs->trans("Weight").''; print ' '; @@ -2059,6 +2074,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print $object->getLibFinished(); print ''; + if ($conf->bom->enabled) { + print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + if ($object->fk_default_bom) { + $bom_static = new BOM($db); + $bom_static->fetch($object->fk_default_bom); + print $bom_static->getNomUrl(1); + } + print ''; + } + // Brut Weight print ''.$langs->trans("Weight").''; if ($object->weight != '') From 09ab9308065677ff55d55093d3bb8e187c77e942 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 18:31:19 +0200 Subject: [PATCH 004/112] sale_representative_order_invoice_list --- htdocs/commande/list.php | 55 ++++++++++++++++++++++++++++++++++ htdocs/compta/facture/list.php | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 3747b2107b2..af6fa6e5bf5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -187,6 +187,7 @@ $arrayfields = array( 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), @@ -1172,6 +1173,9 @@ if ($resql) { print ''; print ''; } + if (!empty($arrayfields['sale_representative']['checked'])) { + print ''; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook @@ -1329,6 +1333,9 @@ if ($resql) { if (!empty($arrayfields['u.login']['checked'])) { print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); } + if (!empty($arrayfields['sale_representative']['checked'])) { + print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -1685,6 +1692,54 @@ if ($resql) { } } + if (!empty($arrayfields['sale_representative']['checked'])) { + // Sales representatives + print ''; + if ($obj->socid > 0) { + $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) { + dol_print_error($db); + } + $nbofsalesrepresentative = count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 6) { + // We print only number + print $nbofsalesrepresentative; + } elseif ($nbofsalesrepresentative > 0) { + $userstatic = new User($db); + $j = 0; + foreach ($listsalesrepresentatives as $val) { + $userstatic->id = $val['id']; + $userstatic->lastname = $val['lastname']; + $userstatic->firstname = $val['firstname']; + $userstatic->email = $val['email']; + $userstatic->statut = $val['statut']; + $userstatic->entity = $val['entity']; + $userstatic->photo = $val['photo']; + $userstatic->login = $val['login']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; + $userstatic->user_mobile = $val['user_mobile']; + $userstatic->job = $val['job']; + $userstatic->gender = $val['gender']; + //print '
': + print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); + $j++; + if ($j < $nbofsalesrepresentative) { + print ' '; + } + //print '
'; + } + } + //else print $langs->trans("NoSalesRepresentativeAffected"); + } else { + print ' '; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 14b0383fa8d..ad8ead936be 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -228,6 +228,7 @@ $arrayfields = array( 'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140), 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170), 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171), 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180), @@ -1234,6 +1235,9 @@ if ($resql) { print ''; print ''; } + if (!empty($arrayfields['sale_representative']['checked'])) { + print ''; + } if (!empty($arrayfields['f.retained_warranty']['checked'])) { print ''; print ''; @@ -1426,6 +1430,9 @@ if ($resql) { if (!empty($arrayfields['u.login']['checked'])) { print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); } + if (!empty($arrayfields['sale_representative']['checked'])) { + print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); + } if (!empty($arrayfields['f.retained_warranty']['checked'])) { print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder); } @@ -1894,6 +1901,54 @@ if ($resql) { } } + if (!empty($arrayfields['sale_representative']['checked'])) { + // Sales representatives + print ''; + if ($obj->socid > 0) { + $listsalesrepresentatives = $thirdpartystatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) { + dol_print_error($db); + } + $nbofsalesrepresentative = count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 6) { + // We print only number + print $nbofsalesrepresentative; + } elseif ($nbofsalesrepresentative > 0) { + $userstatic = new User($db); + $j = 0; + foreach ($listsalesrepresentatives as $val) { + $userstatic->id = $val['id']; + $userstatic->lastname = $val['lastname']; + $userstatic->firstname = $val['firstname']; + $userstatic->email = $val['email']; + $userstatic->statut = $val['statut']; + $userstatic->entity = $val['entity']; + $userstatic->photo = $val['photo']; + $userstatic->login = $val['login']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; + $userstatic->user_mobile = $val['user_mobile']; + $userstatic->job = $val['job']; + $userstatic->gender = $val['gender']; + //print '
': + print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); + $j++; + if ($j < $nbofsalesrepresentative) { + print ' '; + } + //print '
'; + } + } + //else print $langs->trans("NoSalesRepresentativeAffected"); + } else { + print ' '; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + if (!empty($arrayfields['f.retained_warranty']['checked'])) { print ''.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : ' ').''; } From 70a062e2c1da3ed83f59e249ac74554eee95ff6a Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 23:59:42 +0200 Subject: [PATCH 005/112] change position --- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4f68c1d9014..72f5528ec31 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -187,7 +187,7 @@ $arrayfields = array( 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'position'=>116), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6cb2d05a157..c8175300b16 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -228,7 +228,7 @@ $arrayfields = array( 'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140), 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'position'=>166), 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170), 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171), 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180), From c02e3eed6b227123f883ecd607e935dce5d8fcd1 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 18 May 2021 18:45:07 +0200 Subject: [PATCH 006/112] checked --- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 72f5528ec31..153250534fd 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -187,7 +187,7 @@ $arrayfields = array( 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'position'=>116), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index c8175300b16..9eab570f31b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -228,7 +228,7 @@ $arrayfields = array( 'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140), 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'position'=>166), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166), 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170), 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171), 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180), From 2998c948844592056be74c7c9951379e8a04ba6c Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 3 Aug 2021 11:12:19 +0200 Subject: [PATCH 007/112] NEW : add constant PROPAL_NOT_BILLABLE --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c0d8dd9a28..83f28af1d15 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2579,7 +2579,7 @@ if ($action == 'create') { } // Create an invoice and classify billed - if ($object->statut == Propal::STATUS_SIGNED) { + if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPAL_NOT_BILLABLE)) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { print ''.$langs->trans("AddBill").''; } From f00694470fab4a3b38ac415eb18c9b429048ec0e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 3 Aug 2021 15:40:01 +0200 Subject: [PATCH 008/112] rename constant to PROPOSAL_ARE_NOT_BILLABLE --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 83f28af1d15..9b58b35c4a7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2579,7 +2579,7 @@ if ($action == 'create') { } // Create an invoice and classify billed - if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPAL_NOT_BILLABLE)) { + if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { print ''.$langs->trans("AddBill").''; } From 4873a91afc624486f856baa4ac09705cd9cbfbe9 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Tue, 3 Aug 2021 17:33:06 +0400 Subject: [PATCH 009/112] CLOSE #18326 Workflow: Close order on shipment closing. Allow an order to be closed automatically when all linked shipment have been closed and all products / items have been shipped. --- htdocs/admin/workflow.php | 10 ++++++++-- htdocs/core/modules/modWorkflow.class.php | 1 + .../interface_20_modWorkflow_WorkflowManager.class.php | 10 ++++++++-- htdocs/langs/en_US/workflow.lang | 1 + htdocs/langs/fr_FR/workflow.lang | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 09156e08588..1b6fa5bebe7 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -91,15 +91,21 @@ $workflowcodes = array( ), // Automatic classification of order - 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( + 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), 'picto'=>'order' ), - 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( + 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, + 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), + 'picto'=>'order' + ), + 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( + 'family'=>'classify_order', + 'position'=>42, 'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)), 'picto'=>'order', 'warning'=>'' diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index fbf7927ed1c..eaaf15d40a1 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -87,6 +87,7 @@ class modWorkflow extends DolibarrModules 0=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 0, 'current', 0), 1=>array('WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 0, 'current', 0), 2=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 0, 'current', 0), + 3=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 0, 'current', 0), 4=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 0, 'current', 0), 5=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 0, 'current', 0), 6=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0), diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 72a08d22494..c47965c7d52 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -256,10 +256,15 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - if ($action == 'SHIPPING_VALIDATE') { + if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING)) { + if (!empty($conf->commande->enabled) && !empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && + ( + (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || + (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) + ) + ) { $qtyshipped = array(); $qtyordred = array(); require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -318,6 +323,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } + // classify billed reception if ($action == 'BILL_SUPPLIER_VALIDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG); diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 15fd8ef07c2..fafbc6e8d8a 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -13,6 +13,7 @@ descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal as b descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked order) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales order as shipped when a shipment is validated (and if the quantity shipped by all shipments is the same as in the order to update) +descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED=Classify linked source sales order as shipped when a shipment is closed (and if the quantity shipped by all shipments is the same as in the order to update) # Autoclassify purchase order descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposal) descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) diff --git a/htdocs/langs/fr_FR/workflow.lang b/htdocs/langs/fr_FR/workflow.lang index 2af480afa83..13fbbace793 100644 --- a/htdocs/langs/fr_FR/workflow.lang +++ b/htdocs/langs/fr_FR/workflow.lang @@ -13,6 +13,7 @@ descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classer la/les proposition(s) commer descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classer la/les commande(s) client(s) source(s) facturée(s) à la validation de la facture client (et si le montant de la facture est le même que le montant total des commandes liées) descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classer la/les commande(s) client(s) source(s) à Facturée quand une facture client est passée à Payé (et si le montant de la facture est identique à la somme des commandes sources) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classer la commande source à expédiée à la validation d'une expédition (et si les quantités expédiées dans le bon d'expédition sont les même que dans la commande mise à jour) +descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED=Classer la commande source à expédiée à la cloture d'une expédition (et si les quantités expédiées dans le bon d'expédition sont les même que dans la commande mise à jour) # Autoclassify purchase order descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classer la ou les proposition(s) commerciale(s) fournisseur sources facturées quand une facture fournisseur est validée (et si le montant de la facture est le même que le total des propositions sources liées) descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classer la ou les commande(s) fournisseur(s) de source(s) à facturée(s) lorsque la facture fournisseur est validée (et si le montant de la facture est le même que le montant total des commandes liées) From 1da9829d61bfa48aa6e0506f1e5a62db413bb799 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 3 Aug 2021 14:08:23 +0000 Subject: [PATCH 010/112] Fixing style errors. --- .../interface_20_modWorkflow_WorkflowManager.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index c47965c7d52..8235348f21f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -259,10 +259,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && + if (!empty($conf->commande->enabled) && !empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && ( (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || - (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) + (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) ) ) { $qtyshipped = array(); From 26ba153169909456d381d28f7f824ac3a374a82c Mon Sep 17 00:00:00 2001 From: Daniel Mietchen Date: Wed, 4 Aug 2021 00:21:04 -0400 Subject: [PATCH 011/112] typo fix and copyedits --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7878f6270a7..834cc09236e 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING -Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! +Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). From 8c7b6e66662f7d3629208aeeecd21254b9362395 Mon Sep 17 00:00:00 2001 From: Daniel Mietchen Date: Wed, 4 Aug 2021 00:34:29 -0400 Subject: [PATCH 012/112] typo fixes --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 035387834bd..84deea18f00 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ *Please:* - *only keep the "Fix", "Close" or "New" section* - *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)* -- *replace the bracket enclosed textswith meaningful informations* +- *replace the bracket enclosed texts with meaningful information* # Fix #[*issue_number Short description*] From 6b20b32f07852c990367a3830c23d5d6a746af51 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 5 Aug 2021 16:31:21 +0200 Subject: [PATCH 013/112] Fix lang error on hrm/index.php --- htdocs/hrm/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index fe2c42b0d1b..8a294a47e2c 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -234,7 +234,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { print ''; print ''.$holidaystatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1, 'leave').''; - print ''.dol_escape_htmltag($typeleaves[$obj->fk_type]['label']).''; + print ''.dol_escape_htmltag($langs->trans($typeleaves[$obj->fk_type]['code'])).''; $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning'; $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon'; From d249ffd5adf97f9498ffba3840bf8e1d0d9cc925 Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Fri, 6 Aug 2021 13:40:19 +0900 Subject: [PATCH 014/112] Fix: Change French word to English in English array. --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index ee4b64471c3..df5dcba60ad 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -118,7 +118,7 @@ class Mo extends CommonObject 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')), ); public $rowid; public $ref; From 80c63cae5e6ddaffead1a5c8c14346b7bed22c36 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 6 Aug 2021 08:32:40 +0200 Subject: [PATCH 015/112] add GETPOST to 'target' value on new bookmarks -> allows to set default value --- htdocs/bookmarks/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 1094eabf0c6..8ac05863ed0 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -40,7 +40,7 @@ $action = GETPOST("action", "alpha"); $title = (string) GETPOST("title", "alpha"); $url = (string) GETPOST("url", "alpha"); $urlsource = GETPOST("urlsource", "alpha"); -$target = GETPOST("target", "alpha"); +$target = GETPOST("target", "int"); $userid = GETPOST("userid", "int"); $position = GETPOST("position", "int"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -169,7 +169,7 @@ if ($action == 'create') { // Target print ''.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, 1); + print $form->selectarray('target', $liste, GETPOST('target', 'int')); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").''; // Owner From 864a8b4b3ebda7dd8698c4e2d7e2b4b44f2e31e2 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 6 Aug 2021 16:22:19 +0200 Subject: [PATCH 016/112] FIX: holiday card: hooks uninitialized --- htdocs/holiday/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 692b9639805..8929e7881bc 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -81,6 +81,9 @@ if (($id > 0) || $ref) } } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('holidaycard', 'globalcard')); + $cancreate = 0; if (!empty($user->rights->holiday->write_all)) $cancreate = 1; if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate = 1; From cbc7589559322a97782020facf4e0f8c11bc8b85 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 6 Aug 2021 16:35:49 +0200 Subject: [PATCH 017/112] NEW: add constant MAIN_IBAN_NOT_MANDATORY --- htdocs/compta/bank/class/account.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ed61da3592e..885051bf36e 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1519,6 +1519,10 @@ class Account extends CommonObject */ public function needIBAN() { + global $conf; + + if ( ! empty($conf->global->MAIN_IBAN_NOT_MANDATORY) ) return 0; + $country_code = $this->getCountryCode(); $country_code_in_EEC = array( From 68482c637bb890f42a135c1baed1c0d81f3f88fc Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 6 Aug 2021 18:45:25 +0200 Subject: [PATCH 018/112] Update actioncomm.class Property contactid should be contact_id --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c6c0d277edd..bbf86d87c59 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -261,7 +261,7 @@ class ActionComm extends CommonObject /** * @var int socpeople id linked to action */ - public $contactid; + public $contact_id; /** * @var Societe|null Company linked to action (optional) @@ -273,7 +273,7 @@ class ActionComm extends CommonObject /** * @var Contact|null Contact linked to action (optional) * @deprecated - * @see $contactid + * @see $contact_id */ public $contact; From 091f5ab23be0c6d96e815b6fa0990130404d997d Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:12:45 +0200 Subject: [PATCH 019/112] Customer Display Lang --- htdocs/langs/en_US/cashdesk.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 86fdfd753a5..3b2d704a453 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -128,3 +128,4 @@ PrintPaymentMethodOnReceipts=Print payment method on tickets|receipts WeighingScale=Weighing scale ShowPriceHT = Display the column with the price excluding tax (on screen) ShowPriceHTOnReceipt = Display the column with the price excluding tax (on the receipt) +CustomerDisplay=Customer display From 49b53e04f4b0db61d5befd5b39597430f849fa35 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:13:31 +0200 Subject: [PATCH 020/112] Customer Display total on pay --- htdocs/takepos/pay.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index ba8ac8f82f7..773118e670f 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -255,6 +255,20 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { }); }, 2500); } + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "var line1='".$langs->trans('TotalTTC')."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".price($invoice->total_ttc, 1, '', 1, -1, -1)."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; +} +?>
From bae5b397069f00e549f8c42b420910d2296ce38e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:14:28 +0200 Subject: [PATCH 021/112] Customer display on click product --- htdocs/takepos/invoice.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 721a7b92ae8..5526a5607d1 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -550,6 +550,10 @@ if ($action == "addline") { if ($idoflineadded <= 0) { $invoice->fetch_thirdparty(); $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0); + if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { + $CUSTOMER_DISPLAY_line1 = $prod->label; + $CUSTOMER_DISPLAY_line2 = price($price_ttc); + } } $invoice->fetch($placeid); @@ -1176,6 +1180,23 @@ $( document ).ready(function() { }); + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "function CustomerDisplay(){"; + echo "var line1='".$CUSTOMER_DISPLAY_line1."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".$CUSTOMER_DISPLAY_line2."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; + echo "}"; +} +?> + Date: Sun, 8 Aug 2021 19:15:18 +0200 Subject: [PATCH 022/112] Customer display on addline --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index e7b8b8af438..d11a081280c 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -434,7 +434,7 @@ function ClickProduct(position) { if (idproduct=="") return; // Call page invoice.php to generate the section with product lines $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline, function() { - //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); + global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?> }); } From ea531a4c88c89fbd16f0eeb706a64afec2a50f64 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:16:11 +0200 Subject: [PATCH 023/112] Customer display settings --- htdocs/takepos/admin/receipt.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 9b236fc837a..74a54400fef 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -254,6 +254,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con print "\n"; } +if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + print ''; + print $langs->trans('CustomerDisplay'); + print ''; + print ajax_constantonoff("TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0); + print "\n"; +} + print ''; print '
'; From 108a5ff7cbf610b29858cef7f1bc6747b58dcda9 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Mon, 9 Aug 2021 15:14:25 +0200 Subject: [PATCH 024/112] FIX postgre filter select search extrafield --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 6b08baddb72..557c057c1c1 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { - $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = "' . $db->escape($crit) . '")'; + $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = \'' . $db->escape($crit) . '\')'; continue; } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); From e4cb1e023aa4b678235f5a6115478f3e4bf94e05 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 9 Aug 2021 15:39:04 +0200 Subject: [PATCH 025/112] fix link to supplier card of thirdparty on supplier_order list --- htdocs/supplier_proposal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5fcafb2fdc4..3c89be6bfe4 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -877,7 +877,7 @@ if ($resql) { // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print $companystatic->getNomUrl(1, 'customer'); + print $companystatic->getNomUrl(1, 'supplier'); print ''; if (!$i) { $totalarray['nbfield']++; From 0bead55836f87ea1a22724c96c3b9765a3cd9cb7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 9 Aug 2021 18:11:36 +0200 Subject: [PATCH 026/112] ok --- htdocs/admin/pdf_other.php | 9 +++++++++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index ed14f2ac119..2866240e87d 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -103,6 +103,15 @@ if ($conf->use_javascript_ajax) { } print ''; +print ''.$langs->trans("PDF_NO_CODE_CLIENT"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_NO_CODE_CLIENT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_NO_CODE_CLIENT", $arrval, $conf->global->PDF_NO_CODE_CLIENT); +} +print ''; /* print ''.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index b56fbc758db..e1455da3b20 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if ($object->thirdparty->code_client && empty($conf->global->PDF_NO_CODE_CLIENT)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98c9e954ac2..674a2926023 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,6 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line +PDF_NO_CODE_CLIENT=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From 284b40f15202110f891ea655aac0794dc30b1d12 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:38:07 +0200 Subject: [PATCH 027/112] CONST --- htdocs/admin/pdf.php | 10 ++++++++++ htdocs/admin/pdf_other.php | 9 --------- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index cee63fd91fd..56d22553d89 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,6 +371,16 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; +print ''.$langs->trans("MAIN_PDF_NO_CODE_CLIENT"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_NO_CODE_CLIENT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_NO_CODE_CLIENT", $arrval, $conf->global->MAIN_PDF_NO_CODE_CLIENT); +} +print ''; + // Ref print ''.$langs->trans("HideRefOnPDF").''; diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 2866240e87d..ed14f2ac119 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -103,15 +103,6 @@ if ($conf->use_javascript_ajax) { } print ''; -print ''.$langs->trans("PDF_NO_CODE_CLIENT"); -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PDF_NO_CODE_CLIENT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PDF_NO_CODE_CLIENT", $arrval, $conf->global->PDF_NO_CODE_CLIENT); -} -print ''; /* print ''.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e1455da3b20..2cffa9d25da 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->PDF_NO_CODE_CLIENT)) { + if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CODE_CLIENT)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 674a2926023..acb4bf6c409 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -PDF_NO_CODE_CLIENT=Do not display customer code +MAIN_PDF_NO_CODE_CLIENT=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From f8df84544293e9ee874c906c3029ce7b8ea28cc7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:45:15 +0200 Subject: [PATCH 028/112] Const and Com --- htdocs/admin/pdf.php | 8 +++++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 56d22553d89..69fcbebb671 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,13 +371,15 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -print ''.$langs->trans("MAIN_PDF_NO_CODE_CLIENT"); +// + +print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_CODE_CLIENT'); + print ajax_constantonoff('MAIN_PDF_NO_CUSTOMER_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_NO_CODE_CLIENT", $arrval, $conf->global->MAIN_PDF_NO_CODE_CLIENT); + print $form->selectarray("MAIN_PDF_NO_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_NO_CUSTOMER_CODE); } print ''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 2cffa9d25da..e521e01765f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CODE_CLIENT)) { + if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CUSTOMER_CODE)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index acb4bf6c409..6458091faf2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CODE_CLIENT=Do not display customer code +MAIN_PDF_NO_CUSTOMER_CODE=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From fcd174f3ada66a2328ee04e8c7fc56dd09ce3ebe Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 10 Aug 2021 07:45:47 +0000 Subject: [PATCH 029/112] Fixing style errors. --- htdocs/admin/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 69fcbebb671..3c6e32b0cb4 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,7 +371,7 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -// +// print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); print ''; From b610cc1c6ca45f99291c39cd4180eebe83dbf34b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 10 Aug 2021 11:18:25 +0200 Subject: [PATCH 030/112] FIX: shipping validation workflow: 'ORDER_CLOSE' trigger called from wrong object --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index b40900dd6c7..e58f84f338c 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -309,7 +309,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $diff_array = array_diff_assoc($qtyordred, $qtyshipped); if (count($diff_array) == 0) { //No diff => mean everythings is shipped - $ret = $object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE'); + $ret = $order->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE'); if ($ret < 0) { $this->error = $object->error; $this->errors = $object->errors; return $ret; From 6a41edd3c2b1a4f101d35460b6decfb34204971d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:02:37 +0200 Subject: [PATCH 031/112] ok --- htdocs/admin/pdf.php | 9 +++++++++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 ++++++---- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index cee63fd91fd..83225de223d 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -253,6 +253,15 @@ for ($i = 1; $i <= 6; $i++) { } } +// Show sender name + +print ''.$langs->trans("MAIN_PDF_NO_SENDER_NAME").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_NO_SENDER_NAME'); +} else { + print $form->selectyesno('MAIN_PDF_NO_SENDER_NAME', (!empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) ? $conf->global->MAIN_PDF_NO_SENDER_NAME : 0, 1); +} +print ''; print ''; print ''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index b56fbc758db..ef8a2fe088c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,10 +1585,12 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if(empty($conf->global->MAIN_PDF_NO_SENDER_NAME)){ + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98c9e954ac2..36d52f40af1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,6 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line +MAIN_PDF_NO_SENDER_NAME=Not show sender name in address MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From a5accb8c3c980c482644ed49c40bbc6933197732 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:18:07 +0200 Subject: [PATCH 032/112] yes/no --- htdocs/admin/pdf.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 83225de223d..4d73a889544 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -65,6 +65,8 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_NO_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_NO_SENDER_NAME", GETPOST("MAIN_PDF_NO_SENDER_NAME"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); From 21d6b9834a94ed6d3e741add16b7a1b5eda3ac28 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:31:25 +0200 Subject: [PATCH 033/112] yes/no save --- htdocs/admin/pdf.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 3c6e32b0cb4..8d26d30131e 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -89,6 +89,8 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_NO_CUSTOMER_CODE')) dolibarr_set_const($db, "MAIN_PDF_NO_CUSTOMER_CODE", GETPOST("MAIN_PDF_NO_CUSTOMER_CODE"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity); From 1d9d90036df4ec9b73878cad0f1a8d99dc7fc153 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 10 Aug 2021 15:14:41 +0000 Subject: [PATCH 034/112] Fixing style errors. --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index ef8a2fe088c..c943e6fa9e3 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,7 +1585,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - if(empty($conf->global->MAIN_PDF_NO_SENDER_NAME)){ + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); From 087e2691038e151eb1d78c04283545b00861d243 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 10 Aug 2021 17:34:47 +0200 Subject: [PATCH 035/112] FIX : on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dbb454ef800..08516fbc7d2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -464,7 +464,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid; $sql .= " WHERE l.fk_commande = ".$this->id; if ($only_product) $sql .= ' AND p.fk_product_type = 0'; $sql .= " ORDER BY l.rang, l.rowid"; From 2cb7e828a35af998f50268010be1b204a9a77984 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 18:05:58 +0200 Subject: [PATCH 036/112] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 36d52f40af1..21f56208bae 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_SENDER_NAME=Not show sender name in address +MAIN_PDF_NO_SENDER_NAME=Hide sender name in address MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From be016197b40d7193515d2b6110f0f0e879d9175a Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 18:07:11 +0200 Subject: [PATCH 037/112] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6458091faf2..ba027a3696b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CUSTOMER_CODE=Do not display customer code +MAIN_PDF_NO_CUSTOMER_CODE=Hide customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From 816648f283a74a666112ce36e9565fbb2f772cd2 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:28:44 +0200 Subject: [PATCH 038/112] other_docs --- .../modules/commande/doc/pdf_einstein.modules.php | 10 ++++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 12 +++++++----- .../modules/expedition/doc/pdf_rouget.modules.php | 10 ++++++---- .../modules/fichinter/doc/pdf_soleil.modules.php | 12 +++++++----- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index bd6caafd15a..f2b0c19c9ce 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1418,10 +1418,12 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c440cbf1cba..ab5c566058a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -693,11 +693,13 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetTextColor(0, 0, 60); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..c1131f0a3af 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1047,10 +1047,12 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 08d57587625..1b1ca0d33e2 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -649,11 +649,13 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetTextColor(0, 0, 60); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetFont('', '', $default_font_size - 1); From b45a57060f5175a20226e0b1808164b5d9081dc4 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:36:16 +0200 Subject: [PATCH 039/112] const_and_other_doc --- htdocs/admin/pdf.php | 6 +++--- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8d26d30131e..8db10aa3034 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -375,13 +375,13 @@ print ''; // -print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); +print ''.$langs->trans("DOC_SHOW_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_CUSTOMER_CODE'); + print ajax_constantonoff('DOC_SHOW_CUSTOMER_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_NO_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_NO_CUSTOMER_CODE); + print $form->selectarray("DOC_SHOW_CUSTOMER_CODE", $arrval, $conf->global->DOC_SHOW_CUSTOMER_CODE); } print ''; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c440cbf1cba..c86567db370 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -657,7 +657,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_contrat, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..621b20e624f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -971,7 +971,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($object->thirdparty->code_client)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 08d57587625..57aec4907a8 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -613,7 +613,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e521e01765f..cdc1e660dca 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CUSTOMER_CODE)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ba027a3696b..ed71e52c146 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CUSTOMER_CODE=Hide customer code +DOC_SHOW_CUSTOMER_CODE=Show customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From b7441aaf4564fb2b38384de2f9e14076926e2662 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 10:37:06 +0000 Subject: [PATCH 040/112] Fixing style errors. --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index cdc1e660dca..d98b1695c9f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) {) $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); From 6fbd93999fe888f5e5f396cf85de53f426f5935e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 13:33:51 +0200 Subject: [PATCH 041/112] css --- htdocs/core/class/html.form.class.php | 2 +- htdocs/product/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cee87c8ab41..33d2f70caa4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4724,7 +4724,7 @@ class Form $more .= '
'."\n"; foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) { - $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2472c764d7e..281613caae9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2417,7 +2417,7 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d // Define confirmation messages $formquestionclone = array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), + array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss'=>'width150'), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), ); From c12905f0f3ce498bfa9ae226ed5079ad50f3983c Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 17:51:39 +0200 Subject: [PATCH 042/112] ok --- htdocs/admin/pdf_other.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index ed14f2ac119..01ba7236f90 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,6 +53,9 @@ if ($cancel) { } if ($action == 'update') { + + if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); From 775164f84a0f513d44f7b7d1a67204945be50f7d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 06:50:50 +0000 Subject: [PATCH 043/112] Fixing style errors. --- htdocs/admin/pdf_other.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 01ba7236f90..f03bfc6a5ec 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,7 +53,6 @@ if ($cancel) { } if ($action == 'update') { - if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); From 8da328b183a9ffeeaa828bfc40898eaaa3a486ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 15:44:48 +0200 Subject: [PATCH 044/112] Update extrafields_list_search_sql.tpl.php --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 557c057c1c1..f62f65f18e9 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { - $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = \'' . $db->escape($crit) . '\')'; + $sql .= " AND (" . $extrafieldsobjectprefix.$tmpkey . " = '" . $db->escape($crit) . "')"; continue; } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); From c5e8302ba2213604b919169a03ddbcd06f1bfaba Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:18:16 +0200 Subject: [PATCH 045/112] Const --- htdocs/admin/pdf.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8db10aa3034..a92b4011b83 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -375,7 +375,7 @@ print ''; // -print ''.$langs->trans("DOC_SHOW_CUSTOMER_CODE"); +print ''.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DOC_SHOW_CUSTOMER_CODE'); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index bd6caafd15a..7acf7007e60 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1356,7 +1356,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c86567db370..a8462a08e19 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -657,7 +657,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_contrat, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 621b20e624f..90d1119b33c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -971,7 +971,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a01fab1dacf..27cbbd8f802 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1803,7 +1803,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R'); } - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 57aec4907a8..a88b0a44bf7 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -613,7 +613,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d98b1695c9f..1837589e504 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) {) + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) {) $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ed71e52c146..4d474e61a2a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -DOC_SHOW_CUSTOMER_CODE=Show customer code +MAIN_PDF_HIDE_CUSTOMER_CODE=Hide customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From a8562704cf2a2146293f978622ad87268fa496b3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 18:16:53 +0200 Subject: [PATCH 046/112] add_doc --- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 83ccd391bd9..88e64483300 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1538,7 +1538,7 @@ class pdf_eratosthene extends ModelePDFCommandes } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6f4b0b1a2a..05fbfbbc2a6 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1021,7 +1021,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 401309c22e5..73ffab18441 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2041,7 +2041,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R'); } - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f75f5ecab56..5490da11b02 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1634,7 +1634,7 @@ class pdf_cyan extends ModelePDFPropales } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); From 956bd00c13f0706ab9b0abde9e9fee9f2528f351 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 18:37:13 +0200 Subject: [PATCH 047/112] CHANGE_CONST_ADD_DOC --- htdocs/admin/pdf.php | 8 ++++---- .../core/modules/commande/doc/pdf_einstein.modules.php | 2 +- .../modules/commande/doc/pdf_eratosthene.modules.php | 10 ++++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 2 +- .../modules/expedition/doc/pdf_espadon.modules.php | 10 ++++++---- .../core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++++---- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 10 ++++++---- .../core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 ++++++---- htdocs/langs/en_US/admin.lang | 2 +- 12 files changed, 40 insertions(+), 30 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 4d73a889544..4a68fe12e6b 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -65,7 +65,7 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - if (GETPOSTISSET('MAIN_PDF_NO_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_NO_SENDER_NAME", GETPOST("MAIN_PDF_NO_SENDER_NAME"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_HIDE_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_HIDE_SENDER_NAME", GETPOST("MAIN_PDF_HIDE_SENDER_NAME"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); @@ -257,11 +257,11 @@ for ($i = 1; $i <= 6; $i++) { // Show sender name -print ''.$langs->trans("MAIN_PDF_NO_SENDER_NAME").''; +print ''.$langs->trans("MAIN_PDF_HIDE_SENDER_NAME").''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_SENDER_NAME'); + print ajax_constantonoff('MAIN_PDF_HIDE_SENDER_NAME'); } else { - print $form->selectyesno('MAIN_PDF_NO_SENDER_NAME', (!empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) ? $conf->global->MAIN_PDF_NO_SENDER_NAME : 0, 1); + print $form->selectyesno('MAIN_PDF_HIDE_SENDER_NAME', (!empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) ? $conf->global->MAIN_PDF_HIDE_SENDER_NAME : 0, 1); } print ''; print ''; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f2b0c19c9ce..315c7d1d32e 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1418,7 +1418,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 83ccd391bd9..264777a57a5 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1604,10 +1604,12 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index ab5c566058a..fe634ecd50e 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -693,7 +693,7 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6f4b0b1a2a..fdc9dd52ab8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1097,10 +1097,12 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index c1131f0a3af..bb9022f8efd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1047,7 +1047,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a01fab1dacf..f5500aa35cd 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1860,10 +1860,12 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 401309c22e5..adb656d03b9 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2098,10 +2098,12 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 1b1ca0d33e2..b54f0f8a7f1 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -649,7 +649,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c943e6fa9e3..340d799f6a7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,7 +1585,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f75f5ecab56..186544fabb2 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1699,10 +1699,12 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 21f56208bae..36fc408a2b2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_SENDER_NAME=Hide sender name in address +MAIN_PDF_HIDE_SENDER_NAME=Hide sender name in address MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From 310b5c974b60d80dc87e4630d8bcd137ab39e970 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 19:43:12 +0200 Subject: [PATCH 048/112] Fix help --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..2fef145800f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -127,7 +127,7 @@ class pdf_rouget extends ModelePdfExpedition $this->db = $db; $this->name = "rouget"; - $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->description = $langs->trans("DocumentModelStandardPDF").' ('.$langs->trans("OldImplementation").')'; $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 55a0b0a34c3..db435d13c96 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2155,4 +2155,5 @@ DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off -InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s \ No newline at end of file +InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s +OldImplementation=Old implementation From 687eb536aee1eb8a71d0077abc0ab1de20118a55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 20:05:03 +0200 Subject: [PATCH 049/112] Update card.php --- htdocs/bookmarks/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 8ac05863ed0..f7795a14f47 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -169,7 +169,7 @@ if ($action == 'create') { // Target print ''.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, GETPOST('target', 'int')); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").''; // Owner From 51a28a4ac4f6a2f9c5a630503aacca9d54e888ab Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 5 Aug 2021 16:31:21 +0200 Subject: [PATCH 050/112] Fix lang error on hrm/index.php --- htdocs/hrm/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index fe2c42b0d1b..8a294a47e2c 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -234,7 +234,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { print ''; print ''.$holidaystatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1, 'leave').''; - print ''.dol_escape_htmltag($typeleaves[$obj->fk_type]['label']).''; + print ''.dol_escape_htmltag($langs->trans($typeleaves[$obj->fk_type]['code'])).''; $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning'; $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon'; From bf721438231ee143cb6a224faced52ba0270e4d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:04:03 +0200 Subject: [PATCH 051/112] Fix phpcs --- htdocs/compta/bank/class/account.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 885051bf36e..03ec879c5ad 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1521,7 +1521,9 @@ class Account extends CommonObject { global $conf; - if ( ! empty($conf->global->MAIN_IBAN_NOT_MANDATORY) ) return 0; + if (!empty($conf->global->MAIN_IBAN_IS_NEVER_MANDATORY)) { + return 0; + } $country_code = $this->getCountryCode(); From 9e54dc0dcbf21f09e2ab266526275ce8c73f9a63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:31:14 +0200 Subject: [PATCH 052/112] typo --- htdocs/install/mysql/tables/llx_product.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 4aad3393137..1e15dd5a940 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -103,5 +103,5 @@ create table llx_product desiredstock float DEFAULT 0, fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, - fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project + fk_project integer DEFAULT NULL -- Used when the product was generated by a project or is specific to a project )ENGINE=innodb; From 80673e0efc56cf87cd7f2135e0ad442203c9410e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:32:39 +0200 Subject: [PATCH 053/112] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5fed4bc4ca1..e28d873c209 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019-2020 Thibault FOUCART + * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * * This program is free software; you can redistribute it and/or modify From 3befe8f3839c9f5d1301daa3c47e4633df0f7ccc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:34:11 +0200 Subject: [PATCH 054/112] Update 12.0.0-13.0.0.sql --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 95d6d208145..c83755009ae 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -29,7 +29,6 @@ -- Missing in v12 or lower -ALTER TABLE llx_product ADD COLUMN fk_default_bom integer DEFAULT NULL; ALTER TABLE llx_payment_salary MODIFY COLUMN ref varchar(30) NULL; ALTER TABLE llx_payment_various MODIFY COLUMN ref varchar(30) NULL; From eadfc9f4aefa535f7491af496b831dc16fca2c9d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 19:36:18 +0000 Subject: [PATCH 055/112] Fixing style errors. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 40d63c4643f..0645ca9c2a6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2115,7 +2115,7 @@ class Product extends CommonObject $this->localtax2_tx = $obj->localtax2_tx; $this->localtax1_type = $obj->localtax1_type; $this->localtax2_type = $obj->localtax2_type; - + $this->finished = $obj->finished; $this->fk_default_bom = $obj->fk_default_bom; From 5b30cf3e77ae6b4bcb9d59029aebb3acda8add06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:44:18 +0200 Subject: [PATCH 056/112] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9cbb7d56ec4..2332d97feab 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1911,7 +1911,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; - if ($object->isService() && !empty($conf->bom->enabled)) { + if (!$object->isService() && !empty($conf->bom->enabled)) { print ''; } - if ($conf->bom->enabled) { - print ''; - } - // Brut Weight if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) { print ''; } + if (!$object->isService() && !empty($conf->bom->enabled)) { + print ''; + } + + // Other attributes $parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; From 0d2e3ece1a8c30e1d04affe71e33040f75ce371f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:50:28 +0200 Subject: [PATCH 059/112] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index edd309b9c15..6a87350f02b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1912,7 +1912,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id; print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); From 3c0601d1f95d676d1c5f645844334a611087cad2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 19:46:39 +0000 Subject: [PATCH 057/112] Fixing style errors. --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2332d97feab..818b2621fe9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -68,7 +68,7 @@ if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } if (!empty($conf->bom->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; } // Load translation files required by the page From 3af8e18b3c2c7dd26276998e5069b4ddc1252b1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:47:28 +0200 Subject: [PATCH 058/112] Create card.php --- htdocs/product/card.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 818b2621fe9..edd309b9c15 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -68,7 +68,7 @@ if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } if (!empty($conf->bom->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; } // Load translation files required by the page @@ -2280,16 +2280,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; - if ($object->fk_default_bom) { - $bom_static = new BOM($db); - $bom_static->fetch($object->fk_default_bom); - print $bom_static->getNomUrl(1); - } - print '
'.$langs->trans("Weight").''; @@ -2380,6 +2370,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("QCFrequency").''.$object->qc_frequency.'
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + if ($object->fk_default_bom) { + $bom_static = new BOM($db); + $bom_static->fetch($object->fk_default_bom); + print $bom_static->getNomUrl(1); + } + print '
'; if (!$object->isService() && !empty($conf->bom->enabled)) { - print ''; From d66df5cb6082bf8517c34e5ccd692434c7f8341b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 21:53:21 +0200 Subject: [PATCH 060/112] Complete #15548 --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 274e3b145e0..92eb2b7a012 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -60,3 +60,5 @@ ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128); -- -- add action trigger INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13); + +ALTER TABLE llx_product ADD COLUMN fk_default_bom integer DEFAULT NULL; From 0d071350271e315c3c374ebc333dc8971e1a6245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 22:19:53 +0200 Subject: [PATCH 061/112] Update list.php --- htdocs/commande/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 153250534fd..ef2d9748b8e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1680,7 +1680,7 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { print ''; print ''; + // Remainder to pay Multicurrency + if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + print ''; + print ''; + } + // Retained warranty : usualy use on construction industry if (!empty($object->situation_final) && !empty($object->retained_warranty) && $displayWarranty) { // Billed - retained warranty From 76c39a86a03eda2952e0b296ca6cc6df24fb9e60 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Mon, 16 Aug 2021 09:44:09 +0800 Subject: [PATCH 073/112] Supplier Invoice - Multicurrency remainder to pay Added multicurrency remainder to be paid. --- htdocs/fourn/facture/card.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6b67d0a2dcf..5d6a5c0dea2 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3237,6 +3237,17 @@ if ($action == 'create') { print ''; print ''; print ''; + + // Remainder to pay Multicurrency + if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + print ''; + print ''; + } + print ''; } else // Credit note { From ee65860b270304f814827547cd913e99d1c7ab79 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 16 Aug 2021 01:45:33 +0000 Subject: [PATCH 074/112] Fixing style errors. --- htdocs/fourn/facture/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5d6a5c0dea2..b39041542eb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3237,17 +3237,17 @@ if ($action == 'create') { print ''; print ''; print ''; - + // Remainder to pay Multicurrency - if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { - print ''; - print ''; - } - + if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + print ''; + print ''; + } + print ''; } else // Credit note { From b92fe38bc0157a6ef8f15c6117a66e67cac55f01 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 16 Aug 2021 01:47:49 +0000 Subject: [PATCH 075/112] Fixing style errors. --- htdocs/compta/facture/card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 4c11bb595cb..5d81da90088 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5078,15 +5078,15 @@ if ($action == 'create') { print ''; // Remainder to pay Multicurrency - if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { - print ''; - print ''; - } - + if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + print ''; + print ''; + } + // Retained warranty : usualy use on construction industry if (!empty($object->situation_final) && !empty($object->retained_warranty) && $displayWarranty) { // Billed - retained warranty From b8da594c31415272969d708eb070a46dd3675f50 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Aug 2021 05:47:25 +0200 Subject: [PATCH 076/112] Better fix --- htdocs/accountancy/class/accountancyexport.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 1bb597d7187..b7419e4602f 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1462,13 +1462,13 @@ class AccountancyExport print $date_lim_reglement.$separator; // CNPI if ($line->doc_type == 'supplier_invoice') { - if (($line->debit - $line->credit) < 0) { + if (($line->amount) < 0) { $nature_piece = 'AF'; } else { $nature_piece = 'FF'; } } elseif ($line->doc_type == 'customer_invoice') { - if (($line->debit - $line->credit) < 0) { + if (($line->amount) < 0) { $nature_piece = 'AC'; } else { $nature_piece = 'FC'; From ba12071ea3ad98d97852a3a2098ece09cdfe1333 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Aug 2021 07:57:40 +0200 Subject: [PATCH 077/112] FIX Accountancy - SQL error on select journal on journal --- htdocs/accountancy/class/bookkeeping.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index aeaa42154d8..8d8ba413f21 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1024,6 +1024,8 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); + } elseif ($key == 't.code_journal' && !empty($value)) { + $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); } else { $sqlwhere[] = natural_search($key, $value, 0, 1); } From 1bfc0004b1a6a7f8472a45de6fc44e7191f63654 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Aug 2021 08:12:24 +0200 Subject: [PATCH 078/112] Better fix --- htdocs/accountancy/class/bookkeeping.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 8d8ba413f21..6eed5223d45 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1025,7 +1025,11 @@ class BookKeeping extends CommonObject } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.code_journal' && !empty($value)) { - $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); + if (is_array($value)) { + $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); + } else { + $sqlwhere[] = natural_search("t.code_journal", $value, 3, 1); + } } else { $sqlwhere[] = natural_search($key, $value, 0, 1); } From 94fbcbdad11400265d03fefdb1da47ad8d28eb6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Aug 2021 20:22:50 +0200 Subject: [PATCH 079/112] CSS For support page --- htdocs/install/check.php | 55 +++++------ htdocs/install/default.css | 62 +++++++++++- htdocs/support/default.css | 191 ------------------------------------- htdocs/support/inc.php | 9 +- htdocs/support/index.php | 37 ++++--- 5 files changed, 113 insertions(+), 241 deletions(-) delete mode 100644 htdocs/support/default.css diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 99e9e38c958..cf7a1fd8e98 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -26,6 +26,7 @@ * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it */ + include_once 'inc.php'; global $langs; @@ -74,7 +75,7 @@ if (!empty($useragent)) { $browserversion = $tmp['browserversion']; $browsername = $tmp['browsername']; if ($browsername == 'ie' && $browserversion < 7) { - print 'Error '.$langs->trans("WarningBrowserTooOld")."
\n"; + print 'Error '.$langs->trans("WarningBrowserTooOld")."
\n"; } } @@ -83,13 +84,13 @@ if (!empty($useragent)) { $arrayphpminversionerror = array(5, 5, 0); $arrayphpminversionwarning = array(5, 6, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { // Minimum to use (error if lower) - print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); + print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); $checksok = 0; // 0=error, 1=warning } elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) { // Minimum supported (warning if lower) - print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); + print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); $checksok = 0; // 0=error, 1=warning } else { - print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); + print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); } if (empty($force_install_nophpinfo)) { print ' ('.$langs->trans("MoreInformation").')'; @@ -99,58 +100,58 @@ print "
\n"; // Check PHP support for $_GET and $_POST if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) { // We must keep $_GET and $_POST here - print 'Warning '.$langs->trans("PHPSupportPOSTGETKo"); + print 'Warning '.$langs->trans("PHPSupportPOSTGETKo"); print ' ('.$langs->trans("Recheck").')'; print "
\n"; $checksok = 0; } else { - print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; + print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; } // Check if session_id is enabled if (!function_exists("session_id")) { - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; $checksok = 0; } else { - print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; + print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; } // Check if GD is supported (we need GD for image conversion) if (!function_exists("imagecreate")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; } // Check if Curl is supported if (!function_exists("curl_init")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; } // Check if PHP calendar extension is available if (!function_exists("easter_date")) { - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; } else { - print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; } // Check if UTF8 is supported if (!function_exists("utf8_encode")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; } @@ -158,19 +159,19 @@ if (!function_exists("utf8_encode")) { if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { if (!function_exists("locale_get_primary_language") || !function_exists("locale_get_region")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; } } if (!class_exists('ZipArchive')) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { - print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; + print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; } // Check memory @@ -192,9 +193,9 @@ if ($memmaxorig != '') { } } if ($memmax >= $memrequired || $memmax == -1) { - print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; + print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; } else { - print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; + print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; } } @@ -244,12 +245,12 @@ if (is_readable($conffile) && filesize($conffile) > 8) { // File is missing and cannot be created if (!file_exists($conffile)) { - print 'Error '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow); - print "

"; + print 'Error '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated", $conffiletoshow); + print '

'; print $langs->trans("YouMustCreateWithPermission", $conffiletoshow); - print "

"; + print '


'."\n"; - print $langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok'); + print ''.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; $err++; } else { if (dol_is_dir($conffile)) { @@ -380,7 +381,7 @@ if (!file_exists($conffile)) { $choice .= '
'; //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; - // Ok '; + // Ok '; } $choice .= ''; diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 85a2f4703c2..88967664ad8 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -16,10 +16,22 @@ */ +.center { + text-align: center; +} + +.centpercent { + width: 100%; +} + .paddingright { padding-right: 4px; } +.valignmiddle { + vertical-align: middle; +} + .opacitymedium { opacity: 0.5; } @@ -28,6 +40,10 @@ display: inline-block; } +.small { + font-size: 0.9em; +} + body { font-size:14px; font-family: roboto,arial,tahoma,verdana,helvetica; @@ -36,14 +52,14 @@ body { } table.main-inside { - padding-left: 10px; - padding-right: 10px; + /*padding-left: 10px; + padding-right: 10px;*/ padding-bottom: 10px; margin-bottom: 10px; margin-top: 10px; color: #000000; border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; + /* border-bottom: 1px solid #ccc; */ line-height: 22px; } @@ -418,3 +434,43 @@ a.button:hover { .text-security { -webkit-text-security: disc; } + + + +/* For support section */ + +.tablesupport { + padding: 6px; + width: 500px; +} + +table.login.tablesupport .title { + background: #eee !important; +} + +.blocksupport { + padding: 12px; + /* width: 90%; */ +} + +table.tablesupport { + min-height: 250px; + border: 1px solid #E0E0E0; + background: #FFF; +} + + +/* Force values for small screen 570 */ +@media only screen and (max-width: 570px) +{ + .blocksupport { + width: 90%; + } + + .tablesupport { + padding: 6px; + width: 100%; + } +} + +} diff --git a/htdocs/support/default.css b/htdocs/support/default.css deleted file mode 100644 index 735224254d3..00000000000 --- a/htdocs/support/default.css +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2004 Rodolphe Quiedeville - * Copyright (C) 2009 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -body { -font-size:14px; -font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; -background: #f9f9f9; -/* background-color: #F4F4F4; */ -margin: 5px 5px; -} - -.center { - text-align: center; -} - -.centpercent { - width: 100%; -} - -.valignmiddle { - vertical-align: middle; -} - -inline-block { - display: inline-block; -} - -div.titre { -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -} - -span.titre { -font-size: 15px; -font-weight: bold; -background: #FFFFFF; -color: #4965B3; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -border: 1px solid #AAAAAA; -} - -div.soustitre { -font-size: 15px; -font-weight: bold; -color: #4965B3; -padding: 0 1.2em 0.5em 2em; -margin: 1.2em 1.2em 1.2em 1.2em; -border-bottom: 1px solid #8CACBB; -border-right: 1px solid #8CACBB; -text-align: right; -} - -input:disabled -{ -background: #FDFDFD; -border: 1px solid #ACBCBB; -padding: 0 0 0 0; -margin: 0 0 0 0; -} - -table.main { -background: #dcdcd3; -text-align: left; -border: 1px solid #8CACBB; -} - -table.tablesupport { - min-height: 250px; -} - -div.ok { -color: #114466; -} - -div.warning { -color: #777711; -} - -div.error { -color: #550000; font-weight: bold; -padding: 0.2em 0.2em 0.2em 0.2em; -margin: 0.5em 0 0.5em 0; -border: 1px solid #6C7C8B; -} - -font.error { -color: #550000; -} - -div.header { -background-color: #dcdff4; -border-bottom: solid black 1px; -padding-left: 5px; -text-align: center; -} - -a:link,a:visited,a:active { - color: #2266DD; - text-decoration:none; -} -a:hover { - color: #2266DD; - text-decoration:underline; -} - -a.titre { -text-decoration:none; -} - - -div.main-inside h2 { -font-size:18px; -font-weight: bold; -color: #4965B3; -} - -tr.bg1 { -background-color: #E5E5E5; -} - -tr.bg2 { -background-color: #B5C5C5; -} - -td.label { -background: #dcdcd3; -color: #5945A3; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -border-bottom: 1px solid #8CACBB; -} - -td.comment { -background: #dcdcd3; -color: black; -padding: 5px 5px 5px 5px; -margin: 0 0 0 0; -text-decoration:none; -font-size: 13px; -border-bottom: 1px solid #8CACBB; -} - -.install -{ -border: 1px solid #8CACBB; -padding: 4px 4px 4px 4px; -} - -tr.title -{ -background: #EEEEEE; -} - -table.login { border: 1px solid #E0E0E0; background: #FFF; } - -.tablesupport { - padding: 6px; -} - -.blocksupport { - padding: 12px; - /* width: 90%; */ -} -/* Force values for small screen 570 */ -@media only screen and (max-width: 570px) -{ - .blocksupport { - width: 90%; - } -} - -.inline-block -{ - display:inline-block; - vertical-align: top; -} diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 31236ab5fa9..2836650fe71 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -229,10 +229,9 @@ function conf($dolibarr_main_document_root) */ function pHeader($soutitre, $next, $action = 'none') { - global $conf; - global $langs; - $langs->load("main"); - $langs->load("admin"); + global $conf, $langs; + + $langs->loadLangs(array("main", "admin")); // On force contenu dans format sortie header("Content-type: text/html; charset=".$conf->file->character_set_client); @@ -246,7 +245,7 @@ function pHeader($soutitre, $next, $action = 'none') print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''.$langs->trans("DolibarrHelpCenter").''."\n"; print ''."\n"; diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 220da1290ac..4c80445865b 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -40,14 +40,15 @@ if (!defined('DOL_URL_ROOT')) { $langs->loadLangs(array("other", $langs->load("help"))); + /* * View */ pHeader($langs->trans("DolibarrHelpCenter"), $_SERVER["PHP_SELF"]); -print '
'.$langs->trans("HelpCenterDesc1")."
\n"; -print $langs->trans("HelpCenterDesc2")."
\n"; +print '
'.$langs->trans("HelpCenterDesc1")."
\n"; +print $langs->trans("HelpCenterDesc2")."

\n"; print '
'; @@ -80,12 +81,14 @@ print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id; print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); print '
'; - if ($userstatic->id) { + if ($userstatic->id > 0) { print $userstatic->getLoginUrl(1); } else { print ' '; @@ -1704,7 +1704,6 @@ if ($resql) { // We print only number print $nbofsalesrepresentative; } elseif ($nbofsalesrepresentative > 0) { - $userstatic = new User($db); $j = 0; foreach ($listsalesrepresentatives as $val) { $userstatic->id = $val['id']; From 896cdf4845ef659473a72979b3b7be26d5e0bb33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Aug 2021 22:24:07 +0200 Subject: [PATCH 062/112] Update list.php --- htdocs/compta/facture/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 75970193967..0becff9e54b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1959,7 +1959,6 @@ if ($resql) { // We print only number print $nbofsalesrepresentative; } elseif ($nbofsalesrepresentative > 0) { - $userstatic = new User($db); $j = 0; foreach ($listsalesrepresentatives as $val) { $userstatic->id = $val['id']; From e691217d00035371c7989d62a0d5280f7c601050 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 12 Aug 2021 13:56:41 +0200 Subject: [PATCH 063/112] Add a Global variable 'PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES' to have the possibility to hide product label in supplier order lines. --- htdocs/core/lib/pdf.lib.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6a17f4b6d44..93829c4a470 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1275,12 +1275,15 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); } - // Description short of product line - $libelleproduitservice = $label; - if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { - $libelleproduitservice = ''.$libelleproduitservice.''; + if (empty($conf->global->PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES)) { + // Description short of product line + $libelleproduitservice = $label; + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { + $libelleproduitservice = ''.$libelleproduitservice.''; + } } + // Add ref of subproducts if (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) { $prodser->get_sousproduits_arbo(); From cd60d09d9e0814a2dac20b6316ae2693b9330cad Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 12 Aug 2021 16:15:04 +0400 Subject: [PATCH 064/112] FIX #18399 Fix shipment validation email template override. Object type name for shipment was apparently wrong. --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 044115f1568..557d76b05f1 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -515,7 +515,7 @@ class Notify case 'SHIPPING_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment'); - $object_type = 'expedition'; + $object_type = 'shipping'; $labeltouse = $conf->global->SHIPPING_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; From 84b8717693777afecdfc62a22fe11af57851b3d0 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 12 Aug 2021 17:05:00 +0400 Subject: [PATCH 065/112] CLOSE #18401 Add __NEWREF__ subtitute to get new object reference. Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a9cb45e06fb..e04545f094b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6860,6 +6860,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($onlykey) { $substitutionarray['__ID__'] = '__ID__'; $substitutionarray['__REF__'] = '__REF__'; + $substitutionarray['__NEWREF__'] = '__NEWREF__'; $substitutionarray['__REF_CLIENT__'] = '__REF_CLIENT__'; $substitutionarray['__REF_SUPPLIER__'] = '__REF_SUPPLIER__'; $substitutionarray['__NOTE_PUBLIC__'] = '__NOTE_PUBLIC__'; @@ -6940,6 +6941,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, } else { $substitutionarray['__ID__'] = $object->id; $substitutionarray['__REF__'] = $object->ref; + $substitutionarray['__NEWREF__'] = $object->newref; $substitutionarray['__REF_CLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null); From 2125bc9aa51116fd9d01f1b091ac9eb359056a80 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 12 Aug 2021 17:13:35 +0400 Subject: [PATCH 066/112] CLOSE #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a9cb45e06fb..d99ef50bdec 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7183,6 +7183,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } + if (is_object($object) && $object->element == 'shipping') { + $substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id; + } + } if (is_object($object) && $object->element == 'action') { From 22eda3fd63e270357c0c8e6408ccaef6bd6672f2 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 12 Aug 2021 15:39:52 +0200 Subject: [PATCH 067/112] NEW : add missing printFieldListFrom hook call on several lists --- htdocs/comm/propal/list.php | 6 ++++++ htdocs/commande/list.php | 6 ++++++ htdocs/compta/facture/list.php | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 29c87b0ebd2..ccdc77c26cd 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -298,6 +298,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE p.fk_soc = s.rowid'; $sql.= ' AND p.entity IN ('.getEntity('propal').')'; if (! $user->rights->societe->client->voir && ! $socid) //restriction diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f64aadf0e53..227c4d48528 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -273,6 +273,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE c.fk_soc = s.rowid'; $sql.= ' AND c.entity IN ('.getEntity('commande').')'; if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 653f1182d78..4685b0e9582 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -407,6 +407,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE f.fk_soc = s.rowid'; $sql.= ' AND f.entity IN ('.getEntity('invoice').')'; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; From 96a820476cc0478d8416a3bea6be1a75e404a028 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 13 Aug 2021 10:45:43 +0200 Subject: [PATCH 068/112] Fix supplier invoice clone : missing data on lines (#18055) --- htdocs/fourn/class/fournisseur.facture.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8b02edcbbe0..d91f5227f21 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -500,7 +500,8 @@ class FactureFournisseur extends CommonInvoice $this->lines[$i]->date_end, $this->lines[$i]->array_options, $this->lines[$i]->fk_unit, - $this->lines[$i]->multicurrency_subprice + $this->lines[$i]->multicurrency_subprice, + $this->lines[$i]->ref_supplier ); } else { $this->error = $this->db->lasterror(); @@ -538,8 +539,16 @@ class FactureFournisseur extends CommonInvoice $line->fk_product, 'HT', (!empty($line->info_bits) ? $line->info_bits : ''), - $line->product_type - ); + $line->product_type, + $line->remise_percent, + 0, + $line->date_start, + $line->date_end, + $line->array_options, + $line->fk_unit, + $line->multicurrency_subprice, + $line->ref_supplier + ); } else { $this->error = $this->db->lasterror(); $this->db->rollback(); From 1932bc308ddd11320c46a4a4b8e3fd7028adcad7 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 13 Aug 2021 13:26:11 +0200 Subject: [PATCH 069/112] FIX: e-mail of applicant is not transferred to the new user when creating a user from an applicant card --- htdocs/recruitment/recruitmentcandidature_card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index a1e98ded601..a84644d30cb 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -264,6 +264,7 @@ if (empty($reshook)) { $nuser->birth = $object->date_birth; $nuser->salary = $object->remuneration_proposed; $nuser->fk_user = $jobposition->fk_user_supervisor; // Supervisor + $nuser->email = $object->email; $result = $nuser->create($user); From c67c9eb7179c68fb748369fbdcb1b600d4a9b004 Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Sat, 14 Aug 2021 21:22:07 +0900 Subject: [PATCH 070/112] Fix: MO status selector draft showing all values instead of showing only draft values --- htdocs/mrp/mo_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index bac3528e642..957d6ac75aa 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -235,7 +235,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1') { $search[$key] = ''; } $mode_search = 2; From abc94a397a1f48b00ffa88b42f5412ef42496a4e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 15 Aug 2021 11:12:14 +0200 Subject: [PATCH 071/112] FIX #18389 Accountancy - Bug on LDcompta10 export for supplier invoice --- htdocs/accountancy/class/accountancyexport.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 28446c09d47..1bb597d7187 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1296,7 +1296,9 @@ class AccountancyExport /** * Export format : LD Compta version 10 & higher - * http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf + * Last review for this format : 08-15-2021 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf * * @param array $objectLines data * @@ -1460,7 +1462,7 @@ class AccountancyExport print $date_lim_reglement.$separator; // CNPI if ($line->doc_type == 'supplier_invoice') { - if (($line->debit - $line->credit) > 0) { + if (($line->debit - $line->credit) < 0) { $nature_piece = 'AF'; } else { $nature_piece = 'FF'; From 9a65cbeab7de73ecf6f25c7b0d55503c24b43307 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Mon, 16 Aug 2021 09:39:09 +0800 Subject: [PATCH 072/112] Customer Invoice - Multicurrency Remaining to Pay Added the remainder to be paid in multicurrency mode. --- htdocs/compta/facture/card.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5c21f2b9539..4c11bb595cb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5077,6 +5077,16 @@ if ($action == 'create') { print ''.price($resteapayeraffiche).' 
'; + print ''; + print $langs->trans('MulticurrencyRemainderToPay'); + print ''; + print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).''.price($resteapayeraffiche).'
'; + print ''; + print $langs->trans('MulticurrencyRemainderToPay'); + print ''; + print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).' 
'.price($resteapayeraffiche).'
'; - print ''; - print $langs->trans('MulticurrencyRemainderToPay'); - print ''; - print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'
'; + print ''; + print $langs->trans('MulticurrencyRemainderToPay'); + print ''; + print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).' 
 
'; - print ''; - print $langs->trans('MulticurrencyRemainderToPay'); - print ''; - print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'
'; + print ''; + print $langs->trans('MulticurrencyRemainderToPay'); + print ''; + print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'
'; print ''; print '