Patch level : 10.0 366

Files correlati     : sc2.exe
Ricompilazione Demo : [ ]
Commento

Bug 0001334

La stampa deve prevedere l'ordinamento per valuta ed un totale a rottura di valuta.


git-svn-id: svn://10.65.10.50/trunk@19105 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-07-11 22:22:31 +00:00
parent a08bb6b87f
commit 2fb1f2ec9f
2 changed files with 58 additions and 43 deletions

View File

@ -1045,48 +1045,56 @@ void TPrint_application::print()
// NULL cursor passed only prints once // NULL cursor passed only prints once
// pre and post process do everything // pre and post process do everything
bool some_printed = false;
if (_cur == NULL) if (open_print())
{ {
//************************************************ if (_cur == NULL)
int cnt = 0; {
bool ok = TRUE; //************************************************
do { int cnt = 0;
if (preprocess_print (0, cnt)) bool ok = TRUE;
{ do {
int cnt2 = 0; if (preprocess_print (0, cnt))
do { {
if (preprocess_page (0, cnt2)) int cnt2 = 0;
{ do {
set_page (0, cnt2); if (preprocess_page (0, cnt2))
ok = print_one (0); {
} set_page (0, cnt2);
} ok = print_one (0);
while (ok && postprocess_page (0, cnt2++) == REPEAT_PAGE); if (ok) some_printed = true;
} }
} }
while (ok && postprocess_print (0, cnt++) == REPEAT_PAGE); while (ok && postprocess_page (0, cnt2++) == REPEAT_PAGE);
// ***************************************************** }
} }
else while (ok && postprocess_print (0, cnt++) == REPEAT_PAGE);
{ // *****************************************************
// cursor exists ********************************************* }
(*_cur) = 0l; else
_cur->freeze (TRUE); {
// cursor exists *********************************************
(*_cur) = 0l;
_cur->freeze (TRUE);
const long items =_cur->items();
if (_cur->items () >= _wthr && some_printed = items > 0L;
(_force_progind || printer ().printtype () != screenvis)) if (items >= _wthr &&
_prind = new TProgind (_cur->items (), TR("Stampa in corso..."), _wcancel, _wbar); (_force_progind || printer ().printtype () != screenvis))
print_tree (_pr_tree); _prind = new TProgind (items, TR("Stampa in corso..."), _wcancel, _wbar);
_cur->freeze (FALSE); print_tree (_pr_tree);
_cur->freeze (FALSE);
if (_prind) if (_prind)
{ {
delete _prind; delete _prind;
_prind = NULL; _prind = NULL;
} }
// **************************************************************** // ****************************************************************
} }
close_print();
}
if (!_repeat_print) if (!_repeat_print)
{ {
if (printer().isopen ()) if (printer().isopen ())
@ -1098,7 +1106,8 @@ void TPrint_application::print()
postclose_print (); postclose_print ();
} }
else else
printer().formfeed(); if (some_printed)
printer().formfeed();
} }
bool TPrint_application::print_tree (link_item * head) bool TPrint_application::print_tree (link_item * head)

View File

@ -249,7 +249,10 @@ protected:
virtual bool preprocess_page(int file, int counter) virtual bool preprocess_page(int file, int counter)
{ return TRUE; } { return TRUE; }
// @cmember Permette di eseguire qualcosa prima della richiesta di un processo di stampa // @cmember Permette di eseguire qualcosa prima dell'inizio della stampa
virtual bool open_print() { return true ;}
// @cmember Permette di eseguire qualcosa prima della richiesta di un processo di stampa
// (es. per inizializzare i contatori). // (es. per inizializzare i contatori).
// <nl> Ritornando FALSE cencella la richeista di stampa o i sottoalberi // <nl> Ritornando FALSE cencella la richeista di stampa o i sottoalberi
virtual bool preprocess_print(int file, int counter) virtual bool preprocess_print(int file, int counter)
@ -266,6 +269,9 @@ protected:
virtual print_action postprocess_print(int file, int counter) virtual print_action postprocess_print(int file, int counter)
{ return NEXT_PAGE; } { return NEXT_PAGE; }
// @cmember Permette di eseguire qualcosa alla fine della stampa
virtual void close_print() { }
// @cmember Viene eseguita dopo che tutti i lavori di stampa sono stati completati // @cmember Viene eseguita dopo che tutti i lavori di stampa sono stati completati
virtual void postclose_print() virtual void postclose_print()
{} {}