Aggiunti alcuni metodi utili.

git-svn-id: svn://10.65.10.50/trunk@3388 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-08-13 15:50:55 +00:00
parent 788d0e2811
commit 8ef74a65b6
2 changed files with 12 additions and 2 deletions

View File

@ -167,6 +167,7 @@ int TDocumento::read(const TRectype& rec)
set_key(*key, pr, an, cn, nu);
TLocalisamfile doc(LF_DOC);
TLocalisamfile rdoc(LF_RIGHEDOC);
int err = _head.read(doc);
if (err == NOERR)
@ -221,6 +222,12 @@ int TDocumento::remove() const
return err;
}
const bool TDocumento::in_valuta()
{
TString16 val(valuta());
return (val.not_empty() && val != "LIT");
}
long TDocumento::get_next_key(char provv, int anno, const char* codnum) const
{
TLocalisamfile doc(LF_DOC);

View File

@ -43,8 +43,8 @@ class TDocumento : public TObject
TRectype _head; // Record di testata
TRecord_array _rows; // Array di TRectype per le righe documenti di vendita.
protected:
protected:
TRectype & row(int index) { return _rows.row(index, FALSE); }
long get_next_key(char provv, int anno, const char* codnum) const;
public:
@ -69,6 +69,9 @@ public:
int anno() const { return _head.get_int("ANNO"); }
const TString& numerazione() { return _head.get("CODNUM"); }
long numero() const { return _head.get_long("NDOC"); }
const TString & valuta() { return _head.get("CODVAL"); }
const bool in_valuta();
const real cambio() { return _head.get_real("CAMBIO"); }
const TDate& data() const { return _head.get_date("DATADOC"); }
// const TString& tipodoc() { return _head.get("TIPODOC"); }
const TTipo_documento& tipo() const;