Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Possibiltá di fare la stampa per gruppo aziendale + toolbar nella maschera


git-svn-id: svn://10.65.10.50/trunk@8977 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2000-05-04 14:52:26 +00:00
parent 867a668a77
commit e94b044ffe
3 changed files with 122 additions and 63 deletions

View File

@ -21,13 +21,13 @@ class TControlloDonazioni : public TPrintapp
TLocalisamfile* _contsan;
int _contatore, _totfinestampa;
TDate _dataold, _dataini, _datafin;
TString16 _tipodon, _luogodon, _luogoold, _sezold;
TString16 _tipodon, _luogodon, _luogoold, _sezold, _gruppoold, _gruppoazie;
TString16 _sezini, _sotini, _sezfin, _sotfin;
TString16 _tipostampa, _ordinamento, _controllo, _prima;
bool _stampa80, _primedon, _breve;
TParagraph_string _cognome_nome;
TArray _giorni, _mesi, _giornifinale;
bool _riepfinale;
bool _riepfinale, _pergruppo;
protected:
virtual bool user_create();
@ -39,7 +39,7 @@ protected:
public:
void crea_intestazione();
void header_stampa(const TDate data, const TString16 luogo, const TString16 sezione, const TString16 sottog);
void header_stampa(const TDate data, const TString16 luogo, const TString16 sezione, const TString16 sottog, const TString16 gruppoazie);
void footer_stampa();
void fine_stampa();
TMask& app_mask() { return *_msk; }
@ -137,7 +137,7 @@ bool TControlloDonazioni::preprocess_page(int file, int counter)
if (_dataold.ok())
footer_stampa();
_dataold = datanew;
header_stampa(datanew,"","","");
header_stampa(datanew,"","","","");
_contatore = 0;
}
}
@ -150,7 +150,7 @@ bool TControlloDonazioni::preprocess_page(int file, int counter)
if (_luogoold != "****")
footer_stampa();
_luogoold = luogonew;
header_stampa(NULLDATE,luogonew,"","");
header_stampa(NULLDATE,luogonew,"","","");
_contatore = 0;
}
}
@ -170,7 +170,20 @@ bool TControlloDonazioni::preprocess_page(int file, int counter)
if (_sezold != "****")
footer_stampa();
_sezold = seznew;
header_stampa(NULLDATE,"",sezione,sottog);
header_stampa(NULLDATE,"",sezione,sottog,"");
_contatore = 0;
}
}
break;
case 'G':
{
TString16 grupponew = current_cursor()->curr(LF_SOGGETTI).get(SOG_GRUPPOAZIE);
if (grupponew != _gruppoold )
{
if (_gruppoold != "****")
footer_stampa();
_gruppoold = grupponew;
header_stampa(NULLDATE,"","","",grupponew);
_contatore = 0;
}
}
@ -309,7 +322,7 @@ void TControlloDonazioni::fine_stampa()
reset_footer();
}
void TControlloDonazioni::header_stampa(const TDate data, const TString16 luogo, const TString16 sezione, const TString16 sottog)
void TControlloDonazioni::header_stampa(const TDate data, const TString16 luogo, const TString16 sezione, const TString16 sottog, const TString16 gruppoazie)
{
TString intestazione(132);
intestazione = "STAMPA DI CONTROLLO DONAZIONI ";
@ -360,6 +373,19 @@ void TControlloDonazioni::header_stampa(const TDate data, const TString16 luogo,
}
}
break;
case 'G':
{
intestazione << "PER GRUPPO AZIENDALE ";
if (gruppoazie.not_empty())
{
intestazione << " ";
TTable gaz("GAZ");
gaz.put("CODTAB",gruppoazie);
if (gaz.read() == NOERR)
intestazione << gaz.get("S0");
}
}
break;
}
if (_stampa80)
intestazione.center_just(80);
@ -392,6 +418,9 @@ bool TControlloDonazioni::set_print(int m)
_breve = _msk->get_bool(F_BREVE);
if (_breve)
_cognome_nome.set_width(50);
_pergruppo = _msk->get_bool(F_PERGRUPPO);
if (_pergruppo)
_gruppoazie = _msk->get(F_GRUPPOAZIE);
_tipostampa = _msk->get(F_TIPOSTAMPA);
_ordinamento = _msk->get(F_ORDINAMENTO);
_riepfinale = _msk->get_bool(F_RIEPFINALE);
@ -402,14 +431,14 @@ bool TControlloDonazioni::set_print(int m)
chiave = "92->DATADON|";
break;
case 'L':
//chiave = "92->LUOGODON|92->DATADON|";
chiave = "92->LUOGODON|";
break;
case 'S':
//chiave = "90->CODSEZ|90->CODSOT|92->DATADON|";
//chiave = "92->CODSEZ|92->CODSOT|92->DATADON|";
chiave = "92->CODSEZ|92->CODSOT|";
break;
case 'G':
chiave = "90->GRUPPOAZIE|";
break;
}
switch (_ordinamento[0])
{
@ -433,60 +462,44 @@ bool TControlloDonazioni::set_print(int m)
break;
}
TString256 filtro = "";
TString80 filtrotmp ="";
// filtro per tipo donazione
if (_tipodon.not_empty())
filtro = format("(TIPODON == \"%s\")",(const char*)_tipodon);
filtro.format("(TIPODON == \"%s\")",(const char*)_tipodon);
// filtro per luogo donazione
if (_luogodon.not_empty())
{
if (filtro.empty())
filtro = format("(LUOGODON == \"%s\")",(const char*)_luogodon);
else
{
filtrotmp.format("(LUOGODON == \"%s\")",(const char*)_luogodon);
if (filtro.not_empty())
filtro << " && ";
filtro << format("(LUOGODON == \"%s\")",(const char*)_luogodon);
}
filtro << filtrotmp;
}
// filtro per prime donazioni
if (_primedon)
{
if (filtro.empty())
filtro = format("(PRIMADON == \"X\")");
else
{
filtrotmp.format("(PRIMADON == \"X\")");
if (filtro.not_empty())
filtro << " && ";
filtro << format("(PRIMADON == \"X\")");
}
}
filtro << filtrotmp;
}
// filtro per gruppo aziendale
if (_pergruppo)
{
if (_gruppoazie.not_empty())
filtrotmp.format("(90->GRUPPOAZIE == \"%s\")",(const char*)_gruppoazie);
else
filtrotmp.format("(90->GRUPPOAZIE != \"\")");
if (filtro.not_empty())
filtro << " && ";
filtro << filtrotmp;
}
TString16 inizio = "";
inizio << _sezini;
inizio << _sotini;
TString16 fine = "";
fine << _sezfin;
fine << _sotfin;
// filtro per sezione/sottogruppo
/*
if (inizio.not_empty())
{
if (filtro.empty())
filtro = format("(90->CODSEZ+90->CODSOT >= \"%s\")",(const char*)inizio);
else
{
filtro << " && ";
filtro << format("(90->CODSEZ+90->CODSOT >= \"%s\")",(const char*)inizio);
}
if (fine.not_empty())
{
if (filtro.empty())
filtro = format("(90->CODSEZ+90->CODSOT <= \"%s\")",(const char*)fine);
else
{
filtro << " && ";
filtro << format("(90->CODSEZ+90->CODSOT <= \"%s\")",(const char*)fine);
}
}
}
*/
if (inizio.not_empty())
{
if (filtro.empty())
@ -547,6 +560,7 @@ bool TControlloDonazioni::set_print(int m)
_dataold = NULLDATE;
_luogoold = "****";
_sezold = "****";
_gruppoold = "****";
reset_files();
add_file(LF_DONAZ);
reset_print();

View File

@ -18,5 +18,8 @@
#define F_TIPOSTAMPA 115
#define F_ORDINAMENTO 116
#define F_RIEPFINALE 117
#define F_D_TIPODON 201
#define F_D_LUOGODON 202
#define F_PERGRUPPO 118
#define F_GRUPPOAZIE 119
#define F_D_GRUPPOAZIE 120
#define F_D_TIPODON 121
#define F_D_LUOGODON 122

View File

@ -1,5 +1,19 @@
#include "at6300a.h"
TOOLBAR "" 0 -3 0 3
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Stampa di controllo donazioni" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
@ -117,7 +131,7 @@ BEGIN
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 7
GROUPBOX DLG_NULL 77 8
BEGIN
PROMPT 1 4 "Opzioni per la stampa"
END
@ -191,17 +205,55 @@ BEGIN
PROMPT 2 9 "Riepilogo mensile e annuale a fine pagina"
END
BOOLEAN F_PERGRUPPO
BEGIN
PROMPT 2 10 "Stampa per gruppo aziendale"
MESSAGE TRUE ENABLE,F_GRUPPOAZIE|ENABLE,F_D_GRUPPOAZIE
MESSAGE FALSE RESET,F_GRUPPOAZIE|RESET,F_D_GRUPPOAZIE|DISABLE,F_GRUPPOAZIE|DISABLE,F_D_GRUPPOAZIE
END
STRING F_GRUPPOAZIE 4
BEGIN
PROMPT 35 10 ""
FLAGS "U"
USE GAZ
INPUT CODTAB F_GRUPPOAZIE
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
OUTPUT F_GRUPPOAZIE CODTAB
OUTPUT F_D_GRUPPOAZIE S0
CHECKTYPE NORMAL
WARNING "Codice gruppo aziendale non presente"
HELP "Gruppo aziendale di appartenenza"
END
STRING F_D_GRUPPOAZIE 30
BEGIN
PROMPT 43 10 ""
FLAGS "U"
USE GAZ KEY 2
INPUT S0 F_D_GRUPPOAZIE
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
COPY OUTPUT F_GRUPPOAZIE
CHECKTYPE NORMAL
WARNING "Gruppo aziendale non presente"
HELP "Gruppo aziendale di appartenenza"
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"
ITEM "G|Gruppo aziendale"
END
RADIOBUTTON F_ORDINAMENTO 35
BEGIN
PROMPT 30 11 "Ordinamento per"
PROMPT 30 12 "Ordinamento per"
ITEM "C|Data don. e cognome e nome"
ITEM "I|Data don. e Inserimento"
ITEM "E|Data don. e etichetta sacca"
@ -210,15 +262,5 @@ BEGIN
ITEM "Z|Etichetta sacca e data don."
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK