Caciottelle visualizzazione

Sfanculato il solito errore in cg4400.h cosi' i conflitti se li beccano loro


git-svn-id: svn://10.65.10.50/trunk@1399 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-05-29 10:04:05 +00:00
parent 03aac38221
commit 2cf64cdc49
3 changed files with 46 additions and 19 deletions

View File

@ -67,6 +67,8 @@ class CG4400_application : public TPrintapp
TString _tipodoc, _descr_doc, _codlib, _codice_vidi; TString _tipodoc, _descr_doc, _codlib, _codice_vidi;
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis; TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
TFilename _t; TFilename _t;
TParagraph_string* _desc27;
messaggio _scelta; messaggio _scelta;
protected: protected:

View File

@ -149,6 +149,20 @@ void Visliq_app::reset_fields()
_mask->field(F_RAGSOC).set(""); _mask->field(F_RAGSOC).set("");
} }
bool Visliq_app::select_butt(TMask& m)
{
if (_ditte->run() == K_ENTER)
{
TToken_string& row = _ditte->row(_ditte->selected());
m.field(F_CODDITTA).set(row.get(0));
m.field(F_RAGSOC).set(row.get(1));
set_freqviva(row.get(2));
set_mask_freq(m);
return TRUE;
}
return FALSE;
}
void Visliq_app::build_nomiditte() void Visliq_app::build_nomiditte()
{ {
_nomiditte.destroy(); _nomiditte.destroy();
@ -251,6 +265,10 @@ bool Visliq_app::menu(MENU_TAG m)
bool Visliq_app::set_ditta(TMask_field& f, KEY k) bool Visliq_app::set_ditta(TMask_field& f, KEY k)
{ {
bool found = TRUE; bool found = TRUE;
if (k == K_F9)
return app().select_butt(f.mask());
if (k == K_TAB && f.focusdirty()) if (k == K_TAB && f.focusdirty())
{ {
found = FALSE; found = FALSE;
@ -286,6 +304,10 @@ bool Visliq_app::set_ditta(TMask_field& f, KEY k)
bool Visliq_app::set_ragsoc(TMask_field& f, KEY k) bool Visliq_app::set_ragsoc(TMask_field& f, KEY k)
{ {
bool found = TRUE; bool found = TRUE;
if (k == K_F9)
return app().select_butt(f.mask());
if (k == K_TAB && f.focusdirty()) if (k == K_TAB && f.focusdirty())
{ {
found = FALSE; found = FALSE;
@ -400,16 +422,7 @@ bool Visliq_app::vis_liq()
while ((k = m.run()) != K_ESC) while ((k = m.run()) != K_ESC)
{ {
if (k == DLG_SELECT) if (k == DLG_SELECT)
{ select_butt(m);
if (_ditte->run() == K_ENTER)
{
TToken_string& row = _ditte->row(_ditte->selected());
m.field(F_CODDITTA).set(row.get(0));
m.field(F_RAGSOC).set(row.get(1));
set_freqviva(row.get(2));
set_mask_freq(m);
}
}
else if (k == K_ENTER) else if (k == K_ENTER)
{ {
long dtt = m.get_long(F_CODDITTA); long dtt = m.get_long(F_CODDITTA);
@ -809,6 +822,8 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
long lrettd = vsw->search("Rettifiche IVA a debito", x,line,TRUE); long lrettd = vsw->search("Rettifiche IVA a debito", x,line,TRUE);
long lacct = vsw->search("Versamento acconto dicembre",x,line,TRUE); long lacct = vsw->search("Versamento acconto dicembre",x,line,TRUE);
long lrimb = vsw->search("Iva chiesta a rimborso",x,line,TRUE); long lrimb = vsw->search("Iva chiesta a rimborso",x,line,TRUE);
long lintr = vsw->search("Interesse",x,line,TRUE);
long livdv = vsw->search("IVA DOVUTA",x,line,TRUE);
if (wasdebt != 0) if (wasdebt != 0)
lvers = vsw->search(wasdebt < 0 ? "CREDITO ATTUALE" : "IVA DA VERSARE", lvers = vsw->search(wasdebt < 0 ? "CREDITO ATTUALE" : "IVA DA VERSARE",
@ -848,11 +863,22 @@ void Visliq_app::recalc_liq_data(TViswin* vsw, real& rimb, real& rett, real& ver
} }
else if (risul.sign() > 0) else if (risul.sign() > 0)
{ {
// aggiorna l'interesse solo se c'era dall'inizio, non
// se si e' passati da credito a debito (this is a limit
// and not a feature)
if (lintr > 0)
vsw->replace(lintr, intr.string("###.###.###.###"), 75);
if (livdv > 0)
{
vsw->replace(livdv, risul.string("###.###.###.###"), 75);
risul += intr;
}
ln.overwrite("IVA DA VERSARE", 23); ln.overwrite("IVA DA VERSARE", 23);
ln.overwrite(risul.string("###.###.###.###"), 75); ln.overwrite(risul.string("###.###.###.###"), 75);
} }
vsw->replace(lvers, ln, 0);
vsw->replace(lvers, ln, 0);
vsw->refresh();
} }
void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field* sv) void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field* sv)
@ -977,8 +1003,7 @@ void Visliq_app::write_del()
int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3); int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3);
_del->put("S6", format("%d",ctri)); _del->put("S6", format("%d",ctri));
if (wasdel) _del->rewrite(); _del->rewrite();
else _del->write();
} }
@ -1199,15 +1224,14 @@ void Visliq_app::write_general(TMask& m)
// write delega acconto // write delega acconto
if (ac_mod) if (ac_mod)
{ {
bool was = look_del(12,7,TRUE); look_del(12,7,TRUE);
_del->put("R0",nacct); _del->put("R0",nacct);
_del->put("R1",""); _del->put("R1","");
_del->put("S7",anabi); _del->put("S7",anabi);
_del->put("S8",ancab); _del->put("S8",ancab);
_del->put("S9",ancon); _del->put("S9",ancon);
_del->put("S6","6013"); _del->put("S6","6013");
if (was) _del->rewrite(); _del->rewrite();
else _del->write();
} }
} }

View File

@ -89,6 +89,7 @@ public:
// 2 palle // 2 palle
TMask* get_main_mask() { return _mask; } TMask* get_main_mask() { return _mask; }
bool select_butt(TMask& m);
// riaggiusta la liquidazione del mese dato // riaggiusta la liquidazione del mese dato
void recalc_liq_data(TViswin* v, real& rimb, real& rett, real& vers, void recalc_liq_data(TViswin* v, real& rimb, real& rett, real& vers,