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
186
at/at3300.cpp
186
at/at3300.cpp
@ -220,7 +220,7 @@ void TStatSogxCat::crea_intestazione()
|
|||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(5, row);
|
printer().setheaderline(5, row);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-');
|
sep.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(6, row);
|
printer().setheaderline(6, row);
|
||||||
@ -299,28 +299,33 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
{
|
{
|
||||||
TPrintrow row;
|
TPrintrow row;
|
||||||
TString256 rigastampa;
|
TString256 rigastampa;
|
||||||
rigastampa = "Sezione: ";
|
if (codsez == "ZZ" && codsot == "ZZ")
|
||||||
rigastampa << codsez;
|
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||||
if (codsot.not_empty())
|
else
|
||||||
{
|
{
|
||||||
rigastampa << "/";
|
rigastampa = "Sezione: ";
|
||||||
rigastampa << codsot;
|
rigastampa << codsez;
|
||||||
}
|
if (codsot.not_empty())
|
||||||
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 << "/";
|
||||||
|
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;
|
rigastampa << den;
|
||||||
|
den = sezioni.get(SEZ_DENSOT);
|
||||||
|
if (den.not_empty())
|
||||||
|
{
|
||||||
|
rigastampa << "/";
|
||||||
|
rigastampa << den;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rigastampa.center_just(80);
|
rigastampa.center_just(80);
|
||||||
@ -362,7 +367,7 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
|
|
||||||
// stampa totali per sezione
|
// stampa totali per sezione
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -398,47 +403,41 @@ bool TStatSogxCat::riepilogo()
|
|||||||
stat.setkey(1);
|
stat.setkey(1);
|
||||||
_cur = new TCursor(_rel, "", 1);
|
_cur = new TCursor(_rel, "", 1);
|
||||||
TString256 filtro = "";
|
TString256 filtro = "";
|
||||||
|
|
||||||
// filtro per sezione/sottogruppo
|
// filtro per sezione/sottogruppo
|
||||||
if (_sezini.not_empty())
|
if (_sezini.not_empty())
|
||||||
{
|
{
|
||||||
if (filtro.empty())
|
if (_sotini.not_empty())
|
||||||
filtro = format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
{
|
||||||
else
|
filtro << "(";
|
||||||
{
|
filtro << format("(90->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||||
filtro << " && ";
|
filtro << " || ";
|
||||||
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||||
}
|
filtro << " && ";
|
||||||
if (_sotini.not_empty())
|
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||||
{
|
filtro << ")";
|
||||||
if (filtro.empty())
|
filtro << ")";
|
||||||
filtro = format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
}
|
||||||
else
|
else
|
||||||
{
|
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||||
filtro << " && ";
|
}
|
||||||
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
if (_sezfin.not_empty())
|
||||||
}
|
{
|
||||||
}
|
if (filtro.not_empty())
|
||||||
}
|
filtro << " && ";
|
||||||
if (_sezfin.not_empty())
|
|
||||||
{
|
if (_sotfin.not_empty())
|
||||||
if (filtro.empty())
|
{
|
||||||
filtro = format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
filtro << "(";
|
||||||
else
|
filtro << format("(90->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||||
{
|
filtro << " || ";
|
||||||
filtro << " && ";
|
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||||
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
filtro << " && ";
|
||||||
}
|
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||||
if (_sotfin.not_empty())
|
filtro << ")";
|
||||||
{
|
filtro << ")";
|
||||||
if (filtro.empty())
|
}
|
||||||
filtro = format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
else
|
||||||
else
|
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||||
{
|
|
||||||
filtro << " && ";
|
|
||||||
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_cur->setfilter((const char*) filtro, TRUE);
|
_cur->setfilter((const char*) filtro, TRUE);
|
||||||
TString16 codsez, codsot;
|
TString16 codsez, codsot;
|
||||||
@ -523,8 +522,40 @@ bool TStatSogxCat::riepilogo()
|
|||||||
stat.put(ATSS_NUMERO2, numero2);
|
stat.put(ATSS_NUMERO2, numero2);
|
||||||
stat.write();
|
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())
|
if (catd.not_empty())
|
||||||
{
|
{
|
||||||
stat.zero();
|
stat.zero();
|
||||||
@ -560,6 +591,39 @@ bool TStatSogxCat::riepilogo()
|
|||||||
stat.put(ATSS_NUMERO2, numero2);
|
stat.put(ATSS_NUMERO2, numero2);
|
||||||
stat.write();
|
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);
|
return (stat.eod() > 0);
|
||||||
|
160
at/at3400.cpp
160
at/at3400.cpp
@ -1,5 +1,4 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
//#include <execp.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
@ -293,7 +292,7 @@ void TRiepilogoDonazioni::crea_intestazione()
|
|||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(5, row);
|
printer().setheaderline(5, row);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-');
|
sep.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(6, row);
|
printer().setheaderline(6, row);
|
||||||
@ -386,28 +385,33 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
{
|
{
|
||||||
TPrintrow row;
|
TPrintrow row;
|
||||||
TString256 rigastampa;
|
TString256 rigastampa;
|
||||||
rigastampa = "Sezione: ";
|
if (codsez == "ZZ" && codsot == "ZZ")
|
||||||
rigastampa << codsez;
|
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||||
if (codsot.not_empty())
|
else
|
||||||
{
|
{
|
||||||
rigastampa << "/";
|
rigastampa = "Sezione: ";
|
||||||
rigastampa << codsot;
|
rigastampa << codsez;
|
||||||
}
|
if (codsot.not_empty())
|
||||||
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 << "/";
|
||||||
|
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;
|
rigastampa << den;
|
||||||
|
den = sezioni.get(SEZ_DENSOT);
|
||||||
|
if (den.not_empty())
|
||||||
|
{
|
||||||
|
rigastampa << "/";
|
||||||
|
rigastampa << den;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rigastampa.center_just(80);
|
rigastampa.center_just(80);
|
||||||
@ -456,7 +460,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
}
|
}
|
||||||
// stampa totali per sezione
|
// stampa totali per sezione
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -493,7 +497,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -537,7 +541,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
}
|
}
|
||||||
// stampa totali per sezione
|
// stampa totali per sezione
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -573,7 +577,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -619,7 +623,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
}
|
}
|
||||||
// stampa totali per sezione
|
// stampa totali per sezione
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-');
|
rigastampa.fill('-',80);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -665,45 +669,40 @@ bool TRiepilogoDonazioni::riepilogo()
|
|||||||
TString256 filtro = "";
|
TString256 filtro = "";
|
||||||
|
|
||||||
// filtro per sezione/sottogruppo
|
// filtro per sezione/sottogruppo
|
||||||
if (_sezini.not_empty())
|
if (_sezini.not_empty())
|
||||||
{
|
{
|
||||||
if (filtro.empty())
|
if (_sotini.not_empty())
|
||||||
filtro = format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
{
|
||||||
else
|
filtro << "(";
|
||||||
{
|
filtro << format("(92->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||||
filtro << " && ";
|
filtro << " || ";
|
||||||
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
filtro << "(" << format("(92->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||||
}
|
filtro << " && ";
|
||||||
if (_sotini.not_empty())
|
filtro << format("(92->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||||
{
|
filtro << ")";
|
||||||
if (filtro.empty())
|
filtro << ")";
|
||||||
filtro = format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
}
|
||||||
else
|
else
|
||||||
{
|
filtro << format("(92->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||||
filtro << " && ";
|
}
|
||||||
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
if (_sezfin.not_empty())
|
||||||
}
|
{
|
||||||
}
|
if (filtro.not_empty())
|
||||||
}
|
filtro << " && ";
|
||||||
if (_sezfin.not_empty())
|
|
||||||
{
|
if (_sotfin.not_empty())
|
||||||
if (filtro.empty())
|
{
|
||||||
filtro = format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
filtro << "(";
|
||||||
else
|
filtro << format("(92->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||||
{
|
filtro << " || ";
|
||||||
filtro << " && ";
|
filtro << "(" << format("(92->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||||
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
filtro << " && ";
|
||||||
}
|
filtro << format("(92->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||||
if (_sotfin.not_empty())
|
filtro << ")";
|
||||||
{
|
filtro << ")";
|
||||||
if (filtro.empty())
|
}
|
||||||
filtro = format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
else
|
||||||
else
|
filtro << format("(92->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||||
{
|
|
||||||
filtro << " && ";
|
|
||||||
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_cur->setfilter((const char*) filtro, TRUE);
|
_cur->setfilter((const char*) filtro, TRUE);
|
||||||
TString16 codsez, codsot, tipodon;
|
TString16 codsez, codsot, tipodon;
|
||||||
@ -763,6 +762,39 @@ bool TRiepilogoDonazioni::riepilogo()
|
|||||||
stat.put(ATS_NUMPRIME, numero);
|
stat.put(ATS_NUMPRIME, numero);
|
||||||
stat.write();
|
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);
|
return (stat.eod() > 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user