Patch level : at
Files correlati : Ricompilazione Demo : [ ] Commento : chiusura periodica anche con parametri non presi da tab.sezioni, ma dati sul omento (nel caso siano tutti uguali) git-svn-id: svn://10.65.10.50/trunk@9346 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e52a54aa00
commit
9a52cc0a52
382
at/at0600.cpp
382
at/at0600.cpp
@ -29,10 +29,15 @@ class TChiusuraPeriodica : public TPrintapp
|
|||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
int _cur;
|
int _cur;
|
||||||
TDate _data_chiusura;
|
TDate _data_chiusura, _dataud;
|
||||||
TParagraph_string _operazione;
|
TParagraph_string _operazione;
|
||||||
bool _definitiva, _sospesi;
|
bool _definitiva, _sospesi, _usosez;
|
||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot;
|
||||||
|
int _numdon;
|
||||||
|
TString16 _catfin1, _catfin2;
|
||||||
|
TAssoc_array _categorie;
|
||||||
|
int _contatore, _totale;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
@ -46,8 +51,10 @@ protected:
|
|||||||
public:
|
public:
|
||||||
void filtra_sezioni();
|
void filtra_sezioni();
|
||||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||||
|
void footer_sezione();
|
||||||
|
void fine_stampa();
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
TChiusuraPeriodica() : _data_chiusura(TODAY), _operazione("",30) {}
|
TChiusuraPeriodica() : _data_chiusura(TODAY), _operazione("",35) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
HIDDEN inline TChiusuraPeriodica& app() { return (TChiusuraPeriodica&) main_app(); }
|
HIDDEN inline TChiusuraPeriodica& app() { return (TChiusuraPeriodica&) main_app(); }
|
||||||
@ -71,125 +78,195 @@ void TChiusuraPeriodica::filtra_sezioni()
|
|||||||
current_cursor()->setregion(da, a);
|
current_cursor()->setregion(da, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action TChiusuraPeriodica::postprocess_print(int file, int counter)
|
|
||||||
{
|
|
||||||
printer().formfeed();
|
|
||||||
return NEXT_PAGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TChiusuraPeriodica::preprocess_page(int file, int counter)
|
bool TChiusuraPeriodica::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
_operazione = "Non deve essere filtrato";
|
_operazione = "Situazione da controllare";
|
||||||
TRectype& recsez = current_cursor()->curr(LF_SEZIONI);
|
TRectype& recsez = current_cursor()->curr(LF_SEZIONI);
|
||||||
TRectype& recsog = current_cursor()->curr();
|
TRectype& recsog = current_cursor()->curr();
|
||||||
if (!(app()._sospesi))
|
|
||||||
{
|
|
||||||
const char stato = modstato_tcs(recsog.get(SOG_STATO));
|
|
||||||
if (stato == 'S')
|
|
||||||
return FALSE;
|
|
||||||
const char statosi = modstato_tcs(recsog.get(SOG_STATOSI));
|
|
||||||
if (statosi == 'S')
|
|
||||||
return FALSE;
|
|
||||||
const char statoaf = modstato_tcs(recsog.get(SOG_STATOAF));
|
|
||||||
if (statoaf == 'S')
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
// salto pagina se cambio sezione
|
// salto pagina se cambio sezione
|
||||||
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
||||||
const TString16 codsot = recsog.get(SOG_CODSOT);
|
const TString16 codsot = recsog.get(SOG_CODSOT);
|
||||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||||
{
|
{
|
||||||
if (_codsez != "**")
|
if (_codsez != "**")
|
||||||
printer().formfeed();
|
footer_sezione();
|
||||||
|
_contatore = 0;
|
||||||
_codsez = codsez;
|
_codsez = codsez;
|
||||||
_codsot = codsot;
|
_codsot = codsot;
|
||||||
header_sezione(codsez, codsot);
|
header_sezione(codsez, codsot);
|
||||||
}
|
}
|
||||||
TLocalisamfile& filesog = current_cursor()->file();
|
TLocalisamfile& filesog = current_cursor()->file();
|
||||||
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
const TString16 catsog = recsog.get(SOG_CATDON);
|
||||||
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
if (_usosez)
|
||||||
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
{
|
||||||
const int intesti = recsez.get_int(SEZ_INTESTI);
|
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
||||||
const int donemer = recsez.get_int(SEZ_DONEMER);
|
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
||||||
if ((cat_estinti.not_empty() && intesti!=0) || cat_cancellati.not_empty() || (cat_emeriti.not_empty() && donemer!=0))
|
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
||||||
{
|
const int intesti = recsez.get_int(SEZ_INTESTI);
|
||||||
const TString16 catsog = recsog.get(SOG_CATDON);
|
const int donemer = recsez.get_int(SEZ_DONEMER);
|
||||||
if (catsog == cat_cancellati && cat_cancellati.not_empty())
|
if ((cat_estinti.not_empty() && intesti!=0) || cat_cancellati.not_empty() || (cat_emeriti.not_empty() && donemer!=0))
|
||||||
{
|
{
|
||||||
_operazione = "Cancellato";
|
if (catsog == cat_cancellati && cat_cancellati.not_empty())
|
||||||
if (_definitiva)
|
{
|
||||||
filesog.remove();
|
_operazione = "Cancellato";
|
||||||
}
|
if (_definitiva)
|
||||||
else
|
filesog.remove();
|
||||||
{
|
}
|
||||||
if ((cat_estinti.not_empty() && intesti!=0) || (cat_emeriti.not_empty() && donemer!=0))
|
else
|
||||||
{
|
{
|
||||||
bool dimesso = current_cursor()->curr(-ALIAS_CTD).get_bool("B0");
|
if ((cat_estinti.not_empty() && intesti!=0) || (cat_emeriti.not_empty() && donemer!=0))
|
||||||
if (!dimesso)
|
{
|
||||||
{
|
bool dimesso = current_cursor()->curr(-ALIAS_CTD).get_bool("B0");
|
||||||
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
if (!dimesso)
|
||||||
if (dataultdon.ok())
|
{
|
||||||
{
|
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
||||||
dataultdon.addyear(intesti);
|
if (dataultdon.ok())
|
||||||
if (dataultdon < app()._data_chiusura)
|
|
||||||
{
|
{
|
||||||
const int totdon = recsog.get_int(SOG_TOTDON);
|
dataultdon.addyear(intesti);
|
||||||
if (cat_emeriti.not_empty() && donemer!=0 && totdon>donemer)
|
if (dataultdon < app()._data_chiusura)
|
||||||
{
|
|
||||||
_operazione = "da";
|
|
||||||
_operazione << " ";
|
|
||||||
_operazione << catsog;
|
|
||||||
_operazione << " a ";
|
|
||||||
_operazione << cat_emeriti;
|
|
||||||
if (_definitiva)
|
|
||||||
{
|
|
||||||
recsog.put(SOG_CATDON,cat_emeriti);
|
|
||||||
recsog.put(SOG_DATADIM, _data_chiusura);
|
|
||||||
filesog.rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (cat_estinti.not_empty())
|
const int totdon = recsog.get_int(SOG_TOTDON);
|
||||||
{
|
if (cat_emeriti.not_empty() && donemer!=0 && totdon>donemer)
|
||||||
|
{
|
||||||
_operazione = "da";
|
_operazione = "da";
|
||||||
_operazione << " ";
|
_operazione << " ";
|
||||||
_operazione << catsog;
|
_operazione << catsog;
|
||||||
_operazione << " a ";
|
_operazione << " a ";
|
||||||
_operazione << cat_estinti;
|
_operazione << cat_emeriti;
|
||||||
if (_definitiva)
|
if (_definitiva)
|
||||||
{
|
{
|
||||||
recsog.put(SOG_CATDON,cat_estinti);
|
recsog.put(SOG_CATDON,cat_emeriti);
|
||||||
recsog.put(SOG_DATADIM, _data_chiusura);
|
recsog.put(SOG_DATADIM, _data_chiusura);
|
||||||
|
recsog.put(SOG_DATAULTAGG, TODAY);
|
||||||
|
recsog.put(SOG_UTENULTAGG, user());
|
||||||
filesog.rewrite();
|
filesog.rewrite();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (cat_estinti.not_empty())
|
||||||
|
{
|
||||||
|
_operazione = "da";
|
||||||
|
_operazione << " ";
|
||||||
|
_operazione << catsog;
|
||||||
|
_operazione << " a ";
|
||||||
|
_operazione << cat_estinti;
|
||||||
|
if (_definitiva)
|
||||||
|
{
|
||||||
|
recsog.put(SOG_CATDON,cat_estinti);
|
||||||
|
recsog.put(SOG_DATADIM, _data_chiusura);
|
||||||
|
recsog.put(SOG_DATAULTAGG, TODAY);
|
||||||
|
recsog.put(SOG_UTENULTAGG, user());
|
||||||
|
filesog.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const int totdon = recsog.get_int(SOG_TOTDON);
|
||||||
|
if (_catfin1.not_empty() && totdon<=_numdon)
|
||||||
|
{
|
||||||
|
_operazione = "da";
|
||||||
|
_operazione << " ";
|
||||||
|
_operazione << catsog;
|
||||||
|
_operazione << " a ";
|
||||||
|
_operazione << _catfin1;
|
||||||
|
if (_definitiva)
|
||||||
|
{
|
||||||
|
recsog.put(SOG_CATDON,_catfin1);
|
||||||
|
recsog.put(SOG_DATADIM, TODAY);
|
||||||
|
recsog.put(SOG_DATAULTAGG, TODAY);
|
||||||
|
recsog.put(SOG_UTENULTAGG, user());
|
||||||
|
filesog.rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
if (_catfin2.not_empty())
|
||||||
|
{
|
||||||
|
_operazione = "da";
|
||||||
|
_operazione << " ";
|
||||||
|
_operazione << catsog;
|
||||||
|
_operazione << " a ";
|
||||||
|
_operazione << _catfin2;
|
||||||
|
if (_definitiva)
|
||||||
|
{
|
||||||
|
recsog.put(SOG_CATDON, _catfin2);
|
||||||
|
recsog.put(SOG_DATADIM, TODAY);
|
||||||
|
recsog.put(SOG_DATAULTAGG, TODAY);
|
||||||
|
recsog.put(SOG_UTENULTAGG, user());
|
||||||
|
filesog.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_contatore++;
|
||||||
|
_totale++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_action TChiusuraPeriodica::postprocess_print(int file, int counter)
|
||||||
|
{
|
||||||
|
if (_contatore > 0)
|
||||||
|
footer_sezione();
|
||||||
|
fine_stampa();
|
||||||
|
return NEXT_PAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TChiusuraPeriodica::footer_sezione()
|
||||||
|
{
|
||||||
|
// stampa totale soggetti appartenenti alla sezione
|
||||||
|
reset_footer();
|
||||||
|
TString sep(132);
|
||||||
|
sep.fill('-');
|
||||||
|
set_footer(2, (const char *) sep);
|
||||||
|
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
|
||||||
|
printer().formfeed();
|
||||||
|
reset_footer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TChiusuraPeriodica::fine_stampa()
|
||||||
|
{
|
||||||
|
// stampa totale soggetti a fine stampa
|
||||||
|
reset_footer();
|
||||||
|
TString sep(132);
|
||||||
|
sep.fill('-');
|
||||||
|
set_footer(2, (const char *) sep);
|
||||||
|
if (_totale > 0 && _totale != _contatore)
|
||||||
|
{
|
||||||
|
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
reset_footer();
|
||||||
|
}
|
||||||
|
|
||||||
void TChiusuraPeriodica::header_sezione(const TString16 codsez, const TString16 codsot)
|
void TChiusuraPeriodica::header_sezione(const TString16 codsez, const TString16 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);
|
||||||
TString intestazione(116);
|
TString intestazione(132);
|
||||||
intestazione = "Sezione: ";
|
intestazione = "Sezione: ";
|
||||||
intestazione << codsez;
|
intestazione << codsez;
|
||||||
intestazione << "/";
|
if (codsot.not_empty())
|
||||||
intestazione << codsot;
|
{
|
||||||
intestazione << " ";
|
intestazione << '/';
|
||||||
|
intestazione << codsot;
|
||||||
|
}
|
||||||
|
intestazione << ' ';
|
||||||
intestazione << densez;
|
intestazione << densez;
|
||||||
if (densot.not_empty())
|
if (densot.not_empty())
|
||||||
{
|
{
|
||||||
intestazione << "/";
|
intestazione << '/';
|
||||||
intestazione << densot;
|
intestazione << densot;
|
||||||
}
|
}
|
||||||
|
|
||||||
intestazione.center_just();
|
intestazione.center_just();
|
||||||
set_header(1,"@0g%s", (const char*) intestazione);
|
set_header(1,"@0g%s", (const char*) intestazione);
|
||||||
return;
|
return;
|
||||||
@ -202,44 +279,84 @@ void TChiusuraPeriodica::set_page(int file, int cnt)
|
|||||||
set_row(1,"@12g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
set_row(1,"@12g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
||||||
set_row(1,"@38g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
set_row(1,"@38g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||||
set_row(1,"@64g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
set_row(1,"@64g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||||
set_row(1,"@75g@pn", FLD(LF_SOGGETTI,SOG_TOTDON, "###"));
|
set_row(1,"@75g@ld", FLD(LF_SOGGETTI,SOG_DATAISC));
|
||||||
set_row(1,"@79g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
set_row(1,"@86g@pn", FLD(LF_SOGGETTI,SOG_TOTDON, "###"));
|
||||||
set_row(1,"@86g#a", &_operazione);
|
set_row(1,"@90g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
||||||
|
set_row(1,"@97g#a", &_operazione);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TChiusuraPeriodica::filter_func_chiusura(const TRelation* rel)
|
bool TChiusuraPeriodica::filter_func_chiusura(const TRelation* rel)
|
||||||
{
|
{
|
||||||
bool filtrato = FALSE;
|
bool filtrato = FALSE;
|
||||||
|
|
||||||
TRectype& recsez = rel->lfile(LF_SEZIONI).curr();
|
|
||||||
TRectype& recsog = rel->lfile().curr();
|
TRectype& recsog = rel->lfile().curr();
|
||||||
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
if (!app()._sospesi)
|
||||||
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
{
|
||||||
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
const char stato = modstato_tcs(recsog.get(SOG_STATO));
|
||||||
const int intesti = recsez.get_int(SEZ_INTESTI);
|
if (stato == 'S')
|
||||||
const int donemer = recsez.get_int(SEZ_DONEMER);
|
return FALSE;
|
||||||
if ((cat_estinti.not_empty() && intesti!=0) || cat_cancellati.not_empty() || (cat_emeriti.not_empty() && donemer!=0))
|
const char statosi = modstato_tcs(recsog.get(SOG_STATOSI));
|
||||||
{
|
if (statosi == 'S')
|
||||||
const TString16 catsog = recsog.get(SOG_CATDON);
|
return FALSE;
|
||||||
if (catsog == cat_cancellati && cat_cancellati.not_empty())
|
const char statoaf = modstato_tcs(recsog.get(SOG_STATOAF));
|
||||||
filtrato = TRUE; // da cancellare
|
if (statoaf == 'S')
|
||||||
else
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (app()._usosez)
|
||||||
|
{
|
||||||
|
TRectype& recsez = rel->lfile(LF_SEZIONI).curr();
|
||||||
|
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
||||||
|
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
||||||
|
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
||||||
|
const int intesti = recsez.get_int(SEZ_INTESTI);
|
||||||
|
const int donemer = recsez.get_int(SEZ_DONEMER);
|
||||||
|
if ((cat_estinti.not_empty() && intesti!=0) || cat_cancellati.not_empty() || (cat_emeriti.not_empty() && donemer!=0))
|
||||||
|
{
|
||||||
|
const TString16 catsog = recsog.get(SOG_CATDON);
|
||||||
|
if (catsog == cat_cancellati && cat_cancellati.not_empty())
|
||||||
|
filtrato = TRUE; // da cancellare
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((cat_estinti.not_empty() && intesti!=0) || (cat_emeriti.not_empty() && donemer!=0))
|
||||||
|
{
|
||||||
|
const bool dimesso = rel->lfile(-ALIAS_CTD).get_bool("B0");
|
||||||
|
if (!dimesso)
|
||||||
|
{
|
||||||
|
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
||||||
|
if (dataultdon.ok())
|
||||||
|
{
|
||||||
|
dataultdon.addyear(intesti);
|
||||||
|
filtrato = (dataultdon < app()._data_chiusura);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TAssoc_array& categorie = app()._categorie;
|
||||||
|
if (categorie.items() != 0)
|
||||||
{
|
{
|
||||||
if ((cat_estinti.not_empty() && intesti!=0) || (cat_emeriti.not_empty() && donemer!=0))
|
const TString16 cat = recsog.get(SOG_CATDON);
|
||||||
{
|
filtrato = categorie.is_key((const char*) cat);
|
||||||
const bool dimesso = rel->lfile(-ALIAS_CTD).get_bool("B0");
|
}
|
||||||
if (!dimesso)
|
if (filtrato)
|
||||||
{
|
{
|
||||||
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
const bool dimesso = rel->lfile(-ALIAS_CTD).get_bool("B0");
|
||||||
if (dataultdon.ok())
|
if (!dimesso)
|
||||||
{
|
{
|
||||||
dataultdon.addyear(intesti);
|
TDate data = recsog.get(SOG_DATAULTDON);
|
||||||
filtrato = (dataultdon < app()._data_chiusura);
|
if (data.ok())
|
||||||
}
|
filtrato = (data < app()._dataud);
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
}
|
data = recsog.get(SOG_DATAISC);
|
||||||
}
|
if (data.ok())
|
||||||
|
filtrato = (data < app()._dataud);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return filtrato;
|
return filtrato;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,14 +368,41 @@ bool TChiusuraPeriodica::set_print(int)
|
|||||||
{
|
{
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
|
_contatore = 0;
|
||||||
|
_totale = 0;
|
||||||
|
_usosez = _msk->get_bool(F_USOSEZ);
|
||||||
|
_data_chiusura = _msk->get_date(F_DATA);
|
||||||
|
_categorie.destroy();
|
||||||
|
const TString16 catpri = _msk->get(F_CAT1);
|
||||||
|
const TString16 catsec = _msk->get(F_CAT2);
|
||||||
|
const TString16 catter = _msk->get(F_CAT3);
|
||||||
|
const TString16 catqua = _msk->get(F_CAT4);
|
||||||
|
const TString16 catqui = _msk->get(F_CAT5);
|
||||||
|
const TString16 catses = _msk->get(F_CAT6);
|
||||||
|
if (catpri.not_empty())
|
||||||
|
_categorie.add((const char*) catpri);
|
||||||
|
if (catsec.not_empty())
|
||||||
|
_categorie.add((const char*) catsec);
|
||||||
|
if (catter.not_empty())
|
||||||
|
_categorie.add((const char*) catter);
|
||||||
|
if (catqua.not_empty())
|
||||||
|
_categorie.add((const char*) catqua);
|
||||||
|
if (catqui.not_empty())
|
||||||
|
_categorie.add((const char*) catqui);
|
||||||
|
if (catses.not_empty())
|
||||||
|
_categorie.add((const char*) catses);
|
||||||
|
_dataud = _msk->get_date(F_DATAUD);
|
||||||
|
_numdon = _msk->get_int(F_NUMDON);
|
||||||
|
_catfin1 = _msk->get(F_CATFIN1);
|
||||||
|
_catfin2 = _msk->get(F_CATFIN2);
|
||||||
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
||||||
_sospesi = _msk->get_bool(F_SOSPESI);
|
_sospesi = _msk->get_bool(F_SOSPESI);
|
||||||
_data_chiusura = _msk->get(F_DATA);
|
|
||||||
reset_files();
|
reset_files();
|
||||||
add_file(LF_SOGGETTI);
|
add_file(LF_SOGGETTI);
|
||||||
filtra_sezioni();
|
filtra_sezioni();
|
||||||
current_cursor()->set_filterfunction(filter_func_chiusura,TRUE);
|
current_cursor()->set_filterfunction(filter_func_chiusura,TRUE);
|
||||||
reset_print();
|
reset_print();
|
||||||
|
printer().footerlen(0);
|
||||||
crea_intestazione();
|
crea_intestazione();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -269,25 +413,29 @@ bool TChiusuraPeriodica::set_print(int)
|
|||||||
void TChiusuraPeriodica::crea_intestazione()
|
void TChiusuraPeriodica::crea_intestazione()
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
TString sep(116);
|
TString sep(132);
|
||||||
sep = "";
|
sep = "";
|
||||||
if (_definitiva)
|
if (_definitiva)
|
||||||
sep << "CHIUSURA - DEFINITIVA - ALLA DATA ";
|
sep << "CHIUSURA - DEFINITIVA - ALLA DATA ";
|
||||||
else
|
else
|
||||||
sep << "CHIUSURA - PROVVISORIA - ALLA DATA ";
|
sep << "CHIUSURA - PROVVISORIA - ALLA DATA ";
|
||||||
sep << _data_chiusura.string();
|
if (_usosez)
|
||||||
|
sep << _data_chiusura.string();
|
||||||
|
else
|
||||||
|
sep << _dataud.string();
|
||||||
sep.center_just();
|
sep.center_just();
|
||||||
set_header(2, "@0g%s", (const char*) sep);
|
set_header(2, "@0g%s", (const char*) sep);
|
||||||
TDate data_stampa(TODAY);
|
TDate data_stampa(TODAY);
|
||||||
set_header(2,"@0g%10s", (const char*) data_stampa.string());
|
set_header(2,"@0g%10s", (const char*) data_stampa.string());
|
||||||
sep = "";
|
sep = "";
|
||||||
sep << "Pag. @#";
|
sep << "Pag. @#";
|
||||||
set_header(2, "@100g%s", (const char*) sep);
|
set_header(2, "@120g%s", (const char*) sep);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-');
|
sep.fill('-');
|
||||||
set_header(3, (const char *) sep);
|
set_header(3, (const char *) sep);
|
||||||
set_header(4,"@0gCodice@9gC.@12gCognome@38gNome@64gData u.d.@75gTot@79gTess.@86gOperazione");
|
set_header(4,"@0gCodice@9gC.@12gCognome@38gNome@64gData u.d.@75gData isc.@86gDon.@90gTess.@97gOperazione");
|
||||||
set_header(5,"@0g--------@9g--@12g-------------------------@38g-------------------------@64g----------@75g---@79g------@86g------------------------------");
|
set_header(5,"@0g--------@9g--@12g-------------------------@38g-------------------------@64g----------@75g----------@86g---@90g------@97g-----------------------------------");
|
||||||
|
printer().footerlen(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TChiusuraPeriodica::user_create()
|
bool TChiusuraPeriodica::user_create()
|
||||||
|
28
at/at0600a.h
28
at/at0600a.h
@ -9,6 +9,28 @@
|
|||||||
#define F_D_SEZFIN 106
|
#define F_D_SEZFIN 106
|
||||||
#define F_SOTFIN 107
|
#define F_SOTFIN 107
|
||||||
#define F_D_SOTFIN 108
|
#define F_D_SOTFIN 108
|
||||||
#define F_DATA 109
|
#define F_USOSEZ 109
|
||||||
#define F_SOSPESI 110
|
// se uso dati sezione
|
||||||
#define F_DEFINITIVA 111
|
#define F_DATA 110
|
||||||
|
// se non uso dati sezione
|
||||||
|
#define F_CAT1 201
|
||||||
|
#define F_D_CAT1 202
|
||||||
|
#define F_CAT2 203
|
||||||
|
#define F_D_CAT2 204
|
||||||
|
#define F_CAT3 205
|
||||||
|
#define F_D_CAT3 206
|
||||||
|
#define F_CAT4 207
|
||||||
|
#define F_D_CAT4 208
|
||||||
|
#define F_CAT5 209
|
||||||
|
#define F_D_CAT5 210
|
||||||
|
#define F_CAT6 211
|
||||||
|
#define F_D_CAT6 212
|
||||||
|
#define F_DATAUD 213 // data ultima donazione fino a
|
||||||
|
#define F_NUMDON 214 // numero donazioni di riferimento
|
||||||
|
#define F_CATFIN1 215 // categoria di arrivo con donazioni < numdon
|
||||||
|
#define F_CATFIN2 216 // categoria di arrivo con donazioni >= numdon
|
||||||
|
#define F_D_CATFIN1 217
|
||||||
|
#define F_D_CATFIN2 218
|
||||||
|
// opzioni comuni
|
||||||
|
#define F_SOSPESI 301
|
||||||
|
#define F_DEFINITIVA 302
|
||||||
|
230
at/at0600a.uml
230
at/at0600a.uml
@ -1,6 +1,17 @@
|
|||||||
#include "at0600a.h"
|
#include "at0600a.h"
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -11 ""
|
||||||
|
END
|
||||||
|
|
||||||
PAGE "Chiusura Periodica" -1 -1 78 12
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -11 ""
|
||||||
|
END
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Chiusura Periodica" -1 -1 78 20
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 4
|
GROUPBOX DLG_NULL 77 4
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -124,9 +135,16 @@ BEGIN
|
|||||||
HELP "Sottogruppo finale"
|
HELP "Sottogruppo finale"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 3
|
GROUPBOX DLG_NULL 77 14
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 "Opzioni per la chiusura"
|
PROMPT 1 5 "Opzioni per la chiusura"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_USOSEZ
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 6 "Uso opzioni di chiusura indicate in tabella sezioni"
|
||||||
|
MESSAGE TRUE RESET,1@|DISABLE,1@|ENABLE,2@
|
||||||
|
MESSAGE FALSE RESET,2@|DISABLE,2@|ENABLE,1@
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATA
|
DATE F_DATA
|
||||||
@ -134,28 +152,212 @@ BEGIN
|
|||||||
PROMPT 2 7 "Data di riferimento "
|
PROMPT 2 7 "Data di riferimento "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
HELP "Data di riferimento per i conteggi di chiusura"
|
HELP "Data di riferimento per i conteggi di chiusura"
|
||||||
|
GROUP 2
|
||||||
END
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 8 "Categorie"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT1 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 9 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT1
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@30" S0
|
||||||
|
OUTPUT F_CAT1 CODTAB
|
||||||
|
OUTPUT F_D_CAT1 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT1 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 8 9 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 10 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT2
|
||||||
|
COPY DISPLAY F_CAT1
|
||||||
|
OUTPUT F_CAT2 CODTAB
|
||||||
|
OUTPUT F_D_CAT2 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT2 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 8 10 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT3 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 11 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT3
|
||||||
|
COPY DISPLAY F_CAT1
|
||||||
|
OUTPUT F_CAT3 CODTAB
|
||||||
|
OUTPUT F_D_CAT3 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT3 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 8 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT4 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 9 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT4
|
||||||
|
COPY DISPLAY F_CAT1
|
||||||
|
OUTPUT F_CAT4 CODTAB
|
||||||
|
OUTPUT F_D_CAT4 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT4 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 46 9 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT5 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 10 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT5
|
||||||
|
COPY DISPLAY F_CAT1
|
||||||
|
OUTPUT F_CAT5 CODTAB
|
||||||
|
OUTPUT F_D_CAT5 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT5 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 46 10 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAT6 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 11 ""
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CAT6
|
||||||
|
COPY DISPLAY F_CAT1
|
||||||
|
OUTPUT F_CAT6 CODTAB
|
||||||
|
OUTPUT F_D_CAT6 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Categoria di appartenenza"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CAT6 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 46 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAUD
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 12 "Data ultima donazione fino al "
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 47 12 "(iscrizione se non ha don.)"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMDON 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 13 "Numero donazioni di riferimento "
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CATFIN1 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 14 "Cat. per num. don. fino al num. indicato "
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CATFIN1
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@30" S0
|
||||||
|
OUTPUT F_CATFIN1 CODTAB
|
||||||
|
OUTPUT F_D_CATFIN1 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CATFIN1 30 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 56 14 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CATFIN2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 15 "Cat. per num. don. maggiore del num. indicato "
|
||||||
|
FLAGS "U"
|
||||||
|
USE CTD
|
||||||
|
INPUT CODTAB F_CATFIN2
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@30" S0
|
||||||
|
OUTPUT F_CATFIN2 CODTAB
|
||||||
|
OUTPUT F_D_CATFIN2 S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_CATFIN2 30 20
|
||||||
|
BEGIN
|
||||||
|
PROMPT 56 15 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN F_SOSPESI
|
BOOLEAN F_SOSPESI
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 35 7 "Anche sospesi"
|
PROMPT 2 17 "Anche sospesi"
|
||||||
HELP "Indicare se si vogliono processare per la chiusura anche i soggetti sospesi"
|
HELP "Indicare se si vogliono processare per la chiusura anche i soggetti sospesi"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_DEFINITIVA
|
BOOLEAN F_DEFINITIVA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 53 7 "Chiusura definitiva"
|
PROMPT 30 17 "Chiusura definitiva"
|
||||||
HELP "Se chiusura definitiva, le operazioni stampate verranno registrate"
|
HELP "Se chiusura definitiva, le operazioni stampate verranno registrate"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -12 10 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -22 10 ""
|
|
||||||
END
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user