Corretta stampa dimessi in assenza di date limite
git-svn-id: svn://10.65.10.50/branches/R_10_00@22833 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d9184a421d
commit
37a279b6a0
@ -65,9 +65,9 @@ protected:
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
void header_sezione(const TString& codsez, const TString& codsot);
|
||||
void footer_sezione();
|
||||
void header_gruppo(const TString16 gruppo);
|
||||
void header_gruppo(const TString& gruppo);
|
||||
void footer_gruppo();
|
||||
void fine_stampa();
|
||||
TMask& app_mask() { return *_msk; }
|
||||
@ -107,7 +107,7 @@ void TStampaIscritti::set_page(int file, int cnt)
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
for (int r=1;r<=_etcolonne;r++)
|
||||
for (int r=1; r <= _etcolonne; r++)
|
||||
{
|
||||
if (current_cursor()->pos()<current_cursor()->items())
|
||||
{
|
||||
@ -165,41 +165,61 @@ void TStampaIscritti::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
|
||||
bool is_between(const TDate& date, const TDate& from, const TDate& to)
|
||||
{
|
||||
if (!date.ok())
|
||||
return false;
|
||||
|
||||
if (from.ok() && date < from)
|
||||
return false;
|
||||
|
||||
if (to.ok() && date > to)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TStampaIscritti::filter_func_iscritti(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
const TStampaIscritti& a = app();
|
||||
const TRectype& sog = rel->curr();
|
||||
|
||||
bool filtrato = true;
|
||||
|
||||
// filtro per categorie
|
||||
const TAssoc_array& categorie = a._categorie;
|
||||
if (!categorie.empty())
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
if ((!filtrato) && (!app()._attuale))
|
||||
const TString& cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key(cat);
|
||||
if (!filtrato && !a._attuale)
|
||||
{
|
||||
const TString16 catcoll = rel->lfile(-ALIAS_CTD).get("S6");
|
||||
filtrato = categorie.is_key((const char*) catcoll);
|
||||
const TString& catcoll = rel->lfile(-ALIAS_CTD).get("S6");
|
||||
filtrato = categorie.is_key(catcoll);
|
||||
}
|
||||
}
|
||||
// filtro per date iscrizione/dimissione
|
||||
|
||||
// filtro per date iscrizione/dimissione
|
||||
if (filtrato)
|
||||
{
|
||||
if (app()._tipo_iscdim == ISCRITTI)
|
||||
if (a._tipo_iscdim == ISCRITTI)
|
||||
{
|
||||
const TDate dataisc = sog.get_date(SOG_DATAISC);
|
||||
filtrato = (dataisc >= app()._dataini && dataisc <= app()._datafin);
|
||||
filtrato = is_between(dataisc, a._dataini, a._datafin);
|
||||
}
|
||||
else
|
||||
{
|
||||
const TDate datadim = sog.get(SOG_DATADIM);
|
||||
filtrato = (datadim >= app()._dataini && datadim <= app()._datafin);
|
||||
filtrato = is_between(datadim, a._dataini, a._datafin);
|
||||
}
|
||||
}
|
||||
if (app()._numdon > 0 && filtrato)
|
||||
|
||||
if (filtrato && a._numdon > 0)
|
||||
{
|
||||
const int totdon = sog.get_int(SOG_TOTDON);
|
||||
filtrato = (totdon >= app()._numdon);
|
||||
}
|
||||
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
@ -362,7 +382,7 @@ void TStampaIscritti::fine_stampa()
|
||||
}
|
||||
}
|
||||
|
||||
void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
void TStampaIscritti::header_sezione(const TString& codsez, const TString& codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
@ -383,7 +403,7 @@ void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 cod
|
||||
return;
|
||||
}
|
||||
|
||||
void TStampaIscritti::header_gruppo(const TString16 gruppo)
|
||||
void TStampaIscritti::header_gruppo(const TString& gruppo)
|
||||
{
|
||||
TString intestazione(132);
|
||||
intestazione = "GRUPPO AZIENDALE ";
|
||||
@ -601,6 +621,6 @@ bool TStampaIscritti::user_destroy()
|
||||
int at2600(int argc, char* argv[])
|
||||
{
|
||||
TStampaIscritti a;
|
||||
a.run(argc, argv, "Iscritti/dimessi");
|
||||
a.run(argc, argv, TR("Iscritti/Dimessi"));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user