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

View File

@ -249,7 +249,10 @@ protected:
virtual bool preprocess_page(int file, int counter)
{ 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).
// <nl> Ritornando FALSE cencella la richeista di stampa o i sottoalberi
virtual bool preprocess_print(int file, int counter)
@ -266,6 +269,9 @@ protected:
virtual print_action postprocess_print(int file, int counter)
{ 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
virtual void postclose_print()
{}