Fix: [ bug #1166 ] Supplier account number in its card does not respect
order set in Banks module.
This commit is contained in:
parent
45b1273992
commit
6c26684284
@ -177,13 +177,13 @@ while ($i < $nbofbank)
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print img_picto($langs->trans("Activated"),'on');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&value='.$i.'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print img_picto($langs->trans("Disabled"),'off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
|
||||
@ -131,7 +131,7 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -171,38 +171,71 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
$img=picto_from_langcode($account->country_code);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($account->getCountryCode(),0,$db);
|
||||
print getCountry($account->getCountryCode(), 0, $db);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ibankey="IBANNumber";
|
||||
@ -310,38 +343,77 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
|
||||
if ($account->type == 0 || $account->type == 1)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
$img=picto_from_langcode($account->country_code);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($account->getCountryCode(), 0, $db);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// If bank account
|
||||
print '<tr><td valign="top">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// BBAN
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ibankey="IBANNumber";
|
||||
@ -361,10 +433,6 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
print getCountry($account->getCountryCode());
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$account->proprio.'">';
|
||||
print '</td></tr>';
|
||||
@ -376,11 +444,15 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
|
||||
}
|
||||
|
||||
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Save").'" type="submit" class="button">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div align="center">';
|
||||
print '<input value="'.$langs->trans("Save").'" type="submit" class="button">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -234,7 +234,6 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
|
||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print "<br>";
|
||||
|
||||
|
||||
/*
|
||||
@ -242,7 +241,7 @@ print "<br>";
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">'."\n";
|
||||
if ($user->rights->banque->configurer)
|
||||
if ($user->rights->banque->configurer)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>';
|
||||
}
|
||||
|
||||
@ -92,37 +92,55 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
|
||||
if ($action == 'add' && ! $_POST["cancel"])
|
||||
{
|
||||
// Ajout
|
||||
$account = new CompanyBankAccount($db);
|
||||
$error=0;
|
||||
|
||||
$account->socid = $soc->id;
|
||||
if (! GETPOST('label'))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Label')),'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
if (! GETPOST('bank'))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('BankName')),'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
$account->bank = $_POST["bank"];
|
||||
$account->label = $_POST["label"];
|
||||
$account->courant = $_POST["courant"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
$account->code_guichet = $_POST["code_guichet"];
|
||||
$account->number = $_POST["number"];
|
||||
$account->cle_rib = $_POST["cle_rib"];
|
||||
$account->bic = $_POST["bic"];
|
||||
$account->iban_prefix = $_POST["iban_prefix"];
|
||||
$account->domiciliation = $_POST["domiciliation"];
|
||||
$account->proprio = $_POST["proprio"];
|
||||
$account->owner_address = $_POST["owner_address"];
|
||||
if (! $error)
|
||||
{
|
||||
// Ajout
|
||||
$account = new CompanyBankAccount($db);
|
||||
|
||||
$result = $account->update($user); // TODO Use create and include update into create method
|
||||
if (! $result)
|
||||
{
|
||||
$message=$account->error;
|
||||
$_GET["action"]='create'; // Force chargement page création
|
||||
}
|
||||
else
|
||||
{
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
}
|
||||
$account->socid = $soc->id;
|
||||
|
||||
$account->bank = $_POST["bank"];
|
||||
$account->label = $_POST["label"];
|
||||
$account->courant = $_POST["courant"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
$account->code_guichet = $_POST["code_guichet"];
|
||||
$account->number = $_POST["number"];
|
||||
$account->cle_rib = $_POST["cle_rib"];
|
||||
$account->bic = $_POST["bic"];
|
||||
$account->iban_prefix = $_POST["iban_prefix"];
|
||||
$account->domiciliation = $_POST["domiciliation"];
|
||||
$account->proprio = $_POST["proprio"];
|
||||
$account->owner_address = $_POST["owner_address"];
|
||||
|
||||
$result = $account->update($user); // TODO Use create and include update into create method
|
||||
if (! $result)
|
||||
{
|
||||
$message=$account->error;
|
||||
$_GET["action"]='create'; // Force chargement page création
|
||||
}
|
||||
else
|
||||
{
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setasdefault')
|
||||
@ -203,35 +221,68 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
print '<tr><td>'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<td colspan="4">'.$account->label.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top" width="35%">'.$langs->trans("Bank").'</td>';
|
||||
print '<tr><td valign="top" width="35%">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="4">'.$account->bank.'</td></tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_guichet.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td colspan="3">'.$account->code_banque.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td colspan="3">'.$account->number.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td colspan="3">'.$account->cle_rib.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
@ -255,7 +306,7 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
print '</table>';
|
||||
|
||||
// Check BBAN
|
||||
if (! checkBanForAccount($account))
|
||||
if ($account->label && ! checkBanForAccount($account))
|
||||
{
|
||||
print '<div class="warning">'.$langs->trans("RIBControlError").'</div>';
|
||||
}
|
||||
@ -327,11 +378,8 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer)
|
||||
if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
{
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
print '<form action="rib.php?socid='.$soc->id.'" method="post">';
|
||||
@ -341,40 +389,73 @@ if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top" width="35%">'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<tr><td valign="top" width="35%" class="fieldrequired">'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="label" value="'.$account->label.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Bank").'</td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("BankName").'</td>';
|
||||
print '<td><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
|
||||
|
||||
// BBAN
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
// Show fields of bank account
|
||||
$fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
|
||||
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
|
||||
{
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
}
|
||||
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
|
||||
}
|
||||
$fieldlistsarray=explode(' ',$fieldlists);
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
foreach($fieldlistsarray as $val)
|
||||
{
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="15" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
if ($val == 'DeskCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($val == 'BankCode')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($val == 'AccountNumber')
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($val == 'BankAccountNumberKey')
|
||||
{
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
@ -413,11 +494,8 @@ if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["socid"] && $_GET["action"] == 'create' && $user->rights->societe->creer)
|
||||
if ($socid && $action == 'create' && $user->rights->societe->creer)
|
||||
{
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
print '<form action="rib.php?socid='.$soc->id.'" method="post">';
|
||||
@ -426,58 +504,60 @@ if ($_GET["socid"] && $_GET["action"] == 'create' && $user->rights->societe->cre
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
print '<tr><td valign="top" width="35%">'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="label"></td></tr>';
|
||||
print '<tr><td valign="top" width="35%" class="fieldrequired">'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="label" value="'.GETPOST('label').'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Bank").'</td>';
|
||||
print '<td><input size="30" type="text" name="bank"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Bank").'</td>';
|
||||
print '<td><input size="30" type="text" name="bank" value="'.GETPOST('bank').'"></td></tr>';
|
||||
|
||||
// BBAN
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque"></td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.GETPOST('code_banque').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DeskCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet"></td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.GETPOST('code_guichet').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($account->useDetailedBBAN() == 2)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankCode").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque"></td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.GETPOST('code_banque').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<td>'.$langs->trans("BankAccountNumber").'</td>';
|
||||
print '<td><input size="15" type="text" class="flat" name="number"></td>';
|
||||
print '<td><input size="15" type="text" class="flat" name="number" value="'.GETPOST('number').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
print '<td>'.$langs->trans("BankAccountNumberKey").'</td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib"></td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.GETPOST('value').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="iban_prefix"></td></tr>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="iban_prefix" value="'.GETPOST('iban_prefix').'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic"></td></tr>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.GETPOST('bic').'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
|
||||
print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">";
|
||||
print '<textarea name="domiciliation" rows="4" cols="40">';
|
||||
print GETPOST('domiciliation');
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="proprio"></td></tr>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.GETPOST('proprio').'"></td></tr>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
|
||||
print "<textarea name=\"owner_address\" rows=\"4\" cols=\"40\">";
|
||||
print '<textarea name="owner_address" rows="4" cols="40">';
|
||||
print GETPOST('owner_address');
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '</table><br>';
|
||||
@ -493,7 +573,7 @@ if ($_GET["socid"] && $_GET["action"] == 'create' && $user->rights->societe->cre
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
if ($_GET["socid"] && $_GET["action"] != 'edit' && $_GET["action"] != 'create')
|
||||
if ($socid && $action != 'edit' && $action != 'create')
|
||||
{
|
||||
/*
|
||||
* Barre d'actions
|
||||
@ -509,8 +589,7 @@ if ($_GET["socid"] && $_GET["action"] != 'edit' && $_GET["action"] != 'create')
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user