From 8ef74a65b6b2e32c33a25ebd1a4def6a66a48844 Mon Sep 17 00:00:00 2001 From: angelo Date: Tue, 13 Aug 1996 15:50:55 +0000 Subject: [PATCH] Aggiunti alcuni metodi utili. git-svn-id: svn://10.65.10.50/trunk@3388 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ve/velib01.cpp | 7 +++++++ ve/velib01.h | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ve/velib01.cpp b/ve/velib01.cpp index 14f46254f..2f84a0d12 100755 --- a/ve/velib01.cpp +++ b/ve/velib01.cpp @@ -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); diff --git a/ve/velib01.h b/ve/velib01.h index 454be9a16..1294c47c5 100755 --- a/ve/velib01.h +++ b/ve/velib01.h @@ -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;