Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Statistiche: in tutte possibilita' di selezionare solo il riepilogo finale, se stampa una sola sezione non mi fa il riepilogo finale git-svn-id: svn://10.65.10.50/trunk@7903 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4212a16944
commit
4c1e0aa5c7
248
at/at3100.cpp
248
at/at3100.cpp
@ -93,6 +93,8 @@ class TStatSogxEta : public TApplication
|
||||
TString16 _catdon;
|
||||
TDate _data;
|
||||
TArray _etaini, _etafin;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -208,6 +210,7 @@ bool TStatSogxEta::menu(MENU_TAG m)
|
||||
_sotfin = _msk->get(F_SOTFIN);
|
||||
_catdon = _msk->get(F_CATDON);
|
||||
_data = _msk->get_date(F_DATA);
|
||||
_solotot = msk.get_bool(F_SOLOTOT);
|
||||
TSheet_field& s = (TSheet_field&)_msk->field(F_FASCIE);
|
||||
for (int r=0; r<s.items(); r++)
|
||||
{
|
||||
@ -275,6 +278,7 @@ bool TStatSogxEta::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATS);
|
||||
TCursor* curstat = new TCursor(relstat, "", 1);
|
||||
@ -334,9 +338,17 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -362,116 +374,119 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(120);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
real totalegenerale = ZERO;
|
||||
for (int t=0;t<_etaini.items();t++)
|
||||
{
|
||||
TRigaSFascia& riga = (TRigaSFascia&)_righe[t];
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
totalegenerale+=riga[i];
|
||||
}
|
||||
TRigaSFascia rigatotali(0,0);
|
||||
TString16 valore;
|
||||
real totalefascia = ZERO;
|
||||
for (int r=0;r<_etaini.items();r++)
|
||||
{
|
||||
TRigaSFascia& riga = (TRigaSFascia&)_righe[r];
|
||||
row.reset();
|
||||
real valreal;
|
||||
rigastampa = "da ";
|
||||
real* val1 = (real*)_etaini.objptr(r);
|
||||
valreal = *val1;
|
||||
rigastampa << valreal.string();
|
||||
rigastampa << " a ";
|
||||
real* val2 = (real*)_etafin.objptr(r);
|
||||
valreal = *val2;
|
||||
rigastampa << valreal.string();
|
||||
rigastampa << " anni";
|
||||
totalefascia = ZERO;
|
||||
for (int j=0;j<_colonne->items();j++)
|
||||
totalefascia+=riga[j];
|
||||
// ciclo per stampa
|
||||
int pos = 15;
|
||||
for (j=0;j<_colonne->items();j++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(j,riga[j]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[j].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+10;
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigastampa.center_just(120);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
real totalegenerale = ZERO;
|
||||
for (int t=0;t<_etaini.items();t++)
|
||||
{
|
||||
TRigaSFascia& riga = (TRigaSFascia&)_righe[t];
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
totalegenerale+=riga[i];
|
||||
}
|
||||
TRigaSFascia rigatotali(0,0);
|
||||
TString16 valore;
|
||||
real totalefascia = ZERO;
|
||||
for (int r=0;r<_etaini.items();r++)
|
||||
{
|
||||
TRigaSFascia& riga = (TRigaSFascia&)_righe[r];
|
||||
row.reset();
|
||||
real valreal;
|
||||
rigastampa = "da ";
|
||||
real* val1 = (real*)_etaini.objptr(r);
|
||||
valreal = *val1;
|
||||
rigastampa << valreal.string();
|
||||
rigastampa << " a ";
|
||||
real* val2 = (real*)_etafin.objptr(r);
|
||||
valreal = *val2;
|
||||
rigastampa << valreal.string();
|
||||
rigastampa << " anni";
|
||||
totalefascia = ZERO;
|
||||
for (int j=0;j<_colonne->items();j++)
|
||||
totalefascia+=riga[j];
|
||||
// ciclo per stampa
|
||||
int pos = 15;
|
||||
for (j=0;j<_colonne->items();j++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(j,riga[j]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[j].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+10;
|
||||
if (totalefascia != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalefascia)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+6;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
if (totalefascia != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalefascia)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
valore.format("%8d",totalefascia.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+10;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (totalefascia/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+6;
|
||||
}
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
pos = pos+6;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
if (totalefascia != ZERO)
|
||||
{
|
||||
}
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',120);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
real totale;
|
||||
totale = ZERO;
|
||||
int pos = 15;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totale+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",totalefascia.integer());
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+10;
|
||||
pos=pos+16;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (totalefascia/totalegenerale)*100;
|
||||
real perc = (rigatotali[i]/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+6;
|
||||
}
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',120);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
real totale;
|
||||
totale = ZERO;
|
||||
int pos = 15;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totale+=rigatotali[i];
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
valore.format("%8d",totale.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+16;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (rigatotali[i]/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totale.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TStatSogxEta::riepilogo()
|
||||
@ -597,28 +612,31 @@ bool TStatSogxEta::riepilogo()
|
||||
sesso = "9";
|
||||
if (fascia != -1)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_FASCIA, fascia);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_FASCIA, fascia);
|
||||
numero = 1;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_FASCIA, fascia);
|
||||
numero = 1;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
|
@ -13,7 +13,8 @@
|
||||
#define F_CATDON 301
|
||||
#define F_D_CATDON 302
|
||||
#define F_DATA 303
|
||||
#define F_FASCIE 304
|
||||
#define F_SOLOTOT 304
|
||||
#define F_FASCIE 305
|
||||
|
||||
#define F_ETAINI 101
|
||||
#define F_ETAFIN 102
|
||||
|
@ -158,14 +158,19 @@ BEGIN
|
||||
PROMPT 25 9 "per tutte le categorie non di dimissione"
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLOTOT
|
||||
BEGIN
|
||||
PROMPT 2 7 "Stampa solo totale finale (non stampa il dettaglio per sezione)"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 7 "Fascie di eta'"
|
||||
PROMPT 2 8 "Fascie di eta'"
|
||||
END
|
||||
|
||||
SPREADSHEET F_FASCIE 15 9
|
||||
BEGIN
|
||||
PROMPT 3 8 ""
|
||||
PROMPT 3 9 ""
|
||||
ITEM "Da "
|
||||
ITEM "A "
|
||||
END
|
||||
|
202
at/at3200.cpp
202
at/at3200.cpp
@ -92,6 +92,8 @@ class TMensileDonxGr : public TApplication
|
||||
TAssoc_array* _colonne;
|
||||
TArray _righe; // array per riepilogo donazioni
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin, _tipodon;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -301,6 +303,7 @@ bool TMensileDonxGr::menu(MENU_TAG m)
|
||||
_sezfin = _msk->get(F_SEZFIN);
|
||||
_sotfin = _msk->get(F_SOTFIN);
|
||||
_tipodon = _msk->get(F_TIPODON);
|
||||
_solotot = msk.get_bool(F_SOLOTOT);
|
||||
if (riepilogo())
|
||||
stampa();
|
||||
}
|
||||
@ -314,10 +317,10 @@ void TMensileDonxGr::crea_intestazione()
|
||||
sep = "MENSILE DONAZIONI PER GRUPPO E RH";
|
||||
if (!_tipodon.blank())
|
||||
sep << " - TIPO DONAZIONI " << _tipodon;
|
||||
sep.center_just(80);
|
||||
sep.center_just(101);
|
||||
row.put(sep);
|
||||
row.put("@>", 1);
|
||||
row.put("Pag. @#", 70);
|
||||
row.put("Pag. @#", 90);
|
||||
printer().setheaderline(2, row);
|
||||
row.reset();
|
||||
sep = "";
|
||||
@ -331,7 +334,7 @@ void TMensileDonxGr::crea_intestazione()
|
||||
sep << " al ";
|
||||
sep << _datafin.string();
|
||||
}
|
||||
sep.center_just(80);
|
||||
sep.center_just(101);
|
||||
row.put(sep);
|
||||
printer().setheaderline(3, row);
|
||||
row.reset();
|
||||
@ -343,7 +346,7 @@ void TMensileDonxGr::crea_intestazione()
|
||||
row.put(sep);
|
||||
printer().setheaderline(5, row);
|
||||
sep = "";
|
||||
sep.fill('-',80);
|
||||
sep.fill('-',101);
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(6, row);
|
||||
@ -353,6 +356,7 @@ bool TMensileDonxGr::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATD);
|
||||
TCursor* curstat = new TCursor(relstat, "", 1);
|
||||
@ -427,9 +431,17 @@ void TMensileDonxGr::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -454,76 +466,79 @@ void TMensileDonxGr::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
rigastampa << den;
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaMDxG rigatotali(0,0);
|
||||
int anno = _dataini.year();
|
||||
int meseini, mesefin;
|
||||
real totalemese = ZERO;
|
||||
TString16 valore;
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRigaMDxG& riga = (TRigaMDxG&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 16;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalemese+=riga[i];
|
||||
}
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigastampa.center_just(101);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaMDxG rigatotali(0,0);
|
||||
int anno = _dataini.year();
|
||||
int meseini, mesefin;
|
||||
real totalemese = ZERO;
|
||||
TString16 valore;
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRigaMDxG& riga = (TRigaMDxG&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 16;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalemese+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
}
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',101);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
int pos = 16;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
int pos = 16;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TMensileDonxGr::riepilogo()
|
||||
@ -614,22 +629,7 @@ bool TMensileDonxGr::riepilogo()
|
||||
mese = datadon.month();
|
||||
gruppo = recsog.get(SOG_GRUPPOAB0);
|
||||
rh = recsog.get(SOG_RHANTID);
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, codsez);
|
||||
stat.put(ATS_CODSOT, codsot);
|
||||
stat.put(ATS_ANNO, anno);
|
||||
stat.put(ATS_MESE, mese);
|
||||
stat.put(ATS_TIPODON, " ");
|
||||
stat.put(ATS_GRUPPO, gruppo);
|
||||
stat.put(ATS_RH, rh);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, codsez);
|
||||
@ -639,10 +639,28 @@ bool TMensileDonxGr::riepilogo()
|
||||
stat.put(ATS_TIPODON, " ");
|
||||
stat.put(ATS_GRUPPO, gruppo);
|
||||
stat.put(ATS_RH, rh);
|
||||
numero = 1;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, codsez);
|
||||
stat.put(ATS_CODSOT, codsot);
|
||||
stat.put(ATS_ANNO, anno);
|
||||
stat.put(ATS_MESE, mese);
|
||||
stat.put(ATS_TIPODON, " ");
|
||||
stat.put(ATS_GRUPPO, gruppo);
|
||||
stat.put(ATS_RH, rh);
|
||||
numero = 1;
|
||||
stat.put(ATS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, "ZZ");
|
||||
stat.put(ATS_CODSOT, "ZZ");
|
||||
|
@ -14,3 +14,4 @@
|
||||
#define F_DATAFIN 302
|
||||
#define F_TIPODON 303
|
||||
#define F_D_TIPODON 304
|
||||
#define F_SOLOTOT 305
|
||||
|
@ -117,7 +117,7 @@ BEGIN
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per la statistica"
|
||||
END
|
||||
@ -154,6 +154,11 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLOTOT
|
||||
BEGIN
|
||||
PROMPT 2 8 "Stampa solo totale finale (non stampa il dettaglio per sezione)"
|
||||
END
|
||||
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
|
235
at/at3300.cpp
235
at/at3300.cpp
@ -89,6 +89,8 @@ class TStatSogxCat : public TApplication
|
||||
TArray _righe;
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin;
|
||||
TDate _dataini, _datafin;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -190,6 +192,7 @@ bool TStatSogxCat::menu(MENU_TAG m)
|
||||
_sotfin = _msk->get(F_SOTFIN);
|
||||
_dataini = _msk->get_date(F_DATAINI);
|
||||
_datafin = _msk->get_date(F_DATAFIN);
|
||||
_solotot = msk.get_bool(F_SOLOTOT);
|
||||
if (riepilogo())
|
||||
stampa();
|
||||
}
|
||||
@ -230,6 +233,7 @@ bool TStatSogxCat::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATS);
|
||||
TCursor* curstat = new TCursor(relstat, "", 1);
|
||||
@ -300,9 +304,17 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -328,68 +340,71 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaSxCat rigatotali(" ");
|
||||
TString16 valore;
|
||||
TString16 catdon;
|
||||
|
||||
TTable ctd("CTD");
|
||||
for (ctd.first(); !ctd.eof(); ctd.next())
|
||||
{
|
||||
TString16 catdon = ctd.get("CODTAB");
|
||||
TRigaSxCat& riga = (TRigaSxCat&)_righe[data2row(catdon)];
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaSxCat rigatotali(" ");
|
||||
TString16 valore;
|
||||
TString16 catdon;
|
||||
|
||||
TTable ctd("CTD");
|
||||
for (ctd.first(); !ctd.eof(); ctd.next())
|
||||
{
|
||||
TString16 catdon = ctd.get("CODTAB");
|
||||
TRigaSxCat& riga = (TRigaSxCat&)_righe[data2row(catdon)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << catdon;
|
||||
rigastampa << " ";
|
||||
rigastampa << ctd.get("S0");
|
||||
int pos = 41;
|
||||
const char* indicen = "N";
|
||||
real& colonnan = (real&)_colonne->find(indicen);
|
||||
rigatotali.aggiorna_valore((int) colonnan.integer(),riga[(int) colonnan.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnan.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicet = "T";
|
||||
real& colonnat = (real&)_colonne->find(indicet);
|
||||
rigatotali.aggiorna_valore((int) colonnat.integer(),riga[(int) colonnat.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnat.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << catdon;
|
||||
rigastampa << " ";
|
||||
rigastampa << ctd.get("S0");
|
||||
rigastampa = "Totale";
|
||||
int pos = 41;
|
||||
const char* indicen = "N";
|
||||
real& colonnan = (real&)_colonne->find(indicen);
|
||||
rigatotali.aggiorna_valore((int) colonnan.integer(),riga[(int) colonnan.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnan.integer()].integer());
|
||||
valore.format("%8d",rigatotali[(int) colonnan.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicet = "T";
|
||||
real& colonnat = (real&)_colonne->find(indicet);
|
||||
rigatotali.aggiorna_valore((int) colonnat.integer(),riga[(int) colonnat.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnat.integer()].integer());
|
||||
valore.format("%8d",rigatotali[(int) colonnat.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
int pos = 41;
|
||||
const char* indicen = "N";
|
||||
real& colonnan = (real&)_colonne->find(indicen);
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnan.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicet = "T";
|
||||
real& colonnat = (real&)_colonne->find(indicet);
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnat.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TStatSogxCat::riepilogo()
|
||||
@ -489,39 +504,42 @@ bool TStatSogxCat::riepilogo()
|
||||
}
|
||||
if (cati.not_empty())
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
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
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_CATDON, cati);
|
||||
if (nuovoi)
|
||||
numero = 1;
|
||||
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
|
||||
numero = 0;
|
||||
if (totalei)
|
||||
numero2 = 1;
|
||||
else
|
||||
numero2 = 0;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
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();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
@ -557,40 +575,43 @@ bool TStatSogxCat::riepilogo()
|
||||
}
|
||||
}
|
||||
if (catd.not_empty())
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
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
|
||||
{
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_CATDON, catd);
|
||||
if (nuovod)
|
||||
numero = 1;
|
||||
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
|
||||
numero = 0;
|
||||
if (totaled)
|
||||
numero2 = 1;
|
||||
else
|
||||
numero2 = 0;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.put(ATSS_NUMERO2, numero2);
|
||||
stat.write();
|
||||
}
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
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();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
|
@ -12,3 +12,4 @@
|
||||
|
||||
#define F_DATAINI 301
|
||||
#define F_DATAFIN 302
|
||||
#define F_SOLOTOT 303
|
||||
|
@ -117,7 +117,7 @@ BEGIN
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per la statistica"
|
||||
END
|
||||
@ -132,6 +132,11 @@ BEGIN
|
||||
PROMPT 50 6 "al "
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLOTOT
|
||||
BEGIN
|
||||
PROMPT 2 7 "Stampa solo totale finale (non stampa il dettaglio per sezione)"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
|
409
at/at3400.cpp
409
at/at3400.cpp
@ -89,12 +89,13 @@ class TRiepilogoDonazioni : public TApplication
|
||||
TLocalisamfile* _donaz;
|
||||
TLocalisamfile* _atstatd;
|
||||
TDate _dataini, _datafin;
|
||||
bool _primedon;
|
||||
bool _primedon, _solotot;
|
||||
bool _perpunto;
|
||||
TAssoc_array* _colonne;
|
||||
TArray _righe; // array per riepilogo donazioni
|
||||
TArray _righe_prime; // array per riepilogo prime don
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -245,6 +246,7 @@ bool TRiepilogoDonazioni::menu(MENU_TAG m)
|
||||
_dataini = msk.get(F_DATAINI);
|
||||
_datafin = msk.get(F_DATAFIN);
|
||||
_primedon = msk.get_bool(F_PRIMEDON);
|
||||
_solotot = msk.get_bool(F_SOLOTOT);
|
||||
//_perpunto = msk.get_bool(F_PERPUNTO);
|
||||
_sezini = _msk->get(F_SEZINI);
|
||||
_sotini = _msk->get(F_SOTINI);
|
||||
@ -302,6 +304,7 @@ bool TRiepilogoDonazioni::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATD);
|
||||
TCursor* curstat = new TCursor(relstat, "", 2);
|
||||
@ -386,9 +389,17 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -414,96 +425,17 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRiga rigatotali(0,0);
|
||||
int anno = _dataini.year();
|
||||
int meseini, mesefin;
|
||||
real totalemese = ZERO;
|
||||
TString16 valore;
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRiga& riga = (TRiga&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalemese+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
|
||||
if (_primedon)
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigatotali.azzera_valori();
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
rigastampa = "RIEPILOGO PRIME DONAZIONI";
|
||||
rigastampa.center_just(80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
anno = _dataini.year();
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRiga rigatotali(0,0);
|
||||
int anno = _dataini.year();
|
||||
int meseini, mesefin;
|
||||
real totalemese = ZERO;
|
||||
TString16 valore;
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
@ -516,7 +448,7 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRiga& riga = (TRiga&)_righe_prime[data2row(anno,mese)];
|
||||
TRiga& riga = (TRiga&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
@ -564,89 +496,171 @@ void TRiepilogoDonazioni::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
|
||||
// riepilogo non prime donazione
|
||||
rigatotali.azzera_valori();
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
rigastampa = "RIEPILOGO DONAZIONI NON PRIME";
|
||||
rigastampa.center_just(80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
anno = _dataini.year();
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRiga& rigapri = (TRiga&)_righe_prime[data2row(anno,mese)];
|
||||
TRiga& riga = (TRiga&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
real differenza = riga[i]-rigapri[i];
|
||||
rigatotali.aggiorna_valore(i,differenza);
|
||||
totalemese+=differenza;
|
||||
if (_primedon)
|
||||
{
|
||||
rigatotali.azzera_valori();
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
rigastampa = "RIEPILOGO PRIME DONAZIONI";
|
||||
rigastampa.center_just(80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
anno = _dataini.year();
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRiga& riga = (TRiga&)_righe_prime[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalemese+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",differenza.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
pos = 21;
|
||||
for (i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
printer().formfeed();
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
|
||||
// riepilogo non prime donazione
|
||||
rigatotali.azzera_valori();
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
printer().print(row);
|
||||
rigastampa = "RIEPILOGO DONAZIONI NON PRIME";
|
||||
rigastampa.center_just(80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().print(row);
|
||||
anno = _dataini.year();
|
||||
while (anno<=_datafin.year())
|
||||
{
|
||||
if (anno == _dataini.year())
|
||||
meseini = _dataini.month();
|
||||
else
|
||||
meseini = 1;
|
||||
if (anno == _datafin.year())
|
||||
mesefin = _datafin.month();
|
||||
else
|
||||
mesefin = 12;
|
||||
for (int mese=meseini;mese<=mesefin;mese++)
|
||||
{
|
||||
TRiga& rigapri = (TRiga&)_righe_prime[data2row(anno,mese)];
|
||||
TRiga& riga = (TRiga&)_righe[data2row(anno,mese)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa.format("%s %4d", (const char*)int2month(mese), anno);
|
||||
totalemese = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
real differenza = riga[i]-rigapri[i];
|
||||
rigatotali.aggiorna_valore(i,differenza);
|
||||
totalemese+=differenza;
|
||||
valore = "";
|
||||
valore.format("%8d",differenza.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
anno++;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale periodo";
|
||||
totalemese = ZERO;
|
||||
pos = 21;
|
||||
for (i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalemese+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalemese.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TRiepilogoDonazioni::riepilogo()
|
||||
@ -729,26 +743,7 @@ bool TRiepilogoDonazioni::riepilogo()
|
||||
primadon = recdon.get_bool(DON_PRIMADON);
|
||||
anno = datadon.year();
|
||||
mese = datadon.month();
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, codsez);
|
||||
stat.put(ATS_CODSOT, codsot);
|
||||
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
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, codsez);
|
||||
@ -756,12 +751,34 @@ bool TRiepilogoDonazioni::riepilogo()
|
||||
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();
|
||||
}
|
||||
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, codsez);
|
||||
stat.put(ATS_CODSOT, codsot);
|
||||
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();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATS_CODSEZ, "ZZ");
|
||||
stat.put(ATS_CODSOT, "ZZ");
|
||||
|
@ -13,4 +13,5 @@
|
||||
#define F_DATAINI 301
|
||||
#define F_DATAFIN 302
|
||||
#define F_PRIMEDON 303
|
||||
#define F_SOLOTOT 304
|
||||
//#define F_PERPUNTO 304
|
||||
|
@ -117,7 +117,7 @@ BEGIN
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per il riepilogo"
|
||||
END
|
||||
@ -139,6 +139,12 @@ BEGIN
|
||||
PROMPT 2 7 "Riepilogo per prime donazioni"
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLOTOT
|
||||
BEGIN
|
||||
PROMPT 2 8 "Stampa solo totale finale (non stampa il dettaglio per sezione)"
|
||||
END
|
||||
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
|
401
at/at3600.cpp
401
at/at3600.cpp
@ -95,6 +95,7 @@ class TStatDonGrRh : public TApplication
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin;
|
||||
TAssoc_array* _asoggetti;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -299,6 +300,7 @@ bool TStatDonGrRh::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATD);
|
||||
TCursor* curstat = new TCursor(relstat, "", 3);
|
||||
@ -396,9 +398,17 @@ void TStatDonGrRh::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI SELEZIONATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -424,210 +434,213 @@ void TStatDonGrRh::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaGruppo rigatotali(" "," ");
|
||||
TString16 valore;
|
||||
TString16 gruppo, rh;
|
||||
real totsoggetti = ZERO;
|
||||
real totdonazioni = ZERO;
|
||||
for (int igruppo=0;igruppo<=8;igruppo++)
|
||||
{
|
||||
switch (igruppo)
|
||||
{
|
||||
case 0 : gruppo = ""; break;
|
||||
case 1 : gruppo = "0"; break;
|
||||
case 2 : gruppo = "A"; break;
|
||||
case 3 : gruppo = "A1"; break;
|
||||
case 4 : gruppo = "A2"; break;
|
||||
case 5 : gruppo = "A1B"; break;
|
||||
case 6 : gruppo = "A2B"; break;
|
||||
case 7 : gruppo = "AB"; break;
|
||||
case 8 : gruppo = "B"; break;
|
||||
}
|
||||
for (int irh=0;irh <=2;irh++)
|
||||
{
|
||||
switch (irh)
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaGruppo rigatotali(" "," ");
|
||||
TString16 valore;
|
||||
TString16 gruppo, rh;
|
||||
real totsoggetti = ZERO;
|
||||
real totdonazioni = ZERO;
|
||||
for (int igruppo=0;igruppo<=8;igruppo++)
|
||||
{
|
||||
switch (igruppo)
|
||||
{
|
||||
case 1 : rh = "POS"; break;
|
||||
case 2 : rh = "NEG"; break;
|
||||
default : rh = " "; break;
|
||||
case 0 : gruppo = ""; break;
|
||||
case 1 : gruppo = "0"; break;
|
||||
case 2 : gruppo = "A"; break;
|
||||
case 3 : gruppo = "A1"; break;
|
||||
case 4 : gruppo = "A2"; break;
|
||||
case 5 : gruppo = "A1B"; break;
|
||||
case 6 : gruppo = "A2B"; break;
|
||||
case 7 : gruppo = "AB"; break;
|
||||
case 8 : gruppo = "B"; break;
|
||||
}
|
||||
totsoggetti = ZERO;
|
||||
totdonazioni = ZERO;
|
||||
TRigaGruppo& riga = (TRigaGruppo&)_righe[data2row(gruppo,rh)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << gruppo;
|
||||
rigastampa << " ";
|
||||
rigastampa << rh;
|
||||
int pos = 12;
|
||||
const char* indicedm = "DM";
|
||||
real& colonnadm = (real&)_colonne->find(indicedm);
|
||||
rigatotali.aggiorna_valore((int) colonnadm.integer(),riga[(int) colonnadm.integer()]);
|
||||
totdonazioni+=riga[(int) colonnadm.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnadm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicedf = "DF";
|
||||
real& colonnadf = (real&)_colonne->find(indicedf);
|
||||
rigatotali.aggiorna_valore((int) colonnadf.integer(),riga[(int) colonnadf.integer()]);
|
||||
totdonazioni+=riga[(int) colonnadf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnadf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donazioni
|
||||
valore = "";
|
||||
valore.format("%8d",totdonazioni.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
|
||||
const char* indicesm = "SM";
|
||||
real& colonnasm = (real&)_colonne->find(indicesm);
|
||||
totsoggetti+=riga[(int) colonnasm.integer()];
|
||||
rigatotali.aggiorna_valore((int) colonnasm.integer(),riga[(int) colonnasm.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnasm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicesf = "SF";
|
||||
real& colonnasf = (real&)_colonne->find(indicesf);
|
||||
totsoggetti+=riga[(int) colonnasf.integer()];
|
||||
rigatotali.aggiorna_valore((int) colonnasf.integer(),riga[(int) colonnasf.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnasf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donatori
|
||||
valore = "";
|
||||
valore.format("%8d",totsoggetti.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+14;
|
||||
|
||||
// percentuale
|
||||
if (totsoggetti.integer()!=0)
|
||||
for (int irh=0;irh <=2;irh++)
|
||||
{
|
||||
// maschi
|
||||
if (riga[(int) colonnasm.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = riga[(int) colonnadm.integer()] / riga[(int) colonnasm.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// femmine
|
||||
if (riga[(int) colonnasf.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = riga[(int) colonnadf.integer()] / riga[(int) colonnasf.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// totale
|
||||
switch (irh)
|
||||
{
|
||||
case 1 : rh = "POS"; break;
|
||||
case 2 : rh = "NEG"; break;
|
||||
default : rh = " "; break;
|
||||
}
|
||||
totsoggetti = ZERO;
|
||||
totdonazioni = ZERO;
|
||||
TRigaGruppo& riga = (TRigaGruppo&)_righe[data2row(gruppo,rh)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << gruppo;
|
||||
rigastampa << " ";
|
||||
rigastampa << rh;
|
||||
int pos = 12;
|
||||
const char* indicedm = "DM";
|
||||
real& colonnadm = (real&)_colonne->find(indicedm);
|
||||
rigatotali.aggiorna_valore((int) colonnadm.integer(),riga[(int) colonnadm.integer()]);
|
||||
totdonazioni+=riga[(int) colonnadm.integer()];
|
||||
valore = "";
|
||||
real perc = totdonazioni / totsoggetti;
|
||||
valore << perc.string(3,3);
|
||||
valore.format("%8d",riga[(int) colonnadm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicedf = "DF";
|
||||
real& colonnadf = (real&)_colonne->find(indicedf);
|
||||
rigatotali.aggiorna_valore((int) colonnadf.integer(),riga[(int) colonnadf.integer()]);
|
||||
totdonazioni+=riga[(int) colonnadf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnadf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donazioni
|
||||
valore = "";
|
||||
valore.format("%8d",totdonazioni.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
|
||||
const char* indicesm = "SM";
|
||||
real& colonnasm = (real&)_colonne->find(indicesm);
|
||||
totsoggetti+=riga[(int) colonnasm.integer()];
|
||||
rigatotali.aggiorna_valore((int) colonnasm.integer(),riga[(int) colonnasm.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnasm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicesf = "SF";
|
||||
real& colonnasf = (real&)_colonne->find(indicesf);
|
||||
totsoggetti+=riga[(int) colonnasf.integer()];
|
||||
rigatotali.aggiorna_valore((int) colonnasf.integer(),riga[(int) colonnasf.integer()]);
|
||||
valore = "";
|
||||
valore.format("%8d",riga[(int) colonnasf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donatori
|
||||
valore = "";
|
||||
valore.format("%8d",totsoggetti.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+14;
|
||||
|
||||
// percentuale
|
||||
if (totsoggetti.integer()!=0)
|
||||
{
|
||||
// maschi
|
||||
if (riga[(int) colonnasm.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = riga[(int) colonnadm.integer()] / riga[(int) colonnasm.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// femmine
|
||||
if (riga[(int) colonnasf.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = riga[(int) colonnadf.integer()] / riga[(int) colonnasf.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// totale
|
||||
valore = "";
|
||||
real perc = totdonazioni / totsoggetti;
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
|
||||
if (totdonazioni!=0)
|
||||
{
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
|
||||
if (totdonazioni!=0)
|
||||
{
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
|
||||
totsoggetti = ZERO;
|
||||
totdonazioni = ZERO;
|
||||
int pos = 12;
|
||||
const char* indicedm = "DM";
|
||||
real& colonnadm = (real&)_colonne->find(indicedm);
|
||||
totdonazioni+=rigatotali[(int) colonnadm.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnadm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicedf = "DF";
|
||||
real& colonnadf = (real&)_colonne->find(indicedf);
|
||||
totdonazioni+=rigatotali[(int) colonnadf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnadf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donazioni
|
||||
valore = "";
|
||||
valore.format("%8d",totdonazioni.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
const char* indicesm = "SM";
|
||||
real& colonnasm = (real&)_colonne->find(indicesm);
|
||||
totsoggetti+=rigatotali[(int) colonnasm.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnasm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicesf = "SF";
|
||||
real& colonnasf = (real&)_colonne->find(indicesf);
|
||||
totsoggetti+=rigatotali[(int) colonnasf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnasf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donatori
|
||||
valore = "";
|
||||
valore.format("%8d",totsoggetti.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
|
||||
pos = pos+14;
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
|
||||
// percentuale
|
||||
if (totsoggetti.integer()!=0)
|
||||
{
|
||||
// maschi
|
||||
if (rigatotali[(int) colonnasm.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = rigatotali[(int) colonnadm.integer()] / rigatotali[(int) colonnasm.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// femmine
|
||||
if (rigatotali[(int) colonnasf.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = rigatotali[(int) colonnadf.integer()] / rigatotali[(int) colonnasf.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// totale
|
||||
totsoggetti = ZERO;
|
||||
totdonazioni = ZERO;
|
||||
int pos = 12;
|
||||
const char* indicedm = "DM";
|
||||
real& colonnadm = (real&)_colonne->find(indicedm);
|
||||
totdonazioni+=rigatotali[(int) colonnadm.integer()];
|
||||
valore = "";
|
||||
real perc = totdonazioni / totsoggetti;
|
||||
valore << perc.string(3,3);
|
||||
valore.format("%8d",rigatotali[(int) colonnadm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicedf = "DF";
|
||||
real& colonnadf = (real&)_colonne->find(indicedf);
|
||||
totdonazioni+=rigatotali[(int) colonnadf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnadf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donazioni
|
||||
valore = "";
|
||||
valore.format("%8d",totdonazioni.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
const char* indicesm = "SM";
|
||||
real& colonnasm = (real&)_colonne->find(indicesm);
|
||||
totsoggetti+=rigatotali[(int) colonnasm.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnasm.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
const char* indicesf = "SF";
|
||||
real& colonnasf = (real&)_colonne->find(indicesf);
|
||||
totsoggetti+=rigatotali[(int) colonnasf.integer()];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[(int) colonnasf.integer()].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+8;
|
||||
// stampo totale donatori
|
||||
valore = "";
|
||||
valore.format("%8d",totsoggetti.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
|
||||
pos = pos+14;
|
||||
|
||||
// percentuale
|
||||
if (totsoggetti.integer()!=0)
|
||||
{
|
||||
// maschi
|
||||
if (rigatotali[(int) colonnasm.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = rigatotali[(int) colonnadm.integer()] / rigatotali[(int) colonnasm.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// femmine
|
||||
if (rigatotali[(int) colonnasf.integer()].integer() != 0)
|
||||
{
|
||||
valore = "";
|
||||
real perc = rigatotali[(int) colonnadf.integer()] / rigatotali[(int) colonnasf.integer()];
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+8;
|
||||
// totale
|
||||
valore = "";
|
||||
real perc = totdonazioni / totsoggetti;
|
||||
valore << perc.string(3,3);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TStatDonGrRh::riepilogo()
|
||||
|
216
at/at3700.cpp
216
at/at3700.cpp
@ -91,6 +91,8 @@ class TStatisticaSog : public TApplication
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin;
|
||||
TString16 _catdon;
|
||||
TDate _data;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -232,6 +234,7 @@ bool TStatisticaSog::menu(MENU_TAG m)
|
||||
_sotfin = _msk->get(F_SOTFIN);
|
||||
_catdon = _msk->get(F_CATDON);
|
||||
_data = _msk->get_date(F_DATA);
|
||||
_solotot = msk.get_bool(F_SOLOTOT);
|
||||
if (riepilogo())
|
||||
stampa();
|
||||
}
|
||||
@ -282,6 +285,7 @@ bool TStatisticaSog::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATS);
|
||||
TCursor* curstat = new TCursor(relstat, "", 1);
|
||||
@ -363,9 +367,17 @@ void TStatisticaSog::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -391,89 +403,92 @@ void TStatisticaSog::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaSGruppo rigatotali(" "," ");
|
||||
TString16 valore;
|
||||
TString16 gruppo, rh;
|
||||
real totalegruppo = ZERO;
|
||||
for (int igruppo=0;igruppo<=8;igruppo++)
|
||||
{
|
||||
switch (igruppo)
|
||||
{
|
||||
case 0 : gruppo = ""; break;
|
||||
case 1 : gruppo = "0"; break;
|
||||
case 2 : gruppo = "A"; break;
|
||||
case 3 : gruppo = "A1"; break;
|
||||
case 4 : gruppo = "A2"; break;
|
||||
case 5 : gruppo = "A1B"; break;
|
||||
case 6 : gruppo = "A2B"; break;
|
||||
case 7 : gruppo = "AB"; break;
|
||||
case 8 : gruppo = "B"; break;
|
||||
}
|
||||
for (int irh=0;irh <=2;irh++)
|
||||
{
|
||||
switch (irh)
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaSGruppo rigatotali(" "," ");
|
||||
TString16 valore;
|
||||
TString16 gruppo, rh;
|
||||
real totalegruppo = ZERO;
|
||||
for (int igruppo=0;igruppo<=8;igruppo++)
|
||||
{
|
||||
switch (igruppo)
|
||||
{
|
||||
case 1 : rh = "POS"; break;
|
||||
case 2 : rh = "NEG"; break;
|
||||
default : rh = " "; break;
|
||||
case 0 : gruppo = ""; break;
|
||||
case 1 : gruppo = "0"; break;
|
||||
case 2 : gruppo = "A"; break;
|
||||
case 3 : gruppo = "A1"; break;
|
||||
case 4 : gruppo = "A2"; break;
|
||||
case 5 : gruppo = "A1B"; break;
|
||||
case 6 : gruppo = "A2B"; break;
|
||||
case 7 : gruppo = "AB"; break;
|
||||
case 8 : gruppo = "B"; break;
|
||||
}
|
||||
TRigaSGruppo& riga = (TRigaSGruppo&)_righe[data2row(gruppo,rh)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << gruppo;
|
||||
rigastampa << " ";
|
||||
rigastampa << rh;
|
||||
totalegruppo = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalegruppo+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
if (totalegruppo != 0)
|
||||
for (int irh=0;irh <=2;irh++)
|
||||
{
|
||||
valore = "";
|
||||
valore.format("%8d",totalegruppo.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
real totale;
|
||||
totale = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totale+=rigatotali[i];
|
||||
switch (irh)
|
||||
{
|
||||
case 1 : rh = "POS"; break;
|
||||
case 2 : rh = "NEG"; break;
|
||||
default : rh = " "; break;
|
||||
}
|
||||
TRigaSGruppo& riga = (TRigaSGruppo&)_righe[data2row(gruppo,rh)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << gruppo;
|
||||
rigastampa << " ";
|
||||
rigastampa << rh;
|
||||
totalegruppo = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalegruppo+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
if (totalegruppo != 0)
|
||||
{
|
||||
valore = "";
|
||||
valore.format("%8d",totalegruppo.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale";
|
||||
real totale;
|
||||
totale = ZERO;
|
||||
int pos = 21;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totale+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totale.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
valore.format("%8d",totale.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TStatisticaSog::riepilogo()
|
||||
@ -597,30 +612,33 @@ bool TStatisticaSog::riepilogo()
|
||||
gruppo = "A";
|
||||
if (gruppo == "A1B" || gruppo == "A2B")
|
||||
gruppo = "AB";
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_GRUPPO, gruppo);
|
||||
stat.put(ATSS_RH, rh);
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
if (!_solotot)
|
||||
{
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_GRUPPO, gruppo);
|
||||
stat.put(ATSS_RH, rh);
|
||||
numero = 1;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
if (stat.read() == NOERR)
|
||||
{
|
||||
numero = stat.get_long(ATSS_NUMERO);
|
||||
numero++;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
stat.put(ATSS_CODSEZ, codsez);
|
||||
stat.put(ATSS_CODSOT, codsot);
|
||||
stat.put(ATSS_SESSO, sesso);
|
||||
stat.put(ATSS_GRUPPO, gruppo);
|
||||
stat.put(ATSS_RH, rh);
|
||||
numero = 1;
|
||||
stat.put(ATSS_NUMERO, numero);
|
||||
stat.write();
|
||||
}
|
||||
}
|
||||
stat.zero();
|
||||
stat.put(ATSS_CODSEZ, "ZZ");
|
||||
stat.put(ATSS_CODSOT, "ZZ");
|
||||
|
@ -13,3 +13,4 @@
|
||||
#define F_CATDON 301
|
||||
#define F_D_CATDON 302
|
||||
#define F_DATA 303
|
||||
#define F_SOLOTOT 304
|
||||
|
@ -117,7 +117,7 @@ BEGIN
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per la statistica"
|
||||
END
|
||||
@ -158,6 +158,11 @@ BEGIN
|
||||
PROMPT 2 8 "per tutte le categorie non di dimissione"
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLOTOT
|
||||
BEGIN
|
||||
PROMPT 2 9 "Stampa solo totale finale (non stampa il dettaglio per sezione)"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
|
157
at/at3800.cpp
157
at/at3800.cpp
@ -92,6 +92,7 @@ class TRiepilogoPunto : public TApplication
|
||||
TArray _righe; // array per riepilogo donazioni
|
||||
TString16 _sezini, _sotini, _sezfin, _sotfin;
|
||||
bool _solotot;
|
||||
int _sezionistampate;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -253,6 +254,7 @@ bool TRiepilogoPunto::stampa()
|
||||
{
|
||||
if (printer().open())
|
||||
{
|
||||
_sezionistampate = 0;
|
||||
crea_intestazione();
|
||||
TRelation* relstat = new TRelation(LF_ATSTATD);
|
||||
TCursor* curstat = new TCursor(relstat, "", 1);
|
||||
@ -318,9 +320,17 @@ void TRiepilogoPunto::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
TPrintrow row;
|
||||
TString256 rigastampa;
|
||||
if (codsez == "ZZ" && codsot == "ZZ")
|
||||
rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI SELEZIONATE";
|
||||
{
|
||||
if (_sezionistampate != 1)
|
||||
{
|
||||
//rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE";
|
||||
rigastampa = "";
|
||||
rigastampa << "RIEPILOGO TOTALE SEZIONI DA " << _sezini << '/' << _sotini << " A " << _sezfin << '/' << _sotfin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_sezionistampate++;
|
||||
rigastampa = "Sezione: ";
|
||||
rigastampa << codsez;
|
||||
if (codsot.not_empty())
|
||||
@ -346,50 +356,19 @@ void TRiepilogoPunto::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
}
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaP rigatotali("");
|
||||
real totalepunto = ZERO;
|
||||
TString16 valore;
|
||||
TString16 punto = "**";
|
||||
TRigaP& riga = (TRigaP&)_righe[data2row(punto)];
|
||||
row.reset();
|
||||
rigastampa = "Senza punto";
|
||||
totalepunto = ZERO;
|
||||
//int pos = 31;
|
||||
int pos = 51;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalepunto+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
if (totalepunto != ZERO)
|
||||
if ((codsez == "ZZ" && codsot == "ZZ" && _sezionistampate != 1) || (codsez != "ZZ"))
|
||||
{
|
||||
valore = "";
|
||||
valore.format("%8d",totalepunto.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
|
||||
TTable ldn("LDN");
|
||||
for (ldn.first(); !ldn.eof(); ldn.next())
|
||||
{
|
||||
punto = ldn.get("CODTAB");
|
||||
rigastampa.center_just(80);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
TRigaP rigatotali("");
|
||||
real totalepunto = ZERO;
|
||||
TString16 valore;
|
||||
TString16 punto = "**";
|
||||
TRigaP& riga = (TRigaP&)_righe[data2row(punto)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << punto;
|
||||
rigastampa << " ";
|
||||
rigastampa << ldn.get("S0");
|
||||
//rigastampa.cut(30);
|
||||
rigastampa.cut(55);
|
||||
rigastampa = "Senza punto";
|
||||
totalepunto = ZERO;
|
||||
//int pos = 31;
|
||||
int pos = 51;
|
||||
@ -409,37 +388,71 @@ void TRiepilogoPunto::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
rigastampa.cut(pos+4+8);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale ";
|
||||
totalepunto = ZERO;
|
||||
//pos = 31;
|
||||
pos = 51;
|
||||
for (i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalepunto+=rigatotali[i];
|
||||
}
|
||||
|
||||
TTable ldn("LDN");
|
||||
for (ldn.first(); !ldn.eof(); ldn.next())
|
||||
{
|
||||
punto = ldn.get("CODTAB");
|
||||
TRigaP& riga = (TRigaP&)_righe[data2row(punto)];
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa << punto;
|
||||
rigastampa << " ";
|
||||
rigastampa << ldn.get("S0");
|
||||
//rigastampa.cut(30);
|
||||
rigastampa.cut(55);
|
||||
totalepunto = ZERO;
|
||||
//int pos = 31;
|
||||
int pos = 51;
|
||||
for (int i=0;i<_colonne->items();i++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(i,riga[i]);
|
||||
totalepunto+=riga[i];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
if (totalepunto != ZERO)
|
||||
{
|
||||
valore = "";
|
||||
valore.format("%8d",totalepunto.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',80);
|
||||
rigastampa.cut(pos+4+8);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
rigastampa = "";
|
||||
rigastampa = "Totale ";
|
||||
totalepunto = ZERO;
|
||||
//pos = 31;
|
||||
pos = 51;
|
||||
for (i=0;i<_colonne->items();i++)
|
||||
{
|
||||
totalepunto+=rigatotali[i];
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+10;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totalepunto.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().setheaderline(3, row);
|
||||
printer().formfeed();
|
||||
valore.format("%8d",totalepunto.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos+4);
|
||||
row.put((const char*) rigastampa);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
printer().setheaderline(3, row);
|
||||
printer().formfeed();
|
||||
}
|
||||
}
|
||||
|
||||
bool TRiepilogoPunto::riepilogo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user