From 07bca51a75bd4e9a79ea5490052ad1416b43a971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 14:07:15 +0200 Subject: [PATCH] Debug v18 - Length of amount in number too large --- .../doc/pdf_standard.modules.php | 24 ++++++++++--------- htdocs/fourn/paiement/card.php | 4 +++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 513cc95a8ee..d3b9681a63f 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -125,7 +125,6 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->posxtva = 90; $this->posxtotalttc = 180; - //if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if ($this->page_largeur < 210) { // To work with US executive format $this->posxreffacturefourn -= 20; $this->posxreffacture -= 20; @@ -208,12 +207,12 @@ class pdf_standard extends ModelePDFSuppliersPayments $file = $dir."/SPECIMEN.pdf"; } else { $objectref = dol_sanitizeFileName($object->ref); - $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); + //$objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->payment->dir_output.'/'.$objectref; $file = $dir."/".$objectref.".pdf"; - if (!empty($conf->global->SUPPLIER_REF_IN_NAME)) { - $file = $dir."/".$objectref.($objectrefsupplier ? "_".$objectrefsupplier : "").".pdf"; - } + //if (!empty($conf->global->SUPPLIER_REF_IN_NAME)) { + // $file = $dir."/".$objectref.($objectrefsupplier ? "_".$objectrefsupplier : "").".pdf"; + //} } if (!file_exists($dir)) { @@ -365,23 +364,23 @@ class pdf_standard extends ModelePDFSuppliersPayments // ref fourn $pdf->SetXY($this->posxreffacturefourn, $curY); - $pdf->MultiCell($this->posxreffacturefourn - $this->posxup - 0.8, 3, $object->lines[$i]->ref_supplier, 0, 'L', 0); + $pdf->MultiCell($this->posxreffacturefourn - 0.8, 3, $object->lines[$i]->ref_supplier, 0, 'L', 0); // ref facture fourn $pdf->SetXY($this->posxreffacture, $curY); - $pdf->MultiCell($this->posxreffacture - $this->posxup - 0.8, 3, $object->lines[$i]->ref, 0, 'L', 0); + $pdf->MultiCell($this->posxreffacture - 0.8, 3, $object->lines[$i]->ref, 0, 'L', 0); // type $pdf->SetXY($this->posxtype, $curY); - $pdf->MultiCell($this->posxtype - $this->posxup - 0.8, 3, $object->lines[$i]->type, 0, 'L', 0); + $pdf->MultiCell($this->posxtype - 0.8, 3, $object->lines[$i]->type, 0, 'L', 0); // Total ht $pdf->SetXY($this->posxtotalht, $curY); - $pdf->MultiCell($this->posxtotalht - $this->posxup - 0.8, 3, price($object->lines[$i]->total_ht), 0, 'R', 0); + $pdf->MultiCell($this->posxtotalht - 0.8, 3, price($object->lines[$i]->total_ht), 0, 'R', 0); // Total tva $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxtva - $this->posxup - 0.8, 3, price($object->lines[$i]->total_tva), 0, 'R', 0); + $pdf->MultiCell($this->posxtva - 0.8, 3, price($object->lines[$i]->total_tva), 0, 'R', 0); // Total TTC line $pdf->SetXY($this->posxtotalttc, $curY); @@ -787,6 +786,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); // Show default IBAN account + $iban = ''; $sql = "SELECT iban_prefix as iban"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as rib"; $sql .= " WHERE fk_soc = ".($object->thirdparty->id); @@ -796,7 +796,9 @@ class pdf_standard extends ModelePDFSuppliersPayments $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - $iban = $obj->iban; + if ($obj) { + $iban = $obj->iban; + } } if (!empty($iban)) { diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 381d17221fc..e2f03a33278 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -44,6 +44,8 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); +$socid = 0; + // Initialize objects $object = new PaiementFourn($db); @@ -397,7 +399,7 @@ if ($result > 0) { $delallowed = ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")); $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->SUPPLIER_PAYMENT_ADDON_PDF) ? '' : $conf->global->SUPPLIER_PAYMENT_ADDON_PDF)); - print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang); + print $formfile->showdocuments('supplier_payment', $ref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $object->thirdparty->default_lang); $somethingshown = $formfile->numoffiles; }