Merge pull request #21655 from rycks/14.0-add_account_number_on_invoices_for_debit

NEW #21654: add bank account number used on invoices for debit
This commit is contained in:
Laurent Destailleur 2022-08-23 15:46:59 +02:00 committed by GitHub
commit 83ace0cb12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -1163,6 +1163,14 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
//#21654: add account number used for the debit
if ($object->mode_reglement_code == "PRE") {
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db);
$bac->fetch(0, $object->thirdparty->id);
$iban= $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
$lib_mode_reg .= $langs->trans("PaymentTypePREdetails", dol_trunc($iban, 6, 'right', 'UTF-8', 1));
}
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$posy = $pdf->GetY();

View File

@ -1271,6 +1271,16 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
//#21654: add account number used for the debit
if ($object->mode_reglement_code == "PRE") {
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db);
$bac->fetch(0, $object->thirdparty->id);
$iban= $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
$lib_mode_reg .= $langs->trans("PaymentTypePREdetails", dol_trunc($iban, 6, 'right', 'UTF-8', 1));
}
$pdf->MultiCell($posxend - $posxval, 5, $lib_mode_reg, 0, 'L');
$posy = $pdf->GetY();
@ -1291,6 +1301,7 @@ class pdf_sponge extends ModelePDFFactures
}
}
if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
global $langs;

View File

@ -446,6 +446,7 @@ ErrorPaymentConditionsNotEligibleToDepositCreation=The chose payment conditions
PaymentTypeVIR=Bank transfer
PaymentTypeShortVIR=Bank transfer
PaymentTypePRE=Direct debit payment order
PaymentTypePREdetails=(on account *-%s)
PaymentTypeShortPRE=Debit payment order
PaymentTypeLIQ=Cash
PaymentTypeShortLIQ=Cash
@ -620,4 +621,4 @@ NoPaymentAvailable=No payment available for %s
PaymentRegisteredAndInvoiceSetToPaid=Payment registered and invoice %s set to paid
SendEmailsRemindersOnInvoiceDueDate=Send reminder by email for unpaid invoices
MakePaymentAndClassifyPayed=Record payment
BulkPaymentNotPossibleForInvoice=Bulk payment is not possible for invoice %s (bad type or status)
BulkPaymentNotPossibleForInvoice=Bulk payment is not possible for invoice %s (bad type or status)

View File

@ -437,6 +437,7 @@ VarAmountAllLines=Montant variable (%% tot.) - toutes les lignes identiques
PaymentTypeVIR=Virement bancaire
PaymentTypeShortVIR=Virement bancaire
PaymentTypePRE=Ordre de prélèvement
PaymentTypePREdetails=(compte *-%s)
PaymentTypeShortPRE=Ordre de prélèvement
PaymentTypeLIQ=Espèce
PaymentTypeShortLIQ=Espèce