Patch level : 10.0 patch 226
Files correlati : lv3 Ricompilazione Demo : [ ] Commento : corretta gestione della causale sulle righe dello sheet git-svn-id: svn://10.65.10.50/trunk@18193 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
695a9cca72
commit
c5395a7835
@ -208,6 +208,7 @@ protected:
|
|||||||
virtual int rewrite( const TMask& m );
|
virtual int rewrite( const TMask& m );
|
||||||
virtual int read ( TMask& m );
|
virtual int read ( TMask& m );
|
||||||
virtual void init_insert_mode( TMask& m );
|
virtual void init_insert_mode( TMask& m );
|
||||||
|
void elimina_vuote( const TMask& m);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TGiac_per_cli& giacenza();
|
TGiac_per_cli& giacenza();
|
||||||
@ -549,7 +550,11 @@ bool TGestione_bolle_msk::lv_codart_handler(TMask_field& f, KEY k)
|
|||||||
TConfig* configlv = new TConfig(CONFIG_DITTA,"lv");
|
TConfig* configlv = new TConfig(CONFIG_DITTA,"lv");
|
||||||
causale = configlv->get("CAUSLAV");
|
causale = configlv->get("CAUSLAV");
|
||||||
}
|
}
|
||||||
msk.set(FR_CODAGG1, causale);
|
|
||||||
|
TSheet_field* sheet = msk.get_sheet();
|
||||||
|
TRiga_documento& rdoc = dmsk.doc()[sheet->selected()+1];
|
||||||
|
if (rdoc.get(RDOC_CODAGG1).empty())
|
||||||
|
msk.set(FR_CODAGG1, causale);
|
||||||
|
|
||||||
if (k == K_ENTER && rcont.get_bool(LVRCONDV_ARROT))
|
if (k == K_ENTER && rcont.get_bool(LVRCONDV_ARROT))
|
||||||
{
|
{
|
||||||
@ -607,8 +612,15 @@ bool TGestione_bolle_msk::lv_causale_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
//leggo il codart che ho scritto nella riga corrente delle sheet
|
//leggo il codart che ho scritto nella riga corrente delle sheet
|
||||||
const TString& codart = msk.get(FR_CODART);
|
const TString& codart = msk.get(FR_CODART);
|
||||||
//recupero i dati di interesse dalla testata per poter trovare il contratto
|
|
||||||
TDocumento_mask& dmsk = (TDocumento_mask&) msk.get_sheet()->mask();
|
TDocumento_mask& dmsk = (TDocumento_mask&) msk.get_sheet()->mask();
|
||||||
|
//srcrivo nel documento la causale
|
||||||
|
TSheet_field* sheet = msk.get_sheet();
|
||||||
|
|
||||||
|
TRiga_documento& rdoc = dmsk.doc()[sheet->selected()+1];
|
||||||
|
rdoc.put(RDOC_CODAGG1, causale);
|
||||||
|
|
||||||
|
//recupero i dati di interesse dalla testata per poter trovare il contratto
|
||||||
const long codcf = dmsk.get_long(F_CODCF);
|
const long codcf = dmsk.get_long(F_CODCF);
|
||||||
const int indsped = dmsk.get_int(F_CODINDSP);
|
const int indsped = dmsk.get_int(F_CODINDSP);
|
||||||
TDate datadoc = dmsk.get_date(F_DATADOC);
|
TDate datadoc = dmsk.get_date(F_DATADOC);
|
||||||
@ -709,33 +721,33 @@ TMask* TGestione_bolle_app::get_mask( int mode )
|
|||||||
|
|
||||||
#define FOR_EACH_DOC_ROW_BACK(d, r, row) const TRiga_documento* row = NULL; for (int r = d.rows(); r > 0 && (row = &d[r]) != NULL; r--)
|
#define FOR_EACH_DOC_ROW_BACK(d, r, row) const TRiga_documento* row = NULL; for (int r = d.rows(); r > 0 && (row = &d[r]) != NULL; r--)
|
||||||
|
|
||||||
//ridefinisco il metodo write delle TMotore_application
|
void TGestione_bolle_app::elimina_vuote( const TMask& m)
|
||||||
int TGestione_bolle_app::write( const TMask& m )
|
|
||||||
{
|
{
|
||||||
TDocumento_mask& mask = (TDocumento_mask&) m;
|
TDocumento_mask& mask = (TDocumento_mask&) m;
|
||||||
TDocumento& d = mask.doc();
|
TDocumento& d = mask.doc();
|
||||||
|
|
||||||
|
TSheet_field& sheet = mask.sfield(F_SHEET);
|
||||||
|
|
||||||
FOR_EACH_DOC_ROW_BACK(d, r, row)
|
FOR_EACH_DOC_ROW_BACK(d, r, row)
|
||||||
{
|
{
|
||||||
if (row->get_int(RDOC_QTA) == 0 && row->get_int(RDOC_QTAGG1) == 0)
|
if (row->is_articolo() && row->get_int(RDOC_QTA) == 0 && row->get_int(RDOC_QTAGG1) == 0)
|
||||||
|
{
|
||||||
d.destroy_row(r,true);
|
d.destroy_row(r,true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ridefinisco il metodo write delle TMotore_application
|
||||||
|
int TGestione_bolle_app::write( const TMask& m )
|
||||||
|
{
|
||||||
|
elimina_vuote(m);
|
||||||
return TMotore_application::write(m);
|
return TMotore_application::write(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ridefinisco il metodo rewrite delle TMotore_application
|
//ridefinisco il metodo rewrite delle TMotore_application
|
||||||
int TGestione_bolle_app::rewrite( const TMask& m )
|
int TGestione_bolle_app::rewrite( const TMask& m )
|
||||||
{
|
{
|
||||||
TDocumento_mask& mask = (TDocumento_mask&) m;
|
elimina_vuote(m);
|
||||||
TDocumento& d = mask.doc();
|
|
||||||
|
|
||||||
FOR_EACH_DOC_ROW_BACK(d, r, row)
|
|
||||||
{
|
|
||||||
if (row->get_int(RDOC_QTA) == 0 && row->get_int(RDOC_QTAGG1) == 0)
|
|
||||||
d.destroy_row(r,true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TMotore_application::rewrite(m);
|
return TMotore_application::rewrite(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user