From 0c416a1e38d7f04d6d3a4657e484e95a3dda50dd Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 26 Jul 2022 15:38:50 +0200 Subject: [PATCH 1/4] better hook management --- htdocs/takepos/invoice.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e3f4a106c67..a37752863a0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -562,14 +562,16 @@ if (empty($reshook)) { $invoice->fetch_thirdparty(); $array_options = array(); + $line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'locatax1_tx' => $localtax1_tx, 'locatax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options); + // complete line by hook - $parameters = array('prod' => $prod); - $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); + $parameters = array('prod' => $prod, 'line' => $line); + $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) { - $idoflineadded = $invoice->addline($prod->description, $price, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $array_options, 100, '', null, 0); - } + if (!empty($hookmanager->resArray)) $line = $hookmanager->resArray; + + $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $line['array_options'], 100, '', null, 0); if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { $CUSTOMER_DISPLAY_line1 = $prod->label; From 3e930f92b8dd4d1a406decfc5c192885b2ecfce9 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 26 Jul 2022 15:47:03 +0200 Subject: [PATCH 2/4] add reshook test --- htdocs/takepos/invoice.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a37752863a0..3657ca7f4b6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -569,9 +569,14 @@ if (empty($reshook)) { $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (!empty($hookmanager->resArray)) $line = $hookmanager->resArray; - $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $line['array_options'], 100, '', null, 0); + if (empty($reshook)) { + if (!empty($hookmanager->resArray)) { + $line = $hookmanager->resArray; + } + + $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', $line['array_options'], 100, '', null, 0); + } if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { $CUSTOMER_DISPLAY_line1 = $prod->label; From 54c1e5c13894fb2d3925b72d430bc5331a862563 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 27 Jul 2022 11:41:31 +0200 Subject: [PATCH 3/4] FIX - php V8 form setup --- htdocs/core/class/html.formsetup.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 1cfddb588fd..92dec00d987 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1103,6 +1103,7 @@ class FormSetupItem $out.= $this->langs->trans("NorProspectNorCustomer"); } } elseif ($this->type == 'product') { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $product = new Product($this->db); $resprod = $product->fetch($this->fieldValue); if ($resprod > 0) { From 62f7b6791df25ed2655909aadd355cbdb75d3da8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Aug 2022 18:18:17 +0200 Subject: [PATCH 4/4] CSS --- htdocs/admin/tools/dolibarr_export.php | 10 ++++++---- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 1a68b17c3e0..9d91bb9ef50 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -168,9 +168,10 @@ print ''; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; print ''; print ''; -print ''; +print ''; print ''; + print ''; print ''; print ''; + print ''; -print '
'; @@ -196,10 +197,11 @@ print ''; print '
'; +print ''; print '
'; -print ' '.$langs->trans("ShowAdvancedOptions").''; +print ' '.$langs->trans("ShowAdvancedOptions").'...'; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3886651e8d5..078d485a5c9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -543,6 +543,7 @@ fieldset { border: 1px solid #AAAAAA !important; padding-inline-start: 2em; padding-inline-end: 2em; + min-inline-size: auto; } .legendforfieldsetstep { padding-bottom: 10px; } input#onlinepaymenturl, input#directdownloadlink { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6e423228df1..ca485fb0d5f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -725,6 +725,7 @@ fieldset { border: 1px solid #AAAAAA !important; padding-inline-start: 2em; padding-inline-end: 2em; + min-inline-size: auto; } .legendforfieldsetstep { padding-bottom: 10px; } input#onlinepaymenturl, input#directdownloadlink {