303 lines
		
	
	
		
			6.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			303 lines
		
	
	
		
			6.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
// cg3300.h
 | 
						|
 | 
						|
enum stampe {
 | 
						|
  clienti=1, 
 | 
						|
  fornitori=2, 
 | 
						|
  modulo101=3, 
 | 
						|
  modulo102=4,
 | 
						|
  entrambi=5
 | 
						|
};
 | 
						|
 | 
						|
class desc_campo : public TObject
 | 
						|
{
 | 
						|
public:
 | 
						|
  int      _riga;
 | 
						|
  TString  _formato;
 | 
						|
  desc_campo() : _riga(0), _formato("") {}
 | 
						|
  virtual ~desc_campo() {}
 | 
						|
};
 | 
						|
 | 
						|
class Array_desc_campi : public TObject
 | 
						|
{
 | 
						|
  TArray  _campi;            // Array di campi e stringhe di formato
 | 
						|
  int     _passo;            // Numero di righe tra le righe dettaglio
 | 
						|
  int     _righe_modulo;     // Numero di righe totali del modulo
 | 
						|
 | 
						|
public:
 | 
						|
  const desc_campo&  campi(int i)    { return (const desc_campo&) _campi[i]; }
 | 
						|
  int   riga (int i)    { return ((const desc_campo&)_campi[i])._riga; }
 | 
						|
  const char * formato (int i) 
 | 
						|
              { return ((desc_campo&)_campi[i])._formato; }
 | 
						|
  void               add (int, const char*);
 | 
						|
  void               leggi_modulo (const char *, const char *);
 | 
						|
 | 
						|
  const int          passo() { return _passo; }
 | 
						|
  const int          righe_modulo () { return _righe_modulo; }
 | 
						|
 | 
						|
  Array_desc_campi() {};
 | 
						|
  virtual ~Array_desc_campi() {};
 | 
						|
};
 | 
						|
 | 
						|
class Record_B {
 | 
						|
  int  esc;
 | 
						|
  real impesc;
 | 
						|
  real ivaesc;
 | 
						|
  real tot;
 | 
						|
  
 | 
						|
public:
 | 
						|
  void compila (TLocalisamfile *);
 | 
						|
  void azzera(); 
 | 
						|
  void somma();
 | 
						|
 | 
						|
  real tot_real()    { return tot; }
 | 
						|
  int  esc_int()     { return esc; }
 | 
						|
  real impesc_real() { return impesc; }
 | 
						|
  real ivaesc_real() { return ivaesc; }
 | 
						|
 | 
						|
  const char * tot_str()    { return tot.string("@@@@@@@@@@@"); }
 | 
						|
//  const char * esc_str()    { return esc.string("@@@@@@@@@@@"); }
 | 
						|
  const char * impesc_str() { return impesc.string("@@@@@@@@@@@"); }
 | 
						|
  const char * ivaesc_str() { return ivaesc.string("@@@@@@@@@@@"); }
 | 
						|
 | 
						|
  Record_B() : esc(0), impesc(0.00), ivaesc(0.00), tot(0.00) {};
 | 
						|
  virtual ~Record_B () {};
 | 
						|
};
 | 
						|
 | 
						|
struct alleg_sort {
 | 
						|
  long          codditta_dic;
 | 
						|
  char          tipopers_dic  [2];
 | 
						|
  char          paiva_dic [12];
 | 
						|
  char          cognome_dic [31];
 | 
						|
  char          nome_dic [21];
 | 
						|
  char          ragsoc_dic[51];
 | 
						|
//  char         datana_dic[11];
 | 
						|
  TDate         datana_dic;
 | 
						|
  char          sesso_dic [2];
 | 
						|
  char          comunena_dic [51];
 | 
						|
  char          provna_dic [6];
 | 
						|
  char          viafis_dic[36];  // via + numero civico
 | 
						|
  char          comunefis_dic [51];
 | 
						|
  char          provfis_dic [6];
 | 
						|
  char          attivita_dic [51];
 | 
						|
  char          codatt_dic [6];
 | 
						|
  int           natgiu_dic;
 | 
						|
  int      anno;
 | 
						|
  char     codatt_dett   [6];
 | 
						|
  char     tipopers_dett [2];
 | 
						|
  long     codcf_dett ;
 | 
						|
 | 
						|
  char     ragsoc_dett [51];
 | 
						|
  char     cognome_dett [31];
 | 
						|
  char     nome_dett [21];
 | 
						|
 | 
						|
  char     via_dett [36];
 | 
						|
  char     comune_dett [51];
 | 
						|
  char     prov_dett [6];
 | 
						|
 | 
						|
  char     statopaiva_dett [2];
 | 
						|
  char     paiva_dett [12];
 | 
						|
 | 
						|
  bool     immesso;
 | 
						|
 | 
						|
  real    impesc;
 | 
						|
  real    ivaesc;
 | 
						|
  real    niesc;
 | 
						|
  real    e8esc;
 | 
						|
  int     ndocesc;
 | 
						|
 | 
						|
  real    impesp;
 | 
						|
  real    ivaesp;
 | 
						|
  real    niesp;
 | 
						|
  real    e8esp;
 | 
						|
  int     ndocesp;
 | 
						|
 | 
						|
  real    prog101102;
 | 
						|
 | 
						|
  real    tot_rigac;
 | 
						|
  real    tot_rigap;
 | 
						|
};
 | 
						|
 | 
						|
