Stampa di controllo donazioni: possibilita' di fare a fine pagina il
riepilogo mensile e annuale delle donazioni (chiesto da Parma) Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@6308 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7055eba8dd
commit
e295c25d76
113
at/at6300.cpp
113
at/at6300.cpp
@ -20,13 +20,14 @@ class TControlloDonazioni : public TPrintapp
|
||||
TMask* _msk;
|
||||
TLocalisamfile* _contsan;
|
||||
int _contatore, _totfinestampa;
|
||||
int _cur;
|
||||
TDate _dataold, _dataini, _datafin;
|
||||
TString16 _tipodon, _luogodon, _luogoold, _sezold;
|
||||
TString16 _sezini, _sotini, _tipostampa,_ordinamento;
|
||||
TString16 _controllo, _prima;
|
||||
bool _stampa80, _primedon, _breve;
|
||||
TParagraph_string _cognome_nome;
|
||||
TArray _giorni, _mesi;
|
||||
bool _riepfinale;
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -173,6 +174,21 @@ bool TControlloDonazioni::preprocess_page(int file, int counter)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (_riepfinale)
|
||||
{
|
||||
TDate datadon = current_cursor()->curr().get(DON_DATADON);
|
||||
int giorno = datadon.day();
|
||||
int mese = datadon.month();
|
||||
if (mese == _dataini.month())
|
||||
{
|
||||
real* valore = (real*)_giorni.objptr(giorno-1);
|
||||
*valore += 1;
|
||||
}
|
||||
real* valore1 = (real*)_mesi.objptr(mese-1);
|
||||
*valore1 += 1;
|
||||
if (!((datadon >= _dataini) && (datadon <= _datafin)))
|
||||
return FALSE;
|
||||
}
|
||||
// salto pagina se non ci sono abbastanza righe per il record
|
||||
if ((_stampa80) && (printer().rows_left() < 2))
|
||||
printer().formfeed();
|
||||
@ -193,13 +209,61 @@ print_action TControlloDonazioni::postprocess_print(int file, int counter)
|
||||
void TControlloDonazioni::footer_stampa()
|
||||
{
|
||||
// stampa totale soggetti a fine pagina
|
||||
reset_footer();
|
||||
TString sep(80);
|
||||
sep.fill('-');
|
||||
set_footer(1, (const char *) sep);
|
||||
set_footer(2,"TOTALE DONAZIONI %d", _contatore);
|
||||
printer().formfeed();
|
||||
reset_footer();
|
||||
if (_contatore > 0)
|
||||
{
|
||||
reset_footer();
|
||||
TString sep(80);
|
||||
sep.fill('-');
|
||||
set_footer(1, (const char *) sep);
|
||||
set_footer(2,"TOTALE DONAZIONI %d", _contatore);
|
||||
if (_riepfinale)
|
||||
{
|
||||
TString16 valore;
|
||||
TString256 rigastampa = "TOTALI 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31";
|
||||
set_footer(3,rigastampa);
|
||||
rigastampa = "GIORNO";
|
||||
int pos = 7;
|
||||
for (int i=0;i<31;i++)
|
||||
{
|
||||
valore = "";
|
||||
real* numero = (real*)_giorni.objptr(i);
|
||||
real numero1 = *numero;
|
||||
valore.format("%3d",numero1.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+4;
|
||||
}
|
||||
set_footer(4,rigastampa);
|
||||
rigastampa = "TOTALI GEN. FEB. MAR. APR. MAG. GIU. LUG. AGO. SET. OTT. NOV. DIC. TOTALE";
|
||||
set_footer(6,rigastampa);
|
||||
rigastampa = "MESE ";
|
||||
pos = 8;
|
||||
real totale = ZERO;
|
||||
for (int j=0;j<12;j++)
|
||||
{
|
||||
valore = "";
|
||||
real* numero = (real*)_mesi.objptr(j);
|
||||
real numero1 = *numero;
|
||||
totale+=numero1;
|
||||
valore.format("%4d",numero1.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+5;
|
||||
}
|
||||
pos=pos+4;
|
||||
valore = "";
|
||||
valore.format("%4d",totale.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
|
||||
set_footer(7,rigastampa);
|
||||
_giorni.destroy();
|
||||
_mesi.destroy();
|
||||
for (i=0;i<31;i++)
|
||||
_giorni.add(new real(ZERO),i);
|
||||
for (j=0;j<12;j++)
|
||||
_mesi.add(new real(ZERO),j);
|
||||
}
|
||||
printer().formfeed();
|
||||
reset_footer();
|
||||
}
|
||||
}
|
||||
|
||||
void TControlloDonazioni::fine_stampa()
|
||||
@ -299,6 +363,7 @@ bool TControlloDonazioni::set_print(int m)
|
||||
_cognome_nome.set_width(50);
|
||||
_tipostampa = _msk->get(F_TIPOSTAMPA);
|
||||
_ordinamento = _msk->get(F_ORDINAMENTO);
|
||||
_riepfinale = _msk->get_bool(F_RIEPFINALE);
|
||||
TString80 chiave = "";
|
||||
switch (_tipostampa[0])
|
||||
{
|
||||
@ -374,10 +439,29 @@ bool TControlloDonazioni::set_print(int m)
|
||||
// filtro per data
|
||||
TRectype da(LF_DONAZ);
|
||||
TRectype a (LF_DONAZ);
|
||||
if (_dataini.ok())
|
||||
da.put(DON_DATADON, _dataini);
|
||||
if (_datafin.ok())
|
||||
a.put(DON_DATADON, _datafin);
|
||||
if (_riepfinale)
|
||||
{
|
||||
TDate inizio = _dataini;
|
||||
TDate fine = _datafin;
|
||||
inizio.set_day(1);
|
||||
inizio.set_month(1);
|
||||
fine.set_end_month();
|
||||
da.put(DON_DATADON, inizio);
|
||||
a.put(DON_DATADON, fine);
|
||||
_giorni.destroy();
|
||||
_mesi.destroy();
|
||||
for (int i=0;i<31;i++)
|
||||
_giorni.add(new real(ZERO),i);
|
||||
for (int j=0;j<12;j++)
|
||||
_mesi.add(new real(ZERO),j);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_dataini.ok())
|
||||
da.put(DON_DATADON, _dataini);
|
||||
if (_datafin.ok())
|
||||
a.put(DON_DATADON, _datafin);
|
||||
}
|
||||
current_cursor()->setregion(da, a);
|
||||
current_cursor()->setfilter(filtro, TRUE);
|
||||
((TSorted_cursor*)current_cursor())->change_order(chiave);
|
||||
@ -463,7 +547,10 @@ void TControlloDonazioni::crea_intestazione()
|
||||
set_header(3,"@0gProg.@7gEt.sacca@17gCodice@26gTessera@34gCognome e nome@70gNato il@81gSe/So@87gData don.@98gTipo@104gLuogo@110gGr.@114gRh@118gFen.Rh@125gKellDu");
|
||||
set_header(4,"@0g------@7g---------@17g--------@26g-------@34g-----------------------------------@70g----------@81g-----@87g----------@98g----@104g-----@110g---@114g---@118g------@125g--- ---");
|
||||
}
|
||||
printer().footerlen(3);
|
||||
if (_riepfinale)
|
||||
printer().footerlen(9);
|
||||
else
|
||||
printer().footerlen(5);
|
||||
}
|
||||
|
||||
bool TControlloDonazioni::user_create()
|
||||
|
@ -17,5 +17,6 @@
|
||||
#define F_BREVE 114
|
||||
#define F_TIPOSTAMPA 115
|
||||
#define F_ORDINAMENTO 116
|
||||
#define F_RIEPFINALE 117
|
||||
#define F_D_TIPODON 201
|
||||
#define F_D_LUOGODON 202
|
||||
|
@ -117,7 +117,7 @@ END
|
||||
// HELP "Sottogruppo finale"
|
||||
//END
|
||||
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
GROUPBOX DLG_NULL 77 7
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per la stampa"
|
||||
END
|
||||
@ -182,9 +182,14 @@ BEGIN
|
||||
PROMPT 36 9 "Formato di stampa breve"
|
||||
END
|
||||
|
||||
BOOLEAN F_RIEPFINALE
|
||||
BEGIN
|
||||
PROMPT 2 10 "Riepilogo mensile e annuale a fine pagina"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOSTAMPA 25
|
||||
BEGIN
|
||||
PROMPT 1 11 "Stampa per "
|
||||
PROMPT 1 12 "Stampa per "
|
||||
ITEM "D|Data donazione"
|
||||
ITEM "L|Punto prelievo"
|
||||
ITEM "S|Sezione/Sottogruppo"
|
||||
@ -192,7 +197,7 @@ END
|
||||
|
||||
RADIOBUTTON F_ORDINAMENTO 35
|
||||
BEGIN
|
||||
PROMPT 30 11 "Ordinamento per data donazione e ..."
|
||||
PROMPT 30 12 "Ordinamento per data donazione e ..."
|
||||
ITEM "C|Cognome e nome"
|
||||
ITEM "I|Inserimento"
|
||||
ITEM "E|Etichetta sacca"
|
||||
|
Loading…
x
Reference in New Issue
Block a user