campo-sirio/cg/cg3300.h
alex e82c0ef7b3 Patch level : 20.424
Files correlati     :  cg1.exe cg3.exe
Ricompilazione Demo : [ ]
Commento            :
Aggiunto supporto per le lingue a cg1.exe e cg3.exe


git-svn-id: svn://10.65.10.50/trunk@10914 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-03-14 15:13:36 +00:00

293 lines
6.6 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 (const TRectype& all);
void azzera();
void somma();
const real& tot_real() const { return tot; }
int esc_int() const { return esc; }
const real& impesc_real() { return impesc; }
const real& ivaesc_real() const { return ivaesc; }
const char* tot_str() const { return tot.string("@@@@@@@@@@@"); }
const char* impesc_str() const { return impesc.string("@@@@@@@@@@@"); }
const char* ivaesc_str() const { 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 {
struct alleg_sort * _all;
protected:
const TRectype & look_com(const char * cod);
const char * decodifica_desc_att (const TString & codatt);
public:
void azzera_struttura();
bool fill_dati_anag_dic (const TRectype & ditta);
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(const TRectype& alleg);
void somma (const TRectype& rec, stampe);
const real& importo() const { 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 , // 10
IND_FIS ,
COMUNE_FIS,
PROV_FIS ,
PAIVA_FIS,
ATT_FIS ,
CODATT_FIS ,
RAGSOC_DIC ,
NAT_GIU ,
IND_GIU ,
COMUNE_GIU , // 20
PROV_GIU ,
PAIVA_GIU,
ATT_GIU ,
CODATT_GIU ,
NUM_PAG_TOT,
NUM_REC,
PROG_DETT,
COG_DETT,
NOM_DETT,
VIA_DETT, // 30
COM_DETT,
PRO_DETT,
PAIVA_DETT,
ESC_DETT,
SEGNO_IMPESC,
IMPESC_DETT,
SEGNO_IVAESC,
IVAESC_DETT,
SEGNO_NIESC,
NIESC_DETT, // 40
SEGNO_E8ESC,
E8ESC_DETT,
SEGNO_TOTC,
TOTC_DETT,
CASELLA_PAIVA,
ESP_DETT,
SEGNO_IMPESP,
IMPESP_DETT,
SEGNO_IVAESP,
IVAESP_DETT, // 50
SEGNO_NIESP,
NIESP_DETT,
SEGNO_E8ESP,
E8ESP_DETT,
SEGNO_TOTP,
TOTP_DETT,
RECB_ESC, // 57
RECB_IMPESC,
RECB_IVAESC,
RECB_SEGNO_TOT, // 60
RECB_TOT,
RIP_ESC, // 62
RIP_SEGNO_IMPESP,
RIP_IMPESP,
RIP_SEGNO_IVAESP,
RIP_IVAESP,
RIP_SEGNO_NIESP,
RIP_NIESP,
RIP_SEGNO_E8ESP,
RIP_E8ESP, // 70
RIP_SEGNO_TOTALE,
RIP_TOTALE,
TOT_ESC, // 73
TOT_SEGNO_IMPESP,
TOT_IMPESP,
TOT_SEGNO_IVAESP,
TOT_IVAESP,
TOT_SEGNO_NIESP,
TOT_NIESP,
TOT_SEGNO_E8ESP, // 80
TOT_E8ESP,
TOT_SEGNO_TOTALE,
TOT_TOTALE
};