Correzione MI2206

git-svn-id: svn://10.65.10.50/trunk@3776 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
ale 1996-10-15 12:23:04 +00:00
parent a3e5b7647f
commit 27bf18b4da

View File

@ -56,15 +56,16 @@ bool TVar_sc::create()
rp.sheet_mask().set_handler(124, codval_handler);
rp.sheet_mask().set_handler(125, datacam_handler);
rp.sheet_mask().set_handler(126, cambio_handler);
rp.sheet_mask().set_handler(100, gestione_handler);
rp.sheet_mask().set_handler(DLG_OK, registra_dati_comuni);
rp.sheet_mask().set_handler(DLG_DELREC, elimina_partita);
rp.swap_columns(105,106);
rp.swap_columns(105,107);
rp.swap_columns(105,108);
rp.swap_columns(105,109);
rp.swap_columns(105,110);
rp.sheet_mask().set_handler(100, gestione_handler);
rp.sheet_mask().set_handler(DLG_OK, registra_dati_comuni);
rp.sheet_mask().set_handler(DLG_DELREC, elimina_partita);
_registrato = FALSE;
_aperti = FALSE;
@ -592,7 +593,9 @@ bool TVar_sc::video_SC()
_nriga = _msk->get_int (F_NRIGA);
setta_campi_maschera(*_mask);
_mask->force_update();
tasto = _mask->run();
switch (tasto)
@ -1086,7 +1089,7 @@ bool TVar_sc::tipopag_handler(TMask_field& f, KEY k)
if (tipomov == 1 && tipopag != 0)
return f.warning_box("In caso di fattura non e' possibile indicare il tipo pagamento");
if (tipomov != 1)
if (tipomov != 1 && tipomov != 2)
if (tipopag < 1 || tipopag > 9)
return f.warning_box("Tipo pagamento errato");
}
@ -1207,28 +1210,30 @@ bool TVar_sc::codpag_handler(TMask_field& f, KEY k)
TString codpag = f.get();
TTable cpg ("%CPG");
TString dep (format("%-4s", (const char*) codpag));
if (codpag.not_empty())
{
TTable cpg ("%CPG");
TString dep (format("%-4s", (const char*) codpag));
cpg.zero();
cpg.put("CODTAB", dep);
if (cpg.read() == NOERR)
{
descr = cpg.get("S0");
tipo = atoi(cpg.get("S4"));
}
else
return f.warning_box("Codice di pagamento errato o non presente in tabella");
cpg.zero();
cpg.put("CODTAB", dep);
if (cpg.read() == NOERR)
{
descr = cpg.get("S0");
tipo = atoi(cpg.get("S4"));
}
else
return f.warning_box("Codice di pagamento errato o non presente in tabella");
int tipopag = f.mask().get_int(112);
if (tipopag != 0)
{
if (tipopag != tipo)
return f.warning_box("Il tipo pagamento della scadenza non e' congruo con il tipo pagamento del codice di pagamento");
}
else
f.mask().set(112,tipo);
int tipopag = f.mask().get_int(112);
if (tipopag != 0)
{
if (tipopag != tipo)
return f.warning_box("Il tipo pagamento della scadenza non e' congruo con il tipo pagamento del codice di pagamento");
}
else
f.mask().set(112,tipo);
}
TString ultclass = f.mask().get(113);
if (ultclass.empty())
f.mask().set(114, descr);
@ -1240,13 +1245,15 @@ bool TVar_sc::tpscad_handler(TMask_field& f, KEY k)
{
if ( (k == K_TAB || k == K_ENTER) && f.mask().is_running())
{
TString codpag = f.mask().get(111);
if (codpag.empty()) return TRUE;
int tipopag = atoi(f.get());
if (tipopag < 1 || tipopag > 9)
return f.warning_box("Tipo pagamento errato");
TString codpag = f.mask().get(111);
TTable cpg ("%CPG");
TString dep (format("%-4s", (const char*) codpag));
@ -2495,3 +2502,5 @@ bool TVar_sc::menu(MENU_TAG m)
return main_loop();
return FALSE;
}