diff --git a/cg/cg4300.h b/cg/cg4300.h index c8bf74055..604847335 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -78,6 +78,8 @@ enum tbc { precedente = 1, incorso = 2}; #define RIMBORSO 12 // prospetto rimborso infraannuale #define ACCONTO 13 // riga prospetto acconti #define ACCHEAD 14 // header prospetto acconti +#define RISDITTA 15 // riga tabulato deleghe +#define DELHEAD 16 // header tabulato deleghe // ............................................................... // support structs diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 2e9dba084..7c77cc1e2 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -137,7 +137,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) // se necessario (serve nelle chiamate ricorsive) // Ritorna FALSE soltanto se il ricalcolo era necessario e non e' // stato effettuato per scelta dello stronzo commercialista. - + look_lim(liq_month(month), TRUE); if (_isregis && _lim->get_bool("B1")) @@ -149,7 +149,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) _isricacq = cnf1.get_bool("RicAcq"); // ricalcolo normale - // TBI lim c'e' solo per i trimestri + // lim c'e' solo per i trimestri bool ok = _lim->get_bool("B0"); if (ok && !recalc) return TRUE; bool calc = (_recalc == ever || (_recalc == one && month == _month)); @@ -159,6 +159,9 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) TToken_string atts; TToken_string cattivs; + + // azzera rimborsi + zero_firm(month); _nditte->save_status(); if (_nditte->is_first_match(LF_ATTIV)) @@ -317,7 +320,22 @@ bool TLiquidazione_app::update_att(int month, const char* codatt, } return ok || calc; } - + +void TLiquidazione_app::zero_firm(int month) +{ + for (_rmb->first(); !_rmb->eof(); _rmb->next()) + { + if (atoi((const char*)(*_rmb_mese)) == month && + _year == (const char*)(*_rmb_anno)) + { + _rmb->put("R0",""); + _rmb->put("R1",""); + _rmb->put("R2",""); + _rmb->rewrite(); + } + } +} + void TLiquidazione_app::zero_att(int month, const char* codatt) { for (_pim->first(); !_pim->eof(); _pim->next()) @@ -420,7 +438,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) * Fatture in ritardo vengono considerate solo in dichiarazione * annuale */ - if (month != 13 && rcs.get_bool("RITFATT")) + if (_month != 13 && rcs.get_bool("RITFATT")) continue; /* diff --git a/cg/cg4303.cpp b/cg/cg4303.cpp index ddc291491..75eba65f2 100755 --- a/cg/cg4303.cpp +++ b/cg/cg4303.cpp @@ -422,13 +422,6 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts) alv = ivav/vtot; alv.round(2); ala = ivaa/atot; ala.round(2); - TString alvs = alv.string(); - TString alas = ala.string(); - TString vtots = vtot.string(); - TString atots = atot.string(); - TString ivavs = ivav.string(); - TString ivaas = ivaa.string(); - if (ala > alv) { rimborsami = TRUE; diff --git a/cg/cg4305.cpp b/cg/cg4305.cpp index b25cc6ec5..38082eb66 100755 --- a/cg/cg4305.cpp +++ b/cg/cg4305.cpp @@ -62,6 +62,8 @@ bool TLiquidazione_app::set_deleghe() bool TLiquidazione_app::extract_deleghe() { + bool onemade = FALSE; + char buf[256]; _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(), " Estrazione deleghe \n" @@ -101,7 +103,16 @@ bool TLiquidazione_app::extract_deleghe() (_month == 13 && (mens || _isbenzinaro)); _isriepilogo = _month == 13; _isendliq = _isannual || _isriepilogo; + +// if (onemade == FALSE && _isprint) +// { +// _DescrItem* d = new _DescrItem(DELHEAD); + // condire qui +// _descr_arr.add(d); +// } + extract_delega(_month); + onemade = TRUE; } _prind->addstatus(1); } @@ -118,6 +129,17 @@ bool TLiquidazione_app::extract_delega(int month) { real topay = result_liq(month); real intr = _lim->get_real("R14"); + + // per questa volta lasciamo perdere la describe_delega +// if (_isprint) +// { +// _DescrItem* d = new _DescrItem(RISDITTA); +// d->_r0 = topay; +// d->_r1 = intr; +// d->_s0 = _nditte->curr().get("CODDITTA"); +// d->_s1 = _nditte->curr().get("RAGSOC"); +// _descr_arr.add(d); +// } if (topay.sign() <= 0) return TRUE; @@ -235,7 +257,7 @@ bool TLiquidazione_app::recalc_acconto() if (_basecalc == incorso) { - // that's pazzesc but it turns out there's no better way + // that's pazzesc but as it turns out there's no better way _comp_acconto = TRUE; // force recalc of current month _recalc = one; @@ -299,5 +321,4 @@ bool TLiquidazione_app::recalc_acconto() _descr_arr.add(d); } return TRUE; -} - +} \ No newline at end of file