class SortRecord {
 | 
						|
  TLocalisamfile    * _clifo;
 | 
						|
  TLocalisamfile    * _comuni;
 | 
						|
  TLocalisamfile    * _anagfis;
 | 
						|
  TLocalisamfile    * _anaggiu;
 | 
						|
  TLocalisamfile    * _anag;
 | 
						|
  TTable            * _attiv;
 | 
						|
  TTable            * _tpd;
 | 
						|
  struct alleg_sort * _all;
 | 
						|
 | 
						|
 protected:
 | 
						|
  TRectype& look_com(const char *);
 | 
						|
  long cerca_codice_all(TString tipo, long codcf) ;
 | 
						|
  const char * decodifica_desc_att (TString & codatt);
 | 
						|
  bool corrispettivo (const char * tipodoc);
 | 
						|
 | 
						|
public:
 | 
						|
  void         azzera_struttura(); 
 | 
						|
  bool         fill_dati_anag_dic (TLocalisamfile *);
 | 
						|
  const char * fill_dati_dettaglio (const char * tipo, long codcf);
 | 
						|
  const char * Strutt_str() { return (const char *) _all; }
 | 
						|
  struct alleg_sort * Strutt() { return _all; }
 | 
						|
  void         compila(TLocalisamfile *);
 | 
						|
  void         somma  (TLocalisamfile *, stampe);
 | 
						|
  real         importo() { return _all->impesc; }
 | 
						|
  int          RecSize () { return sizeof(struct alleg_sort); }
 | 
						|
  long         codcf_dett() { return _all->codcf_dett; }
 | 
						|
  const real&  Impesc() { return _all->impesc; }
 | 
						|
 | 
						|
  SortRecord(); 
 | 
						|
  ~SortRecord(); 
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
struct Totali {
 | 
						|
  
 | 
						|
// Totali anno corrente
 | 
						|
  real          _tot_tot_rigac;
 | 
						|
  int           _tot_esc;
 | 
						|
  real          _tot_impesc;
 | 
						|
  real          _tot_ivaesc;
 | 
						|
  real          _tot_niesc;
 | 
						|
  real          _tot_e8esc;
 | 
						|
 | 
						|
// Totali anno precedente
 | 
						|
  real          _tot_tot_rigap;
 | 
						|
  int           _tot_esp;
 | 
						|
  real          _tot_impesp;
 | 
						|
  real          _tot_ivaesp;
 | 
						|
  real          _tot_niesp;
 | 
						|
  real          _tot_e8esp;
 | 
						|
 | 
						|
// Riporti
 | 
						|
  real          _rip_tot_riga;
 | 
						|
  int           _rip_tot_es;
 | 
						|
  real          _rip_tot_impes;
 | 
						|
  real          _rip_tot_ivaes;
 | 
						|
  real          _rip_tot_nies;
 | 
						|
  real          _rip_tot_e8es;
 | 
						|
 | 
						|
  real          _tot_col_101102;
 | 
						|
 | 
						|
public:
 | 
						|
 | 
						|
  void azzera_totali();
 | 
						|
  void incrementa_totali(struct alleg_sort*, stampe);
 | 
						|
  void compila_riporti();  
 | 
						|
 | 
						|
  const real& TotTotRigac()  { return _tot_tot_rigac; }
 | 
						|
  const int   TotEsc()       { return _tot_esc; }
 | 
						|
  const real& TotImpesc()    { return _tot_impesc; }
 | 
						|
  const real& TotIvaesc()    { return _tot_ivaesc; }
 | 
						|
  const real& TotNiesc()     { return _tot_niesc; }
 | 
						|
  const real& TotE8esc()     { return _tot_e8esc; }
 | 
						|
  
