Correzione Agli estratti conto

git-svn-id: svn://10.65.10.50/trunk@2648 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-02-28 16:54:03 +00:00
parent 677751be4d
commit 28d7c4ac99
7 changed files with 108 additions and 66 deletions

View File

@ -267,6 +267,7 @@ BEGIN
KEY "Totale documento"
PROMPT 6 1 ""
FLAGS "H"
PICTURE "###.###.###.###"
END
DATA 209 10

View File

@ -18,6 +18,7 @@
#include <mov.h>
#include <pagsca.h>
#include <scadenze.h>
#define DA_VUOTARE "***"
///////////////////////////////////////////////////////////
@ -161,6 +162,7 @@ TEC_row::TEC_row(const TRiga_partite& row, const TDate& data, const TImporto& im
_data = data;
_causale = row.get(PART_CODCAUS);
_data_doc = row.get(PART_DATADOC);
_num_doc = row.get(PART_NUMDOC);
_num_prot = row.get_long(PART_PROTIVA);
_num_reg = row.get_long(PART_NREG);
_importo = imp; _importo.normalize();
@ -176,7 +178,8 @@ TEC_row::TEC_row(const TRiga_partite& row, const TDate& data, const TImporto& im
}
TEC_row::TEC_row(const char* desc, const TImporto& imp, const TValuta& val)
: _riga(9999), _rata(9999), _num_prot(0), _num_reg(0), _salvo_buon_fine(FALSE)
: _riga(9999), _rata(9999), _num_doc(0),
_num_prot(0), _num_reg(0), _salvo_buon_fine(FALSE)
{
_descrizione = desc;
_importo = imp; _importo.normalize();
@ -203,7 +206,7 @@ int TEC_row::compare(const TSortable& s) const
// Annulla i campi uguali alla riga precedente
void TEC_row::reset_uguali()
{
_descrizione = "";
_descrizione = DA_VUOTARE;
_num_doc = "";
_data_doc = botime;
_num_prot = 0;
@ -226,7 +229,7 @@ void TEC_row::set_imp(TForm_item& fi, const real& imp, bool valuta) const
{
new_picture = old_picture;
if (old_picture.find(',') > 0)
new_picture << ".###";
new_picture << ".@@@";
else
new_picture << ",@@@";
}
@ -263,9 +266,14 @@ void TEC_row::print_on(TPrint_section& body)
if (num_reg() > 0) // Riga di partita vera e propria (non totale parziale)
{
TString s(80); s = descr.prompt();
TString s(80);
if (_descrizione != DA_VUOTARE)
{
s = descr.prompt();
TEC_form::_form->change_magic_body(*this, s);
}
descr.set(s);
}
else
descr.set(_descrizione);
@ -273,9 +281,6 @@ void TEC_row::print_on(TPrint_section& body)
TForm_item& datadoc = body.find_field(PEC_DATADOC);
datadoc.set(_data_doc.string());
TForm_item& totdoc = body.find_field(PEC_TOTDOC);
totdoc.set(_totale.string());
TForm_item& numdoc = body.find_field(PEC_NUMDOC);
numdoc.set(_num_doc);
@ -313,6 +318,10 @@ void TEC_row::print_on(TPrint_section& body)
set_imp(esposto, _esposto, valuta);
esposto.set_prompt(_salvo_buon_fine ? "*" : " ");
TForm_item& totdoc = body.find_field(PEC_TOTDOC);
old_pictures.add(totdoc.picture());
set_imp(totdoc, _totale, valuta);
TForm_item& lire = body.find_field(PEC_IMPLIRE);
lire.set(_importo_lire.string());
@ -333,6 +342,7 @@ void TEC_row::print_on(TPrint_section& body)
avere.set_picture(old_pictures.row(1));
scaduto.set_picture(old_pictures.row(2));
esposto.set_picture(old_pictures.row(3));
totdoc.set_picture(old_pictures.row(4));
}
@ -499,7 +509,8 @@ real TEC_array::calcola_scaduto(const TRiga_scadenze& rata, bool valuta)
delete arrpag;
scaduto_rata.normalize(sezione);
return scaduto_rata.valore();
const bool total_payed = scaduto_rata.valore().sign() <= 0;
return total_payed ? ZERO : scaduto_rata.valore();
}
TEC_row& TEC_array::new_row(const TRiga_partite& row, const TDate& data,
@ -987,6 +998,7 @@ void TEC_form::azzera_totali()
TPrint_section& foot = section('F');
printer().footerlen(foot.height());
printer().setcurrentpage(1);
}
bool TEC_form::print_game(const TPartita& game)
@ -1047,7 +1059,15 @@ bool TEC_form::print_game(const TPartita& game)
{
saldo.normalize();
TEC_row sld(describe(PEC_SALDO), saldo, righe.row(r-1).valuta());
const TString & dessaldo = describe(PEC_SALDO);
TString desc(80);
const TValuta & val = righe.row(r-1).valuta();
desc = dessaldo;
desc << ' ' << val.codice();
TEC_row sld(desc, saldo, val);
sld.scaduto(scaduto);
sld.esposto(esposto);
sld.importo_lire(implire);
@ -1235,7 +1255,8 @@ bool TStampaEC_application::print_selected()
bool one_printed = FALSE;
const long items = c.items();
for (long i = 0; i < items; i++) if (print_all || s.checked(i))
for (long i = 0; i < items; i++)
if (print_all || s.checked(i))
{
if (one_printed)
printer().formfeed();

View File

@ -65,7 +65,7 @@ END
DATE F_DATALIMOP
BEGIN
PROMPT 1 4 "Data limite operazione "
FLAGS "A"
// FLAGS "A"
// CHECKTYPE REQUIRED
END

View File

@ -67,7 +67,8 @@ bool TStampaSol_application::print_selected()
bool one_printed = FALSE;
const long items = c.items();
for (long i=0; i < items; i++) if (print_all || s.checked(i))
for (long i=0; i < items; i++)
if (print_all || s.checked(i))
{
if (one_printed)
printer().formfeed();
@ -224,8 +225,7 @@ bool TStampaSol_application::menu(MENU_TAG)
TSol_mask &m= mask();
while (m.run() != K_QUIT)
{
const bool neverending_game = m.get_bool(F_ALLMOV);
_form= new TSol_form(m, _gesval, neverending_game ? 0: F_DATALIMSOL, F_DATALIMSOL);
_form= new TSol_form(m, _gesval, F_DATALIMOP, F_DATALIMSOL);
print_selected();
delete _form;
_form= NULL;

View File

@ -9,6 +9,5 @@
#define F_STAMPESP 107
#define F_IMPORMIN 108
#define F_RIFIMPMIN 109
#define F_ALLMOV 110
#endif

View File

@ -59,6 +59,12 @@ BEGIN
FLAGS "D"
END
DATE F_DATALIMOP
BEGIN
PROMPT 30 4 "Data limite operazione "
END
DATE F_DATALIMSOL
BEGIN
PROMPT 1 4 "Data limite sollecito "
@ -85,11 +91,6 @@ BEGIN
PROMPT 1 6 "Stampa esposizione"
END
BOOLEAN F_ALLMOV
BEGIN
PROMPT 1 7 "Stampa tutti i movimenti"
END
STRING F_LUOGOSEND 50 32
BEGIN
PROMPT 1 8 "Luogo d'invio "

View File

@ -9,6 +9,7 @@
#include "sc2401.h"
#include <causali.h>
#define DA_VUOTARE "***"
TESSL_mask::TESSL_mask(const char *name) : TSelection_mask(name), _ditta(LF_NDITTE) {
_ditta.add(LF_ANAG, "TIPOA==TIPOA|CODANAGR==CODANAGR");
@ -66,9 +67,12 @@ TESSL_row::TESSL_row(const TRiga_partite& row, const TDate& data, const TImporto
_data = data;
_causale = row.get(PART_CODCAUS);
_data_doc = row.get(PART_DATADOC);
_num_doc = row.get(PART_NUMDOC);
_num_prot = row.get_long(PART_PROTIVA);
_num_reg = row.get_long(PART_NREG);
_importo = imp; _importo.normalize();
_descrizione = row.get(PART_DESCR);
_valuta.get(row);
const bool valuta = form().in_valuta() && _valuta.in_valuta();
@ -81,7 +85,7 @@ TESSL_row::TESSL_row(const TRiga_partite& row, const TDate& data, const TImporto
TESSL_row::TESSL_row(const char* desc, const TImporto& imp, const TValuta& val)
: _riga(9999), _rata(9999), _num_prot(0), _num_reg(0), _salvo_buon_fine(FALSE)
{
_descrizione = desc;
_descrizione = DA_VUOTARE;
_importo = imp; _importo.normalize();
_valuta = val;
}
@ -105,7 +109,7 @@ int TESSL_row::compare(const TSortable& s) const
// Annulla i campi uguali alla riga precedente
void TESSL_row::reset_uguali()
{
_descrizione = "";
_descrizione = DA_VUOTARE;
_num_doc = "";
_data_doc = botime;
_num_prot = 0;
@ -129,7 +133,7 @@ void TESSL_row::set_imp(TForm_item& fi, const real& imp, bool valuta) const
{
new_picture = old_picture;
if (old_picture.find(',') > 0)
new_picture << ".###";
new_picture << ".@@@";
else
new_picture << ",@@@";
}
@ -169,8 +173,12 @@ void TESSL_row::print_on(TPrint_section& body)
TForm_item& descr = body.find_field(PEC_DESCR);
if (num_reg() > 0) // Riga di partita vera e propria (non totale parziale)
{
TString s(80); s = descr.prompt();
TString s(80);
if (_descrizione != DA_VUOTARE)
{
s = descr.prompt();
TESSL_form::_form->change_magic_body(*this, s);
}
descr.set(s);
}
else
@ -179,9 +187,6 @@ void TESSL_row::print_on(TPrint_section& body)
TForm_item& datadoc = body.find_field(PEC_DATADOC);
datadoc.set(_data_doc.string());
TForm_item& totdoc = body.find_field(PEC_TOTDOC);
totdoc.set(_totale.string());
TForm_item& numdoc = body.find_field(PEC_NUMDOC);
numdoc.set(_num_doc);
@ -222,6 +227,10 @@ void TESSL_row::print_on(TPrint_section& body)
set_imp(esposto, _esposto, valuta);
esposto.set_prompt(_salvo_buon_fine ? "*" : " ");
TForm_item& totdoc = body.find_field(PEC_TOTDOC);
old_pictures.add(totdoc.picture());
set_imp(totdoc, _totale, valuta);
TForm_item& cambio = body.find_field(PEC_CAMBIO);
cambio.set(_valuta.cambio().string());
@ -239,6 +248,7 @@ void TESSL_row::print_on(TPrint_section& body)
avere.set_picture(old_pictures.row(1));
scaduto.set_picture(old_pictures.row(2));
esposto.set_picture(old_pictures.row(3));
totdoc.set_picture(old_pictures.row(4));
}
static int val_compare(const void* o1, const void* o2) {
@ -357,7 +367,8 @@ real TESSL_array::calcola_scaduto(const TRiga_scadenze& rata, bool valuta)
}
}
scaduto_rata.normalize(sezione);
return scaduto_rata.valore();
const bool total_payed = scaduto_rata.valore().sign() <= 0;
return total_payed ? ZERO : scaduto_rata.valore();
}
TESSL_row& TESSL_array::new_row(const TRiga_partite& row, const TDate& data, const TImporto& imp, int n)
@ -875,6 +886,7 @@ void TESSL_form::azzera_totali()
TPrint_section& foot = section('F');
printer().footerlen(foot.height());
printer().setcurrentpage(1);
}
bool TESSL_form::print_game(const TPartita& game)
@ -934,7 +946,15 @@ bool TESSL_form::print_game(const TPartita& game)
{
saldo.normalize();
TESSL_row sld(describe(PEC_SALDO), saldo, righe.row(r-1).valuta());
const TString & dessaldo = describe(PEC_SALDO);
TString desc(80);
const TValuta & val = righe.row(r-1).valuta();
desc = dessaldo;
desc << ' ' << val.codice();
TESSL_row sld(desc, saldo, val);
sld.scaduto(scaduto);
sld.esposto(esposto);
sld.importo_in_lire(implire);