From 5fe1763043ea0ec6a7c04f61f5bd44a332860ea9 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 12 Jul 2023 02:52:10 +0200
Subject: [PATCH 1/4] Fix missing mandatory legal date
---
htdocs/langs/en_US/main.lang | 1 +
htdocs/takepos/receipt.php | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 978d5a92268..b4745e1b919 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1218,3 +1218,4 @@ ExternalUser=External user
NoSpecificContactAddress=No specific contact or address
NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the thirdparty is not enough or not accurate.
TreeView=Tree view
+DateOfPrinting=Date of printing
\ No newline at end of file
diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php
index 9d43c2f46a6..aae77adee5c 100644
--- a/htdocs/takepos/receipt.php
+++ b/htdocs/takepos/receipt.php
@@ -135,7 +135,7 @@ if ($object->statut == Facture::STATUS_DRAFT) {
} else {
print $object->ref;
}
-if ($conf->global->TAKEPOS_SHOW_CUSTOMER) {
+if (!empty($conf->global->TAKEPOS_SHOW_CUSTOMER)) {
if ($object->socid != getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"])) {
$soc = new Societe($db);
if ($object->socid > 0) {
@@ -146,6 +146,9 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) {
print "
".$langs->trans("Customer").': '.$soc->name;
}
}
+if (!empty($conf->global->TAKEPOS_SHOW_DATE_OF_PRINING)) {
+ print "
".$langs->trans("DateOfPrinting").': '.dol_print_date(dol_now(), 'dayhour', 'tzuserrel').'
';
+}
?>
From 45b393f027f7854d674f2126462d5e5eaba55ee5 Mon Sep 17 00:00:00 2001
From: atm-greg <30891670+atm-greg@users.noreply.github.com>
Date: Wed, 12 Jul 2023 14:25:30 +0200
Subject: [PATCH 2/4] Fix 17 mrp pdf vinci (#25324)
* fix htmlentities in desc + posy on multiline
* fix tes productToMake fetch and display info after that + remove useless product ReFetch
---
.../modules/mrp/doc/pdf_vinci.modules.php | 57 ++++++++++---------
1 file changed, 31 insertions(+), 26 deletions(-)
diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
index c5dc9dd8b19..362faa4cd8e 100644
--- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
+++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
@@ -1168,35 +1168,40 @@ class pdf_vinci extends ModelePDFMo
}
// product info
- $posy += 7;
- $prodToMake = new Product($this->db);
- $prodToMake->fetch($object->fk_product);
- $pdf->SetFont('', 'B', $default_font_size + 1);
- $pdf->SetXY($posx, $posy);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($w, 3, $prodToMake->ref, '', 'R');
+ $prodToMake = new Product($this->db);
+ $resProdToMake = $prodToMake->fetch($object->fk_product);
- $posy += 5;
- $prodToMake = new Product($this->db);
- $prodToMake->fetch($object->fk_product);
- $pdf->SetFont('', 'B', $default_font_size + 3);
- $pdf->SetXY($posx, $posy);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($w, 3, $prodToMake->description, '', 'R');
+ if ($resProdToMake > 0)
+ {
+ // ref
+ $posy += 7;
+ $pdf->SetFont('', 'B', $default_font_size + 1);
+ $pdf->SetXY($posx, $posy);
+ $pdf->SetTextColor(0, 0, 60);
+ $pdf->MultiCell($w, 3, $prodToMake->ref, '', 'R');
- $array = array_filter(array($prodToMake->length, $prodToMake->width, $prodToMake->height));
- $dim = implode("x", $array);
- if (!empty($dim)) {
- $posy += 5;
- $pdf->SetFont('', 'B', $default_font_size + 3);
- $pdf->SetXY($posx, $posy);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($w, 3, $dim, '', 'R');
- }
+ // description
+ $posy += 5;
+ $pdf->SetFont('', 'B', $default_font_size + 3);
+ $pdf->SetXY($posx, $posy);
+ $pdf->SetTextColor(0, 0, 60);
+ $pdf->MultiCell($w, 3, html_entity_decode($prodToMake->description), '', 'R');
+ $posy = $pdf->GetY() - 5;
- $posy += 5;
- $prodToMake = new Product($this->db);
- $prodToMake->fetch($object->fk_product);
+ // dimensions
+ $array = array_filter(array($prodToMake->length, $prodToMake->width, $prodToMake->height));
+ $dim = implode("x", $array);
+ if (!empty($dim)) {
+ $posy += 5;
+ $pdf->SetFont('', 'B', $default_font_size + 3);
+ $pdf->SetXY($posx, $posy);
+ $pdf->SetTextColor(0, 0, 60);
+ $pdf->MultiCell($w, 3, $dim, '', 'R');
+ }
+
+ }
+
+ $posy += 5;
$pdf->SetFont('', 'B', $default_font_size + 3);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
From 9044952f5c2b2d8a84fb5dab15cf7facd29f7de3 Mon Sep 17 00:00:00 2001
From: lvessiller-opendsi
Date: Wed, 12 Jul 2023 14:32:45 +0200
Subject: [PATCH 3/4] FIX dol_print_error parameters on ticket fetch method
(#25318)
---
htdocs/ticket/class/ticket.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index cbb2e04fcf7..43136c50ec2 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -557,7 +557,7 @@ class Ticket extends CommonObject
// Check parameters
if (empty($id) && empty($ref) && empty($track_id) && empty($email_msgid)) {
$this->error = 'ErrorWrongParameters';
- dol_print_error(get_class($this)."::fetch ".$this->error);
+ dol_print_error('', get_class($this)."::fetch ".$this->error);
return -1;
}
From 76d6a30d4809095d71cd01de3aaee3eada50646f Mon Sep 17 00:00:00 2001
From: Regis Houssin
Date: Wed, 12 Jul 2023 16:30:34 +0200
Subject: [PATCH 4/4] FIX to avoid wrong path of file (#25320)
---
htdocs/core/class/html.formmail.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 74f0eadfdf2..21d7f071043 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -808,7 +808,7 @@ class FormMail extends Form
$relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val)));
if ($conf->entity > 1) {
- $relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile);
+ $relativepathtofile = str_replace('/'.$conf->entity.'/', '/', $relativepathtofile);
}
// Try to extract data from full path
$formfile_params = array();