modifiche del 08/08/96
git-svn-id: svn://10.65.10.50/trunk@3362 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
de8657e537
commit
b17a735833
@ -95,21 +95,11 @@ int TTipo_documento::read(const char* tipodoc)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
TMask& TTipo_documento::mask()
|
|
||||||
{
|
|
||||||
if (_mask == NULL)
|
|
||||||
{
|
|
||||||
TFilename profile_file = _rec.get("S4");
|
|
||||||
profile_file.ext("ini");
|
|
||||||
TConfig p(profile_file);
|
|
||||||
_mask = new TVariable_mask(p.get("MSKFILE", "MAIN"));
|
|
||||||
}
|
|
||||||
return *_mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Documento per vendite
|
// Documento per vendite
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TAssoc_array TDocumento::_tipi;
|
||||||
|
|
||||||
TDocumento::TDocumento()
|
TDocumento::TDocumento()
|
||||||
: _head(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA")
|
: _head(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA")
|
||||||
@ -137,6 +127,8 @@ int TDocumento::read(const TRectype& rec)
|
|||||||
key->put("NUMDOC", doc.get("NUMDOC"));
|
key->put("NUMDOC", doc.get("NUMDOC"));
|
||||||
err = _rows.read(key);
|
err = _rows.read(key);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
_head = rec;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -146,13 +138,15 @@ int TDocumento::read(const char* codnum, int anno, char provv, long numdoc)
|
|||||||
CHECK(codnum && *codnum && anno > 0 && (provv == 'D' || provv == 'P') && numdoc > 0,
|
CHECK(codnum && *codnum && anno > 0 && (provv == 'D' || provv == 'P') && numdoc > 0,
|
||||||
"Codice documento non valido");
|
"Codice documento non valido");
|
||||||
|
|
||||||
_head.zero();
|
TRectype rec(_head);
|
||||||
_head.put("CODNUM", codnum);
|
|
||||||
_head.put("ANNO", anno);
|
rec.zero();
|
||||||
_head.put("PROVV", provv);
|
rec.put("CODNUM", codnum);
|
||||||
_head.put("NUMDOC", numdoc);
|
rec.put("ANNO", anno);
|
||||||
|
rec.put("PROVV", provv);
|
||||||
|
rec.put("NUMDOC", numdoc);
|
||||||
|
|
||||||
return read(_head);
|
return read(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TDocumento::write(bool re) const
|
int TDocumento::write(bool re) const
|
||||||
|
27
ve/velib01.h
27
ve/velib01.h
@ -29,8 +29,9 @@ public:
|
|||||||
pagamento, banca_appoggio, listino, agente,
|
pagamento, banca_appoggio, listino, agente,
|
||||||
spedizione, porto, causale_trasporto, vettori };
|
spedizione, porto, causale_trasporto, vettori };
|
||||||
|
|
||||||
const TString& tipodoc() const { return _rec.get("CODTAB");}
|
const TString & tipodoc() const { return _rec.get("CODTAB");}
|
||||||
TMask& mask();
|
const TString & profile_name() const { return _rec.get("S4");}
|
||||||
|
const TString & mask_name() const { return _rec.get("S4");}
|
||||||
|
|
||||||
bool uguale(TCondizione_uguaglianza u) const { return _rec.get("S2")[(int)u]; }
|
bool uguale(TCondizione_uguaglianza u) const { return _rec.get("S2")[(int)u]; }
|
||||||
|
|
||||||
@ -49,24 +50,30 @@ class TDocumento : public TObject
|
|||||||
public:
|
public:
|
||||||
int rows() const { return _rows.rows(); }
|
int rows() const { return _rows.rows(); }
|
||||||
|
|
||||||
const TRectype& head() const { return _head; } // Ritorna la testata del documento
|
const TRectype & head() const { return _head; } // Ritorna la testata del documento
|
||||||
const TRectype& operator[](int index) const { return _rows.row(index); } // Ritorna la riga n-esima del documento
|
TRectype & head() { return _head; } // Ritorna la testata del documento
|
||||||
TRectype& operator[](int index) { return _rows.row(index, FALSE); }
|
const TRectype & operator[](int index) const { return _rows.row(index); } // Ritorna la riga n-esima del documento
|
||||||
|
TRectype & operator[](int index) { return _rows.row(index, FALSE); }
|
||||||
TRectype& add_row() { return _rows.row(-1, TRUE); }
|
TRectype& add_row() { return _rows.row(-1, TRUE); }
|
||||||
bool destroy_row(int n) { return _rows.destroy_row(n); }
|
bool destroy_row(int n) { return _rows.destroy_row(n); }
|
||||||
|
void destroy_rows() { _rows.destroy_rows(); }
|
||||||
|
|
||||||
int read(const char* codnum, int anno, char provv, long numdoc);
|
int read(const char * codnum, int anno, char provv, long numdoc);
|
||||||
int read(const TRectype& rec);
|
int read(const TRectype & rec);
|
||||||
int write(bool re = FALSE) const;
|
int write(bool re = FALSE) const;
|
||||||
int rewrite() const { return write(TRUE); }
|
int rewrite() const { return write(TRUE); }
|
||||||
int remove() const;
|
int remove() const;
|
||||||
|
|
||||||
const TTipo_documento& tipo() const;
|
const TTipo_documento & tipo() const;
|
||||||
const TDate& data() const { return _head.get_date("DATADOC"); }
|
const TString & tipodoc() { return _head.get("TIPODOC"); }
|
||||||
|
const TDate & data() const { return _head.get_date("DATADOC"); }
|
||||||
|
const TString & numerazione() { return _head.get("CODNUM"); }
|
||||||
|
int anno() const { return _head.get_int("ANNO"); }
|
||||||
|
char tipo_numerazione() { return _head.get_int("PROVV"); }
|
||||||
long numero() const { return _head.get_long("NDOC"); }
|
long numero() const { return _head.get_long("NDOC"); }
|
||||||
|
|
||||||
TDocumento ();
|
TDocumento ();
|
||||||
TDocumento(const char* codnum, int anno, char provv, long numdoc);
|
TDocumento(const char * codnum, int anno, char provv, long numdoc);
|
||||||
virtual ~TDocumento() { }
|
virtual ~TDocumento() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user