Patch level : 12.00 1382

Files correlati     : cg7.exe cg7400c.png cg7400x.png cg7a00a.rep cg7a00a.msk cg7c00a.rep cg7c00a.msk cg7e00b.png cg7h00b.png cg7400a.png cg7400a.rep cg7400a.msk cg7400b.png cg7500a.png cg7600a.png cg7700a.png
                      cg7700b.png cg7800a.png cg7900a.png cg7900b.png cg7a00a.png cg7b00a.png cg7c00a.png cg7d00a.png cg7e00a.png cg7f00a.png cg7g00a.png cg7g00b.png cg7h00a.png cgmenu.men
Bug                 :

Commento:
Quadri Dichiarazione IVA 2025
Aggiunto quadro VL
This commit is contained in:
Alessandro Bonazzi 2025-03-05 20:14:26 +01:00
parent 3586a66bfb
commit 7308ff69f5
3 changed files with 24 additions and 12 deletions

View File

@ -93,9 +93,10 @@ void TQuadro_IVA_mask::build_report_sheet()
TToken_string d(80); TToken_string d(80);
const char quadro = source_file()[3]; const char quadro = source_file()[3];
TSheet_field & sf = sfield(F_REPORTS); TSheet_field & sf = sfield(F_REPORTS);
TQuadro_IVA_app & app = (TQuadro_IVA_app &)main_app();
sf.destroy(); sf.destroy();
((TQuadro_IVA_app &) main_app()).load_sheet(sf); app.load_sheet(sf);
__stop.load("STOP"); __stop.load("STOP");
const int items = sf.items(); const int items = sf.items();
@ -158,13 +159,14 @@ bool TQuadro_IVA_mask::on_field_event(TOperable_field& o, TField_event e, long j
{ {
const int ditta_attiva = main_app().get_firm(); const int ditta_attiva = main_app().get_firm();
int codditta = get_int(F_FIRM); int codditta = get_int(F_FIRM);
TQuadro_IVA_app & app = (TQuadro_IVA_app &)main_app();
if (codditta != ditta_attiva) if (app.has_data() && dirty() && codditta != ditta_attiva)
{ {
if (yesno_box("Devo salvare i dati")) if (yesno_box("Devo salvare i dati"))
((TQuadro_IVA_app &)main_app()).save_data(*this); app.save_data(*this);
main_app().set_firm(codditta); app.set_firm(codditta);
((TQuadro_IVA_app &)main_app()).load_data(*this); app.load_data(*this);
reset_dirty(); reset_dirty();
} }
} }
@ -173,11 +175,15 @@ bool TQuadro_IVA_mask::on_field_event(TOperable_field& o, TField_event e, long j
if (e == fe_button) if (e == fe_button)
{ {
int codditta = get_int(F_FIRM); int codditta = get_int(F_FIRM);
TQuadro_IVA_app & app = (TQuadro_IVA_app &)main_app();
((TQuadro_IVA_app &)main_app()).save_data(*this); if (app.has_data())
main_app().set_firm(codditta); {
((TQuadro_IVA_app &)main_app()).load_data(*this); app.save_data(*this);
reset_dirty(); app.set_firm(codditta);
app.load_data(*this);
reset_dirty();
}
} }
break; break;
default: default:
@ -411,10 +417,11 @@ void TQuadro_IVA_app::main_loop()
_mask = new TQuadro_IVA_mask(_name); _mask = new TQuadro_IVA_mask(_name);
if (_mask->exist(F_FIRM)) if (_mask->exist(F_FIRM))
_mask->set(F_FIRM, prefix().get_codditta()); _mask->set(F_FIRM, prefix().get_codditta());
load_data(*_mask); if (has_data())
load_data(*_mask);
while ((k = _mask->run()) != K_QUIT) while ((k = _mask->run()) != K_QUIT)
print(); print();
if (_mask->dirty() && yesno_box("Devo salvare i dati")) if (has_data() && _mask->dirty() && yesno_box("Devo salvare i dati"))
save_data(*_mask); save_data(*_mask);
set_firm(oldditta); set_firm(oldditta);
} }

View File

@ -86,6 +86,7 @@ protected:
virtual char last_quadro_report() const { return 'a';} virtual char last_quadro_report() const { return 'a';}
public: public:
virtual bool has_data() const { return false; }
virtual void load_data(TQuadro_IVA_mask & m) {}; virtual void load_data(TQuadro_IVA_mask & m) {};
virtual void save_data(TQuadro_IVA_mask & m) {}; virtual void save_data(TQuadro_IVA_mask & m) {};
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) pure; virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) pure;

View File

@ -103,6 +103,7 @@ void TQuadro_VL_recordset::load(const char repid)
} }
} }
/*
TISAM_recordset * recset = app().mask()->get_recset(REP_QUADRO); TISAM_recordset * recset = app().mask()->get_recset(REP_QUADRO);
recset->set_var("#ANNO", format("%d", year())); recset->set_var("#ANNO", format("%d", year()));
@ -139,6 +140,7 @@ void TQuadro_VL_recordset::load(const char repid)
break; break;
} }
} }
*/
const TRectype & lia = cache().get("%LIA", format("%04d", year())); const TRectype & lia = cache().get("%LIA", format("%04d", year()));
const bool credito_compensabile = (lia.get("S9") == "CM"); const bool credito_compensabile = (lia.get("S9") == "CM");
@ -180,6 +182,7 @@ void TQuadro_VL_recordset::load(const char repid)
else else
credito_utilizzato_iva = risultato -iva_credeb; credito_utilizzato_iva = risultato -iva_credeb;
add_value("VL27.1", credito_utilizzato_iva); add_value("VL27.1", credito_utilizzato_iva);
ivadetr += credito_utilizzato_iva;
if (month < 10) if (month < 10)
{ {
add_value("VL22.1", credito_utilizzato_iva); add_value("VL22.1", credito_utilizzato_iva);
@ -287,6 +290,7 @@ class TQuadro_VL_app : public TQuadro_IVA_app
{ {
protected: protected:
virtual bool has_data() const override { return true; }
virtual void load_sheet(TSheet_field & sf); virtual void load_sheet(TSheet_field & sf);
public: public:
@ -301,7 +305,7 @@ public:
void TQuadro_VL_app::load_sheet(TSheet_field & sf) void TQuadro_VL_app::load_sheet(TSheet_field & sf)
{ {
TToken_string & row1 = sf.row(sf.items()); row1.add("|1|Quadro VJ - VJ1 - VJ19|cg7800b"); // TToken_string & row1 = sf.row(sf.items()); row1.add("|1|Quadro VJ - VJ1 - VJ19|cg7800b");
} }
void TQuadro_VL_app::load_data(TQuadro_IVA_mask & m) void TQuadro_VL_app::load_data(TQuadro_IVA_mask & m)