Patch level : 10.0 patch 326
Files correlati : lv3 Ricompilazione Demo : [ ] Commento : 0001099: Registrazione di una bolla vuota...non deve succedere Descrizione Nuova bolla, agganciareil contratto, non imputare alcun dato e premere registra... viene registrata una bolla completamente vuota. git-svn-id: svn://10.65.10.50/trunk@18982 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8a75b3c8b4
commit
3afd02594a
@ -40,6 +40,7 @@ protected:
|
|||||||
static bool lv_datatmp_handler(TMask_field& f, KEY k);
|
static bool lv_datatmp_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
static bool ss_notify(TSheet_field& ss, int r, KEY key);
|
static bool ss_notify(TSheet_field& ss, int r, KEY key);
|
||||||
|
static bool ss_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
virtual void on_idle();
|
virtual void on_idle();
|
||||||
|
|
||||||
@ -363,6 +364,36 @@ bool TGestione_bolle_msk::ss_notify(TSheet_field& ss, int r, KEY key)
|
|||||||
return TDocumento_mask::ss_notify(ss, r, key);
|
return TDocumento_mask::ss_notify(ss, r, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//SS_HANDLER: handler che mi peremette di evitare la registrazione in caso di documento
|
||||||
|
//senza righe valide (cioè con quantità diverese da zero)
|
||||||
|
bool TGestione_bolle_msk::ss_handler(TMask_field& f, KEY key)
|
||||||
|
{
|
||||||
|
if ((key == K_ENTER) && f.mask().insert_mode())
|
||||||
|
{
|
||||||
|
TSheet_field& ss = (TSheet_field&)f;
|
||||||
|
|
||||||
|
bool vuote = true;
|
||||||
|
if (ss.items() > 0)
|
||||||
|
vuote = false;
|
||||||
|
|
||||||
|
if(!vuote)
|
||||||
|
{
|
||||||
|
vuote = true;
|
||||||
|
|
||||||
|
FOR_EACH_SHEET_ROW(ss, r, row)
|
||||||
|
{
|
||||||
|
if (row->get_int(ss.cid2index(FR_QTA)) != 0 || row->get_int(ss.cid2index(FR_QTAGG1)) != 0)
|
||||||
|
vuote = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!app().is_transaction() && vuote)
|
||||||
|
return error_box(TR("Il documento e' privo di righe valide e pertanto verrà ignorato"));
|
||||||
|
}
|
||||||
|
return TDocumento_mask::ss_handler(f, key);
|
||||||
|
}
|
||||||
|
|
||||||
//LV_DATA_HANDLER: handler che si occupa di decodificare i campi data in testata
|
//LV_DATA_HANDLER: handler che si occupa di decodificare i campi data in testata
|
||||||
bool TGestione_bolle_msk::lv_data_handler(TMask_field& f, KEY k)
|
bool TGestione_bolle_msk::lv_data_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
@ -1061,6 +1092,7 @@ TGestione_bolle_msk::TGestione_bolle_msk(const char* tipodoc) : TDocumento_mask(
|
|||||||
field(F_DATADOC).disable();
|
field(F_DATADOC).disable();
|
||||||
sfield(F_SHEET).set_nav_column(FR_QTA, FR_QTAGG1);
|
sfield(F_SHEET).set_nav_column(FR_QTA, FR_QTAGG1);
|
||||||
sfield(F_SHEET).set_auto_append();
|
sfield(F_SHEET).set_auto_append();
|
||||||
|
sfield(F_SHEET).set_handler( ss_handler );
|
||||||
sfield(F_SHEET).set_notify( ss_notify );
|
sfield(F_SHEET).set_notify( ss_notify );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1114,9 +1146,17 @@ int TGestione_bolle_app::write( const TMask& m )
|
|||||||
{
|
{
|
||||||
elimina_vuote(m);
|
elimina_vuote(m);
|
||||||
|
|
||||||
TGestione_bolle_msk& mask = (TGestione_bolle_msk&) m;
|
/*TGestione_bolle_msk& mask = (TGestione_bolle_msk&) m;
|
||||||
|
|
||||||
return TMotore_application::write(m);
|
int err = NOERR;
|
||||||
|
const TDocumento& doc = mask.doc();
|
||||||
|
|
||||||
|
if (doc.rows() > 0)*/
|
||||||
|
int err = TMotore_application::write(m);
|
||||||
|
/*else
|
||||||
|
warning_box(TR("Non è possibile registrare un documento di trasporto senza neanche una riga. Questa bolla verrà ignorata"));*/
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
//ridefinisco il metodo rewrite delle TMotore_application
|
//ridefinisco il metodo rewrite delle TMotore_application
|
||||||
@ -1124,9 +1164,17 @@ int TGestione_bolle_app::rewrite( const TMask& m )
|
|||||||
{
|
{
|
||||||
elimina_vuote(m);
|
elimina_vuote(m);
|
||||||
|
|
||||||
TGestione_bolle_msk& mask = (TGestione_bolle_msk&) m;
|
/*TGestione_bolle_msk& mask = (TGestione_bolle_msk&) m;
|
||||||
|
|
||||||
return TMotore_application::rewrite(m);
|
int err = NOERR;
|
||||||
|
const TDocumento& doc = mask.doc();
|
||||||
|
|
||||||
|
if (doc.rows() > 0)*/
|
||||||
|
int err = TMotore_application::rewrite(m);
|
||||||
|
/* else
|
||||||
|
warning_box(TR("Non è possibile registrare un documento di trasporto senza neanche una riga. Questa bolla verrà ignorata"));*/
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
//ridefinisco il metodo read della TMotore_application
|
//ridefinisco il metodo read della TMotore_application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user