From 08714ea39b78816ae7e5770f33ea458bdeda26a0 Mon Sep 17 00:00:00 2001 From: iLLixM <162678117+iLLixM@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:26:38 +0100 Subject: [PATCH] New: set bank account information to invoice on new membership subscriptions (#31688) * set bank account information on new membership subscriptions When creating new membership subscriptions and choosing to create an invoice, existing bank account information should be used. * (fix phpstan) set bank account on new membership subscriptions set bank account information on new membership subscriptions When creating new membership subscriptions and choosing to create an invoice, existing bank account information should be used. Added --- htdocs/adherents/class/adherent.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 96a9cf398e4..4c5703e4540 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1836,6 +1836,13 @@ class Adherent extends CommonObject } } $invoice->socid = $this->fk_soc; + // set customer's bank account on the invoice + if (!empty($customer->fk_account)) { + $invoice->fk_account = $customer->fk_account; + } elseif (getDolGlobalString('FACTURE_RIB_NUMBER')) { + // set default bank account from invoice module settings + $invoice->fk_account = (int) getDolGlobalString('FACTURE_RIB_NUMBER'); + } //$invoice->date = $datesubscription; $invoice->date = dol_now();