diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d829a7c5ada..ccaa01b34cc 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -849,15 +849,22 @@ class BonPrelevement extends CommonObject foreach ($factures as $key => $fac) { $fact = new Facture($this->db); - if ($fact->fetch($fac[0]) >= 0) // Field 0 of $fac is rowid of invoice + $resfetch = $fact->fetch($fac[0]); + if ($resfetch >= 0) // Field 0 of $fac is rowid of invoice { if ($soc->fetch($fact->socid) >= 0) { $bac = new CompanyBankAccount($this->db); $bac->fetch(0, $soc->id); - if ($format == 'FRST' && $bac->frstrecur != 'FRST') continue; - if ($format == 'RCUR' && ($bac->frstrecur != 'RCUR' && $bac->frstrecur != 'RECUR')) continue; + if ($format == 'FRST' && $bac->frstrecur != 'FRST') + { + continue; + } + if ($format == 'RCUR' && ($bac->frstrecur != 'RCUR' && $bac->frstrecur != 'RECUR')) + { + continue; + } if ($bac->verif() >= 1) { @@ -865,28 +872,29 @@ class BonPrelevement extends CommonObject /* second tableau necessaire pour BonPrelevement */ $factures_prev_id[$i] = $fac[0]; $i++; + //dol_syslog(__METHOD__."::RIB is ok", LOG_DEBUG); } else { - dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR); + dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); $this->invoice_in_error[$fac[0]]="Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); $this->thirdparty_in_error[$soc->id]="Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } else { - dol_syslog(__METHOD__."::Check RIB Failed to read company", LOG_ERR); + dol_syslog(__METHOD__."::Check RIB Failed to read company", LOG_WARNING); } } else { - dol_syslog(__METHOD__."::Check RIB Failed to read invoice", LOG_ERR); + dol_syslog(__METHOD__."::Check RIB Failed to read invoice", LOG_WARNING); } } } else { - dol_syslog(__METHOD__."::Check RIB No invoice to process", LOG_ERR); + dol_syslog(__METHOD__."::Check RIB No invoice to process", LOG_WARNING); } } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index d9775250853..5177e8681b7 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -72,8 +72,7 @@ if ($action == 'create') } elseif ($result == 0) { - $mesg=''; - $mesg=$langs->trans("NoInvoiceCouldBeWithdrawed"); + $mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format); setEventMessages($mesg, null, 'errors'); $mesg.='
'."\n"; foreach($bprev->invoice_in_error as $key => $val) diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 6b1babf9d88..7b33ad15947 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -26,7 +26,7 @@ LastWithdrawalReceipt=Latest %s direct debit receipts MakeWithdrawRequest=Make a direct debit payment request WithdrawRequestsDone=%s direct debit payment requests recorded ThirdPartyBankCode=Third party bank code -NoInvoiceCouldBeWithdrawed=No invoice withdrawed with success. Check that invoice are on companies with a valid BAN. +NoInvoiceCouldBeWithdrawed=No invoice withdrawed with success. Check that invoices are on companies with a valid default BAN and that BAN has a RUM with mode %s. ClassCredited=Classify credited ClassCreditedConfirm=Are you sure you want to classify this withdrawal receipt as credited on your bank account? TransData=Transmission date