diff --git a/m770/77stba.cpp b/m770/77stba.cpp index 1ea797026..458c5acb5 100755 --- a/m770/77stba.cpp +++ b/m770/77stba.cpp @@ -1055,7 +1055,9 @@ void TQuadroL::stampa_testata(TPrinter& pr) progind()->addstatus(1); } -bool TQuadroL::stampa_L(TPrinter& pr,const long lStartRec,const int iRecL) +// Stampa fino a iRecL record del quadro L. +// Incrementa lStartRec per ogni incremento del cursore +bool TQuadroL::stampa_L(TPrinter& pr,long& lStartRec,const int iRecL) { long codit=0L; bool eof=FALSE; @@ -1085,7 +1087,8 @@ bool TQuadroL::stampa_L(TPrinter& pr,const long lStartRec,const int iRecL) if (usa_progind()) progind()->addstatus(1); righe++; - ++cur; + ++cur; + lStartRec++; // eof=cur.pos()==cur.items(); bFinitaPagina = (righe==iRecL); } @@ -1185,7 +1188,7 @@ bool TQuadroL::print(const long codditta, const long NumFis, const long NumNoFis calcola_totali_precedenti(); pr.formlen(dic_form_len()); - int lOffsetL=_START_AGG_L-1; + long lOffsetL=_START_AGG_L-1; (*cur)=lOffsetL; bool finito=FALSE; while (!finito) @@ -1198,7 +1201,7 @@ bool TQuadroL::print(const long codditta, const long NumFis, const long NumNoFis pr.formlen(dic_form_len()); if (!finito) { - lOffsetL+=_REC_PRIMA_AGG_L; + //lOffsetL+=_REC_PRIMA_AGG_L; jump_to_line(pr, prima_riga(SECONDA)); finito=stampa_L(pr,lOffsetL,_REC_SECONDA_AGG_L); } diff --git a/m770/77stba.h b/m770/77stba.h index 93f9aab4d..e21462606 100755 --- a/m770/77stba.h +++ b/m770/77stba.h @@ -267,7 +267,7 @@ class TQuadroL : public TDicForm protected: void stampa_testata(TPrinter& pr); void stampa_totali_L(TPrinter& pr); - bool stampa_L(TPrinter& pr,const long lStartRec,const int iRecL); + bool stampa_L(TPrinter& pr,long& lStartRec,const int iRecL); virtual void next_page(TPrinter& pr) { fill_page(pr, -1); } virtual void set_body(TPrinter& pr, const char tipo) {} virtual int prima_riga(PaginaQuadro p) const; @@ -369,7 +369,8 @@ class TStampaAlleSoci : public TStampaQuadro class TQuadroGAgg : public TDicForm { long _codditta; - public: + public: + bool EsisteAllegG(const long codditta); virtual bool print(const long codditta, const long NumFis = 0, const long NumNoFis = 0); TQuadroGAgg(const char* sNomeForm, const char* quadro) : TDicForm(sNomeForm, quadro) {} virtual ~TQuadroGAgg() {} diff --git a/m770/77stqga.cpp b/m770/77stqga.cpp index 3459f8129..7d1b2e243 100755 --- a/m770/77stqga.cpp +++ b/m770/77stqga.cpp @@ -6,13 +6,44 @@ const int PRIMO_IMPORTO = 24; const int PRIMA_ALIQUOTA = 49; +// determina se codditta necessita dell'all.G +bool TQuadroGAgg::EsisteAllegG(const long codditta) +{ + TString filtr(24); + _codditta=codditta; + TCursor* cur=cursor(); + filtr.format("CODDITTA==%ld", codditta); + cur->setfilter(filtr, TRUE); + const long items = cur->items(); + if (!items) + return FALSE; + + (*cur)=0L; + TRectype& rec = cur->curr(); + TToken_string p35a(rec.get("P35A")); + + for (int i=0; i<20; i++) + { + if (i == 6 || i == 10 || i == 13 || i == 16 || i == 19) + { + TString aliquota = p35a.get(i); + if (!aliquota.blank()) + return TRUE; + } + } + return FALSE; +} + bool TQuadroGAgg::print(const long codditta, const long NumFis, const long NumNoFis) { TCursor* cur = cursor(); TPrinter& pr = printer(); - - // MA SERVE??? - (*cur)=0L; + + if (!EsisteAllegG(codditta)) + return FALSE; + + // MA SERVE??? +// (*cur)=0L; TRectype& rec = cur->curr(); diff --git a/m770/menu_st.uml b/m770/menu_st.uml index 441fccd9b..142ccc832 100755 --- a/m770/menu_st.uml +++ b/m770/menu_st.uml @@ -99,7 +99,7 @@ BUTTON B_ALLG 1 1 BEGIN PROMPT 1 ROW5 "" PICTURE 123 -// MESSAGE RUN,771MOD,-1 + MESSAGE RUN,772MOD,-4,J,S GROUP 1 END diff --git a/m770/menustq.uml b/m770/menustq.uml index 671da08be..c43a6d1e8 100755 --- a/m770/menustq.uml +++ b/m770/menustq.uml @@ -93,7 +93,7 @@ BUTTON B_ALLG 1 1 BEGIN PROMPT 1 ROW5 "" PICTURE 123 -// MESSAGE RUN,771MOD,-1 + MESSAGE RUN,772MOD,-4,J,D FLAGS MYFLAGS GROUP GRUPPO END