1994-12-28 11:00:21 +00:00
|
|
|
#ifndef __CONTO_H
|
|
|
|
#define __CONTO_H
|
|
|
|
|
1996-01-09 10:39:24 +00:00
|
|
|
#ifndef __REAL_H
|
|
|
|
#include <real.h>
|
1996-01-09 10:32:00 +00:00
|
|
|
#endif
|
|
|
|
|
1995-03-22 09:04:45 +00:00
|
|
|
#ifndef __ISAM_H
|
1996-01-05 15:17:50 +00:00
|
|
|
class TRectype;
|
1994-12-28 11:00:21 +00:00
|
|
|
#endif
|
|
|
|
|
1996-01-05 15:17:50 +00:00
|
|
|
#ifndef __MASK_H
|
|
|
|
class TMask;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1994-12-28 11:00:21 +00:00
|
|
|
class TBill : public TSortable
|
|
|
|
{
|
|
|
|
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
|
|
|
int _gruppo, _conto;
|
|
|
|
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
1995-12-07 11:09:17 +00:00
|
|
|
TString _descrizione; // Vuota fino alla chiamata di describe
|
1994-12-28 11:00:21 +00:00
|
|
|
int _tipo_cr; // Tipo costo/ricavo
|
|
|
|
bool _sospeso;
|
1995-03-10 10:03:13 +00:00
|
|
|
char _sezione;
|
1994-12-28 11:00:21 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual int compare(const TSortable& s) const;
|
|
|
|
virtual const char* class_name() const { return "Conto"; }
|
|
|
|
|
|
|
|
const TBill& copy(const TBill& b);
|
1995-04-20 14:29:00 +00:00
|
|
|
const char* field_name(int n, bool contro) const;
|
1994-12-28 11:00:21 +00:00
|
|
|
|
1996-01-11 15:44:06 +00:00
|
|
|
public: // TObject
|
|
|
|
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
|
|
|
|
1994-12-28 11:00:21 +00:00
|
|
|
public:
|
|
|
|
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
|
1995-03-22 09:04:45 +00:00
|
|
|
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d),
|
|
|
|
_sezione(' '), _sospeso(FALSE)
|
|
|
|
{ set(g,c,s,t,d,r);}
|
1994-12-28 11:00:21 +00:00
|
|
|
|
1996-01-11 15:44:06 +00:00
|
|
|
TBill(TToken_string& tgcsd, int from, int mode = 0) { get(tgcsd, from, mode); }
|
|
|
|
TBill(const TRectype& rec, bool contro = FALSE) { get(rec, contro); }
|
1994-12-28 11:00:21 +00:00
|
|
|
TBill(const TBill& b) { copy(b); }
|
|
|
|
virtual ~TBill() {}
|
|
|
|
|
|
|
|
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ',
|
|
|
|
const char* d = NULL, int r = -1);
|
1996-01-11 15:44:06 +00:00
|
|
|
|
|
|
|
const TBill& get(TToken_string& ts, int from, int mode = 0);
|
1994-12-28 11:00:21 +00:00
|
|
|
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
|
|
|
|
const TBill& operator=(const TBill& b) { return copy(b); }
|
|
|
|
|
|
|
|
bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; }
|
|
|
|
|
|
|
|
char tipo() const { return _tipo; }
|
|
|
|
int gruppo() const { return _gruppo; }
|
|
|
|
int conto() const { return _conto; }
|
|
|
|
long sottoconto() const { return _sottoconto; }
|
1995-03-23 17:17:13 +00:00
|
|
|
long codclifo() const { return _sottoconto; }
|
1996-01-31 11:52:54 +00:00
|
|
|
long& codclifo() { return _sottoconto; }
|
1994-12-28 11:00:21 +00:00
|
|
|
|
1995-01-16 15:08:33 +00:00
|
|
|
bool find();
|
1996-01-05 15:17:50 +00:00
|
|
|
const TString& descrizione() const;
|
1996-01-11 15:44:06 +00:00
|
|
|
int tipo_cr() const;
|
1994-12-28 11:00:21 +00:00
|
|
|
void tipo_cr(int tcr) { _tipo_cr = tcr; }
|
|
|
|
|
|
|
|
int tipo_att();
|
|
|
|
bool read(TRectype& r);
|
1995-03-10 10:03:13 +00:00
|
|
|
bool sospeso() const { return _sospeso; } // _sospeso e' letto nella read()
|
|
|
|
char sezione() const { return _sezione; }
|
1994-12-28 11:00:21 +00:00
|
|
|
|
1995-04-20 14:29:00 +00:00
|
|
|
void put(TRectype& r, bool contro = FALSE) const;
|
|
|
|
bool get(const TRectype& r, bool contro = FALSE);
|
1995-03-22 09:04:45 +00:00
|
|
|
|
1996-01-05 15:17:50 +00:00
|
|
|
void set(TMask& m, short g, short c, short s, short t = 0, short d = 0) const;
|
|
|
|
void get(const TMask& m, short g, short c, short s, short t = 0, short d = 0);
|
|
|
|
|
1996-01-11 15:44:06 +00:00
|
|
|
const char* string(int mode = 0) const;
|
1994-12-28 11:00:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
|
|
|
|
|
|
|
class TConto : public TBill
|
|
|
|
{
|
1996-05-20 09:26:39 +00:00
|
|
|
real _dare, _avere, _darepro, _averepro, _saldofin, _saldo;
|
1995-03-10 10:03:13 +00:00
|
|
|
TImporto _saldo_finale;
|
1994-12-28 11:00:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
|
|
|
|
: TBill(g, c, s, t, d) {}
|
|
|
|
TConto (TToken_string& tgcsd, int from, int mode = 0)
|
1996-05-20 09:26:39 +00:00
|
|
|
: TBill(tgcsd, from, mode) {}
|
1994-12-28 11:00:21 +00:00
|
|
|
|
|
|
|
real& dare() { return _dare; }
|
|
|
|
const real& dare() const { return _dare; }
|
|
|
|
|
|
|
|
real& avere() { return _avere; }
|
|
|
|
const real& avere() const { return _avere; }
|
|
|
|
|
|
|
|
real& darepro() { return _darepro; }
|
|
|
|
const real& darepro() const { return _darepro; }
|
|
|
|
|
|
|
|
real& averepro() { return _averepro; }
|
|
|
|
const real& averepro() const { return _averepro; }
|
1996-05-20 09:26:39 +00:00
|
|
|
|
1994-12-28 11:00:21 +00:00
|
|
|
real& saldo() { return _saldo; }
|
|
|
|
const real& saldo() const { return _saldo; }
|
1995-03-10 10:03:13 +00:00
|
|
|
|
1996-05-20 09:26:39 +00:00
|
|
|
real& saldofin() { return _saldofin; }
|
|
|
|
const real& saldofin() const { return _saldofin; }
|
|
|
|
|
1995-03-10 10:03:13 +00:00
|
|
|
TImporto& saldo_finale() { return _saldo_finale; }
|
|
|
|
const TImporto& saldo_finale() const { return _saldo_finale; }
|
1994-12-28 11:00:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|