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:
parent
c9972f1dd9
commit
3b0ccddaea
1 changed files with 5 additions and 1 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue