diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index deaa78397c8..3618817e19a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -426,6 +426,7 @@ class BonPrelevement extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set direct debit or credit transfer order to "paid" status. + * Then create the payment for each invoice of the prelemevement_bon. * * @param User $user Id of user * @param int $date date of action diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2d11218ee48..04d0f290732 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1910,7 +1910,7 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) { setEventMessages($result, null, 'errors'); $error++; } else { - /* TODO ALI Header reidrect must be at end after actions. Also tab=pemrissions looks strange + /* TODO ALI Header redirect must be at end after actions. Also tab=pemrissions looks strange header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); */ setEventMessages($langs->trans('WarningModuleNeedRefrech', $langs->transnoentities($module)), null, 'warnings'); diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 7a956e07ec5..9b33f5f39dd 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -345,8 +345,6 @@ if ($event->type == 'payout.created') { // TODO LMR Enable this only if this is a payment of a Dolibarr llx_prelevement_demande only - // TODO LMR The payment ID is $event->data->latest_charge. check that payment does not exists (it may have been created by Dolibarr) to avoid to create payment twice. - $paiement = new Paiement($db); $paiement->datepaye = $now; $paiement->date = $now; @@ -369,6 +367,10 @@ if ($event->type == 'payout.created') { $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe' if test + + $db->begin(); + + if (!$errorforinvoice) { dol_syslog('* Record payment for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document');