Patch level : 12.0 1044
Files correlati : cg0.exe cg0200a.msk cgtbbnp.msk Commento : Agiunto supporto per IBAN esteri all'anagrafica clienti e alle banche di presentazione
This commit is contained in:
parent
728cfef2eb
commit
0444dc05ee
@ -50,6 +50,7 @@
|
|||||||
#define DLG_PASTE 46 /* TAG del bottone incolla */
|
#define DLG_PASTE 46 /* TAG del bottone incolla */
|
||||||
#define DLG_BARCODE_TYPE 47 /* TAG del tipo codice a barre */
|
#define DLG_BARCODE_TYPE 47 /* TAG del tipo codice a barre */
|
||||||
#define DLG_ALL 48 /* TAG del bottone Tutti */
|
#define DLG_ALL 48 /* TAG del bottone Tutti */
|
||||||
|
#define DLG_LOG 49 /* TAG del delle transazioni */
|
||||||
|
|
||||||
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
|
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
|
||||||
|
|
||||||
@ -111,7 +112,7 @@
|
|||||||
#define NOT_EMPTY_CHECK_FIELD 21 0
|
#define NOT_EMPTY_CHECK_FIELD 21 0
|
||||||
#define ORA_FUNC 22 0
|
#define ORA_FUNC 22 0
|
||||||
#define SCONTO_FUNC 23 0
|
#define SCONTO_FUNC 23 0
|
||||||
#define CHECK_IBAN_FUNC 24 8
|
#define CHECK_IBAN_FUNC 24 10
|
||||||
#define CHECK_BBAN_FUNC 25 5
|
#define CHECK_BBAN_FUNC 25 5
|
||||||
|
|
||||||
#define VALEXPR VALIDATE EXPR_FUNC
|
#define VALEXPR VALIDATE EXPR_FUNC
|
||||||
|
@ -566,12 +566,28 @@ void TMask_field::show(
|
|||||||
// @flag true | Rendere visibile il campo (default)
|
// @flag true | Rendere visibile il campo (default)
|
||||||
// @flag false | Rendere invisibile il campo
|
// @flag false | Rendere invisibile il campo
|
||||||
{
|
{
|
||||||
if (_ctl)
|
if (_ctl)
|
||||||
{
|
{
|
||||||
if (on && !_flags.show_default && in_module(0))
|
if (on && !_flags.show_default && in_module(0))
|
||||||
on = false; // Nego la visibiltà in assenza del modulo opportuno
|
on = false; // Nego la visibiltà in assenza del modulo opportuno
|
||||||
_ctl->show(on);
|
_ctl->show(on);
|
||||||
_flags.shown = on;
|
_flags.shown = on;
|
||||||
|
if (mask().is_sheetmask())
|
||||||
|
{
|
||||||
|
TSheet_field * s = mask().get_sheet();
|
||||||
|
|
||||||
|
if (s != nullptr)
|
||||||
|
{
|
||||||
|
const int nrow = s->selected();
|
||||||
|
|
||||||
|
if (nrow >= 0 && nrow < s->items() && s->exist_column(dlg()))
|
||||||
|
s->enable_cell(nrow, dlg(), on);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef DBG
|
||||||
|
else
|
||||||
|
int not_sheetmask = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -942,6 +958,22 @@ void TOperable_field::enable(bool on)
|
|||||||
{
|
{
|
||||||
TMask_field::enable(on);
|
TMask_field::enable(on);
|
||||||
if (_ctl) _ctl->enable(on);
|
if (_ctl) _ctl->enable(on);
|
||||||
|
if (mask().is_sheetmask())
|
||||||
|
{
|
||||||
|
TSheet_field * s = mask().get_sheet();
|
||||||
|
|
||||||
|
if (s != nullptr)
|
||||||
|
{
|
||||||
|
const int nrow = s->selected();
|
||||||
|
|
||||||
|
if (nrow >= 0 && nrow < s->items() && s->exist_column(dlg()))
|
||||||
|
s->enable_cell(nrow, dlg(), on);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef DBG
|
||||||
|
else
|
||||||
|
int not_sheetmask = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TOperable_field::on_key(
|
bool TOperable_field::on_key(
|
||||||
|
@ -833,6 +833,7 @@ int TSpreadsheet::field2col(const TOperable_field* f) const
|
|||||||
void TSpreadsheet::update_rec(int rec)
|
void TSpreadsheet::update_rec(int rec)
|
||||||
{
|
{
|
||||||
const int riga = rec2row(rec);
|
const int riga = rec2row(rec);
|
||||||
|
|
||||||
if (riga >= 0)
|
if (riga >= 0)
|
||||||
{
|
{
|
||||||
const bool has_focus = rec == selected() && mask().focus_field().dlg() == owner().dlg();
|
const bool has_focus = rec == selected() && mask().focus_field().dlg() == owner().dlg();
|
||||||
@ -1082,7 +1083,6 @@ void TSpreadsheet::update(
|
|||||||
const long as = AUTOSELECT ? XI_ATR_AUTOSELECT : 0;
|
const long as = AUTOSELECT ? XI_ATR_AUTOSELECT : 0;
|
||||||
xi_scroll_rec(_obj, handle[first], NORMAL_COLOR, XI_ATR_ENABLED | as, 0);
|
xi_scroll_rec(_obj, handle[first], NORMAL_COLOR, XI_ATR_ENABLED | as, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_needs_update = -1; // Clear pending row update
|
_needs_update = -1; // Clear pending row update
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2210,6 +2210,7 @@ void TSpreadsheet::enable_cell(
|
|||||||
}
|
}
|
||||||
|
|
||||||
TBit_array& ba = prop->disabled();
|
TBit_array& ba = prop->disabled();
|
||||||
|
|
||||||
if (column >= 0)
|
if (column >= 0)
|
||||||
{
|
{
|
||||||
ba.set(column, !on);
|
ba.set(column, !on);
|
||||||
@ -3810,7 +3811,6 @@ void TSheet_field::row2mask(int n, TToken_string& r, int mode)
|
|||||||
// Assegna il focus all'interfaccia per evitare effetti indesiderati durante i messaggi
|
// Assegna il focus all'interfaccia per evitare effetti indesiderati durante i messaggi
|
||||||
low_set_focus_id(f->parent(), -1);
|
low_set_focus_id(f->parent(), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f->has_check() && (mode & 0x1))
|
if (f->has_check() && (mode & 0x1))
|
||||||
f->check(STARTING_CHECK);
|
f->check(STARTING_CHECK);
|
||||||
f->set_dirty(false);
|
f->set_dirty(false);
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <diction.h>
|
#include <diction.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <msksheet.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -376,12 +378,14 @@ const char * get_system_dir(TSystem_dirs what)
|
|||||||
|
|
||||||
bool sirio_codesigning(const TFilename& filename, bool verify)
|
bool sirio_codesigning(const TFilename& filename, bool verify)
|
||||||
{
|
{
|
||||||
const char * const default_sign = R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://timestamp.digicert.com /v)";
|
// const char * const default_sign = R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://timestamp.digicert.com /v)";
|
||||||
const char * const default_verify = R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" verify /a /pa /v)";
|
// const char * const default_verify = R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" verify /a /pa /v)";
|
||||||
TConfig installini("install.ini", "Main");
|
// TConfig installini("install.ini", "Main");
|
||||||
TString command = installini.get(!verify ? "SirioSignCommand" : "SirioSignVerifyCommand", nullptr, -1, "");
|
// if (command.empty())
|
||||||
if (command.empty())
|
// command << !verify ? default_sign : default_verify;
|
||||||
command << !verify ? default_sign : default_verify;
|
TString command = !verify ? "signtool.exe sign /a /s MY /n \"Sirio Informatica e Sistemi SPA\" /fd sha256 /tr http://timestamp.digicert.com /v)" :
|
||||||
|
"signtool.exe verify /a /pa /v" ;
|
||||||
|
|
||||||
command << " \"" << filename << "\"";
|
command << " \"" << filename << "\"";
|
||||||
const int exit = xvt_sys_execute(command, TRUE, FALSE);
|
const int exit = xvt_sys_execute(command, TRUE, FALSE);
|
||||||
return exit == 0 || exit == 2; // Execution was successful [0] OR Execution has completed with warnings [2]
|
return exit == 0 || exit == 2; // Execution was successful [0] OR Execution has completed with warnings [2]
|
||||||
@ -721,12 +725,10 @@ static bool is_sirio_station(const char* hostname)
|
|||||||
const char* const ranger[] =
|
const char* const ranger[] =
|
||||||
{
|
{
|
||||||
"NBKI7HPFERRANDI", // Davide
|
"NBKI7HPFERRANDI", // Davide
|
||||||
"NBKDELLI7TOLLAR", // Mattia
|
|
||||||
"MOBILE", // Roberto
|
"MOBILE", // Roberto
|
||||||
"SPOCK", // Alessandro ?
|
"SPOCK", // Alessandro
|
||||||
"ARCHIMEDE", // Alessandro
|
"ARCHIMEDE", // Alessandro
|
||||||
"SIRIOCOMP",
|
"SIRIOCOMP",
|
||||||
"NBK_SPALACINO_A", // Simone
|
|
||||||
"NBKPEREGOW8", // Stefano
|
"NBKPEREGOW8", // Stefano
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -844,4 +846,103 @@ const TString & mod2tabname(word module)
|
|||||||
mod = dongle().module_code2name(module);
|
mod = dongle().module_code2name(module);
|
||||||
mod.upper();
|
mod.upper();
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void build_IBAN(TString & iban, const char * iso, const char * cin,
|
||||||
|
const char * bcin, const char * abi, const char * cab, const char * cc)
|
||||||
|
{
|
||||||
|
TString bban;
|
||||||
|
|
||||||
|
iban.cut(0);
|
||||||
|
if (iso && *iso)
|
||||||
|
iban = iso;
|
||||||
|
if (iban.blank())
|
||||||
|
iban = "IT";
|
||||||
|
if (iban == "IT")
|
||||||
|
{
|
||||||
|
if (bcin && *bcin)
|
||||||
|
bban << TString(bcin).left(1);
|
||||||
|
if (abi && *abi)
|
||||||
|
bban << TString(abi).left(5);
|
||||||
|
if (cab && *cab)
|
||||||
|
bban << TString(cab).left(5);
|
||||||
|
}
|
||||||
|
if (cc && *cc)
|
||||||
|
bban << cc;
|
||||||
|
if (cin && *cin)
|
||||||
|
iban << TString(cin).left(2);
|
||||||
|
iban << bban;
|
||||||
|
}
|
||||||
|
|
||||||
|
void split_IBAN(const char * iban, TString & iso, TString & cin,
|
||||||
|
TString & bcin, TString & abi, TString & cab, TString & cc)
|
||||||
|
{
|
||||||
|
TString wiban(iban);
|
||||||
|
|
||||||
|
iso = wiban.left(2);
|
||||||
|
cin = wiban.mid(2, 2);
|
||||||
|
if (iso == "IT")
|
||||||
|
{
|
||||||
|
bcin = wiban.mid(4,1);
|
||||||
|
abi = wiban.mid(5, 5);
|
||||||
|
cab = wiban.mid(10, 5);
|
||||||
|
cc = wiban.mid(15);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bcin.cut(0);
|
||||||
|
abi.cut(0);
|
||||||
|
cab.cut(0);
|
||||||
|
cc = wiban.mid(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void enable_iban_fields(TMask & mask, short fldbban, short fldbcin,
|
||||||
|
short fldabi, short fldcab, short fldcc,
|
||||||
|
short flddes, const bool italy, bool pres, int nrow)
|
||||||
|
{
|
||||||
|
if (mask.is_sheetmask())
|
||||||
|
{
|
||||||
|
TSheet_field * s = mask.get_sheet();
|
||||||
|
|
||||||
|
if (nrow >= 0)
|
||||||
|
s->select(nrow);
|
||||||
|
}
|
||||||
|
if (fldbban > 0 && !pres)
|
||||||
|
mask.show(fldbban, !italy);
|
||||||
|
if (!pres)
|
||||||
|
{
|
||||||
|
mask.show(fldbcin, italy);
|
||||||
|
mask.show(fldabi, italy);
|
||||||
|
mask.show(fldcab, italy);
|
||||||
|
mask.show(fldcc, italy);
|
||||||
|
}
|
||||||
|
if (flddes > 0)
|
||||||
|
mask.show(flddes, italy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_iban_fields(const char * iban, TMask & mask,
|
||||||
|
short fldbban, short fldiso, short fldcin,
|
||||||
|
short fldbcin, short fldabi, short fldcab,
|
||||||
|
short fldcc, short flddes, bool pres)
|
||||||
|
{
|
||||||
|
TString4 iso, cin, bcin;
|
||||||
|
TString8 abi, cab;
|
||||||
|
TString80 cc;
|
||||||
|
TString msg;
|
||||||
|
TString wiban(iban);
|
||||||
|
|
||||||
|
split_IBAN(wiban, iso, cin, bcin, abi, cab, cc);
|
||||||
|
|
||||||
|
const bool italy = iso.blank() || (iso == "IT");
|
||||||
|
|
||||||
|
enable_iban_fields(mask, fldbban, fldbcin, fldabi, fldcab, fldcc, flddes, italy, pres);
|
||||||
|
mask.set(fldiso, iso);
|
||||||
|
mask.set(fldcin, cin);
|
||||||
|
if (fldbban > 0)
|
||||||
|
mask.set(fldbban, italy ? wiban.mid(4) : cc);
|
||||||
|
mask.set(fldbcin, bcin);
|
||||||
|
mask.set(fldabi, abi);
|
||||||
|
mask.set(fldcab, cab);
|
||||||
|
mask.set(fldcc, italy ? cc : EMPTY_STRING);
|
||||||
|
}
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
#include <date.h>
|
#include <date.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MASK_H
|
||||||
|
class TMask;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __STRINGS_H
|
#ifndef __STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
@ -113,4 +117,15 @@ const TString & mod2tabname(word module);
|
|||||||
|
|
||||||
inline bool is_multi_table(const int file) { return file == LF_TAB || file == LF_TABGEN || file == LF_TABCOM || file == LF_TABMOD; }
|
inline bool is_multi_table(const int file) { return file == LF_TAB || file == LF_TABGEN || file == LF_TABCOM || file == LF_TABMOD; }
|
||||||
|
|
||||||
|
void build_IBAN(TString & iban, const char * iso, const char * icin,
|
||||||
|
const char * bcin, const char * abi, const char * cab, const char * cc);
|
||||||
|
void split_IBAN(const char * iban, TString & iso, TString & icin,
|
||||||
|
TString & bcin, TString & abi, TString & cab, TString & cc);
|
||||||
|
void enable_iban_fields(TMask & mask, short fldbban, short fldbcin,
|
||||||
|
short fldabi, short fldcab, short fldcc,
|
||||||
|
short flddes, const bool italy, bool pres, int nrow = -1);
|
||||||
|
void set_iban_fields(const char * iban, TMask & mask,
|
||||||
|
short fldbban, short fldiso, short fldcin,
|
||||||
|
short fldbcin, short fldabi, short fldcab,
|
||||||
|
short fldcc, short flddes, bool pres);
|
||||||
#endif /* __UTILITY_H */
|
#endif /* __UTILITY_H */
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <diction.h>
|
#include <diction.h>
|
||||||
#include <expr.h>
|
#include <expr.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <msksheet.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
@ -943,108 +944,127 @@ HIDDEN bool _iban_val(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
if (key == K_TAB || key == K_ENTER)
|
if (f.to_check(key))
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
const int nparms = get_val_param_count();
|
const int nparms = get_val_param_count();
|
||||||
CHECKD(nparms == 8, "IBAN_CHECK deve avere 8 parametri: ", nparms);
|
|
||||||
int id[8];
|
CHECKD(nparms == 10 , "IBAN_CHECK deve avere 10 parametri: ", nparms);
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
|
int id[9];
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
id[i] = get_int_val_param(i);
|
id[i] = get_int_val_param(i);
|
||||||
|
|
||||||
|
bool pres = get_int_val_param(9);
|
||||||
|
|
||||||
if (f.dlg() == id[1]) // Campo Stato IBAN
|
TString80 iban = m.get(id[0]);
|
||||||
|
TString4 iso, cin, bcin;
|
||||||
|
TString8 abi, cab;
|
||||||
|
TString80 cc;
|
||||||
|
|
||||||
|
if (f.running_check(key) && f.dlg() == id[1]) // Campo Stato IBAN
|
||||||
{
|
{
|
||||||
if (key == K_TAB && !f.focusdirty())
|
iso = m.get(id[1]);
|
||||||
|
|
||||||
|
const bool italy = iso.blank() || (iso == "IT");
|
||||||
|
|
||||||
|
enable_iban_fields(m, id[3], id[4], id[5], id[6], id[7], id[8], italy, pres);
|
||||||
|
m.reset(id[0]);
|
||||||
|
m.reset(id[2]);
|
||||||
|
if (italy)
|
||||||
|
m.reset(id[3]);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
const TString& iban = m.get(id[0]);
|
m.reset(id[4]);
|
||||||
m.set(id[1], iban.left(2));
|
if (!pres)
|
||||||
m.set(id[2], iban.mid(2,2));
|
{
|
||||||
m.set(id[3], iban.mid(4));
|
m.reset(id[5]);
|
||||||
m.set(id[4], iban.mid(4,1));
|
m.reset(id[6]);
|
||||||
m.set(id[5], iban.mid(5,5));
|
}
|
||||||
m.set(id[6], iban.mid(10,5));
|
m.reset(id[7]);
|
||||||
m.set(id[7], iban.mid(15));
|
m.reset(id[8]);
|
||||||
|
}
|
||||||
|
if (m.is_sheetmask())
|
||||||
|
{
|
||||||
|
TSheet_field * s = m.get_sheet();
|
||||||
|
const int nrow = s->selected();
|
||||||
|
|
||||||
|
if (!s->sheet_row_mask(nrow).is_running())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
s->set_row_cell(id[i], m.get(id[i]), nrow);
|
||||||
|
s->check_row(nrow);
|
||||||
|
s->force_update(nrow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const bool italy = f.empty() || f.get() == "IT";
|
|
||||||
m.show(id[3], !italy);
|
|
||||||
m.show(id[4], italy);
|
|
||||||
m.show(id[5], italy);
|
|
||||||
m.show(id[6], italy);
|
|
||||||
m.show(id[7], italy);
|
|
||||||
}
|
}
|
||||||
if (f.dlg() == id[2])
|
if (f.final_check(key) && f.dlg() == id[2])
|
||||||
{
|
{
|
||||||
TString4 stato = m.get(id[1]);
|
TString msg;
|
||||||
if (stato.empty())
|
|
||||||
stato = "IT";
|
|
||||||
const bool italy = stato=="IT";
|
|
||||||
const bool do_test = !m.field(id[italy ? 7 : 3]).empty(); // Faccio il test solo in presenza di conto corrente
|
|
||||||
TString80 iban;
|
|
||||||
if (do_test)
|
|
||||||
{
|
|
||||||
if (f.empty()) // Cifra di controllo vuota
|
|
||||||
{
|
|
||||||
TString msg;
|
|
||||||
TString80 iban;
|
|
||||||
iban << stato << "@@";
|
|
||||||
if (italy)
|
|
||||||
{
|
|
||||||
TEdit_field& cin = m.efield(id[4]);
|
|
||||||
TEdit_field& cc = m.efield(id[7]);
|
|
||||||
if (cin.empty() && !cc.empty())
|
|
||||||
{
|
|
||||||
cc.set_focusdirty();
|
|
||||||
cc.validate(K_TAB);
|
|
||||||
}
|
|
||||||
iban << m.get(id[4]) << m.get(id[5]) << m.get(id[6]) << m.get(id[7]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
iban << m.get(id[3]);
|
|
||||||
|
|
||||||
int err = 1;
|
|
||||||
for (int pp = 0; pp <= 99 && err == 1; pp++)
|
|
||||||
{
|
|
||||||
msg.format("%02d", pp);
|
|
||||||
iban.overwrite(msg, 2);
|
|
||||||
err = iban_check(iban, msg);
|
|
||||||
if (err == 0)
|
|
||||||
{
|
|
||||||
m.set(id[1], stato);
|
|
||||||
m.set(id[2], pp);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
iban << m.get(id[1]) << m.get(id[2]);
|
iso = m.get(id[1]);
|
||||||
|
cin = m.get(id[2]);
|
||||||
|
if (iso.blank())
|
||||||
|
iso = "IT";
|
||||||
|
const bool italy = iso.blank() || (iso == "IT");
|
||||||
|
const TString cc = m.get(id[italy ? 7 : 3]);
|
||||||
|
|
||||||
|
if (italy)
|
||||||
|
{
|
||||||
|
TEdit_field & fcc = m.efield(id[7]);
|
||||||
|
|
||||||
|
if (m.efield(id[4]).empty() && cc.full())
|
||||||
|
{
|
||||||
|
fcc.set_focusdirty();
|
||||||
|
fcc.validate(K_TAB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cin.blank() && cc.full())
|
||||||
|
{
|
||||||
if (italy)
|
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"));
|
bcin = m.get(id[4]);
|
||||||
if (err > 1) // Errore grave
|
abi = m.get(id[5]);
|
||||||
ok = error_box(msg);
|
cab = m.get(id[6]);
|
||||||
else
|
}
|
||||||
|
for (int pp = 0; pp <= 99; pp++)
|
||||||
|
{
|
||||||
|
cin = format("%02d", pp);
|
||||||
|
build_IBAN(iban, iso, cin, bcin, abi, cab, cc);
|
||||||
|
if (iban_check(iban, msg) == 0)
|
||||||
{
|
{
|
||||||
msg << '\n' << TR("Si desidera continuare ugualmente?");
|
m.set(id[1], iso);
|
||||||
ok = yesno_box(msg);
|
m.set(id[2], cin);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key == K_ENTER)
|
cin = m.get(id[2]);
|
||||||
|
if (italy)
|
||||||
{
|
{
|
||||||
if (!ok) iban.cut(0);
|
bcin = m.get(id[4]);
|
||||||
m.set(id[0], iban);
|
abi = m.get(id[5]);
|
||||||
|
cab = m.get(id[6]);
|
||||||
}
|
}
|
||||||
|
build_IBAN(iban, iso, cin, bcin, abi, cab, cc);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.set(id[0], ok ? iban : EMPTY_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1056,11 +1076,11 @@ HIDDEN bool _bban_val(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
const int nparms = get_val_param_count();
|
const int nparms = get_val_param_count();
|
||||||
CHECKD(nparms == 5, "BBAN_CHECK deve avere 5 parametri: ", nparms);
|
|
||||||
int id[5];
|
int id[5];
|
||||||
|
|
||||||
|
CHECKD(nparms == 5, "BBAN_VAL deve avere 5 parametri: ", nparms);
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
id[i] = get_int_val_param(i);
|
id[i] = get_int_val_param(i);
|
||||||
|
|
||||||
if (m.field(id[1]).empty()) // CIN vuoto
|
if (m.field(id[1]).empty()) // CIN vuoto
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
@ -1078,11 +1098,10 @@ HIDDEN bool _bban_val(TMask_field& f, KEY key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (f.dlg() == id[1] && key == K_ENTER)
|
if (f.dlg() == id[1] && key == K_ENTER)
|
||||||
{
|
{
|
||||||
TString80 bban;
|
TString80 bban;
|
||||||
|
|
||||||
for (int i = 1; i < 5; i++)
|
for (int i = 1; i < 5; i++)
|
||||||
bban << m.get(id[i]);
|
bban << m.get(id[i]);
|
||||||
if (bban.len() > 11)
|
if (bban.len() > 11)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user