diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle_reception.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle_reception.modules.php index 5b84dc0d1d0..639381890de 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle_reception.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle_reception.modules.php @@ -387,14 +387,22 @@ class pdf_canelle_reception extends ModelePDFSuppliersInvoices // Reception $reception_content = ''; - $object->lines[$i]->fetchObjectLinked(); - if (!empty($object->lines[$i]->linkedObjects['reception'])) - { - $reception = array_shift($object->lines[$i]->linkedObjects['reception']); - $reception_content = $reception->ref.' du '.date('d/m/Y', $reception->date_delivery); - + if(!empty($object->linkedObjects['reception'])){ + if(count($object->linkedObjects['reception']) == 1){ + $reception = array_shift($object->linkedObjects['reception']); + $reception_content = $reception->ref.' du '.date('d/m/Y', $reception->date_delivery); + }else { + $object->lines[$i]->fetchObjectLinked(); + if (!empty($object->lines[$i]->linkedObjects['reception'])) + { + $reception = array_shift($object->lines[$i]->linkedObjects['reception']); + $reception_content = $reception->ref.' du '.date('d/m/Y', $reception->date_delivery); + + } + } } + $pdf->SetXY($this->posxreception-5, $curY); $pdf->MultiCell($this->posxtva-$this->posxreception+4, 3, $reception_content, 0, 'R'); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 10c4b5585de..64374f563d3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1363,12 +1363,11 @@ class FactureFournisseur extends CommonInvoice * @param string $fk_unit Code of the unit to use. Null to use the default one * @param int $origin_id id origin document * @param double $pu_ht_devise Amount in currency - * @param string $ref_supplier Supplier ref * @return int >0 if OK, <0 if KO * * FIXME Add field ref (that should be named ref_supplier) and label into update. For example can be filled when product line created from order. */ - public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false, $array_options=0, $fk_unit=null, $origin_id=0, $pu_ht_devise=0,$ref_supplier='') + public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false, $array_options=0, $fk_unit=null, $origin_id=0, $pu_ht_devise=0) { dol_syslog(get_class($this)."::addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits,$price_base_type,$type,$fk_unit", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d6aa7a1871d..9594715b70f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -710,7 +710,7 @@ if (empty($reshook)) $lines[$i]->fk_unit, $lines[$i]->id ); - + if ($result < 0) { $error++; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 07608a365a4..502f1f6e1a6 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1860,7 +1860,7 @@ else if ($id || $ref) } else { - print '