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
This commit is contained in:
iLLixM 2024-11-05 15:26:38 +01:00 committed by GitHub
parent 07f737cea4
commit 08714ea39b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();