75 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#ifndef __CONTO_H
 | 
						|
#define __CONTO_H
 | 
						|
 | 
						|
#ifndef __STRINGS_H
 | 
						|
#include <strings.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __REAL_H
 | 
						|
#include <real.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
 | 
						|
 | 
						|
protected:
 | 
						|
  virtual int compare(const TSortable& s) const;
 | 
						|
  virtual const char* class_name() const { return "Conto"; }
 | 
						|
  const char* describe();
 | 
						|
 | 
						|
public:
 | 
						|
  TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
 | 
						|
    : _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(-1) {}
 | 
						|
 | 
						|
  TBill(TToken_string& tgcsd, int from, int mode = 0);
 | 
						|
  virtual ~TBill() {}
 | 
						|
 | 
						|
  const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
 | 
						|
  const TBill& add_to(TToken_string& ts, int from, int mode = 0);
 | 
						|
 | 
						|
  virtual bool ok() const;        // Gruppo, Conto e Sottoconto non nulli
 | 
						|
 | 
						|
  char tipo() const { return _tipo; }
 | 
						|
  int gruppo() const { return _gruppo; }
 | 
						|
  int conto() const { return _conto; }
 | 
						|
  long sottoconto() const { return _sottoconto; }
 | 
						|
  
 | 
						|
  const TString& descrizione();
 | 
						|
  int tipo_cr();
 | 
						|
  int tipo_att();
 | 
						|
  bool read(TRectype& r);
 | 
						|
 | 
						|
  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;
 | 
						|
 | 
						|
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; }
 | 
						|
  real& avere() { return _avere; }
 | 
						|
  real& darepro() { return _darepro; }
 | 
						|
  real& averepro() { return _averepro; }
 | 
						|
  real& saldo()  { return _saldo; }
 | 
						|
};
 | 
						|
 | 
						|
#endif
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 |