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;