This commit is contained in:
Laurent Destailleur 2023-03-08 12:20:35 +01:00
parent 09a5f09e2a
commit c75dc107e7
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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');

View File

@ -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');