FIX Debug reception module

This commit is contained in:
Laurent Destailleur 2021-05-10 11:53:19 +02:00
parent ed18045807
commit a2cd181435
3 changed files with 19 additions and 4 deletions

View File

@ -1233,7 +1233,7 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w,
/**
* Output line description into PDF
*
* @param TCPDF $pdf PDF object
* @param TCPDF $pdf PDF object
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object lang for output

View File

@ -388,6 +388,18 @@ class pdf_squille extends ModelePdfReception
// Description of product line
$curX = $this->posxdesc - 1;
// The desc of line is not store into reception, so we force it to the value of product.
/*
if (empty($object->lines[0]->desc)) {
// TODO We must get value from fk_commendefourndet
$sqldesc = 'SELECT description FROM '.MAIN_DB_PREFIX.' WHERE rowid = '.((int) $object->lines[0]->fk_commandefourndet);
$resqldesc = $this->db->query($sqldesc);
if ($resqldesc) {
$objdesc = $this->db->fetch_object($resqldesc);
$object->lines[0]->desc = $objdesc->description;
}
}*/
$pdf->startTransaction();
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc);

View File

@ -1043,13 +1043,15 @@ class Reception extends CommonObject
$line = new CommandeFournisseurDispatch($this->db);
$line->fetch($obj->rowid);
$line->fetch_product();
$sql_commfourndet = 'SELECT qty, ref, label, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent FROM llx_commande_fournisseurdet WHERE rowid='.$line->fk_commandefourndet;
$sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent';
$sql_commfourndet .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet';
$sql_commfourndet .= ' WHERE rowid = '.((int) $line->fk_commandefourndet);
$resql_commfourndet = $this->db->query($sql_commfourndet);
if (!empty($resql_commfourndet)) {
$obj = $this->db->fetch_object($resql_commfourndet);
$line->qty_asked = $obj->qty;
$line->description = $line->comment;
$line->desc = $line->comment;
$line->description = $obj->description;
$line->desc = $obj->description;
$line->tva_tx = $obj->tva_tx;
$line->vat_src_code = $obj->vat_src_code;
$line->subprice = $obj->subprice;
@ -1060,6 +1062,7 @@ class Reception extends CommonObject
} else {
$line->qty_asked = 0;
$line->description = '';
$line->desc = '';
$line->label = $obj->label;
}