From e9e5163789085544c9ae71cf4fb9e3be4d7f71bf Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 5 Aug 2022 17:43:33 +0200 Subject: [PATCH 01/18] yesno --- htdocs/core/class/html.formsetup.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 3ff36b356da..a6b4c96e7ad 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -835,7 +835,11 @@ class FormSetupItem } elseif ($this->type== 'color') { $out.= $this->generateInputFieldColor(); } elseif ($this->type == 'yesno') { - $out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); + if (!empty($conf->use_javascript_ajax)) { + $out.= ajax_constantonoff($this->confKey); + } else { + $out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); + } } elseif (preg_match('/emailtemplate:/', $this->type)) { $out.= $this->generateInputFieldEmailTemplate(); } elseif (preg_match('/category:/', $this->type)) { @@ -1057,7 +1061,15 @@ class FormSetupItem } elseif ($this->type== 'color') { $out.= $this->generateOutputFieldColor(); } elseif ($this->type == 'yesno') { - $out.= ajax_constantonoff($this->confKey); + if (!empty($conf->use_javascript_ajax)) { + $out.= ajax_constantonoff($this->confKey); + } else { + if ($this->confKey == 1) { + $out.= $this->langs('yes'); + } else { + $out.= $this->langs('no'); + } + } } elseif (preg_match('/emailtemplate:/', $this->type)) { include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($this->db); From 93fd5c9e7db2fb05ce7688b24dd7dc48d110da0d Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 5 Aug 2022 17:55:39 +0200 Subject: [PATCH 02/18] corection lang --- htdocs/core/class/html.formsetup.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index a6b4c96e7ad..87fc937429c 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1036,7 +1036,7 @@ class FormSetupItem */ public function generateOutputField() { - global $conf, $user; + global $conf, $user, $langs; if (!empty($this->fieldOverride)) { return $this->fieldOverride; @@ -1064,10 +1064,10 @@ class FormSetupItem if (!empty($conf->use_javascript_ajax)) { $out.= ajax_constantonoff($this->confKey); } else { - if ($this->confKey == 1) { - $out.= $this->langs('yes'); + if ($this->fieldValue == 1) { + $out.= $langs->trans('yes'); } else { - $out.= $this->langs('no'); + $out.= $langs->trans('no'); } } } elseif (preg_match('/emailtemplate:/', $this->type)) { From 9a780a25d8d95ded57cd7df828557ebf2a8b9822 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 11 Aug 2022 17:33:28 +0200 Subject: [PATCH 03/18] NEW show SellBy/EatBy dates for each batch product in shipment card --- htdocs/expedition/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c226ba927be..dd41274e81a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1526,6 +1526,12 @@ if ($action == 'create') { } else { print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed'; } + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); + } print ' ('.$dbatch->qty.')'; $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) { From dc0e5e8d893ede8039b8d34cec614fb8392a84d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Aug 2022 10:59:15 +0200 Subject: [PATCH 04/18] keep batch info when correcting stock --- .../product/stock/tpl/stockcorrection.tpl.php | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 08a66d1b8c6..eb927756263 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -41,6 +41,19 @@ if (empty($id)) { $id = $object->id; } +$pdluoid = GETPOST('pdluoid', 'int'); + +$pdluo = new Productbatch($db); + +if ($pdluoid > 0) { + $result = $pdluo->fetch($pdluoid); + if ($result > 0) { + $pdluoid = $pdluo->id; + } else { + dol_print_error($db, $pdluo->error, $pdluo->errors); + } +} + print '