Corretto L agg. e filtro in all.G

git-svn-id: svn://10.65.10.50/trunk@3849 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1996-10-30 10:54:27 +00:00
parent d104d60a02
commit 42036c85e4
5 changed files with 46 additions and 11 deletions

View File

@ -1055,7 +1055,9 @@ void TQuadroL::stampa_testata(TPrinter& pr)
progind()->addstatus(1); 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; long codit=0L;
bool eof=FALSE; bool eof=FALSE;
@ -1085,7 +1087,8 @@ bool TQuadroL::stampa_L(TPrinter& pr,const long lStartRec,const int iRecL)
if (usa_progind()) if (usa_progind())
progind()->addstatus(1); progind()->addstatus(1);
righe++; righe++;
++cur; ++cur;
lStartRec++;
// eof=cur.pos()==cur.items(); // eof=cur.pos()==cur.items();
bFinitaPagina = (righe==iRecL); bFinitaPagina = (righe==iRecL);
} }
@ -1185,7 +1188,7 @@ bool TQuadroL::print(const long codditta, const long NumFis, const long NumNoFis
calcola_totali_precedenti(); calcola_totali_precedenti();
pr.formlen(dic_form_len()); pr.formlen(dic_form_len());
int lOffsetL=_START_AGG_L-1; long lOffsetL=_START_AGG_L-1;
(*cur)=lOffsetL; (*cur)=lOffsetL;
bool finito=FALSE; bool finito=FALSE;
while (!finito) while (!finito)
@ -1198,7 +1201,7 @@ bool TQuadroL::print(const long codditta, const long NumFis, const long NumNoFis
pr.formlen(dic_form_len()); pr.formlen(dic_form_len());
if (!finito) if (!finito)
{ {
lOffsetL+=_REC_PRIMA_AGG_L; //lOffsetL+=_REC_PRIMA_AGG_L;
jump_to_line(pr, prima_riga(SECONDA)); jump_to_line(pr, prima_riga(SECONDA));
finito=stampa_L(pr,lOffsetL,_REC_SECONDA_AGG_L); finito=stampa_L(pr,lOffsetL,_REC_SECONDA_AGG_L);
} }

View File

@ -267,7 +267,7 @@ class TQuadroL : public TDicForm
protected: protected:
void stampa_testata(TPrinter& pr); void stampa_testata(TPrinter& pr);
void stampa_totali_L(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 next_page(TPrinter& pr) { fill_page(pr, -1); }
virtual void set_body(TPrinter& pr, const char tipo) {} virtual void set_body(TPrinter& pr, const char tipo) {}
virtual int prima_riga(PaginaQuadro p) const; virtual int prima_riga(PaginaQuadro p) const;
@ -369,7 +369,8 @@ class TStampaAlleSoci : public TStampaQuadro
class TQuadroGAgg : public TDicForm class TQuadroGAgg : public TDicForm
{ {
long _codditta; long _codditta;
public: public:
bool EsisteAllegG(const long codditta);
virtual bool print(const long codditta, const long NumFis = 0, const long NumNoFis = 0); virtual bool print(const long codditta, const long NumFis = 0, const long NumNoFis = 0);
TQuadroGAgg(const char* sNomeForm, const char* quadro) : TDicForm(sNomeForm, quadro) {} TQuadroGAgg(const char* sNomeForm, const char* quadro) : TDicForm(sNomeForm, quadro) {}
virtual ~TQuadroGAgg() {} virtual ~TQuadroGAgg() {}

View File

@ -6,13 +6,44 @@
const int PRIMO_IMPORTO = 24; const int PRIMO_IMPORTO = 24;
const int PRIMA_ALIQUOTA = 49; 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) bool TQuadroGAgg::print(const long codditta, const long NumFis, const long NumNoFis)
{ {
TCursor* cur = cursor(); TCursor* cur = cursor();
TPrinter& pr = printer(); TPrinter& pr = printer();
// MA SERVE??? if (!EsisteAllegG(codditta))
(*cur)=0L; return FALSE;
// MA SERVE???
// (*cur)=0L;
TRectype& rec = cur->curr(); TRectype& rec = cur->curr();

View File

@ -99,7 +99,7 @@ BUTTON B_ALLG 1 1
BEGIN BEGIN
PROMPT 1 ROW5 "" PROMPT 1 ROW5 ""
PICTURE 123 PICTURE 123
// MESSAGE RUN,771MOD,-1 MESSAGE RUN,772MOD,-4,J,S
GROUP 1 GROUP 1
END END

View File

@ -93,7 +93,7 @@ BUTTON B_ALLG 1 1
BEGIN BEGIN
PROMPT 1 ROW5 "" PROMPT 1 ROW5 ""
PICTURE 123 PICTURE 123
// MESSAGE RUN,771MOD,-1 MESSAGE RUN,772MOD,-4,J,D
FLAGS MYFLAGS FLAGS MYFLAGS
GROUP GRUPPO GROUP GRUPPO
END END