From c1aecd2bfe8d6ce2d104bba1049e6794e63003fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Mar 2023 10:39:28 +0100 Subject: [PATCH 1/2] fix warning --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 2cc9094176a..b8663dfe40f 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1023,7 +1023,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Get list of remote payment modes $listofsources = array(); - if (is_object($stripe)) { + if (isset($stripe) && is_object($stripe)) { try { $customerstripe = $stripe->customerStripe($object, $stripeacc, $servicestatus); if (!empty($customerstripe->id)) { From aec3e151ab10abf27444a2ed21ed5b3aec7e5de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Mar 2023 10:47:15 +0100 Subject: [PATCH 2/2] fix warnings --- htdocs/societe/paymentmodes.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index b8663dfe40f..93ec01e0524 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -155,7 +155,7 @@ if (empty($reshook)) { } if (!$error) { - $companybankaccount->old = dol_clone($companybankaccount); + $companybankaccount->oldcopy = dol_clone($companybankaccount); $companybankaccount->socid = $object->id; @@ -196,8 +196,8 @@ if (empty($reshook)) { $companybankaccount->setAsDefault($id); // This will make sure there is only one default rib } - if ($companypaymentmode->old->stripe_card_ref != $companypaymentmode->stripe_card_ref) { - if ($companybankaccount->old->iban != $companybankaccount->iban) { + if ($companypaymentmode->oldcopy->stripe_card_ref != $companypaymentmode->stripe_card_ref) { + if ($companybankaccount->oldcopy->iban != $companybankaccount->iban) { // TODO If we modified the iban, we must also update the pm_ on Stripe side, or break the link completely ? } } @@ -229,7 +229,7 @@ if (empty($reshook)) { $companypaymentmode->fetch($id); if (!$error) { - $companybankaccount->old = dol_clone($companybankaccount); + $companybankaccount->oldcopy = dol_clone($companybankaccount); $companypaymentmode->fk_soc = $object->id; @@ -258,8 +258,8 @@ if (empty($reshook)) { $companypaymentmode->setAsDefault($id); // This will make sure there is only one default rib } - if ($companypaymentmode->old->stripe_card_ref != $companypaymentmode->stripe_card_ref) { - if ($companybankaccount->old->number != $companybankaccount->number) { + if ($companypaymentmode->oldcopy->stripe_card_ref != $companypaymentmode->stripe_card_ref) { + if ($companybankaccount->oldcopy->number != $companybankaccount->number) { // TODO If we modified the card, we must also update the pm_ on Stripe side, or break the link completely ? } } @@ -306,7 +306,7 @@ if (empty($reshook)) { $companybankaccount->rum = GETPOST('rum', 'alpha'); $companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth', 'int'), GETPOST('date_rumday', 'int'), GETPOST('date_rumyear', 'int')); $companybankaccount->datec = dol_now(); - $companybankaccount->status = 1; + $companybankaccount->status = 1; $companybankaccount->bank = trim($companybankaccount->bank); if (empty($companybankaccount->bank) && !empty($companybankaccount->thirdparty)) {