Debug SEPA payment

This commit is contained in:
Laurent Destailleur 2023-08-10 12:57:31 +02:00
parent 8c99d538d4
commit df6b9947b0
7 changed files with 12 additions and 17 deletions

View File

@ -421,7 +421,7 @@ print '</td></tr>';
if (!empty($object->ext_payment_id)) {
// External payment ID
print '<tr><td class="tdtop">'.$langs->trans("StripeCustomerId").'</td><td>';
print '<tr><td class="tdtop">'.$langs->trans("StripePaymentId").'</td><td>';
if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) {
$tmp1 = explode('@', $object->ext_payment_id);
if (!empty($tmp1[1])) {

View File

@ -840,7 +840,7 @@ class BonPrelevement extends CommonObject
* @param string $executiondate Date to execute the transfer
* @param int $notrigger Disable triggers
* @param string $type 'direct-debit' or 'bank-transfer'
* @param int $did ID of an existing payment request. If $did is defined, no entry
* @param int $did ID of an existing payment request. If $did is defined, we use the existing payment request.
* @param int $fk_bank_account Bank account ID the receipt is generated for. Will use the ID into the setup of module Direct Debit or Credit Transfer if 0.
* @return int <0 if KO, No of invoice included into file if OK
*/

View File

@ -776,7 +776,7 @@ abstract class CommonInvoice extends CommonObject
* @param float $amount Amount we request direct debit or credit transfer for. If 0, the remain to pay will be calculated and used.
* @param string $type 'direct-debit' or 'bank-transfer'
* @param string $sourcetype Source ('facture' or 'supplier_invoice')
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, 0 if a request already exists, >0 if OK
*/
public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture')
{
@ -787,7 +787,7 @@ abstract class CommonInvoice extends CommonObject
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
if ($this->statut > self::STATUS_DRAFT && $this->paye == 0) {
if ($this->status > self::STATUS_DRAFT && $this->paye == 0) {
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db);
$bac->fetch(0, $this->socid);
@ -870,17 +870,17 @@ abstract class CommonInvoice extends CommonObject
return 1;
} else {
$this->error = "A request already exists";
dol_syslog(get_class($this).'::demandeprelevement Impossible de creer une demande, demande deja en cours');
dol_syslog(get_class($this).'::demandeprelevement Can t create a request to generate a direct debit, a request already exists.');
return 0;
}
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this).'::demandeprelevement Erreur -2');
dol_syslog(get_class($this).'::demandeprelevement Error -2');
return -2;
}
} else {
$this->error = "Status of invoice does not allow this";
dol_syslog(get_class($this)."::demandeprelevement ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id");
dol_syslog(get_class($this)."::demandeprelevement ".$this->error." $this->status, $this->paye, $this->mode_reglement_id");
return -3;
}
}
@ -927,7 +927,7 @@ abstract class CommonInvoice extends CommonObject
dol_syslog(get_class($this)."::makeStripeSepaRequest start", LOG_DEBUG);
if ($this->statut > self::STATUS_DRAFT && $this->paye == 0) {
if ($this->status > self::STATUS_DRAFT && $this->paye == 0) {
// Get the default payment mode for BAN payment of the third party
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db); // table societe_rib
@ -939,7 +939,7 @@ abstract class CommonInvoice extends CommonObject
return -1;
}
// Load the pending payment requests to process
// Load the pending payment request to process (with rowid=$did)
$sql = "SELECT rowid, date_demande, amount, fk_facture, fk_facture_fourn, fk_prelevement_bons";
$sql .= " FROM ".$this->db->prefix()."prelevement_demande";
$sql .= " WHERE rowid = ".((int) $did);
@ -1022,7 +1022,7 @@ abstract class CommonInvoice extends CommonObject
$bon = new BonPrelevement($this->db);
if (!$error) {
if (empty($obj->fk_prelevement_bons)) {
// This create record into llx_prelevment_bons and update link with llx_prelevement_demande
// This creates a record into llx_prelevement_bons and updates link with llx_prelevement_demande
$nbinvoices = $bon->create(0, 0, 'real', 'ALL', '', 0, $type, $did, $fk_bank_account);
if ($nbinvoices <= 0) {
$error++;

View File

@ -51,6 +51,7 @@ StripeAccount=Stripe account
StripeChargeList=List of Stripe charges
StripeTransactionList=List of Stripe transactions
StripeCustomerId=Stripe customer id
StripePaymentId=Stripe payment id
StripePaymentModes=Stripe payment modes
LocalID=Local ID
StripeID=Stripe ID

View File

@ -115,7 +115,7 @@ if (!$rowid) {
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("StripePaymentId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("StripeCustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);

View File

@ -107,9 +107,6 @@ if (!$rowid) {
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
//print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("DateOperation", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');

View File

@ -107,9 +107,6 @@ if (!$rowid) {
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
//print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');