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