 | 
						|
  const real& TotTotRigap()  { return _tot_tot_rigap; }
 | 
						|
  const int   TotEsp()       { return _tot_esp; }
 | 
						|
  const real& TotImpesp()    { return _tot_impesp; }
 | 
						|
  const real& TotIvaesp()    { return _tot_ivaesp; }
 | 
						|
  const real& TotNiesp()     { return _tot_niesp; }
 | 
						|
  const real& TotE8esp()     { return _tot_e8esp; }
 | 
						|
 | 
						|
  const real& RipTotTotRiga()   { return _rip_tot_riga; }
 | 
						|
  const int   RipTotEs()       { return _rip_tot_es; }
 | 
						|
  const real& RipTotImpes()    { return _rip_tot_impes; }
 | 
						|
  const real& RipTotIvaes()    { return _rip_tot_ivaes; }
 | 
						|
  const real& RipTotNies()     { return _rip_tot_nies; }
 | 
						|
  const real& RipTotE8es()     { return _rip_tot_e8es; }
 | 
						|
};
 | 
						|
 | 
						|
enum modi_stampa {
 | 
						|
  modulo=1,
 | 
						|
  controllo=2,
 | 
						|
  dischetto=3 
 | 
						|
};
 | 
						|
 | 
						|
enum posizioni {
 | 
						|
  PAIVA_DIC = 0,
 | 
						|
  PAG_NUM,
 | 
						|
  COGNOME_DIC,
 | 
						|
  NOME_DIC   ,
 | 
						|
  GG_NA  ,
 | 
						|
  MM_NA  ,
 | 
						|
  AA_NA  ,
 | 
						|
  MASCHIO,
 | 
						|
  FEMMINA,
 | 
						|
  COMUNE_NA,
 | 
						|
  PROV_NA  ,
 | 
						|
  IND_FIS  ,
 | 
						|
  COMUNE_FIS,
 | 
						|
  PROV_FIS  ,
 | 
						|
  PAIVA_FIS,
 | 
						|
  ATT_FIS   ,
 | 
						|
  CODATT_FIS ,
 | 
						|
  RAGSOC_DIC      ,
 | 
						|
  NAT_GIU    ,
 | 
						|
  IND_GIU    ,
 | 
						|
  COMUNE_GIU ,
 | 
						|
  PROV_GIU   ,
 | 
						|
  PAIVA_GIU,
 | 
						|
  ATT_GIU   ,
 | 
						|
  CODATT_GIU  ,
 | 
						|
  NUM_PAG_TOT,
 | 
						|
  NUM_REC,
 | 
						|
  PROG_DETT,
 | 
						|
  COG_DETT,
 | 
						|
  NOM_DETT,
 | 
						|
  VIA_DETT,
 | 
						|
  COM_DETT,
 | 
						|
  PRO_DETT,
 | 
						|
  PAIVA_DETT,
 | 
						|
  ESC_DETT,
 | 
						|
  SEGNO_IMPESC,
 | 
						|
  IMPESC_DETT,
 | 
						|
  SEGNO_IVAESC,
 | 
						|
  IVAESC_DETT,
 | 
						|
  SEGNO_NIESC,
 | 
						|
  NIESC_DETT,
 | 
						|
  SEGNO_E8ESC,
 | 
						|
  E8ESC_DETT,
 | 
						|
  SEGNO_TOTC,
 | 
						|
  TOTC_DETT,
 | 
						|
  CASELLA_PAIVA,
 | 
						|
  ESP_DETT,
 | 
						|
  SEGNO_IMPESP,  
 | 
						|
  IMPESP_DETT,
 | 
						|
  SEGNO_IVAESP,
 | 
						|
  IVAESP_DETT,
 | 
						|
  SEGNO_NIESP,
 | 
						|
  NIESP_DETT,
 | 
						|
  SEGNO_E8ESP,
 | 
						|
  E8ESP_DETT,
 | 
						|
  SEGNO_TOTP,
 | 
						|
  TOTP_DETT,
 | 
						|
  RECB_ESC,
 | 
						|
  RECB_IMPESP,
 | 
						|
  RECB_IVAESC,
 | 
						|
  RECB_SEGNO_TOT,
 | 
						|
  RECB_TOT,
 | 
						|
  RIP_ESC,
 | 
						|
  RIP_SEGNO_IMPESP,
 | 
						|
  RIP_IMPESP,
 | 
						|
  RIP_SEGNO_IVAESP,
 | 
						|
  RIP_IVAESP,
 | 
						|
  RIP_SEGNO_NIESP,
 | 
						|
  RIP_NIESP,
 | 
						|
  RIP_SEGNO_E8ESP,
 | 
						|
  RIP_E8ESP,
 | 
						|
  RIP_SEGNO_TOTALE,
 | 
						|
  RIP_TOTALE,
 | 
						|
  TOT_ESC,
 | 
						|
  TOT_SEGNO_IMPESP,
 | 
						|
  TOT_IMPESP,
 | 
						|
  TOT_SEGNO_IVAESP,
 | 
						|
  TOT_IVAESP,
 | 
						|
  TOT_SEGNO_NIESP,
 | 
						|
  TOT_NIESP,
 | 
						|
  TOT_SEGNO_E8ESP,
 | 
						|
  TOT_E8ESP,
 | 
						|
  TOT_SEGNO_TOTALE,
 | 
						|
  TOT_TOTALE
 | 
						|
};
 | 
						|
 |