FIX Must use the ICS and not IDS bu default
This commit is contained in:
parent
423837a750
commit
1d69089702
2 changed files with 7 additions and 11 deletions
|
|
@ -835,7 +835,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
if (isModEnabled('paymentbybanktransfer')) {
|
||||
if (getDolGlobalString("SEPA_USE_IDS")) { // ICS is not used with bank transfer !
|
||||
if (getDolGlobalString("SEPA_USE_IDS")) { // Use another ICS for bank transfer
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>';
|
||||
print '<td>'.$object->ics_transfer.'</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ class BonPrelevement extends CommonObject
|
|||
// Add payment of withdrawal into bank
|
||||
$fk_bank_account = $this->fk_bank_account;
|
||||
if (empty($fk_bank_account)) {
|
||||
$fk_bank_account = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$fk_bank_account = ($this->type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
}
|
||||
|
||||
$facs = array();
|
||||
|
|
@ -878,8 +878,6 @@ class BonPrelevement extends CommonObject
|
|||
public function NbFactureAPrelever($type = 'direct-debit', $forsalary = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
if ($forsalary == 1) {
|
||||
$sql = "SELECT count(s.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
|
|
@ -977,7 +975,7 @@ class BonPrelevement extends CommonObject
|
|||
|
||||
// Clean params
|
||||
if (empty($fk_bank_account)) {
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
|
@ -1351,7 +1349,7 @@ class BonPrelevement extends CommonObject
|
|||
$this->emetteur_iban = $account->iban;
|
||||
$this->emetteur_bic = $account->bic;
|
||||
|
||||
$this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics);
|
||||
$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456"
|
||||
|
||||
$this->raison_sociale = $account->proprio;
|
||||
}
|
||||
|
|
@ -1682,7 +1680,7 @@ class BonPrelevement extends CommonObject
|
|||
|
||||
// Clean params
|
||||
if (empty($fk_bank_account)) {
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
}
|
||||
|
||||
$result = 0;
|
||||
|
|
@ -2372,8 +2370,6 @@ class BonPrelevement extends CommonObject
|
|||
public function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST', $type = 'direct-debit', $fk_bank_account = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
// SEPA INITIALISATION
|
||||
global $conf;
|
||||
|
||||
// Clean parameters
|
||||
$dateTime_YMD = dol_print_date($ladate, '%Y%m%d');
|
||||
|
|
@ -2382,7 +2378,7 @@ class BonPrelevement extends CommonObject
|
|||
|
||||
// Clean params
|
||||
if (empty($fk_bank_account)) {
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
$fk_bank_account = ($type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
}
|
||||
|
||||
// Get data of bank account
|
||||
|
|
@ -2396,7 +2392,7 @@ class BonPrelevement extends CommonObject
|
|||
$this->emetteur_iban = $account->iban;
|
||||
$this->emetteur_bic = $account->bic;
|
||||
|
||||
$this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
||||
$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
||||
|
||||
$this->raison_sociale = $account->proprio;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue