Patch level : 2.2
Files correlati : Ricompilazione Demo : [ ] Commento : Formattazione di TBill in stringa utile per modulo ca git-svn-id: svn://10.65.10.50/trunk@13290 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d11018ad2d
commit
6c2c7f5a18
@ -647,7 +647,7 @@ const char* TBill::field_name(int n, bool contro) const
|
|||||||
{
|
{
|
||||||
CHECKD(n >= 0 && n <= 3, "Invalid bill field ", n);
|
CHECKD(n >= 0 && n <= 3, "Invalid bill field ", n);
|
||||||
|
|
||||||
const char* f;
|
const char* f = NULL;
|
||||||
if (contro)
|
if (contro)
|
||||||
{
|
{
|
||||||
switch(n)
|
switch(n)
|
||||||
@ -681,10 +681,14 @@ void TBill::put(TRectype& r, bool c) const
|
|||||||
|
|
||||||
bool TBill::get(const TRectype& r, bool c)
|
bool TBill::get(const TRectype& r, bool c)
|
||||||
{
|
{
|
||||||
|
char t = ' ';
|
||||||
|
if (r.type(field_name(3, c)) != _nullfld)
|
||||||
|
t = r.get_char(field_name(3, c));
|
||||||
|
|
||||||
set(r.get_int(field_name(0, c)),
|
set(r.get_int(field_name(0, c)),
|
||||||
r.get_int(field_name(1, c)),
|
r.get_int(field_name(1, c)),
|
||||||
r.get_long(field_name(2, c)),
|
r.get_long(field_name(2, c)),
|
||||||
r.get_char(field_name(3, c)));
|
t);
|
||||||
|
|
||||||
set_description(NULL);
|
set_description(NULL);
|
||||||
_tipo_cr = -1;
|
_tipo_cr = -1;
|
||||||
@ -814,7 +818,7 @@ bool TBill::read(TRectype &r)
|
|||||||
|
|
||||||
if (tipo() <= ' ' || sottoconto() <= 0)
|
if (tipo() <= ' ' || sottoconto() <= 0)
|
||||||
{
|
{
|
||||||
TString16 key; key.format("%d|%d|%ld", gruppo(), conto(), sottoconto());
|
const char* key = string();
|
||||||
const TRectype& pcon = cache().get(LF_PCON, key);
|
const TRectype& pcon = cache().get(LF_PCON, key);
|
||||||
if (!pcon.empty())
|
if (!pcon.empty())
|
||||||
{
|
{
|
||||||
@ -879,7 +883,7 @@ int TBill::tipo_cr() const
|
|||||||
|
|
||||||
int TBill::indicatore_bilancio() const
|
int TBill::indicatore_bilancio() const
|
||||||
{
|
{
|
||||||
TString16 str;
|
TString8 str;
|
||||||
str.format("%d|%d", gruppo(), conto());
|
str.format("%d|%d", gruppo(), conto());
|
||||||
const int ib = atoi(cache().get(LF_PCON, str, PCN_INDBIL));
|
const int ib = atoi(cache().get(LF_PCON, str, PCN_INDBIL));
|
||||||
if (ib == 0)
|
if (ib == 0)
|
||||||
@ -904,6 +908,17 @@ const char* TBill::string(int mode) const
|
|||||||
{
|
{
|
||||||
TString& s = get_tmp_string();
|
TString& s = get_tmp_string();
|
||||||
|
|
||||||
|
if (mode & 0x8)
|
||||||
|
{
|
||||||
|
if (_sottoconto != 0)
|
||||||
|
s.format("%03d%03d%06ld", _gruppo, _conto, _sottoconto); else
|
||||||
|
if (_conto != 0)
|
||||||
|
s.format("%03d%03d", _gruppo, _conto); else
|
||||||
|
if (_gruppo != 0)
|
||||||
|
s.format("%03d", _gruppo);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
if (mode & 0x4)
|
if (mode & 0x4)
|
||||||
{
|
{
|
||||||
const int cr = tipo_cr();
|
const int cr = tipo_cr();
|
||||||
@ -932,7 +947,6 @@ const char* TBill::string(int mode) const
|
|||||||
bool TBill::required_cdc() const
|
bool TBill::required_cdc() const
|
||||||
{
|
{
|
||||||
TString16 key;
|
TString16 key;
|
||||||
|
|
||||||
for (int i = 2; i >= 0; i--)
|
for (int i = 2; i >= 0; i--)
|
||||||
{
|
{
|
||||||
key.format("%d|%d|%ld", gruppo(), i > 0 ? conto() : 0, i > 1 ? sottoconto() : 0);
|
key.format("%d|%d|%ld", gruppo(), i > 0 ? conto() : 0, i > 1 ? sottoconto() : 0);
|
||||||
|
@ -229,8 +229,8 @@ public:
|
|||||||
bool sospeso() const;
|
bool sospeso() const;
|
||||||
char sezione() const;
|
char sezione() const;
|
||||||
|
|
||||||
void put(TRectype& r, bool contro = FALSE) const;
|
void put(TRectype& r, bool contro = false) const;
|
||||||
bool get(const TRectype& r, bool contro = FALSE);
|
bool get(const TRectype& r, bool contro = false);
|
||||||
|
|
||||||
void set(TMask& m, short g, short c, short s, short t = 0, short d = 0) const;
|
void set(TMask& m, short g, short c, short s, short t = 0, short d = 0) const;
|
||||||
void get(const TMask& m, short g, short c, short s, short t = 0, short d = 0);
|
void get(const TMask& m, short g, short c, short s, short t = 0, short d = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user