Aggiustamenti selezione ditte per liquidazione, deleghe, acconto

git-svn-id: svn://10.65.10.50/trunk@806 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-12-30 10:10:28 +00:00
parent 1b10a93af5
commit 1877ed7dee
5 changed files with 45 additions and 71 deletions

View File

@ -181,6 +181,8 @@ bool TLiquidazione_app::user_create()
} }
} }
build_ditte_sheet(all);
if (pnd) pnd->addstatus(1); if (pnd) pnd->addstatus(1);
TApplication::set_firm(__firm); TApplication::set_firm(__firm);
@ -527,14 +529,14 @@ bool TLiquidazione_app::set_liquidazione()
m.set_handler(CG43_BUT_DFR, fr_butt_handler); m.set_handler(CG43_BUT_DFR, fr_butt_handler);
m.set_handler(CG43_RDB_VERS, what_freq_handler); m.set_handler(CG43_RDB_VERS, what_freq_handler);
m.field(CG43_FLD_SELECTED).set("0"); m.field(CG43_FLD_SELECTED).set(format("%ld",_selected.ones()));
set_choice_limits(m);
KEY k; KEY k;
// stampa abilitata per default // stampa abilitata per default
m.set(CG43_CHK_STAMPA,"X"); m.set(CG43_CHK_STAMPA,"X");
_month = m.get_int(CG43_LST_MESE); _month = m.get_int(CG43_LST_MESE);
build_ditte_sheet(all);
do do
{ {

View File

@ -991,6 +991,8 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
real alv = vol_aff.is_zero() ? real(0.0) : (iva_v / vol_aff); real alv = vol_aff.is_zero() ? real(0.0) : (iva_v / vol_aff);
real ala = imp_a.is_zero() ? real(0.0) : (iva_a / imp_a); real ala = imp_a.is_zero() ? real(0.0) : (iva_a / imp_a);
alv.round(2);
ala.round(2);
// condizione 2 // condizione 2
if (ala > alv) if (ala > alv)

View File

@ -15,7 +15,7 @@ bool TLiquidazione_app::set_deleghe()
{ {
TMask m("cg4300b.msk"); TMask m("cg4300b.msk");
int k = 0; int k = 0;
long l, j; long j;
_calcall = FALSE; _calcall = FALSE;
for (;;) for (;;)
@ -25,41 +25,21 @@ bool TLiquidazione_app::set_deleghe()
k = m.run(); k = m.run();
// _isprint = m.get_bool(CHK_CGB_PRINT);
// _isbase = m.get_bool(CHK_CGB_BASE);
// _basecalc = (tbc)m.get_long(RDB_CGB_BASE);
switch (k) switch (k)
{ {
case DLG_SELECT: case DLG_SELECT:
_selected.reset();
_ditte->destroy();
// build sheet
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
{
TString cod = _nditte_r->get("CODDITTA");
TString vers = _freqviva;
TToken_string d(" ");
// add record
d.add(cod);
d.add(_nditte_r->get("RAGSOC"));
d.add(vers);
_ditte->add(d);
if (_selected[l]) _ditte->check(l);
}
// scegli ditte
_ditte->run(); _ditte->run();
for (j = 0l; j < _ditte->items(); j++) for (j = 0l; j < _ditte->items(); j++)
if (_ditte->checked(j)) _selected.set(j); if (_ditte->checked(j)) _selected.set(j);
break; break;
case BUT_CGB_ALL: case BUT_CGB_ALL:
_ditte->check(-1);
for (j = 0l; j < _ditte->items(); j++)
if (_ditte->checked(j) && !_ditte->disabled(j))
_selected.set(j);
_calcall = TRUE; _calcall = TRUE;
k = K_ENTER; k = K_ENTER;
break; break;
@ -81,26 +61,31 @@ bool TLiquidazione_app::extract_deleghe()
long firm = TApplication::get_firm(); long firm = TApplication::get_firm();
_prind = new TProgind(_calcall ? _n_ditte : _selected.ones(), _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
" Estrazione deleghe " " Estrazione deleghe \n"
" preparazione archivi \n ", " preparazione archivi \n "
" \n ",
TRUE,TRUE,40); TRUE,TRUE,40);
long l; for (int l = 0; l < _ditte->items(); l++)
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
{ {
if (_prind->iscancelled()) if (_prind->iscancelled())
break; break;
if (!(_calcall || _selected[l])) continue; if (!(_calcall || _selected[l]) || _ditte->disabled(l))
if (!prefhndl->exist(_nditte_r->get_long("CODDITTA")))
continue; continue;
TApplication::set_firm(_nditte->curr().get_long("CODDITTA")); TApplication::set_firm(atol(_ditte->row(l).get(1)));
_nditte->curr().zero();
_nditte->curr().put("CODDITTA",_ditte->row(l).get(1));
_nditte->read();
sprintf (buf,"Estrazione deleghe (%d):\nditta %s\n ", sprintf (buf,"Estrazione deleghe (%d):\nditta %s\n ",
_month, _month,
(const char*)_nditte_r->get("RAGSOC")); (const char*)_nditte_r->get("RAGSOC"));
_prind->set_text(buf); _prind->set_text(buf);
if (is_month_ok(_month)) if (is_month_ok(_month))
{ {
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4"); _isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4");
@ -158,10 +143,9 @@ bool TLiquidazione_app::set_acconto()
TMask m("cg4300c.msk"); TMask m("cg4300c.msk");
m.set(CHK_CGC_PRINT,"X"); m.set(CHK_CGC_PRINT,"X");
int k = 0; int k = 0; long j;
_calcall = FALSE; _calcall = FALSE;
_selected.reset();
long j;
for (;;) for (;;)
{ {
@ -177,26 +161,6 @@ bool TLiquidazione_app::set_acconto()
switch (k) switch (k)
{ {
case DLG_SELECT: case DLG_SELECT:
_selected.reset();
_ditte->destroy();
// build sheet
long l;
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
{
TString cod = _nditte_r->get("CODDITTA");
TString vers = _freqviva;
TToken_string d(" ");
// add record
d.add(cod);
d.add(_nditte_r->get("RAGSOC"));
d.add(vers);
_ditte->add(d);
if (_selected[l]) _ditte->check(l);
}
// scegli ditte // scegli ditte
_ditte->run(); _ditte->run();
@ -206,6 +170,10 @@ bool TLiquidazione_app::set_acconto()
break; break;
case BUT_CGC_ALL: case BUT_CGC_ALL:
_ditte->check(-1);
for (j = 0l; j < _ditte->items(); j++)
if (_ditte->checked(j) && !_ditte->disabled(j))
_selected.set(j);
_calcall = TRUE; _calcall = TRUE;
k = K_ENTER; k = K_ENTER;
break; break;
@ -219,19 +187,20 @@ bool TLiquidazione_app::recalc_acconti()
{ {
char buf[256]; char buf[256];
long l; bool onemade = FALSE; bool onemade = FALSE;
long firm = TApplication::get_firm(); long firm = TApplication::get_firm();
_prind = new TProgind(_n_ditte, _prind = new TProgind(_n_ditte,
" Calcolo acconto " " Calcolo acconto "
"\n Preparazione archivi ", "\n Preparazione archivi "
"\n ",
TRUE,TRUE,40); TRUE,TRUE,40);
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next()) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) if (_prind->iscancelled())
break; break;
if (_calcall || _selected[l]) if ((_calcall || _selected[l]) && !_ditte->disabled(l))
{ {
if (onemade == FALSE && _isprint) if (onemade == FALSE && _isprint)
{ {
@ -241,6 +210,10 @@ bool TLiquidazione_app::recalc_acconti()
_descr_arr.add(d); _descr_arr.add(d);
} }
_nditte->curr().zero();
_nditte->curr().put("CODDITTA",_ditte->row(l).get(1));
_nditte->read();
TApplication::set_firm(_nditte->curr().get_long("CODDITTA")); TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
sprintf (buf,"Calcolo acconto:\nditta %s", sprintf (buf,"Calcolo acconto:\nditta %s",
(const char*)_nditte_r->get("RAGSOC")); (const char*)_nditte_r->get("RAGSOC"));

View File

@ -87,7 +87,7 @@ ENDMASK
PAGE "Prospetto mensile" -1 -1 50 10 PAGE "Prospetto mensile" -1 -1 50 10
STRING 102 10 STRING 102 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 2 "Mese "
END END
@ -142,7 +142,7 @@ ENDMASK
PAGE "Prospetto versamenti" -1 -1 50 12 PAGE "Prospetto versamenti" -1 -1 50 12
STRNG 102 10 STRING 102 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 2 "Mese "
END END
@ -191,9 +191,6 @@ BEGIN
PROMPT -22 -1 "Calcola" PROMPT -22 -1 "Calcola"
END END
ENDPAGE ENDPAGE
ENDMASK ENDMASK

View File

@ -65,7 +65,7 @@ ENDMASK
PAGE "Prospetto mensile" -1 -1 50 10 PAGE "Prospetto mensile" -1 -1 50 10
STRING 102 10 STRING 102 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 2 "Mese "
END END
@ -119,7 +119,7 @@ ENDMASK
PAGE "Prospetto versamenti" -1 -1 50 12 PAGE "Prospetto versamenti" -1 -1 50 12
STRING 102 10 STRING 102 20
BEGIN BEGIN
PROMPT 1 2 "Mese " PROMPT 1 2 "Mese "
END END