d0483278e1
Corretta contropartita fantasma della prima riga git-svn-id: svn://10.65.10.50/trunk@1281 c028cbd2-c16b-5b4b-a496-9718f37d4682
103 lines
3.0 KiB
C++
Executable File
103 lines
3.0 KiB
C++
Executable File
#ifndef __CONTO_H
|
|
#define __CONTO_H
|
|
|
|
#ifndef __ISAM_H
|
|
#include <isam.h>
|
|
#endif
|
|
|
|
class TBill : public TSortable
|
|
{
|
|
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
|
int _gruppo, _conto;
|
|
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
|
TString80 _descrizione; // Vuota fino alla chiamata di describe
|
|
int _tipo_cr; // Tipo costo/ricavo
|
|
bool _sospeso;
|
|
char _sezione;
|
|
|
|
protected:
|
|
virtual int compare(const TSortable& s) const;
|
|
virtual const char* class_name() const { return "Conto"; }
|
|
|
|
const TBill& copy(const TBill& b);
|
|
const char* field_name(int n, bool contro) const;
|
|
|
|
public:
|
|
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
|
|
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d),
|
|
_sezione(' '), _sospeso(FALSE)
|
|
{ set(g,c,s,t,d,r);}
|
|
|
|
TBill(TToken_string& tgcsd, int from, int mode = 0);
|
|
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);
|
|
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
|
|
const TBill& operator=(const TBill& b) { return copy(b); }
|
|
|
|
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
|
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; }
|
|
long codclifo() const { return _sottoconto; }
|
|
|
|
bool find();
|
|
const TString& descrizione();
|
|
int tipo_cr();
|
|
void tipo_cr(int tcr) { _tipo_cr = tcr; }
|
|
|
|
int tipo_att();
|
|
bool read(TRectype& r);
|
|
bool sospeso() const { return _sospeso; } // _sospeso e' letto nella read()
|
|
char sezione() const { return _sezione; }
|
|
|
|
void put(TRectype& r, bool contro = FALSE) const;
|
|
bool get(const TRectype& r, bool contro = FALSE);
|
|
|
|
const char* string(int mode = 0);
|
|
};
|
|
|
|
|
|
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
|
|
|
class TConto : public TBill
|
|
{
|
|
real _dare, _avere, _darepro, _averepro, _saldo;
|
|
TImporto _saldo_finale;
|
|
|
|
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)
|
|
: TBill(tgcsd, from, mode) {};
|
|
|
|
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; }
|
|
|
|
real& saldo() { return _saldo; }
|
|
const real& saldo() const { return _saldo; }
|
|
|
|
TImporto& saldo_finale() { return _saldo_finale; }
|
|
const TImporto& saldo_finale() const { return _saldo_finale; }
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|