set payment method information on new membership subscriptions (#31750)

When creating new membership subscriptions and choosing to create an invoice (for linked thirdparty), existing payment method information of the customer should be used.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
iLLixM 2024-11-12 03:37:48 +01:00 committed by GitHub
parent c9972f1dd9
commit 3b0ccddaea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1836,13 +1836,17 @@ class Adherent extends CommonObject
}
}
$invoice->socid = $this->fk_soc;
// set customer's bank account on the invoice
// set customer's payment 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');
}
//set customer's payment method on the invoice
if (!empty($customer->mode_reglement_id)) {
$invoice->mode_reglement_id = $customer->mode_reglement_id;
}
//$invoice->date = $datesubscription;
$invoice->date = dol_now();