Aggiustata describe per i clienti fisici
git-svn-id: svn://10.65.10.50/trunk@528 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6bd108b352
commit
365cdfa98d
43
cg/conto.cpp
43
cg/conto.cpp
@ -106,11 +106,9 @@ int TBill::compare(const TSortable& s) const
|
|||||||
|
|
||||||
|
|
||||||
// Certified 95%
|
// Certified 95%
|
||||||
const char* TBill::describe()
|
void TBill::describe()
|
||||||
{
|
{
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
const char* desc = NULL;
|
|
||||||
TFixed_string ragsoc(&__tmp_string[256], 50);
|
|
||||||
|
|
||||||
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
|
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
|
||||||
{
|
{
|
||||||
@ -124,7 +122,7 @@ const char* TBill::describe()
|
|||||||
if (err == NOERR)
|
if (err == NOERR)
|
||||||
{
|
{
|
||||||
_tipo_cr = pcon.get_int("TIPOSPRIC");
|
_tipo_cr = pcon.get_int("TIPOSPRIC");
|
||||||
desc = pcon.get("DESCR");
|
_descrizione = pcon.get("DESCR");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
|
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
|
||||||
@ -137,24 +135,16 @@ const char* TBill::describe()
|
|||||||
err = clifo.read();
|
err = clifo.read();
|
||||||
if (err == NOERR)
|
if (err == NOERR)
|
||||||
{
|
{
|
||||||
char tipoa = clifo.get_char("TIPOAPER");
|
_descrizione = clifo.get("RAGSOC");
|
||||||
|
const char tipoa = clifo.get_char("TIPOAPER");
|
||||||
if (tipoa == 'F')
|
if (tipoa == 'F')
|
||||||
{
|
{
|
||||||
TString80 cognome, nome;
|
TString80 nome = _descrizione.mid(30);
|
||||||
ragsoc = clifo.get("RAGSOC");
|
_descrizione.cut(30);
|
||||||
cognome = ragsoc.mid(0,30);
|
_descrizione.trim(); nome.trim();
|
||||||
nome = ragsoc.mid(30,20);
|
_descrizione << ' ' << nome;
|
||||||
cognome.trim(); nome.trim();
|
|
||||||
|
|
||||||
ragsoc = cognome;
|
|
||||||
ragsoc << " " << nome;
|
|
||||||
|
|
||||||
desc = ragsoc;
|
|
||||||
}
|
}
|
||||||
else
|
if (_gruppo == 0 || _conto == 0)
|
||||||
desc = clifo.get("RAGSOC");
|
|
||||||
if (_conto == 0)
|
|
||||||
{
|
{
|
||||||
_gruppo = clifo.get_int("GRUPPO");
|
_gruppo = clifo.get_int("GRUPPO");
|
||||||
_conto = clifo.get_int("CONTO");
|
_conto = clifo.get_int("CONTO");
|
||||||
@ -163,8 +153,6 @@ const char* TBill::describe()
|
|||||||
_tipo_cr = 0;
|
_tipo_cr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return desc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -208,15 +196,13 @@ int TBill::tipo_att()
|
|||||||
return tipo_att;
|
return tipo_att;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 99% (describe uses __tmp_string)
|
// Certified 99%
|
||||||
const TString& TBill::descrizione()
|
const TString& TBill::descrizione()
|
||||||
{
|
{
|
||||||
if (_descrizione.empty())
|
if (_descrizione.empty())
|
||||||
{
|
{
|
||||||
const char* d = describe();
|
describe();
|
||||||
if (d)
|
if (_descrizione.empty())
|
||||||
_descrizione = *d ? d : " ";
|
|
||||||
else
|
|
||||||
_descrizione = "Sconosciuto";
|
_descrizione = "Sconosciuto";
|
||||||
}
|
}
|
||||||
return _descrizione;
|
return _descrizione;
|
||||||
@ -225,10 +211,7 @@ const TString& TBill::descrizione()
|
|||||||
int TBill::tipo_cr()
|
int TBill::tipo_cr()
|
||||||
{
|
{
|
||||||
if (_tipo_cr < 0)
|
if (_tipo_cr < 0)
|
||||||
{
|
describe();
|
||||||
_descrizione = "";
|
|
||||||
descrizione();
|
|
||||||
}
|
|
||||||
return _tipo_cr;
|
return _tipo_cr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user