Patch level : 4.0 502
Files correlati : cg0.exe Ricompilazione Demo : [ ] Commento : Bug 0000671 Generare il codice iban a partire dal codice bban per i conti italiani git-svn-id: svn://10.65.10.50/trunk@14353 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
68ba1c5e21
commit
a5db480dce
@ -948,30 +948,54 @@ HIDDEN bool _iban_val(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
const TString& stato = m.get(id[1]);
|
const TString& stato = m.get(id[1]);
|
||||||
const bool italy = stato.empty() || stato == "IT";
|
const bool italy = stato.empty() || stato == "IT";
|
||||||
const bool do_test = !f.empty() && !m.field(id[italy ? 7 : 3]).empty(); // Faccio il test solo in presenza di conto corrente
|
|
||||||
TString80 iban;
|
TString80 iban;
|
||||||
if (do_test)
|
|
||||||
{
|
|
||||||
iban << m.get(id[1]) << m.get(id[2]);
|
|
||||||
if (italy)
|
|
||||||
iban << m.get(id[4]) << m.get(id[5]) << m.get(id[6]) << m.get(id[7]);
|
|
||||||
else
|
|
||||||
iban << m.get(id[3]);
|
|
||||||
|
|
||||||
TString msg;
|
if (italy && f.empty() && m.get(id[7]).not_empty())
|
||||||
const int err = iban_check(iban, msg);
|
{
|
||||||
if (err != 0)
|
bool found = false;
|
||||||
{
|
TString16 cin;
|
||||||
msg.insert(TR("Codice IBAN errato:\n"));
|
TString msg;
|
||||||
if (err > 1) // Errore grave
|
|
||||||
ok = error_box(msg);
|
for (int i = 99; !found && i >= 0; i--)
|
||||||
else
|
{
|
||||||
{
|
cin.format("%02d", i);
|
||||||
msg << '\n' << TR("Si desidera continuare ugualmente?");
|
iban = "IT";
|
||||||
ok = yesno_box(msg);
|
iban << cin << m.get(id[4]) << m.get(id[5]) << m.get(id[6]) << m.get(id[7]);
|
||||||
}
|
found = iban_check(iban, msg) == 0;
|
||||||
}
|
}
|
||||||
}
|
if (found)
|
||||||
|
{
|
||||||
|
m.set(id[1], "IT");
|
||||||
|
m.set(id[2], cin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const bool do_test = !f.empty() && !m.field(id[italy ? 7 : 3]).empty(); // Faccio il test solo in presenza di conto corrente
|
||||||
|
|
||||||
|
if (do_test)
|
||||||
|
{
|
||||||
|
iban << m.get(id[1]) << m.get(id[2]);
|
||||||
|
if (italy)
|
||||||
|
iban << m.get(id[4]) << m.get(id[5]) << m.get(id[6]) << m.get(id[7]);
|
||||||
|
else
|
||||||
|
iban << m.get(id[3]);
|
||||||
|
|
||||||
|
TString msg;
|
||||||
|
const int err = iban_check(iban, msg);
|
||||||
|
if (err != 0)
|
||||||
|
{
|
||||||
|
msg.insert(TR("Codice IBAN errato:\n"));
|
||||||
|
if (err > 1) // Errore grave
|
||||||
|
ok = error_box(msg);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg << '\n' << TR("Si desidera continuare ugualmente?");
|
||||||
|
ok = yesno_box(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (key == K_ENTER)
|
if (key == K_ENTER)
|
||||||
{
|
{
|
||||||
if (!ok) iban.cut(0);
|
if (!ok) iban.cut(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user