Skip to content

Commit

Permalink
FIX: PHP warning and no lost hyphen in supplier invoice if date_recep…
Browse files Browse the repository at this point in the history
…tion is empty (Dolibarr#30176)
  • Loading branch information
altairis-noe authored Jun 29, 2024
1 parent 55bc8b7 commit 3e95e31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/reception/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
// Add all links of this new reception to the existing invoice
$objecttmp->fetchObjectLinked();
$rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['order_supplier']) > 0) {
if (!empty($rcp->linkedObjectsIds['order_supplier']) && is_array($rcp->linkedObjectsIds['order_supplier'])) {
foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) {
if (empty($objecttmp->linkedObjectsIds['order_supplier']) || !in_array($value, $objecttmp->linkedObjectsIds['order_supplier'])) { //Don't try to link if already linked
$objecttmp->add_object_linked('order_supplier', $value); // add supplier order linked object
Expand Down Expand Up @@ -405,7 +405,8 @@
$desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
// If we build one invoice for several reception, we must put the ref of reception on the invoice line
if (!empty($createbills_onebythird)) {
$desc = dol_concatdesc($desc, $langs->trans("Reception").' '.$rcp->ref.' - '.dol_print_date($rcp->date, 'day'));
$desc = dol_concatdesc($desc, $langs->trans("Reception").' '.$rcp->ref);
$desc .= (!empty($rcp->date_reception) ? ' - '.dol_print_date($rcp->date_reception, 'day') : '');
}

if ($lines[$i]->subprice < 0) {
Expand Down

0 comments on commit 3e95e31

Please sign in to comment.