Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : tolto controllo inutile (stringa.ok()) e aggiunto totale parziale e finale alle urgenze


git-svn-id: svn://10.65.10.50/trunk@9229 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2000-10-10 08:16:13 +00:00
parent b630b8bd05
commit e48ce4d365
3 changed files with 56 additions and 4 deletions

View File

@ -549,7 +549,7 @@ void TStampaScadenze::header_sezione(const TString16 codsez, const TString16 cod
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;

View File

@ -47,6 +47,7 @@ class TStampaUrgenze : public TPrintapp
int _etlarghezza, _etcolonne;
bool _unica;
int _cur;
int _contatore, _totale;
protected:
virtual bool user_create();
@ -54,11 +55,14 @@ protected:
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page (int file, int counter);
virtual print_action postprocess_print(int file, int counter);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaUrgenze() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -243,9 +247,10 @@ bool TStampaUrgenze::preprocess_page(int file, int counter)
if ((!_unica) && ((_codsez!=codsez)||(_codsot!=codsot)))
{
if (_codsez != "**")
printer().formfeed();
footer_sezione();
_codsez = codsez;
_codsot = codsot;
_contatore = 0;
header_sezione(codsez, codsot);
}
else
@ -255,6 +260,8 @@ bool TStampaUrgenze::preprocess_page(int file, int counter)
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_totale++;
return TRUE;
}
@ -269,7 +276,7 @@ void TStampaUrgenze::header_sezione(const TString16 codsez, const TString16 cods
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -279,6 +286,47 @@ void TStampaUrgenze::header_sezione(const TString16 codsez, const TString16 cods
return;
}
print_action TStampaUrgenze::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
void TStampaUrgenze::footer_sezione()
{
// stampa totale soggetti appartenenti alla sezione
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
printer().formfeed();
reset_footer();
}
}
void TStampaUrgenze::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
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();
}
}
bool TStampaUrgenze::set_print(int)
{
TPrinter& p = printer();
@ -293,6 +341,8 @@ bool TStampaUrgenze::set_print(int)
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -355,6 +405,7 @@ bool TStampaUrgenze::set_print(int)
// filtra per categorie, tipizzazione e data donazione
current_cursor()->set_filterfunction (filter_func_urgenze, TRUE);
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
}
@ -383,6 +434,7 @@ void TStampaUrgenze::crea_intestazione()
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gGr.@53gRh@57gFen.Rh@64gKellDu@72gUlt.donaz.@86gTelefono abit.@101gTelefono altro@116gUlt.idon.");
set_header(5,"@0gTessera@38gSe/So@75gTipo@86gTelefono lav.@116gInt.SI AF");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--- --- ------ --- ---@72g----------@86g--------------@101g--------------@116g----------");
printer().footerlen(3);
}
}

View File

@ -220,7 +220,7 @@ void TStampaConvocazioni::header_sezione(const TString16 codsez, const TString16
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;