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:
|
public:
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void filtra_sezioni();
|
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 footer_sezione();
|
||||||
void header_gruppo(const TString16 gruppo);
|
void header_gruppo(const TString& gruppo);
|
||||||
void footer_gruppo();
|
void footer_gruppo();
|
||||||
void fine_stampa();
|
void fine_stampa();
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
@ -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 TStampaIscritti::filter_func_iscritti(const TRelation * rel)
|
||||||
{
|
{
|
||||||
bool filtrato = TRUE;
|
const TStampaIscritti& a = app();
|
||||||
TLocalisamfile& sog = rel->lfile();
|
const TRectype& sog = rel->curr();
|
||||||
|
|
||||||
|
bool filtrato = true;
|
||||||
|
|
||||||
// filtro per categorie
|
// filtro per categorie
|
||||||
TAssoc_array& categorie = app()._categorie;
|
const TAssoc_array& categorie = a._categorie;
|
||||||
if (categorie.items() != 0)
|
if (!categorie.empty())
|
||||||
{
|
{
|
||||||
const TString16 cat = sog.get(SOG_CATDON);
|
const TString& cat = sog.get(SOG_CATDON);
|
||||||
filtrato = categorie.is_key((const char*) cat);
|
filtrato = categorie.is_key(cat);
|
||||||
if ((!filtrato) && (!app()._attuale))
|
if (!filtrato && !a._attuale)
|
||||||
{
|
{
|
||||||
const TString16 catcoll = rel->lfile(-ALIAS_CTD).get("S6");
|
const TString& catcoll = rel->lfile(-ALIAS_CTD).get("S6");
|
||||||
filtrato = categorie.is_key((const char*) catcoll);
|
filtrato = categorie.is_key(catcoll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// filtro per date iscrizione/dimissione
|
// filtro per date iscrizione/dimissione
|
||||||
if (filtrato)
|
if (filtrato)
|
||||||
{
|
{
|
||||||
if (app()._tipo_iscdim == ISCRITTI)
|
if (a._tipo_iscdim == ISCRITTI)
|
||||||
{
|
{
|
||||||
const TDate dataisc = sog.get_date(SOG_DATAISC);
|
const TDate dataisc = sog.get_date(SOG_DATAISC);
|
||||||
filtrato = (dataisc >= app()._dataini && dataisc <= app()._datafin);
|
filtrato = is_between(dataisc, a._dataini, a._datafin);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const TDate datadim = sog.get(SOG_DATADIM);
|
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);
|
const int totdon = sog.get_int(SOG_TOTDON);
|
||||||
filtrato = (totdon >= app()._numdon);
|
filtrato = (totdon >= app()._numdon);
|
||||||
}
|
}
|
||||||
|
|
||||||
return filtrato;
|
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 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampaIscritti::header_gruppo(const TString16 gruppo)
|
void TStampaIscritti::header_gruppo(const TString& gruppo)
|
||||||
{
|
{
|
||||||
TString intestazione(132);
|
TString intestazione(132);
|
||||||
intestazione = "GRUPPO AZIENDALE ";
|
intestazione = "GRUPPO AZIENDALE ";
|
||||||
@ -601,6 +621,6 @@ bool TStampaIscritti::user_destroy()
|
|||||||
int at2600(int argc, char* argv[])
|
int at2600(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TStampaIscritti a;
|
TStampaIscritti a;
|
||||||
a.run(argc, argv, "Iscritti/dimessi");
|
a.run(argc, argv, TR("Iscritti/Dimessi"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user