From 2c7a78867847d532c5c5ad0c701f872389e5ad69 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Fri, 27 Aug 2021 11:09:10 +0800 Subject: [PATCH 01/97] Update shipment.php --- htdocs/expedition/shipment.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 42b8630bd3c..f9714039016 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -617,15 +617,17 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,"; $sql .= " cd.price, cd.tva_tx, cd.subprice,"; - $sql .= " cd.qty,"; + $sql .= " cd.qty, cd.fk_unit,"; $sql .= ' cd.date_start,'; $sql .= ' cd.date_end,'; $sql .= ' cd.special_code,'; $sql .= ' p.rowid as prodid, p.label as product_label, p.entity, p.ref, p.fk_product_type as product_type, p.description as product_desc,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,'; $sql .= ' p.surface, p.surface_units, p.volume, p.volume_units'; + $sql .= ', u.short_label as unit_order'; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units as u ON cd.fk_unit = u.rowid"; $sql .= " WHERE cd.fk_commande = ".((int) $object->id); $sql .= " ORDER BY cd.rang, cd.rowid"; @@ -761,7 +763,7 @@ if ($id > 0 || !empty($ref)) { } // Qty ordered - print ''.$objp->qty.''; + print ''.$objp->qty.' '.$objp->unit_order.''; // Qty already shipped $qtyProdCom = $objp->qty; @@ -769,7 +771,7 @@ if ($id > 0 || !empty($ref)) { // Nb of sending products for this line of order $qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0); print $qtyAlreadyShipped; - print ''; + print ' '.$objp->unit_order.''; // Qty remains to ship print ''; @@ -780,7 +782,7 @@ if ($id > 0 || !empty($ref)) { } else { print '0 ('.$langs->trans("Service").')'; } - print ''; + print ' '.$objp->unit_order.''; if ($objp->fk_product > 0) { $product = new Product($db); From 9914ebe90bcf37731cb96e94eca07558d84c914c Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 27 Aug 2021 10:21:02 +0200 Subject: [PATCH 02/97] add missing actions to admin page --- htdocs/admin/supplier_order.php | 5 ++++- htdocs/admin/supplier_payment.php | 2 ++ htdocs/fourn/commande/card.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 7cf64e4800d..98fe1c391ce 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -132,6 +132,8 @@ if ($action == 'updateMask') { if ($ret > 0) { $ret = addDocumentModel($value, $type, $label, $scandir); } +} elseif ($action == 'unsetdoc') { + dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity); } elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) { // Default print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"), 'on'); +// print img_picto($langs->trans("Default"), 'on'); + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 3f79b52eff3..4482373a2bd 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -89,6 +89,8 @@ if ($action == 'updateMask') { if ($ret > 0) { $ret = addDocumentModel($value, $type, $label, $scandir); } +} elseif ($action == 'unsetdoc') { + dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity); } elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ea356e189e..8afb77a3437 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2614,8 +2614,9 @@ if ($action == 'create') { $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $usercanread; $delallowed = $usercancreate; + $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->COMMANDE_SUPPLIER_ADDON_PDF)); - print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); + print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); $somethingshown = $formfile->numoffiles; // Show links to link elements From b48566eed853ab7a573d929c89edcea0184ec4ff Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 27 Aug 2021 08:27:04 +0000 Subject: [PATCH 03/97] Fixing style errors. --- htdocs/admin/supplier_order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 98fe1c391ce..26f0212f412 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) { // Default print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { -// print img_picto($langs->trans("Default"), 'on'); + // print img_picto($langs->trans("Default"), 'on'); print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; From c219b8f576bd69db74be6020afa58c0a859adc20 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:19:45 +0800 Subject: [PATCH 04/97] Update card.php --- htdocs/expedition/card.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 676a5cae22c..6c3e3748892 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,11 +1133,17 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } + + // unit of order + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($line->fk_unit); + } // Qty print ''.$line->qty; print ''; - print ''; + print ''.$unit_order.''; $qtyProdCom = $line->qty; // Qty already shipped @@ -1145,7 +1151,7 @@ if ($action == 'create') { $quantityDelivered = $object->expeditions[$line->id]; print $quantityDelivered; print ''; - print ''; + print ''.$unit_order.''; // Qty to ship $quantityAsked = $line->qty; @@ -2030,7 +2036,7 @@ if ($action == 'create') { // Get list of products already sent for same source object into $alreadysent $alreadysent = array(); if ($origin && $origin_id > 0) { - $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; + $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.fk_unit, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot"; $sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition"; //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; @@ -2149,9 +2155,14 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } + + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($lines[$i]->fk_unit); + } // Qty ordered - print ''.$lines[$i]->qty_asked.''; + print ''.$lines[$i]->qty_asked.' '.$unit_order.''; // Qty in other shipments (with shipment and warehouse used) if ($origin && $origin_id > 0) { @@ -2215,7 +2226,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2226,7 +2237,7 @@ if ($action == 'create') { foreach ($lines[$i]->details_entrepot as $detail_entrepot) { print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2241,7 +2252,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''; // Batch number managment @@ -2253,7 +2264,7 @@ if ($action == 'create') { print ''; } else { // Qty to ship or shipped - print ''.$lines[$i]->qty_shipped.''; + print ''.$lines[$i]->qty_shipped.' '.$unit_order.''; // Warehouse source if (!empty($conf->stock->enabled)) { From 74ed754fcc3a08cba815470ba01f9d33655c0019 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:22:25 +0000 Subject: [PATCH 05/97] Fixing style errors. --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6c3e3748892..7c30789ecb0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,7 +1133,7 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } - + // unit of order $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { @@ -2155,7 +2155,7 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } - + $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { $unit_order = measuringUnitString($lines[$i]->fk_unit); From 4ae29c53aa7678f031863828c35a8d4ba7ee69e5 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:30:05 +0800 Subject: [PATCH 06/97] Update pdf_espadon.modules.php --- .../expedition/doc/pdf_espadon.modules.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 28d797acffc..1d449dcccbd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,6 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } + + if ($this->getColumnStatus('unit_order')) { + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1311,6 +1316,20 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); + + $rank = $rank + 10; + $this->cols['unit_order'] = array( + 'rank' => $rank, + 'width' => 15, // in mm + 'status' => empty($conf->global->PRODUCT_USE_UNITS) ? 0 : 1, + 'title' => array( + 'textkey' => 'Unit' + ), + 'border-left' => true, // add left line separator + 'content' => array( + 'align' => 'C', + ), + ); $rank = $rank + 10; $this->cols['qty_shipped'] = array( From 3598e0a2464666d78fcb5497d17dbc8e8681ef38 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:32:07 +0000 Subject: [PATCH 07/97] Fixing style errors. --- .../modules/expedition/doc/pdf_espadon.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 1d449dcccbd..55180a33eb4 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,11 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } - + if ($this->getColumnStatus('unit_order')) { - $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); - $nexY = max($pdf->GetY(), $nexY); - } + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1316,7 +1316,7 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); - + $rank = $rank + 10; $this->cols['unit_order'] = array( 'rank' => $rank, From c4dd6be9f8685107242f10dfe11c5039980aec66 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 18:47:34 +0200 Subject: [PATCH 08/97] Add showdocument hook --- htdocs/core/class/html.formfile.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 591fb5ed2d1..a21ef8e3305 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -391,6 +391,20 @@ class FormFile global $langs, $conf, $user, $hookmanager; global $form; + $reshook = 0; + if (is_object($hookmanager)){ + $parameters = array(); ++ $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + // May report error + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + } + // Remode default action if $reskook > 0 + if ($reshook > 0) { + return ''; + } + if (!is_object($form)) { $form = new Form($this->db); } From 12be914d049f6f59c2735796305178f4056765cb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 21 Sep 2021 16:49:00 +0000 Subject: [PATCH 09/97] Fixing style errors. --- htdocs/core/class/html.formfile.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a21ef8e3305..d0d3717a1f1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -392,13 +392,13 @@ class FormFile global $form; $reshook = 0; - if (is_object($hookmanager)){ + if (is_object($hookmanager)) { $parameters = array(); -+ $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } + } } // Remode default action if $reskook > 0 if ($reshook > 0) { From fd911ff36fc1c76468e152aab95d943881f67a59 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:15:54 +0200 Subject: [PATCH 10/97] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d0d3717a1f1..f6f977d3058 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -394,7 +394,7 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { $parameters = array(); - + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 73b0d8079cae433cd04db9a7c41bb088fbad77c2 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:23:14 +0200 Subject: [PATCH 11/97] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d0d3717a1f1..8b954cc3d3a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -393,8 +393,26 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { - $parameters = array(); - + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + $parameters = array( + 'modulepart'=>&$modulepart, + 'modulesubdir'=>&$modulesubdir, + 'filedir'=>&$filedir, + 'urlsource'=>&$urlsource, + 'genallowed'=>&$genallowed, + 'delallowed'=>&$delallowed, + 'modelselected'=>&$modelselected, + 'allowgenifempty'=>&$allowgenifempty, + 'forcenomultilang'=>&$forcenomultilang, + 'noform'=>&$noform, + 'param'=>&$param, + 'title'=>&$title, + 'buttonlabel'=>&$buttonlabel, + 'codelang'=>&$codelang, + 'morepicto'=>&$morepicto, + 'hideifempty'=>&$hideifempty, + 'removeaction'=>&$removeaction + ); + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // Note that parameters may have been updated by hook // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 49fd1b761cff315d592efd04ed7f2c3b8be29928 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 21 Sep 2021 20:27:33 +0000 Subject: [PATCH 12/97] Fixing style errors. --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8b954cc3d3a..2e58c845e6b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -394,7 +394,7 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { $parameters = array( - 'modulepart'=>&$modulepart, + 'modulepart'=>&$modulepart, 'modulesubdir'=>&$modulesubdir, 'filedir'=>&$filedir, 'urlsource'=>&$urlsource, From c7ff60866a871af82322722b8d163a94be0f218d Mon Sep 17 00:00:00 2001 From: Stephan Steininger Date: Mon, 27 Sep 2021 10:04:59 +0200 Subject: [PATCH 13/97] load existing batch numbers for item within mrp consumtion --- htdocs/mrp/mo_production.php | 10 ++++++++-- htdocs/product/class/html.formproduct.class.php | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 84dab109b91..9bde31e2a53 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -945,7 +945,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) { $preselected = 0; } - print ''; + + $disable = 'disabled'; + if ( ($line->qty - $alreadyconsumed) > 0 ) + $disable = ''; + + print ''; if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { print ''; } @@ -967,7 +972,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($tmpproduct->status_batch) { $preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : ''); - print ''; + print ''.$formproduct->selectLotStock('', 'batch-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product,'','','','','','',1).''; + //print ''; } print ''; } diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 64517c25443..75e731873d1 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -536,10 +536,11 @@ class FormProduct * @param int $forcecombo 1=Force combo iso ajax select2 * @param array $events Events to add to select2 * @param string $morecss Add more css classes to HTML select + * @param int $use_baseval 1=uses batch as value within select * * @return string HTML select */ - public function selectLotStock($selected = '', $htmlname = 'batch_id', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200') + public function selectLotStock($selected = '', $htmlname = 'batch_id', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $use_baseval = 0) { global $conf, $langs; @@ -590,7 +591,11 @@ class FormProduct $label .= ' ('.$langs->trans("Stock").' '.$arraytypes['qty'].')'; } - $out .= '