From 1877ed7dee57994da6a757672d54cecf7fa09439 Mon Sep 17 00:00:00 2001 From: villa Date: Fri, 30 Dec 1994 10:10:28 +0000 Subject: [PATCH] Aggiustamenti selezione ditte per liquidazione, deleghe, acconto git-svn-id: svn://10.65.10.50/trunk@806 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.cpp | 6 ++-- cg/cg4301.cpp | 2 ++ cg/cg4305.cpp | 97 ++++++++++++++++++-------------------------------- cg/cg5500b.uml | 7 ++-- cg/cg5500c.uml | 4 +-- 5 files changed, 45 insertions(+), 71 deletions(-) diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 95a01999c..da72ea47e 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -181,6 +181,8 @@ bool TLiquidazione_app::user_create() } } + build_ditte_sheet(all); + if (pnd) pnd->addstatus(1); 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_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; // stampa abilitata per default m.set(CG43_CHK_STAMPA,"X"); _month = m.get_int(CG43_LST_MESE); - build_ditte_sheet(all); do { diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index d76dcc7b1..adfe82b08 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -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 ala = imp_a.is_zero() ? real(0.0) : (iva_a / imp_a); + alv.round(2); + ala.round(2); // condizione 2 if (ala > alv) diff --git a/cg/cg4305.cpp b/cg/cg4305.cpp index 4cc47bab1..897eda6f3 100755 --- a/cg/cg4305.cpp +++ b/cg/cg4305.cpp @@ -15,7 +15,7 @@ bool TLiquidazione_app::set_deleghe() { TMask m("cg4300b.msk"); int k = 0; - long l, j; + long j; _calcall = FALSE; for (;;) @@ -25,41 +25,21 @@ bool TLiquidazione_app::set_deleghe() 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) { 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(); - for (j = 0l; j < _ditte->items(); j++) if (_ditte->checked(j)) _selected.set(j); - break; + 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; k = K_ENTER; break; @@ -81,26 +61,31 @@ bool TLiquidazione_app::extract_deleghe() long firm = TApplication::get_firm(); _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(), - " Estrazione deleghe " - " preparazione archivi \n ", + " Estrazione deleghe \n" + " preparazione archivi \n " + " \n ", TRUE,TRUE,40); - long l; - for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next()) + for (int l = 0; l < _ditte->items(); l++) { if (_prind->iscancelled()) break; - if (!(_calcall || _selected[l])) continue; - - if (!prefhndl->exist(_nditte_r->get_long("CODDITTA"))) + if (!(_calcall || _selected[l]) || _ditte->disabled(l)) 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 ", _month, (const char*)_nditte_r->get("RAGSOC")); _prind->set_text(buf); + + if (is_month_ok(_month)) { _isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4"); @@ -158,10 +143,9 @@ bool TLiquidazione_app::set_acconto() TMask m("cg4300c.msk"); m.set(CHK_CGC_PRINT,"X"); - int k = 0; + int k = 0; long j; + _calcall = FALSE; - _selected.reset(); - long j; for (;;) { @@ -177,27 +161,7 @@ bool TLiquidazione_app::set_acconto() switch (k) { 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 _ditte->run(); @@ -206,6 +170,10 @@ bool TLiquidazione_app::set_acconto() break; 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; k = K_ENTER; break; @@ -219,19 +187,20 @@ bool TLiquidazione_app::recalc_acconti() { char buf[256]; - long l; bool onemade = FALSE; + bool onemade = FALSE; long firm = TApplication::get_firm(); _prind = new TProgind(_n_ditte, " Calcolo acconto " - "\n Preparazione archivi ", + "\n Preparazione archivi " + "\n ", TRUE,TRUE,40); - for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next()) + for (int l = 0; l < _ditte->items(); l++) { if (_prind->iscancelled()) break; - if (_calcall || _selected[l]) + if ((_calcall || _selected[l]) && !_ditte->disabled(l)) { if (onemade == FALSE && _isprint) { @@ -241,6 +210,10 @@ bool TLiquidazione_app::recalc_acconti() _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")); sprintf (buf,"Calcolo acconto:\nditta %s", (const char*)_nditte_r->get("RAGSOC")); diff --git a/cg/cg5500b.uml b/cg/cg5500b.uml index 08682bbc9..007ccf04a 100755 --- a/cg/cg5500b.uml +++ b/cg/cg5500b.uml @@ -87,7 +87,7 @@ ENDMASK PAGE "Prospetto mensile" -1 -1 50 10 -STRING 102 10 +STRING 102 20 BEGIN PROMPT 1 2 "Mese " END @@ -142,7 +142,7 @@ ENDMASK PAGE "Prospetto versamenti" -1 -1 50 12 -STRNG 102 10 +STRING 102 20 BEGIN PROMPT 1 2 "Mese " END @@ -190,9 +190,6 @@ BUTTON 101 10 2 BEGIN PROMPT -22 -1 "Calcola" END - - - ENDPAGE diff --git a/cg/cg5500c.uml b/cg/cg5500c.uml index af1c743f1..992253971 100755 --- a/cg/cg5500c.uml +++ b/cg/cg5500c.uml @@ -65,7 +65,7 @@ ENDMASK PAGE "Prospetto mensile" -1 -1 50 10 -STRING 102 10 +STRING 102 20 BEGIN PROMPT 1 2 "Mese " END @@ -119,7 +119,7 @@ ENDMASK PAGE "Prospetto versamenti" -1 -1 50 12 -STRING 102 10 +STRING 102 20 BEGIN PROMPT 1 2 "Mese " END