As you may see from the highlighted section, at a certain point aurore started to fetch my internal reference instead of the supplier’s reference although it exists.
Where you see 1000105, 1000108 and 1000073_85_S Dolibarr should have used the product’s supplier reference.
I checked if these references exist with this supplier and they are defined in the buying prices.
After this page in page 2 after 10 references it reverts to using the supplier’s references.
Any ideas?
OK guys. Just discovered.
Around line 478 where it reads:
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc);
it should have a 1 as the closing argument to pdf_writelinedesc:
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
Can anyone put this into github?
I am using Dolibarr 15.0.1 but this seems to be present in v16 still. I just checked the aurore php there.
Thanks,
ksar
September 29, 2022, 8:21pm
3
Hello,
It’s strange because there is the 1 at the end on the V15 branch :
// Description of product line
$curX = $this->posxdesc - 1;
$pdf->startTransaction();
if ($posYAfterImage > 0) {
$descWidth = $this->posxpicture - $curX;
} else {
$descWidth = $this->posxtva - $curX;
}
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
$pageposafter = $pdf->getPage();
if ($pageposafter > $pageposbefore) { // There is a pagebreak
$pdf->rollbackTransaction(true);
$pageposafter = $pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc);
$pageposafter = $pdf->getPage();
Sorry, I should have been more precise.
It is in line 478 (which is line 486 of your 15.0 repo I guess) of the latest version I am getting it from: dolibarr/pdf_aurore.modules.php at develop · Dolibarr/dolibarr · GitHub
If you put the “, 1” as the last argument of the pdf_writelinedesc in the if, the function will get the right references even if it gets near the end of page. I tried and it is working correctly now.
How did you do that highlighting in your post?
Cheers
ksar
September 29, 2022, 8:54pm
5
Need to add #Lnumber at the end of the link :
https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
#L478
}
$posYAfterDescription = $pdf->GetY();
$nexY = $pdf->GetY();
$pageposafter = $pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// We suppose that a too long description or photo were moved completely on next page
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
$pdf->setPage($pageposafter);
$curY = $tab_top_newpage;
}
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
PR is created : FIX : Supplier Reference is lost when page breaks by ksar-ksar · Pull Request #22461 · Dolibarr/dolibarr · GitHub
1 Like