Rinfurbita scelta anno liquidazione

Corrette cazzatelle


git-svn-id: svn://10.65.10.50/trunk@819 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-01-03 16:45:39 +00:00
parent 16f9494a42
commit d4a3b2a822
8 changed files with 8763 additions and 8734 deletions

View File

@ -15,6 +15,7 @@
#include <mov.h>
#include <mailbox.h>
#include <xvtility.h>
real TLiquidazione_app::CENTO(100.0);
@ -153,35 +154,9 @@ bool TLiquidazione_app::user_create()
if (_is_interactive)
{
TLocalisamfile& dt = _nditte->lfile();
for (dt.first(); !dt.eof(); dt.next())
{
// check no archivi
bool good = prefhndl->exist(dt.get_long("CODDITTA"));
if (good)
{
// check no parametri liquidazione
TApplication::set_firm(dt.get_long("CODDITTA"));
if (!look_lia()) good = FALSE;
}
_n_ditte++;
TToken_string* d = new TToken_string(64);
// add record
d->add(dt.get("CODDITTA"));
d->add(dt.get("RAGSOC"));
if (good) d->add(_lia->get("S7"));
else d->add("??");
_nomiditte.add(d);
}
}
build_nomiditte(pnd);
build_ditte_sheet(all);
}
if (pnd) pnd->addstatus(1);
@ -375,6 +350,51 @@ long TLiquidazione_app::select_firm_range(long from, long to, wht freq)
// ----------------------------------------------- handlers
bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key)
{
if (key == K_TAB && f.focusdirty())
{
app().begin_wait();
app().set_year(f.get());
app().build_nomiditte();
app().build_ditte_sheet((wht)atoi(f.mask().get(CG43_RDB_VERS)));
app().end_wait();
}
return TRUE;
}
void TLiquidazione_app::build_nomiditte(TProgind* pnd)
{
_nomiditte.destroy();
// ricostruire _nomiditte e rifare build_ditte_sheet
TLocalisamfile& dt = _nditte->lfile();
for (dt.first(); !dt.eof(); dt.next())
{
// check no archivi
bool good = prefhndl->exist(dt.get_long("CODDITTA"));
if (good)
{
// check no parametri liquidazione
TApplication::set_firm(dt.get_long("CODDITTA"));
if (!look_lia()) good = FALSE;
}
TToken_string* d = new TToken_string(64);
// add record
d->add(dt.get("CODDITTA"));
d->add(dt.get("RAGSOC"));
if (good) d->add(_lia->get("S7"));
else d->add("??");
_nomiditte.add(d);
if (pnd) pnd->addstatus(1);
}
TApplication::set_firm(__firm);
}
bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
{
TMask& m = f.mask();
@ -528,8 +548,10 @@ bool TLiquidazione_app::set_liquidazione()
m.set_handler(CG43_BUT_DTO, to_butt_handler);
m.set_handler(CG43_BUT_DFR, fr_butt_handler);
m.set_handler(CG43_RDB_VERS, what_freq_handler);
m.set_handler(CG43_FLD_ANNO, ch_year_handler);
m.field(CG43_FLD_SELECTED).set(format("%ld",_selected.ones()));
m.field(CG43_FLD_ANNO).set(_year);
set_choice_limits(m);
KEY k;

View File

@ -13,6 +13,8 @@
#include <tabutil.h>
#endif
class TProgind;
// ------------------------------------------------------------------
// Parametri modificabili
// ------------------------------------------------------------------
@ -259,10 +261,12 @@ class TLiquidazione_app : public TPrint_application
TRecfield* _lim_anno;
TRecfield* _lim_mese;
protected:
long select_firm_range(long from, long to, wht freq);
static bool ch_year_handler(TMask_field& f, KEY key);
static bool to_ditt_handler(TMask_field& f, KEY key);
static bool fr_ditt_handler(TMask_field& f, KEY key);
static bool to_butt_handler(TMask_field& f, KEY key);
@ -277,12 +281,15 @@ public:
virtual bool user_destroy();
virtual bool set_print(int i);
// cazzatelle per handlers
TArray_sheet* get_ditte_sheet() { return _ditte; }
TBit_array& get_selected() { return _selected; }
void build_ditte_sheet(wht);
void reset_choices(TMask&);
void set_choice_limits(TMask&);
void build_nomiditte(TProgind* pnd = NULL);
void set_year(const char* y) { _year = y; }
bool set_liquidazione();
bool recalc_all();

View File

@ -64,7 +64,7 @@ NUMBER CG43_FLD_ANNO 4
BEGIN
PROMPT 31 7 "Anno "
HELP "Anno per cui effettuare il calcolo"
FLAGS "A"
CHECKTYPE REQUIRED
END
LIST CG43_LST_MESE 13