Corretto il salto pagina sui clienti a saldo 0, aggiunta stampa

totale pagamenti non  assegnati (valida solo per i solleciti), corretto
l'incolonnamento su Dare/Avere del saldo totale; corretto l'ordinamento
per data scadenza/pagamento.


git-svn-id: svn://10.65.10.50/trunk@2470 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-01-18 18:05:24 +00:00
parent aa872d7573
commit 4e94e16ff0
2 changed files with 54 additions and 11 deletions

View File

@ -78,9 +78,11 @@ bool TStampaSol_application::print_selected()
if (ret > 0)
one_printed = TRUE;
else
{
one_printed = FALSE;
if (ret < 0)
analfabeti++;
}
}
if (one_printed)
printer().formfeed();
@ -147,7 +149,31 @@ int TStampaSol_application::print_sol()
saldo.normalize(f.sezione_normale());
if (sel_tot_saldo || saldo.valore() >= sel_importo )
TImporto unreferenced; //Totale non assegnati per questa partita.
{
// Tutto questo ha senso se e solo se la partita e' espressa in un'unica valuta.
TString valuta;
TRecord_array& unassigned = game.unassigned();
for (int r = unassigned.last_row(); r > 0; r = unassigned.pred_row(r))
{
const TRectype& rec = unassigned.row(r);
const TRiga_partite& sum = game.riga(rec.get_int(PAGSCA_NRIGP));
const char * field = (sum.in_valuta() && f.in_valuta() ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);
if (valuta.empty()) valuta = sum.get(PART_CODVAL);
if (sum.get_date(PART_DATAPAG)<=data_limite_soll)
{
TImporto r(sum.sezione(),rec.get_real(field));
unreferenced += r;
}
}
if (unreferenced.valore() > 0)
{
unreferenced.normalize('A'); //per i non assegnati/anticipi c'e' solo la colonna AVERE
form().totali().add(unreferenced,valuta);
}
}
if (sel_tot_saldo || unreferenced.valore() > 0 || saldo.valore() >= sel_importo )
{
const bool printed = form().print_game(game);
if (printed)

View File

@ -94,7 +94,7 @@ int TESSL_row::compare(const TSortable& s) const
if (c == 0) c = r._rata - _rata;
}
else
c = _data < r._data ? +1 : -1;
c = _data < r._data ? -1 : +1;
return c;
}
@ -637,8 +637,8 @@ void TESSL_form::change_magic_footer(const THash_object& o, TString& s)
void TESSL_form::print_total(int riga, const THash_object& o)
{
const short MAXID = 4;
const short f_id[MAXID] = { PEC_TSALDO, PEC_TSCADUTO, PEC_TESPOSTO, PEC_TIMPLIRE };
const short MAXID = 5;
const short f_id[MAXID] = { PEC_TSALDO, PEC_TSCADUTO, PEC_TESPOSTO, PEC_TIMPLIRE, PEC_TUNASSIGNED };
TString_array prompt(MAXID);
TPrint_section& foot = section('F');
@ -674,16 +674,25 @@ void TESSL_form::print_total(int riga, const THash_object& o)
TForm_item& bavere = body.find_field(PEC_AVERE);
avere.set_x(bavere.x());
}
if (imp.sezione() == 'D')
char sez = imp.sezione();
real num = imp.valore();
if (sez=='D' && num<0)
{
dare.set(imp.valore().string());
num = abs(num); sez = 'A';
}
if (sez=='A' && num<0)
{
num = abs(num); sez = 'D';
}
if (sez == 'D')
{
dare.set(num.string());
avere.set("");
}
else
{
dare.set("");
avere.set(imp.valore().string());
avere.set(num.string());
}
TForm_item& scaduto = foot.find_field(PEC_SCADUTO);
@ -710,6 +719,14 @@ void TESSL_form::print_total(int riga, const THash_object& o)
}
implire.set(t.importo_lire().string());
TForm_item& unreferenced = foot.find_field(PEC_UNASSIGNED);
if (unreferenced.x() <= 0)
{
TForm_item& uns = body.find_field(PEC_AVERE);
unreferenced.set_x(uns.x());
}
unreferenced.set(t.unassigned().valore().string());
foot.update();
// Ripristina prompt originari