Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Statistiche: riepilogo finale a fine stampa + preso sez/sot dalle donazioni anziche' dal soggetto git-svn-id: svn://10.65.10.50/trunk@7711 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
39fbd01ef5
commit
7c63a7ad73
188
at/at3300.cpp
188
at/at3300.cpp
@ -220,7 +220,7 @@ void TStatSogxCat::crea_intestazione()
|
||||
row.put(sep);
|
||||
printer().setheaderline(5, row);
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
sep.fill('-',80);
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(6, row);
|
||||
@ -299,30 +299,35 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
else
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << codsot;
|
||||
}
|
||||
rigastampa << " ";
|
||||
TLocalisamfile sezioni(LF_SEZIONI);
|
||||
sezioni.setkey(1);
|
||||
sezioni.zero();
|
||||
sezioni.put(SEZ_CODSEZ,codsez);
|
||||
sezioni.put(SEZ_CODSOT,codsot);
|
||||
if (sezioni.read() == NOERR)
|
||||
{
|
||||
TString80 den = sezioni.get(SEZ_DENSEZ);
|
||||
rigastampa << den;
|
||||
den = sezioni.get(SEZ_DENSOT);
|
||||
if (den.not_empty())
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << codsot;
|
||||
}
|
||||
rigastampa << " ";
|
||||
TLocalisamfile sezioni(LF_SEZIONI);
|
||||
sezioni.setkey(1);
|
||||
sezioni.zero();
|
||||
sezioni.put(SEZ_CODSEZ,codsez);
|
||||
sezioni.put(SEZ_CODSOT,codsot);
|
||||
if (sezioni.read() == NOERR)
|
||||
{
|
||||
TString80 den = sezioni.get(SEZ_DENSEZ);
|
||||
rigastampa << den;
|
||||
den = sezioni.get(SEZ_DENSOT);
|
||||
if (den.not_empty())
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << den;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
@ -362,7 +367,7 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -398,47 +403,41 @@ bool TStatSogxCat::riepilogo()
|
||||
stat.setkey(1);
|
||||
_cur = new TCursor(_rel, "", 1);
|
||||
TString256 filtro = "";
|
||||
|
||||
// filtro per sezione/sottogruppo
|
||||
if (_sezini.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
}
|
||||
if (_sotini.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_sezfin.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
}
|
||||
if (_sotfin.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
}
|
||||
}
|
||||
if (_sezini.not_empty())
|
||||
{
|
||||
if (_sotini.not_empty())
|
||||
{
|
||||
filtro << "(";
|
||||
filtro << format("(90->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||
filtro << " || ";
|
||||
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
filtro << ")";
|
||||
filtro << ")";
|
||||
}
|
||||
else
|
||||
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
}
|
||||
if (_sezfin.not_empty())
|
||||
{
|
||||
if (filtro.not_empty())
|
||||
filtro << " && ";
|
||||
|
||||
if (_sotfin.not_empty())
|
||||
{
|
||||
filtro << "(";
|
||||
filtro << format("(90->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||
filtro << " || ";
|
||||
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
filtro << ")";
|
||||
filtro << ")";
|
||||
}
|
||||
else
|
||||
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
}
|
||||
_cur->setfilter((const char*) filtro, TRUE);
|
||||
TString16 codsez, codsot;
|
||||
@ -523,8 +522,40 @@ bool TStatSogxCat::riepilogo()
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
stat.put(ATSS_CATDON, cati);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero2 = stat.get_long(ATSS_NUMERO2);
|
||||
if (nuovoi)
|
||||
numero++;
|
||||
if (totalei)
|
||||
numero2++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
stat.put(ATSS_CATDON, cati);
|
||||
if (nuovoi)
|
||||
numero = 1;
|
||||
else
|
||||
numero = 0;
|
||||
if (totalei)
|
||||
numero2 = 1;
|
||||
else
|
||||
numero2 = 0;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
|
||||
if (catd.not_empty())
|
||||
{
|
||||
stat.zero();
|
||||
@ -560,6 +591,39 @@ bool TStatSogxCat::riepilogo()
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
stat.put(ATSS_CATDON, catd);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero2 = stat.get_long(ATSS_NUMERO2);
|
||||
if (nuovod)
|
||||
numero++;
|
||||
if (totaled)
|
||||
numero2++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
stat.put(ATSS_CATDON, catd);
|
||||
if (nuovod)
|
||||
numero = 1;
|
||||
else
|
||||
numero = 0;
|
||||
if (totaled)
|
||||
numero2 = 1;
|
||||
else
|
||||
numero2 = 0;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
}
|
||||
return (stat.eod() > 0);
|
||||
|
162
at/at3400.cpp
162
at/at3400.cpp
@ -1,5 +1,4 @@
|
||||
#include <applicat.h>
|
||||
//#include <execp.h>
|
||||
#include <mask.h>
|
||||
#include <printer.h>
|
||||
#include <progind.h>
|
||||
@ -293,7 +292,7 @@ void TRiepilogoDonazioni::crea_intestazione()
|
||||
row.put(sep);
|
||||
printer().setheaderline(5, row);
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
sep.fill('-',80);
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(6, row);
|
||||
@ -386,30 +385,35 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
else
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << codsot;
|
||||
}
|
||||
rigastampa << " ";
|
||||
TLocalisamfile sezioni(LF_SEZIONI);
|
||||
sezioni.setkey(1);
|
||||
sezioni.zero();
|
||||
sezioni.put(SEZ_CODSEZ,codsez);
|
||||
sezioni.put(SEZ_CODSOT,codsot);
|
||||
if (sezioni.read() == NOERR)
|
||||
{
|
||||
TString80 den = sezioni.get(SEZ_DENSEZ);
|
||||
rigastampa << den;
|
||||
den = sezioni.get(SEZ_DENSOT);
|
||||
if (den.not_empty())
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << codsot;
|
||||
}
|
||||
rigastampa << " ";
|
||||
TLocalisamfile sezioni(LF_SEZIONI);
|
||||
sezioni.setkey(1);
|
||||
sezioni.zero();
|
||||
sezioni.put(SEZ_CODSEZ,codsez);
|
||||
sezioni.put(SEZ_CODSOT,codsot);
|
||||
if (sezioni.read() == NOERR)
|
||||
{
|
||||
TString80 den = sezioni.get(SEZ_DENSEZ);
|
||||
rigastampa << den;
|
||||
den = sezioni.get(SEZ_DENSOT);
|
||||
if (den.not_empty())
|
||||
{
|
||||
rigastampa << "/";
|
||||
rigastampa << den;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
@ -456,7 +460,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -493,7 +497,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -537,7 +541,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -573,7 +577,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -619,7 +623,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-');
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -665,45 +669,40 @@ bool TRiepilogoDonazioni::riepilogo()
|
||||
TString256 filtro = "";
|
||||
|
||||
// filtro per sezione/sottogruppo
|
||||
if (_sezini.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
}
|
||||
if (_sotini.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_sezfin.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
}
|
||||
if (_sotfin.not_empty())
|
||||
{
|
||||
if (filtro.empty())
|
||||
filtro = format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
else
|
||||
{
|
||||
filtro << " && ";
|
||||
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
}
|
||||
}
|
||||
if (_sezini.not_empty())
|
||||
{
|
||||
if (_sotini.not_empty())
|
||||
{
|
||||
filtro << "(";
|
||||
filtro << format("(92->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||
filtro << " || ";
|
||||
filtro << "(" << format("(92->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||
filtro << " && ";
|
||||
filtro << format("(92->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||
filtro << ")";
|
||||
filtro << ")";
|
||||
}
|
||||
else
|
||||
filtro << format("(92->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||
}
|
||||
if (_sezfin.not_empty())
|
||||
{
|
||||
if (filtro.not_empty())
|
||||
filtro << " && ";
|
||||
|
||||
if (_sotfin.not_empty())
|
||||
{
|
||||
filtro << "(";
|
||||
filtro << format("(92->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||
filtro << " || ";
|
||||
filtro << "(" << format("(92->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||
filtro << " && ";
|
||||
filtro << format("(92->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||
filtro << ")";
|
||||
filtro << ")";
|
||||
}
|
||||
else
|
||||
filtro << format("(92->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||
}
|
||||
_cur->setfilter((const char*) filtro, TRUE);
|
||||
TString16 codsez, codsot, tipodon;
|
||||
@ -763,6 +762,39 @@ bool TRiepilogoDonazioni::riepilogo()
|
||||
stat.put(ATS_NUMPRIME, numero);
|
||||
stat.write();
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, "ZZ");
|
||||
stat.put(ATS_CODSOT, "ZZ");
|
||||
stat.put(ATS_ANNO, anno);
|
||||
stat.put(ATS_MESE, mese);
|
||||
stat.put(ATS_TIPODON, tipodon);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
if (_primedon && primadon)
|
||||
{
|
||||
numero = stat.get_long(ATS_NUMPRIME);
|
||||
numero++;
|
||||
stat.put(ATS_NUMPRIME, numero);
|
||||
}
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, "ZZ");
|
||||
stat.put(ATS_CODSOT, "ZZ");
|
||||
stat.put(ATS_ANNO, anno);
|
||||
stat.put(ATS_MESE, mese);
|
||||
stat.put(ATS_TIPODON, tipodon);
|
||||
numero = 1;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
if (_primedon && primadon)
|
||||
stat.put(ATS_NUMPRIME, numero);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
return (stat.eod() > 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user