Merge pull request #17739 from fbosman/patch-6

Update card.php
This commit is contained in:
Laurent Destailleur 2021-06-04 12:57:51 +02:00 committed by GitHub
commit bcd028c040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2232,6 +2232,14 @@ if (empty($reshook)) {
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
setEventMessages($mesg, null, 'errors');
} else {
// Add batchinfo if the detail_batch array is defined
if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) {
$langs->load('productbatch');
foreach ($lines[$i]->detail_batch as $batchline) {
$desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' ';
}
}
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise);