2
0
forked from Wavyzz/dolibarr

Fix NNE has been replaced with ICS

This commit is contained in:
Laurent Destailleur
2016-07-02 11:26:55 +02:00
parent bdba5dce3a
commit 91d2d573c3
3 changed files with 24 additions and 34 deletions

View File

@@ -45,14 +45,6 @@ $action = GETPOST('action','alpha');
if ($action == "set")
{
$db->begin();
for ($i = 0 ; $i < 2 ; $i++)
{
$res = dolibarr_set_const($db, GETPOST("nom$i",'alpha'), GETPOST("value$i",'alpha'),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int');
$account = new Account($db);
@@ -78,6 +70,15 @@ if ($action == "set")
}
else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (GETPOST("PRELEVEMENT_USER") > 0)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
if (! $error)
{
$db->commit();
@@ -131,33 +132,25 @@ print '<td width="30%">'.$langs->trans("Parameter").'</td>';
print '<td width="40%">'.$langs->trans("Value").'</td>';
print "</tr>";
//User
print '<tr class="impair"><td>'.$langs->trans("ResponsibleUser").'</td>';
print '<td align="left">';
print '<input type="hidden" name="nom0" value="PRELEVEMENT_USER">';
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'value0', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td>';
print '</tr>';
//Profid1 of Transmitter
print '<tr class="pair"><td>'.$langs->trans("NumeroNationalEmetter").' - '.$langs->transcountry('ProfId1',$mysoc->country_code).'</td>';
print '<td align="left">';
print '<input type="hidden" name="nom1" value="PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR">';
print '<input type="text" name="value1" value="'.$conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR.'" size="9" ></td>';
print '</tr>';
// Bank account (from Banks module)
print '<tr class="impair"><td>'.$langs->trans("BankToReceiveWithdraw").'</td>';
print '<tr class="impair"><td class="fieldrequired">'.$langs->trans("BankToReceiveWithdraw").'</td>';
print '<td align="left">';
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1);
print '</td></tr>';
// ICS
print '<tr class="pair"><td>'.$langs->trans("ICS").'</td>';
print '<tr class="pair"><td class="fieldrequired">'.$langs->trans("ICS").'</td>';
print '<td align="left">';
print '<input type="text" name="PRELEVEMENT_ICS" value="'.$conf->global->PRELEVEMENT_ICS.'" size="9" ></td>';
print '</td></tr>';
//User
print '<tr class="impair"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
print '<td align="left">';
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td>';
print '</tr>';
print '</table>';
print '<br>';

View File

@@ -87,8 +87,6 @@ class BonPrelevement extends CommonObject
$this->factures = array();
$this->numero_national_emetteur = "";
$this->methodes_trans = array();
$this->methodes_trans[0] = "Internet";
@@ -1018,7 +1016,6 @@ class BonPrelevement extends CommonObject
$this->date_echeance = $datetimeprev;
$this->reference_remise = $ref;
$this->numero_national_emetteur = $conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR;
$this->raison_sociale = $conf->global->PRELEVEMENT_RAISON_SOCIALE;
$this->emetteur_code_banque = $conf->global->PRELEVEMENT_CODE_BANQUE;
@@ -1027,7 +1024,7 @@ class BonPrelevement extends CommonObject
$this->emetteur_number_key = $conf->global->PRELEVEMENT_NUMBER_KEY;
$this->emetteur_iban = $conf->global->PRELEVEMENT_IBAN;
$this->emetteur_bic = $conf->global->PRELEVEMENT_BIC;
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // TODO Add this into setup of admin/prelevement.php. Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
$this->factures = $factures_prev_id;
@@ -1462,7 +1459,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, " "); // Zone Reservee B2
fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3
fputs($this->file, $this->emetteur_ics); // ICS
// Date d'echeance C1
@@ -1611,7 +1608,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, " "); // Zone Reservee B2
fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3
fputs($this->file, $this->emetteur_ics); // ICS
// Date d'echeance C1
@@ -1778,7 +1775,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, " "); // Zone Reservee B2
fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3
fputs($this->file, $this->emetteur_ics); // ICS
// Reserve C1

View File

@@ -78,9 +78,9 @@ function prelevement_prepare_head(BonPrelevement $object)
function prelevement_check_config()
{
global $conf;
if(empty($conf->global->PRELEVEMENT_USER)) return -1;
if(empty($conf->global->PRELEVEMENT_ID_BANKACCOUNT)) return -1;
if(empty($conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR)) return -1;
if(empty($conf->global->PRELEVEMENT_ICS)) return -1;
if(empty($conf->global->PRELEVEMENT_USER)) return -1;
return 0;
}