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

@ -28,6 +28,14 @@
#ifndef __CGPAGAME_H
#include "../cg/cgpagame.h"
#endif
#ifndef __DOC_H
#include <doc.h>
#endif
#ifndef __RDOC_H
#include <rdoc.h>
#endif
#define RIGA_MERCE 'M'
#define RIGA_SPESEDOC 'S'
@ -292,7 +300,6 @@ class TRiga_documento : public TAuto_variable_rectype // velib02
static TAssoc_array _ive;
bool _iva_calc;
protected:
// @cmember Setta il contenuto del campo <p fieldname> (non tipizzata)
virtual void put_str(const char* fieldname, const char* val);
@ -303,10 +310,10 @@ protected:
public:
void dirty_fields(bool dirty_document = TRUE);
bool doc_dependent() const;
int numero() const { return get_int("NRIGA");}
void set_numero(int numero) { put("NRIGA", numero);}
bool is_generata() const { return get_bool("GENERATA");}
void generata(bool on = TRUE) { put("GENERATA", on);}
int numero() const { return get_int(RDOC_NRIGA); }
void set_numero(int numero) { put(RDOC_NRIGA, numero);}
bool is_generata() const { return get_bool(RDOC_GENERATA);}
void generata(bool on = TRUE) { put(RDOC_GENERATA, on);}
bool is_merce() const { return tipo().tipo() == 'M';}
bool is_spese() const { return tipo().tipo() == 'S';}
bool is_prestazione() const { return tipo().tipo() == 'P';}
@ -315,8 +322,8 @@ public:
bool is_descrizione() const { return tipo().tipo() == 'D';}
bool is_articolo() const;
bool is_checked() const { return get_bool("CHECKED");}
void checked(bool on = TRUE) { put("CHECKED", (bool) on);}
void unchecked() { checked(FALSE);}
void checked(bool on = TRUE) { put("CHECKED", (bool)on); }
void unchecked() { checked(FALSE); }
// @cmember Assegna il documento corrente
void set_doc(TDocumento * doc) { _doc = doc; }
const TDocumento & doc() const { CHECK(_doc, "Documento nullo"); return *_doc;}
@ -331,21 +338,21 @@ public:
const TTipo_riga_documento & tipo() const;
const TSpesa_prest & spesa() const;
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(); }
void set_tipo(const char * tipo) { put("TIPORIGA", tipo);}
const bool tipo_valido() const { return get(RDOC_TIPORIGA).not_empty(); }
void set_tipo(const char * tipo) { put(RDOC_TIPORIGA, tipo);}
bool sola_descrizione() const;
void forza_sola_descrizione();
virtual TRectype & operator =(const TRectype & r);
virtual TRectype & operator =(const char * r);
virtual TRectype& operator =(const TRectype& r);
virtual TRectype& operator =(const char* r);
bool raggruppabile(const TRiga_documento& r, TToken_string& campi) const;
TRiga_documento& operator +=(const TRiga_documento& r);
void reset_fields(TAuto_variable_rectype & rec) { rec.remove_field(); }
void set_fields(TAuto_variable_rectype & rec);
void reset_fields(TAuto_variable_rectype& rec) { rec.remove_field(); }
void set_fields(TAuto_variable_rectype& rec);
real prezzo(bool scontato, bool lordo, int ndec) const ;
real importo(bool scontato , bool lordo, int ndec) const ;
@ -353,9 +360,11 @@ public:
real imponibile() const;
real imposta(bool round = TRUE) const;
TRiga_documento(TDocumento* doc, const char * tipo = NULL);
real quantita() const { return get_real(RDOC_QTA); }
TRiga_documento(TDocumento* doc, const char* tipo = NULL);
TRiga_documento(const TRiga_documento& rec, TDocumento* doc,
const char * tipo = NULL);
const char* tipo = NULL);
virtual ~TRiga_documento() {}
};