diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index d1581e7f4..2bc5cf527 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -44,28 +44,6 @@ #include "cglib01.h" #include "cglib02.h" -class TSaldo_cdc : public TSaldo -{ -public: - bool data_limite_commessa(int bilancio, int g, int c, long s, - const TString& commessa, const TString& fase, const TDate& data_inf, - const TDate& data_sup, int indbil, int stp_prov); -}; - - -//per bilancio scalare (ovvero a sezioni contrapposte) per data limite -bool TSaldo_cdc::data_limite_commessa(int bilancio, int g, int c, long s, - const TString& commessa, const TString& fase, const TDate& data_inf, - const TDate& data_sup, int indbil, int stp_prov) -{ - TString filter; - filter << '(' << "CODCMS" << "==\"" << commessa << "\")"; - if (fase.not_empty()) - filter << "&&(" << "FASCMS" << "==\"" << fase << "\")"; - - return data_limite_bilancio(bilancio, g, c, s, data_inf, data_sup, indbil, stp_prov, filter); -} - class TStampa_bilanci : public TPrintapp { static bool mask_anno (TMask_field& f, KEY k); @@ -74,7 +52,6 @@ class TStampa_bilanci : public TPrintapp static bool mask_date (TMask_field& f, KEY k); static bool mask_bilancio(TMask_field& f, KEY k); static bool mask_tipost (TMask_field& f, KEY k); - static bool cdc_handler (TMask_field& f, KEY k); struct cli_for { @@ -138,11 +115,7 @@ class TStampa_bilanci : public TPrintapp bool _mov_ap,_quadratura; bool _print_exercise, _hide_clifo; int _stampa_mov_prov; - - TString _cdc, _fsc; - TBill _bill_from, _bill_to; - TArray _clienti, _fornitori; public: @@ -157,8 +130,6 @@ public: void next_c(); - void header_cdc(int& r); - virtual bool preprocess_print(int,int); virtual void preprocess_header(); virtual bool preprocess_page(int,int); @@ -567,23 +538,6 @@ bool TStampa_bilanci::verifica_handler(TMask_field& f, KEY k) return TRUE; } -bool TStampa_bilanci::cdc_handler(TMask_field& f, KEY k) -{ - if (k == K_TAB) - { - TMask& m = f.mask(); - const bool on = !(m.field(F_DACDC).empty() && m.field(F_ACDC).empty()); - if (!on) - { - m.reset(F_DAFSC); - m.reset(F_AFSC); - } - m.enable(F_DAFSC, on); - m.enable(F_AFSC, on); - } - return TRUE; -} - void TStampa_bilanci::scrivig_file_temp() { TIsamtempfile* tmp = NULL; @@ -853,7 +807,7 @@ void TStampa_bilanci::next_c() bool TStampa_bilanci::bil_sez_contr() { - TSaldo_cdc sld; + TSaldo sld; int indbil_conto=0; int g, c; long s; @@ -981,12 +935,7 @@ bool TStampa_bilanci::bil_sez_contr() } if (_tipo_stampa == 1) //bil. a sez. contrapposte per data limite - { - if (_cdc.not_empty()) - movimentato = sld.data_limite_commessa(_bilancio,g,c,s,_cdc,_fsc,_dataini,_datalim,indbil_conto,_stampa_mov_prov); - else - movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov); - } + movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov); else { if (_tipo_stampa == 2) //bil. a sez. contrapposte all'ultima immissione es. in corso @@ -1128,7 +1077,7 @@ bool TStampa_bilanci::bil_sez_contr() bool TStampa_bilanci::ricerca_sottoc_clifo(int g,int c, bool compensa, int indbil_conto,real& saldo) { - TSaldo_cdc sld; + TSaldo sld; int aep=0; long s, items; bool esiste_sc = FALSE; @@ -1153,14 +1102,10 @@ bool TStampa_bilanci::ricerca_sottoc_clifo(int g,int c, bool compensa, int indbi s = r->get_long(SLD_SOTTOCONTO); if (_tipo_stampa == 1) //bil. a sez. contrapposte per data limite - { - if (_cdc.not_empty()) - movimentato = sld.data_limite_commessa(_bilancio,g,c,s,_cdc,_fsc,_dataini,_datalim,indbil_conto,_stampa_mov_prov); - else - movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov); - } - else if (_tipo_stampa == 2) //bil. a sez. contrapposte all'ultima immissione es. in corso - movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto,_stampa_mov_prov); + movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov); + else + if (_tipo_stampa == 2) //bil. a sez. contrapposte all'ultima immissione es. in corso + movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto,_stampa_mov_prov); if (!movimentato) if (!sld.esiste_saldo() || !sld.significativo()) @@ -1472,7 +1417,7 @@ bool TStampa_bilanci::bil_verifica() _mov_ap = FALSE; //modifica del 19/06/95 movimentato = calcola(g,c,s); - if (_stampa_mov_prov != 3 && _cdc.empty()) + if (_stampa_mov_prov != 3) { if (movimentato) { @@ -1763,15 +1708,7 @@ bool TStampa_bilanci::calcola(int g, int c, long s) rmov.put(RMV_SOTTOCONTO,s); } - TString filter; - if (_cdc.not_empty()) - { - filter << '(' << "CODCMS" << "=='" << _cdc << "')"; - if (_fsc.not_empty()) - filter << "&&(" << "FASCMS" << "=='" << _fsc << "')"; - } - - TCursor cur(&rel, filter, 2, &rmov, &rmov); + TCursor cur(&rel, "", 2, &rmov, &rmov); const long items = cur.items(); cur.freeze(); @@ -1884,7 +1821,7 @@ bool TStampa_bilanci::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_fin //modifica del 19/06. Vedi appunti per capire bool movimentato = calcola(g,c,s); - if (_stampa_mov_prov != 3 && _cdc.empty()) + if (_stampa_mov_prov != 3) { if (movimentato) { @@ -3294,18 +3231,15 @@ void TStampa_bilanci::stampa_riga_totali(int r) set_row(r,"@131g%c", app); r++; - if (_cdc.empty()) // Non ha senso parlare di saldi iniziali delle commesse + if ((_tipo_stampa1 == 1 && _datada == _dataini) || _tipo_stampa1 == 2) { - if ((_tipo_stampa1 == 1 && _datada == _dataini) || _tipo_stampa1 == 2) - { - //modifica del 21/11/1995 - if (_tipo_stampa1 == 2) - set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); - else - set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); - //fine - } - } + //modifica del 21/11/1995 + if (_tipo_stampa1 == 2) + set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + else + set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + //fine + } } else { @@ -3320,16 +3254,13 @@ void TStampa_bilanci::stampa_riga_totali(int r) &_saldo_avere_tot,&_mov_dare_tot,&_mov_avere_tot, &_saldo_finale_tot); } - if (_cdc.empty()) // Non ha senso parlare di saldi iniziali delle commesse + if ((_tipo_stampa1 == 1 && _datada == _dataini) || _tipo_stampa1 == 2) { - if ((_tipo_stampa1 == 1 && _datada == _dataini) || _tipo_stampa1 == 2) - { - if (_tipo_stampa1 == 2) - set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); - else - set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); - } - } + if (_tipo_stampa1 == 2) + set_row(r,FR("@1g****** ********@17gTOTALE CON SALDI INIZIALI@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + else + set_row(r,FR("@1g****** ********@17gTOTALE CON MOVIM. DI APERTURA@46g!@80g!%r@98g%r@114g!@148g!"),&_nuovo_tot_saldo_d,&_nuovo_tot_saldo_a); + } } } } @@ -3824,8 +3755,6 @@ bool TStampa_bilanci::set_print(int) m.set_handler (F_DATADA, mask_date); m.set_handler (F_DATAA, mask_date); m.set_handler (F_ANNO, mask_anno); - m.set_handler (F_DACDC, cdc_handler); - m.set_handler (F_ACDC, cdc_handler); while (m.run() == K_ENTER) { @@ -3855,47 +3784,7 @@ bool TStampa_bilanci::set_print(int) } } - if (m.field(F_DACDC).active() && (m.get(F_DACDC).not_empty() || m.get(F_ACDC).not_empty())) - { - TRelation cdcrel("CMS"); - TRectype da_cdc(cdcrel.curr()), a_cdc(cdcrel.curr()); - da_cdc.put("CODTAB", m.get(F_DACDC)); - a_cdc.put("CODTAB", m.get(F_ACDC)); - TCursor cdccur(&cdcrel, "", 1, &da_cdc, &a_cdc); - const TRecnotype cdc_items = cdccur.items(); - cdccur.freeze(); - - TRelation fscrel("FSC"); - TRectype da_fsc(fscrel.curr()), a_fsc(fscrel.curr()); - da_fsc.put("CODTAB", m.get(F_DAFSC)); - a_fsc.put("CODTAB", m.get(F_AFSC)); - TCursor fsccur(&fscrel, "", 1, &da_fsc, &a_fsc); - const TRecnotype fsc_items = fsccur.items(); - fsccur.freeze(); - - for (cdccur = 0L; cdccur.pos() < cdc_items; ++cdccur) - { - _cdc = cdccur.curr().get("CODTAB"); - if (!da_fsc.empty() || !a_fsc.empty()) - { - for (fsccur = 0L; fsccur.pos() < fsc_items; ++fsccur) - { - _fsc = fsccur.curr().get("CODTAB"); - stampa_un_bilancio(m); - } - } - else - { - _fsc.cut(0); - stampa_un_bilancio(m); - } - } - } - else - { - _cdc.cut(0); _fsc.cut(0); - stampa_un_bilancio(m); - } + stampa_un_bilancio(m); } return FALSE; } @@ -3993,23 +3882,6 @@ int TStampa_bilanci::stampa_intestazione_ditta() return r; } -void TStampa_bilanci::header_cdc(int& r) -{ - if (_cdc.not_empty()) - { - const TString& desc_cdc = cache().get("CMS", _cdc, "S0"); - if (_fsc.not_empty()) - { - const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header(r++, "@b%s %s %s - %s %s %s", TR("Commessa"), - (const char*)_cdc, (const char*)desc_cdc, TR("Fase"), - (const char*)_fsc, (const char*)desc_fsc); - } - else - set_header(r++, "@b%s %s %s", TR("Commessa"), (const char*)_cdc, (const char*)desc_cdc); - } -} - void TStampa_bilanci::preprocess_header() { int r; @@ -4042,13 +3914,10 @@ void TStampa_bilanci::preprocess_header() const TString16 d2(FineEsercizio(_annoes).string()); set_header(r, "@84g%s %s %s", TR("Esercizio"), (const char*)d1, (const char*)d2); /**/ } - r++; - header_cdc(r); riga.fill('_'); - set_header(r, (const char*)riga); - r++; + set_header(++r, (const char*)riga); riga = ""; - set_header(r, (const char*)riga); + set_header(++r, (const char*)riga); } else // bilancio di verifica { @@ -4107,10 +3976,8 @@ void TStampa_bilanci::preprocess_header() else set_header(r, "@107g%s", TR("Conti con saldo <> 0")); } - r++; - header_cdc(r); riga.fill('_'); - set_header(r, (const char*)riga); + set_header(++r, (const char*)riga); r++; TString h("@7g!@46g!@55g"); diff --git a/cg/cg1500.h b/cg/cg1500.h index 4cc905b9d..1d61dedd6 100755 --- a/cg/cg1500.h +++ b/cg/cg1500.h @@ -24,10 +24,6 @@ #define F_QUADRATURA 123 #define F_SEPARATOR 124 #define F_PICTURE 125 -#define F_DACDC 126 -#define F_DAFSC 127 -#define F_ACDC 128 -#define F_AFSC 129 #define F_HIDE_CLIFO 130 #define F_DA_GRUPPO 132 #define F_DA_CONTO 133 diff --git a/cg/cg1500a.uml b/cg/cg1500a.uml index b7544881e..d30c63afb 100755 --- a/cg/cg1500a.uml +++ b/cg/cg1500a.uml @@ -182,61 +182,6 @@ BEGIN PROMPT 2 13 "Quadratura con Libro Giornale" END -GROUPBOX DLG_NULL 73 4 -BEGIN - PROMPT 2 14 "@bCentri di costo / Commesse" - GROUP 4 -END - -STRING F_DACDC 20 -BEGIN - PROMPT 3 15 "Da CDC/Commessa " - FLAGS "UZ" - USE CMS - INPUT CODTAB F_DACDC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 -END - -STRING F_DAFSC 10 -BEGIN - PROMPT 50 15 "Da Fase " - USE FSC - INPUT CODTAB F_DAFSC - DISPLAY "Codice@10" CODTAB - DISPLAY "Descrizione@50" S0 - OUTPUT F_DAFSC CODTAB - CHECKTYPE SEARCH - GROUP 4 -END - -STRING F_ACDC 20 -BEGIN - PROMPT 3 16 "A CDC/Commessa " - FLAGS "UZ" - COPY USE F_DACDC - INPUT CODTAB F_ACDC - COPY DISPLAY F_DACDC - OUTPUT F_ACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 -END - -STRING F_AFSC 10 -BEGIN - PROMPT 50 16 "A Fase " - FLAGS "UZ" - COPY USE F_DAFSC - INPUT CODTAB F_AFSC - COPY DISPLAY F_DAFSC - OUTPUT F_AFSC CODTAB - CHECKTYPE SEARCH - GROUP 4 -END - ENDPAGE PAGE "Parametri bilancio di verifica" -1 -1 74 20 diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index 0fb72c302..46b8baf97 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -1685,25 +1685,6 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k) return true; } -/* qui -bool TPrimanota_application::cg_tipo_handler(TMask_field& f, KEY key) -{ - if (key == K_TAB && f.focusdirty() || key == K_ENTER) - { - TMask& m = f.mask(); - const bool on = f.get().blank() && m.field(CG_SOTTOCONTO).active(); - if (!on) - { - m.reset(CG_COMMESSA); - m.reset(CG_FASE); - } - m.enable(CG_COMMESSA, on); - m.enable(CG_FASE, on); - } - return true; -} -*/ - // Il gruppo non possiede una ricerca propria per cui se viene variato richiama // quella del conto. bool TPrimanota_application::cg_gruppo_handler(TMask_field& f, KEY key) diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index ecb50ebef..e63fe5893 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -37,8 +37,6 @@ class TListaMov_application : public TPrintapp static bool data_inizio (TMask_field&, KEY); static bool data_fine (TMask_field&, KEY); - static bool cdc_handler (TMask_field& f, KEY k); - TRigaiva_array _c; TRelation * _relmov1,* _relmov2,* _relmov3; TCursor * _curr1, * _curr2, * _curr3; @@ -74,8 +72,7 @@ class TListaMov_application : public TPrintapp liste _tipo_lista; word _flags; char _tipoc; - TString _cdc, _fsc, _dacodiva, _acodiva; - bool _cdc_only, _print_cdc; + TString _dacodiva, _acodiva; TDecoder _simbval, _descdoc; protected: @@ -91,7 +88,6 @@ protected: void filtra_cursore_provvisori(TCursor* cur) const; void imposta_parametri_stampa(const TMask& msk); - void set_cdc_header(int& soh); bool codiva_filter(const TRelation* rel) const; bool rmoviva_filter(const TRectype& rmoviva) const; @@ -118,9 +114,6 @@ public: const TString& SimboloValuta (const char* cod); const TString& DescrDoc(const char* cod); - const TString& cdc() const { return _cdc; } - const TString& fsc() const { return _fsc; } - TListaMov_application(char tipost); virtual ~TListaMov_application() {} }; @@ -215,25 +208,6 @@ bool TListaMov_application::data_fine(TMask_field& f, KEY k) return TRUE; } -bool TListaMov_application::cdc_handler(TMask_field& f, KEY k) -{ - if (k == K_TAB) - { - TMask& m = f.mask(); - const bool on = !(m.field(F_DACDC).empty() && m.field(F_ACDC).empty()); - if (!on) - { - m.reset(F_DAFASE); - m.reset(F_AFASE); - m.reset(F_CDC_ONLY); - } - m.enable(F_DAFASE, on); - m.enable(F_AFASE, on); - m.enable(F_CDC_ONLY, on); - } - return TRUE; -} - bool TListaMov_application::RicercaDoc(const char * tipo) { const TRectype& tab_tpd = cache().get(TAB_TPD, tipo); @@ -475,36 +449,6 @@ HIDDEN int tipo_registro(const char* cod, int anno) return atoi(tipo_reg); } -// Controlla che il movimento abbia almeno una riga con la commessa voluta -bool cdc_filter(const TRelation* rel) -{ - bool ok = FALSE; - TLocalisamfile& rmov = rel->lfile(LF_RMOV); - const TRecnotype oldpos = rmov.recno(); - const long numreg = rel->curr(LF_MOV).get_long(MOV_NUMREG); - const TString& cdc = app().cdc(); - const TString& fsc = app().fsc(); - rmov.zero(); - rmov.put(RMV_NUMREG, numreg); - rmov.put(RMV_NUMRIG, 1); - for (int err = rmov.read(_isgteq); err == NOERR; err = rmov.next()) - { - if (rmov.get_long(RMV_NUMREG) != numreg) - break; - if (rmov.get("CODCMS") == cdc) - { - if (fsc.not_empty()) - ok = (rmov.get("FASCMS") == fsc); - else - ok = TRUE; - if (ok) - break; - } - } - rmov.readat(oldpos); - return ok; -} - bool TListaMov_application::rmoviva_filter(const TRectype& rmoviva) const { const TString& codiva = rmoviva.get(RMI_CODIVA); @@ -570,9 +514,6 @@ bool TListaMov_application::filter_func_fatture (const TRelation* rel) if (ok) ok = app().codiva_filter(rel); - if (ok && app().cdc().not_empty()) - ok = cdc_filter(rel); - return ok; } @@ -620,9 +561,6 @@ bool TListaMov_application::filter_func (const TRelation * rel) return false; } - if (app().cdc().not_empty()) - return cdc_filter(rel); - return true; } @@ -822,33 +760,7 @@ void TListaMov_application::set_page(int file, int count) { _nr = 1; const TRectype& rec = current_cursor()->curr(LF_RMOV); - if (_cdc.not_empty()) - { - if (rec.get("CODCMS") == _cdc) - { - if (_fsc.not_empty()) - { - if (rec.get("FASCMS") == _fsc) - { - if (!_cdc_only) - set_row(_nr,"@0g@b"); // Grassettiamo le righe interessate - } - else - { - if (_cdc_only) - return; - } - } - else - if (!_cdc_only) - set_row(_nr,"@0g@b"); // Grassettiamo le righe interessate - } - else - { - if (_cdc_only) - return; - } - } + set_row(_nr,"@3n",FLD(LF_RMOV,RMV_NUMRIG)); set_row(_nr,"@30g@22s",FLD(LF_RMOV,RMV_DESCR)); set_row(_nr,"@54g@3,rn",FLD(LF_RMOV,RMV_GRUPPO)); @@ -860,23 +772,6 @@ void TListaMov_application::set_page(int file, int count) set_row(_nr,"@90g@n",FLD(LF_RMOV,RMV_IMPORTO)); else set_row(_nr,"@110g@n",FLD(LF_RMOV,RMV_IMPORTO)); - if (_print_cdc) - { - TString80 cms = rec.get("CODCMS"); - if (cms.not_empty()) - { - TString riga_commessa(132); - riga_commessa << "@0g@b" << cms; - riga_commessa << "@21g" << cache().get("CMS", cms, "S0"); - cms = rec.get("FASCMS"); - if (cms.not_empty()) - { - riga_commessa << "@72g" << cms; - riga_commessa << "@83g" << cache().get("FSC", cms, "S0"); - } - set_row (_nr+1, riga_commessa); - } - } } else if (file == LF_MOV) { @@ -1412,25 +1307,25 @@ print_action TListaMov_application::postprocess_page(int file,int count) _tot_dare_giornaliero += _tot_dare; //stampa i totali giornalieri - if (!_cdc_only) + if ( FINITO || + (_datareg != datarec)||(_numreg == _numreg_fin)) { - if (FINITO || (_datareg != datarec)||(_numreg == _numreg_fin)) + if (( _scelta_stampa == 0 && _controllo_mov_errati != 1 && _decidi == 2) || (_scelta_stampa == 1 && _decidi == 2)) { - if (( _scelta_stampa == 0 && _controllo_mov_errati != 1 && _decidi == 2) || (_scelta_stampa == 1 && _decidi == 2)) - { - set_row(n, FR("@b@60gTotali del giorno %s"), _datareg.string()); - set_row(n++, "@b@90g%r %r", &_tot_dare_giornaliero, &_tot_avere_giornaliero); - _tot_avere_giornaliero = 0; - _tot_dare_giornaliero = 0; - } - if ((_scelta_stampa == 0 && _controllo_mov_errati != 1 && FINITO) || (_scelta_stampa == 1 && FINITO)) - { - set_row(n++,""); - set_row(n, FR("@b@60gTotale generale")); - set_row(n++, "@b@90g%r %r", &_tot_dare_generale, &_tot_avere_generale); - } - } //if(FINITO||(_datareg... - } //if(!_cdc_only... + set_row(n, FR("@b@60gTotali del giorno %s"), _datareg.string()); + set_row(n++, "@b@90g%r %r", &_tot_dare_giornaliero, &_tot_avere_giornaliero); + _tot_avere_giornaliero = 0; + _tot_dare_giornaliero = 0; + } + if ((_scelta_stampa == 0 && _controllo_mov_errati != 1 && FINITO) || (_scelta_stampa == 1 && FINITO)) + + { + set_row(n++,""); + set_row(n, FR("@b@60gTotale generale")); + set_row(n++, "@b@90g%r %r", &_tot_dare_generale, &_tot_avere_generale); + } + } + if (n == 1) { @@ -2174,58 +2069,12 @@ bool TListaMov_application::set_print(int) msk.set_handler(F_ANNO, annoes_handler); msk.set_handler(F_DATAINI, data_inizio); msk.set_handler(F_DATAFIN, data_fine); - msk.set_handler(F_DACDC, cdc_handler); - msk.set_handler(F_ACDC, cdc_handler); while (msk.run() == K_ENTER) { - _print_cdc = msk.get_bool(F_PRINTCDC); - if (msk.get(F_DACDC).not_empty() || msk.get(F_ACDC).not_empty()) - { - _cdc_only = msk.get_bool(F_CDC_ONLY); - TRelation rel("CMS"); - TRectype darec(rel.curr()), arec(rel.curr()); - darec.put("CODTAB", msk.get(F_DACDC)); - arec.put("CODTAB", msk.get(F_ACDC)); - TCursor cur(&rel, "", 1, &darec, &arec); - const long items = cur.items(); - cur.freeze(); + imposta_parametri_stampa(msk); + print(); - TRelation fscrel("FSC"); - TRectype da_fsc(fscrel.curr()), a_fsc(fscrel.curr()); - da_fsc.put("CODTAB", msk.get(F_DAFASE)); - a_fsc.put("CODTAB", msk.get(F_AFASE)); - TCursor fsccur(&fscrel, "", 1, &da_fsc, &a_fsc); - const TRecnotype fsc_items = fsccur.items(); - fsccur.freeze(); - - for (cur = 0L; cur.pos() < items; ++cur) - { - _cdc = rel.curr().get("CODTAB"); - if (!da_fsc.empty() || !a_fsc.empty()) - { - for (fsccur = 0L; fsccur.pos() < fsc_items; ++fsccur) - { - _fsc = fsccur.curr().get("CODTAB"); - imposta_parametri_stampa(msk); - print(); - } - } - else - { - _fsc.cut(0); - imposta_parametri_stampa(msk); - print(); - } - } - } - else - { - _cdc_only = false; - _cdc.cut(0); _fsc.cut(0); - imposta_parametri_stampa(msk); - print(); - } msk.reset(-5); } return false; @@ -2422,23 +2271,6 @@ void TListaMov_application::init_print(const TMask& msk) } } -void TListaMov_application::set_cdc_header(int& soh) -{ - if (_cdc.not_empty()) - { - const TString& desc_cdc = cache().get("CMS", _cdc, "S0"); - if (_fsc.not_empty()) - { - const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header(++soh, FR("@bCommessa %s %s - Fase %s %s"), - (const char*)_cdc, (const char*)desc_cdc, - (const char*)_fsc, (const char*)desc_fsc); - } - else - set_header(++soh, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); - } -} - void TListaMov_application::preprocess_header() { int soh; // riga d'inizio dell'intestazione @@ -2530,7 +2362,6 @@ void TListaMov_application::preprocess_header() else set_header (soh, FR("@78gcon messaggio: data competenza")); } - set_cdc_header(soh); sep.fill('_'); set_header (++soh, (const char *) sep); set_header (++soh, FR("Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB")); @@ -2570,15 +2401,13 @@ void TListaMov_application::preprocess_header() if (_flags & ST_CAUSALE) { set_header(soh, FR("@86gdalla causale@100g%3s"),(const char*)_causale_ini); - set_header(soh++,FR("@104galla causale@117g%3s"),(const char*)_causale_fin); + set_header(soh,FR("@104galla causale@117g%3s"),(const char*)_causale_fin); } else - set_header (soh++, TR("@86gtutte le causali")); - set_cdc_header(soh); - soh++; + set_header (soh, TR("@86gtutte le causali")); sep.fill('_'); - set_header (soh++, (const char *) sep); - set_header (soh, FR("Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB")); + set_header (++soh, (const char *) sep); + set_header (++soh, FR("Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB")); } break; @@ -2607,7 +2436,6 @@ void TListaMov_application::preprocess_header() set_header (soh, FR("@74gdal codice %ld"), _codice_ini); set_header (soh, FR("@92gal codice %ld"), _codice_fin); } - set_cdc_header(soh); sep.fill('_'); set_header (++soh, (const char *) sep); set_header (++soh, FR("Numero Data Cod Prot. M Documento@48gCod Tp @75gTotale@101gCd Tp T O@129gNo")); @@ -2645,4 +2473,3 @@ int cg3100(int argc, char* argv[]) a.run(argc, argv, title); return TRUE; } - diff --git a/cg/cg3100.h b/cg/cg3100.h index f6a95e7ac..f2590c529 100755 --- a/cg/cg3100.h +++ b/cg/cg3100.h @@ -33,12 +33,6 @@ #define F_RAGSOCINI1 129 #define F_RAGSOCFIN1 130 #define F_SEPARATOR 131 -#define F_DACDC 132 -#define F_ACDC 133 -#define F_CDC_ONLY 134 -#define F_DAFASE 135 -#define F_AFASE 136 -#define F_PRINTCDC 137 #define F_DACODCAUS 139 #define F_DADESCRCAUS 140 #define F_ACODCAUS 141 diff --git a/cg/cg3100a.uml b/cg/cg3100a.uml index 7233c80dd..254f81bde 100755 --- a/cg/cg3100a.uml +++ b/cg/cg3100a.uml @@ -233,74 +233,6 @@ BEGIN ITEM "3|Solo provvisori" END -GROUPBOX DLG_NULL 71 5 -BEGIN - PROMPT 2 18 "@bCDC / Commesse" - GROUP 4 -END - -BOOLEAN F_PRINTCDC -BEGIN - PROMPT 22 18 "Stampa CDC/Commessa e fase relativa ad ogni riga" - GROUP 4 5 -END - -STRING F_DACDC 20 -BEGIN - PROMPT 3 19 "Da CDC/Commessa " - FLAGS "UZ" - USE CMS - INPUT CODTAB F_DACDC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_DAFASE 10 -BEGIN - PROMPT 50 19 "Da fase " - FLAGS "UZ" - USE FSC - INPUT CODTAB F_DAFASE - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DAFASE CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_ACDC 20 -BEGIN - PROMPT 3 20 "A CDC/Commessa " - FLAGS "UZ" - COPY USE F_DACDC - INPUT CODTAB F_ACDC - COPY DISPLAY F_DACDC - OUTPUT F_ACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_AFASE 10 -BEGIN - PROMPT 50 20 "A fase " - FLAGS "UZ" - COPY USE F_DAFASE - INPUT CODTAB F_AFASE - COPY DISPLAY F_DAFASE - OUTPUT F_AFASE CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -BOOLEAN F_CDC_ONLY -BEGIN - PROMPT 3 21 "Stampa solo le righe relative a CDC/Commesse " - GROUP 4 5 -END - ENDPAGE ENDMASK diff --git a/cg/cg3100b.uml b/cg/cg3100b.uml index 51de5c74a..a8cab3a6e 100755 --- a/cg/cg3100b.uml +++ b/cg/cg3100b.uml @@ -311,73 +311,6 @@ BEGIN COPY OUTPUT F_ACODIVA END -GROUPBOX DLG_NULL 71 5 -BEGIN - PROMPT 2 18 "@bCDC / Commesse" - GROUP 4 -END - -BOOLEAN F_PRINTCDC -BEGIN - PROMPT 22 18 "Stampa CDC/Commessa e fase relativa ad ogni riga" - GROUP 4 5 -END - -STRING F_DACDC 20 -BEGIN - PROMPT 3 19 "Da CDC/Commessa " - FLAGS "UZ" - USE CMS - INPUT CODTAB F_DACDC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_DAFASE 10 -BEGIN - PROMPT 50 19 "Da fase " - FLAGS "UZ" - USE FSC - INPUT CODTAB F_DAFASE - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DAFASE CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_ACDC 20 -BEGIN - PROMPT 3 20 "A CDC/Commessa " - FLAGS "UZ" - COPY USE F_DACDC - INPUT CODTAB F_ACDC - COPY DISPLAY F_DACDC - OUTPUT F_ACDC CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -STRING F_AFASE 10 -BEGIN - PROMPT 50 20 "A fase " - FLAGS "UZ" - COPY USE F_DAFASE - INPUT CODTAB F_AFASE - COPY DISPLAY F_DAFASE - OUTPUT F_AFASE CODTAB - CHECKTYPE SEARCH - GROUP 4 5 -END - -BOOLEAN F_CDC_ONLY -BEGIN - PROMPT 3 21 "Stampa solo le righe relative a CDC/Commesse " - GROUP 4 5 -END ENDPAGE ENDMASK diff --git a/cg/cg3200.cpp b/cg/cg3200.cpp index 81d07a8c9..19226a4a5 100755 --- a/cg/cg3200.cpp +++ b/cg/cg3200.cpp @@ -99,16 +99,13 @@ TFieldtypes TMastrini_record::type(const char* fieldname) const class TMastrini_application : public TPrintapp { - static bool anno_hnd(TMask_field& f, KEY k); static bool data_inizio (TMask_field& f, KEY k); static bool data_fine (TMask_field& f, KEY k); static bool gruppo_hnd (TMask_field& f, KEY k); - static bool tipocf_hnd (TMask_field& f, KEY k); static bool contoi_hnd (TMask_field& f, KEY k); static bool contof_hnd (TMask_field& f, KEY k); static bool sottoc_handler_ini (TMask_field& f, KEY k); static bool sottoc_handler_fine (TMask_field& f, KEY k); - static bool cdc_handler (TMask_field& f, KEY k); static bool memorizza_handler(TMask_field& f, KEY k); static bool scelte_notify(TSheet_field& s, int r, KEY k); @@ -161,15 +158,9 @@ class TMastrini_application : public TPrintapp int _rw, _conta_mastrini, _indice_array, _item, _item_lista, _indice_lista; int _ddociva_len; - bool _noseparator, _print_cdc; + bool _noseparator; TString _real_picture; - TString _cdc, _fsc, _riga_commessa; - - - real _totale_commessa_dare, _totale_commessa_avere, _saldo_commessa; - - protected: virtual bool user_create() ; virtual bool user_destroy(); @@ -189,7 +180,6 @@ protected: bool sheet2mask(); const char* real2str(const real& r) const; - bool show_cdc(); public: @@ -217,7 +207,6 @@ public: void carica_array_totali132(); void carica_array_totali198(); void stampa_totaliiva(); - void stampa_totali_commessa(); void ricerca_classe_IV(bool scelta); void data_fine_esercizio(int); const char* descrizione_gruppo(); @@ -280,43 +269,6 @@ bool TMastrini_application::process_link(int id, const char* txt) return mov.edit(); } -// Visualizzo le commesse se necessario -bool TMastrini_application::show_cdc() -{ - const bool okp = has_module(CMAUT); // Mostra campo "Stampa commesse" - bool okg = okp; // Mostra campi del gruppo delle commesse - if (okg) - { - okg = _msk->get_int(F_ANNO) != 0; // Controllo anno - if (okg) - { // Controllo se conto normale - const char ti = _msk->get(F_TIPOCF_INI)[0]; - const char tf = _msk->get(F_TIPOCF_FINE)[0]; - okg = ti <= ' ' && tf <= ' '; - } - } - _msk->show(-7, okg); - _msk->show(F_PRINTCDC, okp); - return okg; -} - -bool TMastrini_application::cdc_handler(TMask_field& f, KEY k) -{ - if (k == K_TAB) - { - TMask& m = f.mask(); - const bool on = !(m.field(F_DACDC).empty() && m.field(F_ACDC).empty()); - if (!on) - { - m.reset(F_DAFSC); - m.reset(F_AFSC); - } - m.enable(F_DAFSC, on); - m.enable(F_AFSC, on); - } - return TRUE; -} - bool TMastrini_application::sottoc_handler_ini(TMask_field& f, KEY key) { const TMask& m = f.mask(); @@ -466,13 +418,6 @@ bool TMastrini_application::gruppo_hnd (TMask_field& f, KEY k) return TRUE; } -bool TMastrini_application::tipocf_hnd (TMask_field& f, KEY k) -{ - if (k == K_SPACE) - app().show_cdc(); - return TRUE; -} - bool TMastrini_application::contoi_hnd (TMask_field& f, KEY k) { if (k == K_TAB && f.focusdirty() && f.mask().is_running()) @@ -653,20 +598,12 @@ bool TMastrini_application::almeno_un_record() TRelation rel(LF_RMOV); rel.add(LF_MOV, "NUMREG==NUMREG"); TRectype& rmov = rel.curr(); -// TRectype& mov = rel.curr(LF_MOV); - TString filter; - if (_cdc.not_empty()) - { - filter << '(' << "CODCMS" << "=='" << _cdc << "')"; - if (_fsc.not_empty()) - filter << "&&(" << "FASCMS" << "=='" << _fsc << "')"; - } rmov.zero(); rmov.put(RMV_GRUPPO, _gruppo); rmov.put(RMV_CONTO, _conto); rmov.put(RMV_SOTTOCONTO, _sottoc); - TCursor cur(&rel, filter, 2, &rmov, &rmov); + TCursor cur(&rel, "", 2, &rmov, &rmov); const long items = cur.items(); cur.freeze(); for (cur = 0L; cur.pos() < items; ++cur) @@ -697,13 +634,6 @@ bool TMastrini_application::almeno_un_record() return trovato; } -bool TMastrini_application::anno_hnd(TMask_field& f, KEY k) -{ - if (f.to_check(k, TRUE)) - app().show_cdc(); - return TRUE; -} - bool TMastrini_application::data_inizio(TMask_field& f, KEY k) { const TDate data = f.mask().get_date(F_DATAINI); @@ -981,32 +911,6 @@ void TMastrini_application::fai_stampa198() } } -void TMastrini_application::stampa_totali_commessa() -{ - if (_cdc.not_empty()) - { - { - _saldo_commessa = _totale_commessa_dare - _totale_commessa_avere; - - set_row (_rw,"@32g@b%s", TR("PROGRESSIVI COMMESSA")); - - if (_numcarat == 1) - { - set_row (_rw,"@66g%r", &_saldo_commessa); - set_row (_rw,"@83g%r", &_totale_commessa_dare); - set_row (_rw,"@100g%r", &_totale_commessa_avere); - } - else - { - set_row (_rw,"@100g%r", &_totale_commessa_dare); - set_row (_rw,"@117g%r", &_totale_commessa_avere); - if (_stampa_saldo_des < 3) - set_row (_rw,"@135g%r", &_saldo_commessa); - } - } - } -} - void TMastrini_application::stampa_totali132() { if (_nummast == 1 || _nummast == 3) @@ -1038,8 +942,6 @@ void TMastrini_application::stampa_totali132() set_row (_rw,"@100g%r", &_totprogre_avere_al); } - stampa_totali_commessa(); - _devi_stampare_footer = FALSE; } @@ -1238,8 +1140,6 @@ void TMastrini_application::stampa_totali198() set_row (_rw,"@135g%r", &_saldo_progre_al); } - stampa_totali_commessa(); - _devi_stampare_footer = FALSE; } @@ -1534,12 +1434,8 @@ bool TMastrini_application::preprocess_page(int file, int counter) case LF_RMOV: { TLocalisamfile& rmov = current_cursor()->file(LF_RMOV); - if (_cdc.not_empty() && rmov.get("CODCMS") != _cdc) - return FALSE; - if (_fsc.not_empty() && rmov.get("FASCMS") != _fsc) - return FALSE; - - //Il flag _gia_stampata_intestazione serve nella stampa in continuo, xche' + + //Il flag _gia_stampata_intestazione serve nella stampa in continuo, xche' //sono costretto a richiamare l'intestazione sia nella preprocess_page (per //i mastrini con intestazione a meta' pagina), sia nella preprocess_header //per i mastrini che si trovano a cavallo fra una pagina e quella successiva. @@ -1987,30 +1883,10 @@ bool TMastrini_application::preprocess_page(int file, int counter) //_riga.destroy(); } - if (_print_cdc) - { - const TString& cms = rmov.get("CODCMS"); - if (cms.not_empty()) - { - TString riga_commessa; - riga_commessa << "@0g@b" << cms; - riga_commessa << "@21g" << cache().get("CMS", cms, "S0"); - const TString& fas = rmov.get("FASCMS"); - if (fas.not_empty()) - { - riga_commessa << "@72g" << fas; - riga_commessa << "@83g" << cache().get("FSC", fas, "S0"); - } - const int jump = max(_d18->items(), max(_d22->items(), _d30->items())); - set_row (_rw+jump, riga_commessa); - } - } - if (_sezione == "D") { _totale_periodo_dare += _importo; _riporto_parziale_dare += _importo; - _totale_commessa_dare += _importo; if (_numcarat == 1) // Stampa 132 caratteri @@ -2026,7 +1902,6 @@ bool TMastrini_application::preprocess_page(int file, int counter) { _totale_periodo_avere += _importo; _riporto_parziale_avere += _importo; - _totale_commessa_avere += _importo; if (_numcarat == 1) // Stampa 132 caratteri @@ -2530,62 +2405,9 @@ bool TMastrini_application::set_print(int m) enable_print_menu(); enable_link("Collegamento prima nota: ", 'b'); - _print_cdc = _msk->get_bool(F_PRINTCDC); - - if (_msk->field(F_DACDC).active() && (_msk->get(F_DACDC).not_empty() || _msk->get(F_ACDC).not_empty())) - { - TRelation rel("CMS"); - TRectype darec(rel.curr()), arec(rel.curr()); - darec.put("CODTAB", _msk->get(F_DACDC)); - arec.put("CODTAB", _msk->get(F_ACDC)); - TCursor cur(&rel, "", 1, &darec, &arec); - const long items = cur.items(); - cur.freeze(); - - TRelation fscrel("FSC"); - TRectype da_fsc(fscrel.curr()), a_fsc(fscrel.curr()); - da_fsc.put("CODTAB", _msk->get(F_DAFSC)); - a_fsc.put("CODTAB", _msk->get(F_AFSC)); - TCursor fsccur(&fscrel, "", 1, &da_fsc, &a_fsc); - const TRecnotype fsc_items = fsccur.items(); - fsccur.freeze(); - - for (cur = 0L; cur.pos() < items; ++cur) - { - _cdc = rel.curr().get("CODTAB"); - if (!da_fsc.empty() || !a_fsc.empty()) - { - for (fsccur = 0L; fsccur.pos() < fsc_items; ++fsccur) - { - _fsc = fsccur.curr().get("CODTAB"); - do - { - _totale_commessa_dare = _totale_commessa_avere = ZERO; - print(); - } - while (need_to_repeat_print()); - } - } - else - { - _fsc.cut(0); - do - { - _totale_commessa_dare = _totale_commessa_avere = ZERO; - print(); - } - while (need_to_repeat_print()); - } - } - } - else - { - _cdc.cut(0); - _fsc.cut(0); - do - print(); - while (need_to_repeat_print()); - } + do + print(); + while (need_to_repeat_print()); _msk->reset(-8); } @@ -2797,20 +2619,6 @@ void TMastrini_application::crea_intestazione() set_header (1, "@122g%-.3s", (const char*) _prov); } - if (_cdc.not_empty()) - { - const TString& desc_cdc = cache().get("CMS", _cdc, "S0"); - if (_fsc.not_empty()) - { - const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header (2, FR("@bCommessa %s %-40s - Fase %s %-40s"), - (const char*)_cdc, (const char*)desc_cdc, - (const char*)_fsc, (const char*)desc_fsc); - } - else - set_header (2, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); - } - set_header (2, "@122g%s", (const char *) _msk->get(F_DATASTAMPA)); if (_nummast == 3) @@ -3157,18 +2965,11 @@ void TMastrini_application::calcola_progressivi_al(const TDate& data_fin) TRectype& rmov = rel.curr(); // const TRectype& mov = rel.curr(LF_MOV); - TString filter; - if (_cdc.not_empty()) - { - filter << "CODCMS" << "==\"" << _cdc << "\""; - if (_fsc.not_empty()) - filter << "&&(" << "FASCMS" << "==\"" << _fsc << "\")"; - } rmov.zero(); rmov.put(RMV_GRUPPO, _gruppo); rmov.put(RMV_CONTO, _conto); rmov.put(RMV_SOTTOCONTO, _sottoc); - TCursor cur(&rel, filter, 2, &rmov, &rmov); + TCursor cur(&rel, "", 2, &rmov, &rmov); const long items = cur.items(); cur.freeze(); for (cur = 0L; cur.pos() < items; ++cur) @@ -3233,70 +3034,67 @@ void TMastrini_application::calcola_progressivi(bool finali) saldo = ZERO; // saldo = Saldo iniziale (Guy: Ovvio no?) - if (_cdc.empty()) - { // Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto // uguali a quelli di rmov per il calcolo dei progressivi precedenti - saldi.setkey(2); - saldi.zero(); - saldi.put(SLD_GRUPPO, _gruppo); - saldi.put(SLD_CONTO, _conto); - saldi.put(SLD_SOTTOCONTO, _sottoc); - const TRectype record(saldi.curr()); - - for (saldi.read(_isgteq); saldi.good() && saldi.curr() == record; saldi.next()) - { - if (!saldi.get_bool(SLD_FLSCA)) - { - const int annoes_saldi = saldi.curr().get_int(SLD_ANNOES); - - //Calcola i progressivi dell'esercizio attuale - if (annoes_saldi == _anno_corrente) - { - progdare_attuale = saldi.get_real(SLD_PDARE); - progavere_attuale = saldi.get_real(SLD_PAVERE); - if (_stampa_mov_prov) - { - progdare_attuale += saldi.get_real(SLD_PDAREPRO); - progavere_attuale += saldi.get_real(SLD_PAVEREPRO); - } + saldi.setkey(2); + saldi.zero(); + saldi.put(SLD_GRUPPO, _gruppo); + saldi.put(SLD_CONTO, _conto); + saldi.put(SLD_SOTTOCONTO, _sottoc); + const TRectype record(saldi.curr()); - saldo = saldi.get_real(SLD_SALDO); - salini = saldi.get(SLD_FLAGSALINI)[0]; - _ultima_data_reg = saldi.get_date(SLD_DATAULMOV); - saldoini_attuale = saldi.get_real(SLD_SALDO); - salini_attuale = saldi.get_char(SLD_FLAGSALINI); - saldofine_attuale = saldi.get_real(SLD_SALDOFIN); - salfine_attuale = saldi.get_char(SLD_FLAGSALFIN); - } - } // if (!saldi.get_bool(SLD_FLSCA)) - } // FOR + for (saldi.read(_isgteq); saldi.good() && saldi.curr() == record; saldi.next()) + { + if (!saldi.get_bool(SLD_FLSCA)) + { + const int annoes_saldi = saldi.curr().get_int(SLD_ANNOES); - //Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo - // finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil - - if (_annomsk != 0) - { - if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5)) - { - const TRecnotype pos = saldi.recno(); - // W96SALDI del 18-07-96 saldofin_esprec usa il flag TRUE xche' deve - // considerare anche il saldo finale - saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,TRUE, _stampa_mov_prov); - saldi.readat(pos); - - if (saldo > ZERO) +//Calcola i progressivi dell'esercizio attuale + if (annoes_saldi == _anno_corrente) + { + progdare_attuale = saldi.get_real(SLD_PDARE); + progavere_attuale = saldi.get_real(SLD_PAVERE); + if (_stampa_mov_prov) { - progredare_eseprec = saldo; - progdare_prec = saldo; - } - else if (saldo < ZERO) - { - saldo = -saldo; - progreavere_eseprec = saldo; - progavere_prec = saldo; + progdare_attuale += saldi.get_real(SLD_PDAREPRO); + progavere_attuale += saldi.get_real(SLD_PAVEREPRO); } + + saldo = saldi.get_real(SLD_SALDO); + salini = saldi.get(SLD_FLAGSALINI)[0]; + _ultima_data_reg = saldi.get_date(SLD_DATAULMOV); + saldoini_attuale = saldi.get_real(SLD_SALDO); + salini_attuale = saldi.get_char(SLD_FLAGSALINI); + saldofine_attuale = saldi.get_real(SLD_SALDOFIN); + salfine_attuale = saldi.get_char(SLD_FLAGSALFIN); + } + } // if (!saldi.get_bool(SLD_FLSCA)) + } // FOR + +//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo +// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil + + if (_annomsk != 0) + { + if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5)) + { + const TRecnotype pos = saldi.recno(); + // W96SALDI del 18-07-96 saldofin_esprec usa il flag TRUE xche' deve + // considerare anche il saldo finale + saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,TRUE, _stampa_mov_prov); + saldi.readat(pos); + + if (saldo > ZERO) + { + progredare_eseprec = saldo; + progdare_prec = saldo; + } + else if (saldo < ZERO) + { + saldo = -saldo; + progreavere_eseprec = saldo; + progavere_prec = saldo; } } } @@ -3796,19 +3594,6 @@ int TMastrini_application::ricerca_gruppo(int start) set_row (r, "@r%s@23g@b%s", TR("Periodo di competenza"), (const char*) dataini); set_row (r, "@35g%s@r", (const char*) datafine); - if (_cdc.not_empty()) - { - const TString& desc_cdc = cache().get("CMS", _cdc, "S0"); - if (_fsc.not_empty()) - { - const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_row(++r, FR("@bCommessa %s %s - Fase %s %s"), - (const char*)_cdc, (const char*)desc_cdc, - (const char*)_fsc, (const char*)desc_fsc); - } - else - set_row(++r, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); - } } else { @@ -3871,12 +3656,9 @@ const char* TMastrini_application::descrizione_sottoconto() // o di quella dello spreadsheet della seconda pagina void TMastrini_application::set_handlers(TMask* msk) const { - msk->set_handler(F_ANNO, anno_hnd); msk->set_handler(F_DATAINI, data_inizio); msk->set_handler(F_DATAFINE, data_fine); msk->set_handler(F_GRUPPOFINE, gruppo_hnd); - msk->set_handler(F_TIPOCF_INI, tipocf_hnd); - msk->set_handler(F_TIPOCF_FINE, tipocf_hnd); msk->set_handler(F_CONTOINI_CONTO, contoi_hnd); msk->set_handler(F_CONTOFINE_CONTO, contof_hnd); @@ -3886,8 +3668,6 @@ void TMastrini_application::set_handlers(TMask* msk) const msk->set_handler(F_SOTTOCFINE_CONTO, sottoc_handler_fine); msk->set_handler(F_SOTTOCFINE_CLIENTE, sottoc_handler_fine); msk->set_handler(F_SOTTOCFINE_FORN, sottoc_handler_fine); - msk->set_handler(F_DACDC, cdc_handler); - msk->set_handler(F_ACDC, cdc_handler); } // Copia i parametri della prima pagina in una nuova riga dello spreadsheet diff --git a/cg/cg3200.h b/cg/cg3200.h index 60352148a..16fa2ed83 100755 --- a/cg/cg3200.h +++ b/cg/cg3200.h @@ -36,12 +36,7 @@ #define F_STAMPATOTIVA 114 #define F_SELEZ_STAMPA 115 #define F_STAMPAMOVPROV 116 -#define F_DACDC 117 -#define F_ACDC 118 -#define F_DAFSC 119 -#define F_AFSC 120 -#define F_PRINTCDC 123 -#define F_NOT_STAMPA_CONT 124 + #define F_SEPARATOR 150 #define F_SORTDESC 151 #define F_MEMORIZZA 500 @@ -54,4 +49,3 @@ #define F_DATASTAMPA 507 #endif // __CG3200_H - diff --git a/cg/cg3200a.uml b/cg/cg3200a.uml index f77a4e92c..b9144b036 100755 --- a/cg/cg3200a.uml +++ b/cg/cg3200a.uml @@ -430,72 +430,6 @@ BEGIN ITEM "3|Tutti" END -GROUPBOX DLG_NULL 71 5 -BEGIN - PROMPT 1 17 "@bCentri di costo / Commesse" - GROUP 7 -END - -BOOLEAN F_PRINTCDC -BEGIN - PROMPT 5 18 "Stampa Centro di costo/Commessa e Fase relativa ad ogni riga" - GROUP 7 -END - -STRING F_DACDC 20 -BEGIN - PROMPT 5 19 "Da CDC/Commessa " - FLAGS "UZ" - USE CMS - INPUT CODTAB F_DACDC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DACDC CODTAB - CHECKTYPE SEARCH - GROUP 7 8 - -END - -STRING F_DAFSC 10 -BEGIN - PROMPT 50 19 "Da Fase " - FLAGS "UZ" - USE FSC - INPUT CODTAB F_DAFSC - DISPLAY "Codice@10" CODTAB - DISPLAY "Descrizione@50" S0 - OUTPUT F_DAFSC CODTAB - CHECKTYPE SEARCH - GROUP 7 - -END - -STRING F_ACDC 20 -BEGIN - PROMPT 5 20 "A CDC/Commessa " - FLAGS "UZ" - COPY USE F_DACDC - INPUT CODTAB F_ACDC - COPY DISPLAY F_DACDC - OUTPUT F_ACDC CODTAB - CHECKTYPE SEARCH - GROUP 7 - -END - -STRING F_AFSC 10 -BEGIN - PROMPT 50 20 "A Fase " - FLAGS "UZ" - COPY USE F_DAFSC - INPUT CODTAB F_AFSC - COPY DISPLAY F_DAFSC - OUTPUT F_AFSC CODTAB - CHECKTYPE SEARCH - GROUP 7 - -END - ENDPAGE PAGE "Parametri" -1 -1 78 20 @@ -533,8 +467,6 @@ BEGIN ITEM "Totali IVA" ITEM "Tipo stampa" ITEM "Provv." - ITEM "Da commessa" - ITEM "A commessa" END ENDPAGE @@ -945,52 +877,6 @@ BEGIN ITEM "3|Completa" END -STRING F_DACDC 20 -BEGIN - PROMPT 1 11 "Da CDC/Commessa " - FLAGS "UZ" - USE CMS - INPUT CODTAB F_DACDC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DACDC CODTAB - CHECKTYPE SEARCH -END - -STRING F_DAFSC 10 -BEGIN - PROMPT 50 11 "Da fase " - FLAGS "UZ" - USE FSC - INPUT CODTAB F_DAFSC - DISPLAY "Codice@20" CODTAB - DISPLAY "Descrizione@70" S0 - OUTPUT F_DAFSC CODTAB - CHECKTYPE SEARCH -END - -STRING F_ACDC 20 -BEGIN - PROMPT 1 12 "A CDC/Commessa " - FLAGS "UZ" - COPY USE F_DACDC - INPUT CODTAB F_ACDC - COPY DISPLAY F_DACDC - OUTPUT F_ACDC CODTAB - CHECKTYPE SEARCH -END - -STRING F_AFSC 10 -BEGIN - PROMPT 50 12 "A fase " - FLAGS "UZ" - COPY USE F_DAFSC - INPUT CODTAB F_AFSC - COPY DISPLAY F_DAFSC - OUTPUT F_AFSC CODTAB - CHECKTYPE SEARCH -END - BUTTON DLG_OK 10 2 BEGIN PROMPT -13 -1 ""