Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.44k stars 2.79k forks source link

pdf_sponge incomplete owner address #27671

Open prod-cnd opened 9 months ago

prod-cnd commented 9 months ago

Bug

On the pdf_sponge_modules.php (display an invoice), the information on check delivery is incomplete for the owner contact.

Environment Version

18.0.4

Environment OS

No response

Environment Web server

WAMP

Environment PHP

7.4.33

Environment Database

mysql 8.0.32

Environment URL(s)

Localhost

Expected and actual behavior

On the pdf_sponge_modules.php (display an invoice), the information on check delivery is complete when you configure Dolibarr by displaying the company's contact details, but when you request the owner contact, we retrieve the first and last name of the account holder and owner_address. However, the owner_zipand owner_townare missing

if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); $posy = $pdf->GetY() + 2; }

A function like getFullAddress() is missing but to display the full contact details of the owner entered in the Bank

In the meantime, I added in my invoicing model

$pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
$pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_zip).' '.$outputlangs->convToOutputCharset($account->owner_town), 0, 'L', 0);

Steps to reproduce the behavior

No response

Attached files

No response

JonBendtsen commented 8 months ago

I suppose you changed this file https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/core/modules/facture/doc/pdf_sponge.modules.php around line 1381 ?

Just 13 lines down under there is a getFullAddress used. Have you tried changing linie 1381 to something like this?

$pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->getFullAddress()), 0, 'L', 0);