From 3b0ccddaea5bf75c332a75344601d5abe904fa3d Mon Sep 17 00:00:00 2001 From: iLLixM <162678117+iLLixM@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:37:48 +0100 Subject: [PATCH] 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 --- htdocs/adherents/class/adherent.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4c5703e4540..a113d6f0970 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -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();