Aggiunti metodi utili alle righe documento

git-svn-id: svn://10.65.10.50/trunk@5034 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-08-05 09:22:43 +00:00
parent 7fd76a968b
commit 4bf81091fd

View File

@ -29,6 +29,14 @@
#include "../cg/cgpagame.h" #include "../cg/cgpagame.h"
#endif #endif
#ifndef __DOC_H
#include <doc.h>
#endif
#ifndef __RDOC_H
#include <rdoc.h>
#endif
#define RIGA_MERCE 'M' #define RIGA_MERCE 'M'
#define RIGA_SPESEDOC 'S' #define RIGA_SPESEDOC 'S'
#define RIGA_PRESTAZIONI 'P' #define RIGA_PRESTAZIONI 'P'
@ -292,7 +300,6 @@ class TRiga_documento : public TAuto_variable_rectype // velib02
static TAssoc_array _ive; static TAssoc_array _ive;
bool _iva_calc; bool _iva_calc;
protected: protected:
// @cmember Setta il contenuto del campo <p fieldname> (non tipizzata) // @cmember Setta il contenuto del campo <p fieldname> (non tipizzata)
virtual void put_str(const char* fieldname, const char* val); virtual void put_str(const char* fieldname, const char* val);
@ -303,10 +310,10 @@ protected:
public: public:
void dirty_fields(bool dirty_document = TRUE); void dirty_fields(bool dirty_document = TRUE);
bool doc_dependent() const; bool doc_dependent() const;
int numero() const { return get_int("NRIGA");} int numero() const { return get_int(RDOC_NRIGA); }
void set_numero(int numero) { put("NRIGA", numero);} void set_numero(int numero) { put(RDOC_NRIGA, numero);}
bool is_generata() const { return get_bool("GENERATA");} bool is_generata() const { return get_bool(RDOC_GENERATA);}
void generata(bool on = TRUE) { put("GENERATA", on);} void generata(bool on = TRUE) { put(RDOC_GENERATA, on);}
bool is_merce() const { return tipo().tipo() == 'M';} bool is_merce() const { return tipo().tipo() == 'M';}
bool is_spese() const { return tipo().tipo() == 'S';} bool is_spese() const { return tipo().tipo() == 'S';}
bool is_prestazione() const { return tipo().tipo() == 'P';} bool is_prestazione() const { return tipo().tipo() == 'P';}
@ -331,10 +338,10 @@ public:
const TTipo_riga_documento & tipo() const; const TTipo_riga_documento & tipo() const;
const TSpesa_prest & spesa() const; const TSpesa_prest & spesa() const;
static const TIVA & iva(const char * codice); static const TIVA & iva(const char * codice);
const TIVA & iva() const {const TString16 cod(get("CODIVA")); return iva(cod);} const TIVA & iva() const {const TString16 cod(get(RDOC_CODIVA)); return iva(cod);}
const bool tipo_valido() const { return get("TIPORIGA").not_empty(); } const bool tipo_valido() const { return get(RDOC_TIPORIGA).not_empty(); }
void set_tipo(const char * tipo) { put("TIPORIGA", tipo);} void set_tipo(const char * tipo) { put(RDOC_TIPORIGA, tipo);}
bool sola_descrizione() const; bool sola_descrizione() const;
void forza_sola_descrizione(); void forza_sola_descrizione();
@ -353,6 +360,8 @@ public:
real imponibile() const; real imponibile() const;
real imposta(bool round = TRUE) const; real imposta(bool round = TRUE) const;
real quantita() const { return get_real(RDOC_QTA); }
TRiga_documento(TDocumento* doc, const char* tipo = NULL); TRiga_documento(TDocumento* doc, const char* tipo = NULL);
TRiga_documento(const TRiga_documento& rec, TDocumento* doc, TRiga_documento(const TRiga_documento& rec, TDocumento* doc,
const char* tipo = NULL); const char* tipo = NULL);