Per i files che riguardano il progetto ab3, sono stati completati con vari oggetti

da testare la parte che riguarda la gestione degli id dei collegamenti a dichiarazione redditi
Per le altre maschere sono state modificate esteticamente.
Agli altri files sono stati apportate modifiche perchè causavano errori di compilazione
a causa delle modifiche apportata alla libreria


git-svn-id: svn://10.65.10.50/trunk@6286 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
sauro 1998-02-27 17:38:34 +00:00
parent a7e0440140
commit c2d6f1c32d
11 changed files with 2074 additions and 477 deletions

View File

@ -1,5 +1,20 @@
#include "ab2100a.h"
PAGE "Ricezione e Invio di Bilanci & Analisi" 0 -1 0 19
TOOLBAR "" 0 19 0 3
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -11 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -11 ""
END
ENDPAGE
PAGE "Ricezione e Invio" -1 -1 0 20
GROUPBOX DLG_NULL 76 5
BEGIN
@ -125,7 +140,7 @@ BEGIN
GROUP 1
END
BOOLENAN F_SRELAZ
BOOLEAN F_SRELAZ
BEGIN
PROMPT 40 15 "Sottorelazioni"
MESSAGE TRUE COPY, F_RELAZ | COPY, F_VOCI
@ -133,16 +148,6 @@ BEGIN
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT 15 20 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT 50 20 ""
END
ENDPAGE
ENDMASK

View File

@ -1,37 +1,162 @@
#include "ab3.h"
#include "ablib01.h"
#include "ab3100.h"
inline TGestione_tree &app() { return (TGestione_tree &)main_app();}
void test_analisi()
bool gestione_sheet(TSheet_field& s, int r, KEY k)
{
//Questa parte di funzione serve per testare la read, write, delete_node, delete_tree, delete_subtree ecc
TLocalisamfile anas(LF_ANALISI);
anas.set_curr(new TAnalisi_bil());
anas.put(ABAN_CODAN,"A1");
anas.read();
// readat -> vedi dopo
//anas.remove(); //Solo per il test della delete_node o la rimozione di una intera tabella
anas.write();
/*Questa parte della funzione serve solo per testare la readat
if (k == K_CTRL + K_INS)
{
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TToken_string &codice = s.row(r-1);
ab_tree.insert_new_node(codice);
ab_tree.user_tree()->write_cache(); //solo debug
ab_tree.user_tree_voc()->write_cache(); //solo debug
// Sincronizzo l'albero con lo sheet
ab_tree.user_tree()->goto_father();
naviga_tree(s.mask().field(F_TREE),K_SPACE);
TMask &s_msk = s.sheet_mask();
s_msk.field(F_COMPONENTE).on_key(K_F9);
const TString &componente = s_msk.get(F_COMPONENTE);
s.row(r).add(componente,F_COMPONENTE-F_ID);
k = K_ENTER;
}
if (k == K_DEL)
{
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TToken_string &codice = s.row(r);
//Posiziono il nodo sul record selezionato
TNumeric_id temp_id = codice.get(0);
ab_tree.remove_node(temp_id);
ab_tree.user_tree()->goto_father();
}
/* if ( k = K_CTRL + K_DEL)
{
// Sincronizzo l'albero con lo sheet come risposta alla rimozione
naviga_tree(s.mask().field(F_TREE),K_SPACE);
} */
if (k == K_ENTER)
{
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TMask &msk = s.sheet_mask();
TRecnotype nrec = 14; //Per capire quale numero ci va scommenta la riga di nrec e provare col debug
TLocalisamfile anas1(LF_ANALISI);
// nrec = anas1.recno(); //nrec è un TRecnotype: dice quale numero ci va dopo
anas1.set_curr(new TAnalisi_bil());
anas1.readat(nrec);
//Abilitare solo una di queste funzioni
anas1.remove();
//anas1.write();
// A questo punto devo modificare il contenuto di CARADD:
// ricavo il suo contenuto da maschera, e lo scrivo nella cache
// se il nodo è stato rimosso, la caradd non viene rimossa dal database: per
// rimuoverla fare i passi successivi in K_DEL
E deve esserci solo questo pezzo: tutto il resto deve essere commentato */
TRectype caradd(ricava_caradd(msk));
ab_tree.user_caradd()->current_cache_record().put(caradd);
ab_tree.user_caradd()->set_status_node(caradd.get(ABCA_ID),NODO_MODIFICATO);
ab_tree.user_caradd()->write_cache(); //solo debug
// TRectype coll(ricava_colldich(msk));
// ab_tree.user_colldich()->current_cache_record().put(coll);
// ab_tree.user_colldich()->set_status_node(coll.get(ABCD_ID),NODO_MODIFICATO);
// ab_tree.user_colldich()->write_cache(); //solo debug
TToken_string &codice = s.row(r);
ab_tree.modify_node(codice);
// Sincronizzo l'albero con lo sheet
ab_tree.user_tree()->goto_father();
naviga_tree(s.mask().field(F_TREE),K_SPACE);
}
return TRUE;
}
bool naviga_tree(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{ //Premuto su un nodo
TTree_field &tf = (TTree_field&)f; //Trasformo il contenuto del campo in un tree
TMask &_msk=f.mask(); //Prelevo la maschera
TSheet_field &sheet_box = _msk.sfield(F_VISTA); //Creo un array che conterrà i dati dello sheet
sheet_box.destroy(-1,FALSE); // ... e lo vuoto
TLocalisamfile voci(LF_VOCI);
TAlbero_locale *ab = (TAlbero_locale*)tf.tree();
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TToken_string key_rel;
TString father_id;
ab->curr_id(father_id); //Salvo l'id del padre
TNumeric_id temp_id; // Serve per la navigazione dei figli
temp_id = ab->current().get_real(ABRA_IDFIGLIO);
if (temp_id > ID_NULLO)
{ // Significa che ho dei figli
for (int i = 0; temp_id > ID_NULLO; i++ )
{
TToken_string &codice = sheet_box.row(i); //Setto la riga dell sheet
ab->goto_node(temp_id); //vado sul nodo
ab->curr_id(codice);
codice.add(ab->current().get(ABRA_TIPOCOD));
codice.add(ab->current().get(ABRA_CODVC));
codice.add(ab->current().get(ABRA_NCOMP));
codice.add(ab->current().get(ABRA_VOCEINCID));
codice.add(ab->current().get(ABRA_DESCRIZ));
codice.add(ab->current().get(ABRA_USACARADD));
// Rintraccio i dati di RELVOCI
key_rel.cut(0);
key_rel.add(ab->current().get(ABRA_TIPOCOD));
key_rel.add(ab->current().get(ABRA_CODVC));
key_rel.add(ab->current().get(ABRA_NCOMP));
ab_tree.user_tree_voc()->goto_node(key_rel);
// Rintraccio i dati di VOCI
voci.put(ABVC_CODVC,ab_tree.user_tree_voc()->current().get(ABRL_CODCOMP));
if (voci.read() == NOERR)
{
codice.add(voci.get(ABVC_CODVC));
if ( ab->current().get_bool(ABRA_USACARADD) )
{ // Se il nodo esisteva già, ci sarà anche la caradd;
// se il nodo è nuovo, la caradd la devo aggiungere
TNumeric_id id_caradd = ab->current().get(ABRA_IDCARADD); // Caratteristica addizionale ridefinita
if (id_caradd != ID_NULLO)
{ // Esiste già una caradd specifica definita
codice.add(id_caradd.string());
}
else
{ // Devo trovare un nuovo id per la nuova caradd
id_caradd = ab_tree.new_id_caradd();
codice.add(id_caradd.string());
}
}
else
{ // Uso la caradd di default
codice.add(voci.get(ABVC_IDCARADD)); // Caratteristiche addizionali di default
}
// sheet_box.disable_cell(i,7);
// sheet_box.disable_cell(i,8);
}
else
{
;
}
sheet_box.check_row(i);
temp_id = ab->current().get_real(ABRA_IDSUCC);
} // Ho finito di scorrere (e visualizzare) tutti i figli
//Riposiziono il nodo e aggiorno lo sheet
ab->goto_node(father_id);
sheet_box.force_update();
}
else
{
sheet_box.destroy(-1,FALSE);
}
return TRUE;
}
return TRUE;
}
void test_saldi()
/*
void TGestione_tree::gestione_saldi()
{
TLocalisamfile saldo(LF_ABSALDI);
// TRecnotype nrec = 96; //Abilitare questa riga per testare la readat
@ -49,18 +174,196 @@ void test_saldi()
//saldo.write();
//saldo.remove();
} */
TRectype ricava_colldich(TMask & msk)
{
TRectype coll (LF_COLLDICH);
TString id = msk.get(F_ID_COLL);
// FARE LA SERIE DI PUT COME NELLA RICAVA CARADD
return coll;
}
void TTest::main_loop()
{
test_analisi(); //Esegue il test delle funzioni e degli oggetti per l'analisi
//test_saldi(); //Esegue il test delle funzioni e degli oggetti per l'analisi
TRectype ricava_caradd(TMask & msk)
{
TRectype car (LF_CARADD);
TString id = msk.get(F_IDCARADD);
car.put(ABCA_ID,id.right_just(12,' '));
car.put(ABCA_STD,msk.get(F_STAMPA_DETT));
car.put(ABCA_CLI,msk.get(F_COL_STM_IMP));
car.put(ABCA_SPI,msk.get(F_CAR_SOPRA));
car.put(ABCA_STI,msk.get(F_CAR_SOTTO));
car.put(ABCA_DST,msk.get(F_DESCR_TOT));
car.put(ABCA_CLT,msk.get(F_COL_STM_TOT));
car.put(ABCA_SPT,msk.get(F_CAR_SOPRA_TOT));
car.put(ABCA_STT,msk.get(F_CAR_SOTTO_TOT));
car.put(ABCA_SVT,msk.get(F_STAMPA_IMP_TOT));
car.put(ABCA_LST,msk.get(F_LIV_STR));
car.put(ABCA_ODA,msk.get(F_FLAG_DA));
car.put(ABCA_SKI,msk.get(F_LINEA_SALTA_SMP));
car.put(ABCA_SKT,msk.get(F_LINEA_SALTA_TOT));
car.put(ABCA_NDV,msk.get(F_NON_DSR_VOC_COM));
car.put(ABCA_RII,msk.get(F_RIGA_GRASS));
car.put(ABCA_RIT,msk.get(F_RIGA_TOT_VC_CMP));
car.put(ABCA_TVL,msk.get(F_TVL));
return car;
}
void aggiorna_colldich(TMask &msk)
{
TLocalisamfile coll(LF_COLLDICH);
coll.put(ABCD_ID,msk.get(F_ID_COLL));
if (coll.read() != NOERR)
{
coll.curr().zero();
}
// FARE LA SERIE DI SET DAI CAMPI DELLA MASCHERA COME NELLA AGGIORNA_CARADD
}
void aggiorna_caradd(TMask &msk)
{
TLocalisamfile car(LF_CARADD);
car.put(ABCA_ID,msk.get(F_IDCARADD));
if (car.read() != NOERR)
{
car.curr().zero();
}
msk.set(F_STAMPA_DETT,car.get(ABCA_STD));
msk.set(F_COL_STM_IMP,car.get(ABCA_CLI));
msk.set(F_CAR_SOPRA,car.get(ABCA_SPI));
msk.set(F_CAR_SOTTO,car.get(ABCA_STI));
msk.set(F_DESCR_TOT,car.get(ABCA_DST));
msk.set(F_COL_STM_TOT,car.get(ABCA_CLT));
msk.set(F_CAR_SOPRA_TOT,car.get(ABCA_SPT));
msk.set(F_CAR_SOTTO_TOT,car.get(ABCA_STT));
msk.set(F_STAMPA_IMP_TOT,car.get(ABCA_SVT));
msk.set(F_LIV_STR,car.get(ABCA_LST));
msk.set(F_FLAG_DA,car.get(ABCA_ODA));
msk.set(F_LINEA_SALTA_SMP,car.get(ABCA_SKI));
msk.set(F_LINEA_SALTA_TOT,car.get(ABCA_SKT));
msk.set(F_NON_DSR_VOC_COM,car.get(ABCA_NDV));
msk.set(F_RIGA_GRASS,car.get(ABCA_RII));
msk.set(F_RIGA_TOT_VC_CMP,car.get(ABCA_RIT));
msk.set(F_TVL,car.get(ABCA_TVL));
}
bool aggiorna_id_colldich(TMask_field& f, KEY k)
{
if ((k==K_SPACE) && (f.dlg() == F_USA_COLL) && (f.focusdirty()))
{
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TMask &sheet_msk = f.mask();
if (sheet_msk.get_bool(F_USA_COLL))
{
ab_tree.user_tree()->goto_node(sheet_msk.get(F_ID));
TNumeric_id id_coll = ab_tree.user_tree()->current().get(ABRA_IDCOLDICH); // id del collegamento a dich.
if (id_coll != ID_NULLO)
{
//Rintraccio il collegamento
sheet_msk.set(F_ID_COLL,id_coll);
}
else
{
//Devo reperire un id disponibile
id_coll = ab_tree.new_id_colldich();
sheet_msk.set(F_ID_COLL,id_coll);
}
// Aggiorno la maschera dei collegamenti a dich.
aggiorna_colldich(sheet_msk);
return TRUE;
}
}
return TRUE;
}
bool aggiorna_id_caradd(TMask_field& f, KEY k)
{
if (((k==K_TAB) && (f.focusdirty()) && (f.dlg()==F_COMPONENTE))
|| ((k==K_SPACE) && (f.dlg() == F_USA_CARADD) && (f.focusdirty())))
{
TRelation *rel = app().get_relation();
TAnalisi_bil &ab_tree = (TAnalisi_bil&)rel->curr();
TMask &sheet_msk = f.mask();
if (sheet_msk.get_bool(F_USA_CARADD))
{ //CARADD NON DI DEFAULT
ab_tree.user_tree()->goto_node(sheet_msk.get(F_ID));
TNumeric_id id_caradd = ab_tree.user_tree()->current().get(ABRA_IDCARADD); // Caratteristica addizionale ridefinita
if (id_caradd != ID_NULLO)
{ // Esiste già una caradd specifica definita
sheet_msk.set(F_IDCARADD,id_caradd);
}
else
{ // Devo trovare un nuovo id per la nuova caradd
id_caradd = ab_tree.new_id_caradd();
sheet_msk.set(F_IDCARADD,id_caradd);
}
}
else
{ //CARADD DI DEFAULT
TLocalisamfile voci(LF_VOCI);
// Rintraccio i dati di VOCI
voci.put(ABVC_CODVC,sheet_msk.get(F_COMPONENTE));
if (voci.read() == NOERR)
{
sheet_msk.set(F_IDCARADD,voci.get(ABVC_IDCARADD));
}
else
{
error_box ("Voce non presente nell'archivio voci");
}
}
aggiorna_caradd(sheet_msk);
return TRUE;
}
return TRUE;
}
bool TGestione_tree::user_create()
{
_msk = new TMask("AB3100A");
_anas = new TRelation(LF_ANALISI);
TAnalisi_bil *tree = new TAnalisi_bil();
_anas->lfile().set_curr(tree);
TTree_field & tf = (TTree_field&)_msk->field(F_TREE);
tf.set_tree(tree->user_tree());
tf.hide_leaves(); //Nasconde le foglie dell'albero
TSheet_field &sheet = _msk->sfield(F_VISTA); //Creo un array che conterrà i dati dello sheet
_msk->set_handler(F_TREE, naviga_tree);
sheet.set_append(FALSE);
sheet.sheet_mask().set_handler(F_COMPONENTE,aggiorna_id_caradd);
sheet.sheet_mask().set_handler(F_USA_CARADD,aggiorna_id_caradd);
sheet.sheet_mask().set_handler(F_USA_COLL,aggiorna_id_colldich);
sheet.set_notify(gestione_sheet);
return TRUE;
}
bool TGestione_tree::user_destroy()
{
delete _anas;
delete _msk;
return FALSE;
}
void ab3100(int argc, char **argv)
{
TTest a;
a.run(argc,argv, "Prova");
TGestione_tree a;
a.run(argc,argv, "Gestione dati");
}

43
ab/ab3100.h Executable file
View File

@ -0,0 +1,43 @@
#include <msksheet.h>
#include "ab3.h"
#include "ablib01.h"
#include "ab3100a.h"
#include "ablib09.h"
//Serve per eseguire il test
class TGestione_tree: public TRelation_application
{
TMask* _msk;
TRelation* _anas;
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool changing_mask(int mode) {return FALSE;}
// void gestione_analisi();
// void gestione_saldi();
public:
virtual TMask* get_mask(int mode) {return _msk;}
virtual TRelation* get_relation() const {return _anas;}
TGestione_tree()
{
}
virtual ~TGestione_tree()
{
}
};
bool gestione_sheet(TSheet_field& s, int r, KEY k);
bool naviga_tree(TMask_field& f, KEY k);
bool aggiorna_id_caradd(TMask_field& f, KEY k);
void aggiorna_caradd(TMask &msk);
TRectype ricava_caradd(TMask & msk);
bool aggiorna_id_caradd(TMask_field& f, KEY k);
void aggiorna_colldich(TMask &msk);
TRectype ricava_colldich(TMask & msk);

82
ab/ab3100a.h Executable file
View File

@ -0,0 +1,82 @@
#ifndef _AB3100A_H
#define _AB3100A_H
#define F_ID 101
#define F_TIPO 102
#define F_CODICE 103
#define F_COMP 104
#define F_VOCE_INC 105
#define F_DESCR 106
#define F_USA_CARADD 107
#define F_COMPONENTE 108
#define F_IDCARADD 109
#define F_ID_COLL 110
#define F_USA_COLL 111
#define F_TESTO_GENERALE 150
#define F_TESTO_CARADD 151
#define F_TESTO_COLLDICH 152
#define F_STAMPA_DETT 153
#define F_STAMPA_IMP_TOT 154
#define F_NON_DSR_VOC_COM 155
#define F_RIGA_GRASS 156
#define F_RIGA_TOT_VC_CMP 157
#define F_TVL 158
#define F_COL_STM_IMP 160
#define F_COL_STM_TOT 161
#define F_CAR_SOPRA 162
#define F_CAR_SOTTO 163
#define F_CAR_SOPRA_TOT 164
#define F_CAR_SOTTO_TOT 165
#define F_LIV_STR 170
#define F_FLAG_DA 171
#define F_LINEA_SALTA_SMP 172
#define F_LINEA_SALTA_TOT 173
#define F_DESCR_TOT 174
#define F_F4A 351
#define F_F4B 352
#define F_P4A 353
#define F_P4B 354
#define F_A5A 355
#define F_A5B 356
#define F_P5A 357
#define F_P5B 358
#define F_A6A 360
#define F_A6B 361
#define F_X4A 362
#define F_X4B 363
#define F_X5A 364
#define F_X5B 365
#define F_X6A 366
#define F_X6B 367
#define F_P6A 368
#define F_P6B 369
#define F_K4A 370
#define F_K5A 371
#define F_K6A 372
#define F_TREE 250
#define F_VISTA 251
#define F_CODICE_ANALISI 252
#define F_DESCRIZIONE_ANALISI 253
#endif //_AB3100A_H

403
ab/ab3100a.uml Executable file
View File

@ -0,0 +1,403 @@
#include "ab3100a.h"
TOOLBAR "" 0 19 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Tabella di analisi" 0 -1 0 19
STRING F_CODICE_ANALISI 2 2
BEGIN
PROMPT 1 3 "Codice: "
USE LF_ANALISI KEY 1
INPUT CODAN F_CODICE_ANALISI
DISPLAY "Codice" CODAN
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODICE_ANALISI CODAN
OUTPUT F_DESCRIZIONE_ANALISI DESCRIZ
FIELD CODAN
CHECKTYPE REQUIRED
KEY 1
FLAGS "U"
END
STRING F_DESCRIZIONE_ANALISI 80 60
BEGIN
PROMPT 1 5 "Descrizione: "
FIELD DESCRIZ
CHECKTYPE NORMAL
KEY 2
FLAGS "U"
END
ENDPAGE
PAGE "Gestione dati" 0 -1 0 19
TREE F_TREE 0 6
BEGIN
PROMPT 0 1 ""
END
SPREADSHEET F_VISTA 0 9
BEGIN
PROMPT 0 10 ""
ITEM "Id@9"
ITEM "Tipo"
ITEM "Codice voce@12"
ITEM "Comp"
ITEM "Voce Incid."
ITEM "Descrizione@80"
ITEM "Usa caradd"
ITEM "Cod. voce ass."
ITEM "Id caradd"
ITEM "Id coll. dich"
ITEM "Coll. dich."
END
ENDPAGE
ENDMASK
TOOLBAR "" 0 19 0 3
BUTTON DLG_OK 10 2
BEGIN
PROMPT -3 -11 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -11 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -13 -11 ""
END
ENDPAGE
PAGE "" 0 -1 0 19
STRING F_ID 10
BEGIN
PROMPT 1 4 "Identificatore: "
FLAGS "D"
END
STRING F_TIPO 1
BEGIN
PROMPT 1 5 "Tipo cod: "
FLAGS "D"
END
STRING F_CODICE 10
BEGIN
PROMPT 1 6 "Codice voce padre: "
FLAGS "_RD"
CHECKTYPE NORMAL
END
STRING F_COMP 6
BEGIN
PROMPT 1 7 "Num. comp.: "
FLAGS "D"
END
NUMBER F_VOCE_INC 12 0
BEGIN
PROMPT 1 9 "Voce di incidenza: "
FLAGS "Z"
END
STRING F_DESCR 80 50
BEGIN
PROMPT 1 8 "Descrizione: "
END
BOOLEAN F_USA_CARADD
BEGIN
PROMPT 1 15 "Usa caratteristiche addizionali"
END
STRING F_COMPONENTE 12 12
BEGIN
PROMPT 1 10 "Codice voce: "
INPUT LF_VOCI F_COMPONENTE
USE LF_RELVOCI KEY 1
JOIN LF_VOCI TO LF_RELVOCI INTO CODVC=COMP
INPUT LF_RELVOCI->TIPOCOD F_TIPO
INPUT LF_RELVOCI->CODVC F_CODICE
INPUT LF_RELVOCI->IDCOMP F_COMP
DISPLAY "Codice@10" LF_VOCI->CODVC
DISPLAY "Descrizione@40" LF_VOCI->DESCRIZ
OUTPUT F_COMPONENTE LF_VOCI->CODVC
// FLAGS "G"
END
NUMBER F_IDCARADD 12 0
BEGIN
PROMPT 1 12 "Id delle carattestiche addizionali "
USE LF_CARADD KEY 1
INPUT ID F_IDCARADD
OUTPUT F_STAMPA_DETT STD
OUTPUT F_COL_STM_IMP CLI
OUTPUT F_CAR_SOPRA SPI
OUTPUT F_CAR_SOTTO STI
OUTPUT F_DESCR_TOT DST
OUTPUT F_COL_STM_TOT CLT
OUTPUT F_CAR_SOPRA_TOT SPT
OUTPUT F_CAR_SOTTO_TOT STT
OUTPUT F_STAMPA_IMP_TOT SVT
OUTPUT F_LIV_STR LST
OUTPUT F_FLAG_DA ODA
OUTPUT F_LINEA_SALTA_SMP SKI
OUTPUT F_LINEA_SALTA_TOT SKT
OUTPUT F_NON_DSR_VOC_COM NDV
OUTPUT F_RIGA_GRASS RII
OUTPUT F_RIGA_TOT_VC_CMP RIT
OUTPUT F_TVL TVL
CHECKTYPE NORMAL
FLAGS "D"
END
NUMBER F_ID_COLL 6 0
BEGIN
PROMPT 1 13 "Identificatore del collegamento: "
FLAGS "D"
END
BOOLEAN F_USA_COLL
BEGIN
PROMTP 1 16 "Utilizzo collegamento a dichiarazioni"
END
TEXT F_TESTO_GENERALE
BEGIN
PROMPT 1 1 "@B Dati generali"
END
ENDPAGE
PAGE "Car. add." 0 -1 0 19
TEXT F_TESTO_CARADD
BEGIN
PROMPT 1 1 "@B Caratteristiche addizionali"
END
NUMBER F_COL_STM_IMP 1 0
BEGIN
PROMPT 1 3 "Colonna di stampa importo "
END
NUMBER F_COL_STM_TOT 1 0
BEGIN
PROMPT 1 4 "Colonna di stampa totale "
END
STRING F_CAR_SOPRA 1 1
BEGIN
PROMTP 1 5 "Carattere di sopralineatura "
END
STRING F_CAR_SOTTO 1 1
BEGIN
PROMPT 1 6 "Carattere di sottolineatura "
END
STRING F_CAR_SOPRA_TOT 1 1
BEGIN
PROMTP 1 7 "Carattere di sopralineatura totale "
END
STRING F_CAR_SOTTO_TOT 1 1
BEGIN
PROMTP 1 8 "Carattere di sottolineatura totale "
END
NUMBER F_LIV_STR 1 0
BEGIN
PROMPT 1 9 "Livello di struttura "
END
STRING F_FLAG_DA 1 1
BEGIN
PROMPT 1 10 "Segno Dare/Avere per conti d'ordine "
END
STRING F_TVL 1 1
BEGIN
PROMPT 1 11 "Tipo valore "
END
NUMBER F_LINEA_SALTA_SMP 2 0
BEGIN
PROMPT 1 12 "Linee di stampa da saltare (0-72) "
END
NUMBER F_LINEA_SALTA_TOT 2 0
BEGIN
PROMPT 1 13 "Linee di stampa da saltare per tot. "
END
STRING F_DESCR_TOT 80 50
BEGIN
PROMPT 1 15 "Descrizione totale "
END
BOOLEAN F_STAMPA_DETT
BEGIN
PROMPT 1 16 " Stampa dettaglio"
END
BOOLEAN F_STAMPA_IMP_TOT
BEGIN
PROMTP 1 17 " Stampa importo totale su riga voci"
END
BOOLEAN F_NON_DSR_VOC_COM
BEGIN
PROMPT 1 18 " Non stampare la descrizione di voce complessa"
END
BOOLEAN F_RIGA_GRASS
BEGIN
PROMPT 45 16 " Riga voce grassetto"
END
BOOLEAN F_RIGA_TOT_VC_CMP
BEGIN
PROMPT 45 17 " Riga tot. voce c. grass."
END
ENDPAGE
PAGE "Coll. dich." 0 -1 0 19
TEXT F_TESTO_COLLDICH
BEGIN
PROMPT 1 1 "@B Collegamento a dichiarazione redditi"
END
NUMBER F_F4A 3 0
BEGIN
PROMPT 1 5 "Rif. riga mod. 740/f: "
END
STRING F_F4B 1 1
BEGIN
PROMTP 1 6 "Riga bis 740/f: "
END
NUMBER F_P4A 3 0
BEGIN
PROMPT 1 7 "Rif. pros. bil. mod. 740: "
END
STRING F_P4B 1 1
BEGIN
PROMPT 1 8 "Riga bis pros. mod. 740: "
END
NUMBER F_A5A 3 0
BEGIN
PROMPT 1 9 "Rif. riga mod. 750/a: "
END
STRING F_A5B 1 0
BEGIN
PROMTP 1 10 "Riga bis mod 750/a: "
END
NUMBER F_P5A 3 0
BEGIN
PROMPT 1 11 "Rif. pros. bil. mod. 750: "
END
STRING F_P5B 1 1
BEGIN
PROMPT 1 12 "Riga bis pros. mod. 750: "
END
NUMBER F_A6A 3 0
BEGIN
PROMPT 1 13 "Rif. riga mod. 760/a: "
END
STRING F_A6B 1 0
BEGIN
PROMPT 1 14 "Riga bis mod. 760/a: "
END
NUMBER F_X4A 3 0
BEGIN
PROMPT 1 15 "Rif. pros. cred. mod. 740:"
END
STRING F_X4B 1 1
BEGIN
PROMPT 1 16 "Riga bis cred. mod. 740: "
END
NUMBER F_X5A 3 0
BEGIN
PROMTP 1 17 "Rif. pros. cred. mod. 750:"
END
STRING F_X5B 1 1
BEGIN
PROMPT 1 18 "Riga bis cred. mod. 750: "
END
NUMBER F_X6A 3 0
BEGIN
PROMTP 40 5 "Rif. pros. cred. mod. 760:"
END
STRING F_X6B 1 1
BEGIN
PROMTP 40 6 "Riga bis cred. mod. 760: "
END
NUMBER F_P6A 3 0
BEGIN
PROMPT 40 7 "Rif. pros. bil. mod. 760: "
END
STRING F_P6B 1 1
BEGIN
PROMPT 40 8 "Riga bis bil. mod. 760: "
END
NUMBER F_K4A 3 0
BEGIN
PROMTP 40 9 "Rif. mod. 740/k: "
END
NUMBER F_K5A 3 0
BEGIN
PROMPT 40 10 "Rif. mod. 750/k: "
END
NUMBER F_K6A 3 0
BEGIN
PROMTP 40 11 "Rif. mod. 760/k: "
END
ENDPAGE
ENDMASK

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,18 @@
#ifndef __ANALISIB_H
#define __ANALISIB_H
#ifndef __RELATION_H
#define __RELATION_H
#include <relation.h>
#endif //__RELATION_H
#include <relapp.h>
#include <tree.h>
#include <mask.h>
#ifndef __APPLICAT_H
#define __APPLICAT_H
#include <applicat.h> //Definizione della classe TApplication
#endif //__APPLICAT_H
#ifndef _ABLI09_H
#include "ablib09.h"
#endif //_ABLIB09_H
#ifndef _ANALISI_H
#include "analisi.h"
#endif //_ANALIS_H
#ifndef _RELVOCI_H
//#define _RELVOCI_H
#include "relvoci.h"
#endif //_RELVOCI_H
#ifndef _RELANA_H
//#define _RELANA_H
#include "relana.h"
#endif //_RELANA_H
#include "saldi.h"
#include "movdett.h"
#include "voci.h"
#include "caradd.h"
#include "colldich.h"
#define MAX_ID_REL 999999999
#define MAX_ID_MOVDETT 999999
#define NODO_AGGIUNTO "A"
@ -39,345 +21,304 @@
#define IMMESSO 'I'
#define TRASFERITO 'T'
#define TIPO_ANALISI "A"
#define TIPO_VOCE "V"
#define ID_NULLO 0
//Serve per eseguire il test
class TTest: public TSkeleton_application
{
protected:
virtual void main_loop();
public:
// @cmember Costruttore
TTest()
{
}
// @cmember Distruttore
virtual ~TTest()
{
}
};
class TNodeId : public TString
{
};
// classe per un albero navigabile in una direzione
// (depth first o breadth first)
class TAlbero : public TObject
{
protected:
virtual void node2id(const TObject * node,TNodeId & id) const
{return;}
public:
virtual bool empty() {return !goto_root();}
virtual bool goto_root() pure ;
virtual bool goto_firstson() pure ;
virtual bool goto_rbrother() pure ;
virtual TObject * curr_node() const pure ;
void curr_id(TNodeId & var) const
{node2id(curr_node(),var);}
virtual bool goto_node(TNodeId &id)
{return FALSE;}
virtual bool has_son() const
{return FALSE;}
virtual bool has_rbrother() const
{return FALSE;}
TAlbero() {}
virtual ~TAlbero() {}
};
// classe per un albero navigabile in due direzioni
class TAlbero_bidir : public TAlbero
{
public:
virtual bool has_father() const
{return FALSE;}
virtual bool has_lbrother() const
{return FALSE;}
virtual bool goto_father()
{return FALSE;}
virtual bool goto_lbrother()
{return FALSE;}
TAlbero_bidir() {}
virtual ~TAlbero_bidir() {}
};
#define ID_NULLO_STR "0"
typedef real TNumeric_id;
/*class TNumeric_id : public real
{
public:
TNumeric_id &operator =(const int &v)
{*((real *)this)=v; return *this;}
TNumeric_id &operator =(const real &v)
{*((real *)this)=v; return *this;}
TNumeric_id(const real &v)
{*this=v;}
TNumeric_id()
{}
};*/
class TAlbero_movdett : public TAlbero_bidir
class TAlbero_movdett : public TBidirectional_tree
{
TToken_string _codtab;
TLocalisamfile *_movdett;
// TNumeric_id _last_id;
protected:
virtual void node2id(const TObject * node,TNodeId & id) const;
virtual void node2id(const TObject * node,TString & id) const;
public:
// @cmember Ritorna TRUE se riesce a trovare il primo figlio
virtual bool has_son() const;
// @cmember Ritorna TRUE se riesce a trovare il fratello destro
virtual bool has_rbrother() const;
// @cmember Ritorna TRUE se riesce a trovare il padre
virtual bool has_father() const;
// @cmember Ritorna TRUE se riesce a trovare il fratello sinistro
virtual bool has_lbrother() const;
// @cmember Si posiziona sulla radice principale
virtual bool goto_root();
// @cmember Si posiziona sul primo figlio
virtual bool goto_firstson();
// @cmember Si posiziona sul padre
virtual bool goto_father();
// @cmember Si posiziona sul fratello destro
virtual bool goto_rbrother();
// @cmember Si posiziona sul fratello sinistro
virtual bool goto_lbrother();
// @cmember Ritorna TRUE se può posizionarsi sul nodo indicato dall'id specificato
virtual bool goto_node(TNodeId & id)
virtual bool goto_node(TString & id)
{return(_movdett->readat(atol(id))==NOERR); }
// @cmember Si posiziona sul nodo specificato dall'id
bool goto_id(const TNumeric_id &id);
// @cmember Ritorna il nodo corrente
virtual TObject * curr_node() const;
// @cmember Ritorna il nodo corrente
bool goto_id(const TNumeric_id &id);
TRectype & curr() {return (TRectype &)*curr_node();}
// @cmember Esegue un lock
// bool lock();
// @cmember Esegue un unlock
// void unlock();
// @cmember Inserisce un nodo nella struttura ad albero
//bool insert_node(real id);
// @cmember Restituisce un nuovo id (il primo disponibile)
// TNumeric_id &new_id(real id);
// @cmember Costruttore
TAlbero_movdett( const char * tabcode);
// @cmember Distruttore
virtual ~TAlbero_movdett() {;}
virtual ~TAlbero_movdett();
};
//Classe per gestire l'albero di relana
class TAlbero_relana : public TAlbero_bidir
class TAlbero_relana : public TBidirectional_tree
{
TString _codtab;
TLocalisamfile *_relana;
TNumeric_id _last_id;
protected:
virtual void node2id(const TObject * node,TNodeId & id) const;
virtual void node2id(const TObject * node,TString & id) const;
public:
// @cmember Ritorna TRUE se riesce a trovare il primo figlio
void zero_id() {_last_id = 0;}
virtual bool has_son() const;
// @cmember Ritorna TRUE se riesce a trovare il fratello destro
virtual bool has_rbrother() const;
// @cmember Ritorna TRUE se riesce a trovare il padre
virtual bool has_father() const;
// @cmember Ritorna TRUE se riesce a trovare il fratello sinistro
virtual bool has_lbrother() const;
// @cmember Si posiziona sulla radice principale
virtual bool goto_root();
// @cmember Si posiziona sul primo figlio
virtual bool goto_firstson();
// @cmember Si posiziona sul padre
virtual bool goto_father();
// @cmember Si posiziona sul fratello destro
virtual bool goto_rbrother();
// @cmember Si posiziona sul fratello sinistro
virtual bool goto_lbrother();
// @cmember Ritorna TRUE se può posizionarsi sul nodo indicato dall'id specificato
virtual bool goto_node(TNodeId & id)
virtual bool goto_node(TString & id)
{return(_relana->readat(atol(id))==NOERR); }
// @cmember Si posiziona sul nodo specificato dall'id
bool goto_id(const TNumeric_id &id);
// @cmember Ritorna il nodo corrente
virtual TObject * curr_node() const;
// @cmember Ritorna il nodo corrente
bool goto_id(const TNumeric_id &id);
TRectype & curr() {return (TRectype &)*curr_node();}
// @cmember Esegue un lock
bool lock();
// @cmember Esegue un unlock
void unlock();
// @cmember Inserisce un nodo nella struttura ad albero
//bool insert_node(real id);
// @cmember Restituisce un nuovo id (il primo disponibile)
TNumeric_id &new_id(real id);
// @cmember Costruttore
TAlbero_relana( const char * tabcode);
// @cmember Distruttore
virtual ~TAlbero_relana();
};
//Classe per gestire la struttura di una tabella di analisi
// basandosi sull'albero di relvoci
class TAlbero_relvoci : public TAlbero
class TAlbero_relvoci : public TTree
{
TString _codtab;
TLocalisamfile *_relvoci;
protected:
virtual void node2id(const TObject * node, TNodeId & id) const;
virtual void node2id(const TObject* node, TString& id) const;
public:
// @cmember Si posiziona sulla radice principale
virtual bool goto_root();
// @cmember Ritorna TRUE se trova un figlio
virtual bool has_son() const;
// @cmember Si posiziona sul primo figlio
virtual bool goto_firstson();
// @cmember Ritorna TRUE se trova un fratello destro
virtual bool has_rbrother() const;
// @cmember Si posiziona sul fratello destro
virtual bool goto_rbrother();
// @cmember Ritorna TRUE se trova un fratello sinistro
bool has_lbrother() const;
// @cmember Si posiziona sul fratello sinistro
bool goto_lbrother();
// @cmember Restituisce il nodo corrente
virtual TObject * curr_node() const;
// @cmember Restituisce il nodo specificato dall'id
virtual bool goto_node(TNodeId & id)
virtual bool goto_node(const TString &id)
{return (_relvoci->readat(atol(id))==NOERR);}
// @cmember Restituisce il nodo corrente
bool has_lbrother() const;
bool goto_lbrother();
TRectype & curr() {return (TRectype &)*curr_node();}
// @cmember Esegue un lock
bool lock();
// @cmember Esegue un unlock
void unlock();
// @cmember Restituisce il codice della tabella che si sta usando
const TString & codtab()
{return _codtab;}
// @cmember Costruttore
TAlbero_relvoci(const char * tabcode);
// @cmember Distruttore
virtual ~TAlbero_relvoci() ;
};
// Struttura da albero basata su un file temporaneo cached
class TAlbero_locale : public TAlbero_bidir
class TAlbero_locale : public TBidirectional_tree
{
TRWrecord_cache * _local_cache;
TLocalisamfile *_f; // da rimuovere !!
TRectype *_currnode;
TNumeric_id _last_insert_id;
TAssoc_array _status_node;
protected:
// @cmember Elimina il sottoalbero dei figli di un nodo
// @cmember che sta per essere eliminato da un struttura di tipo lista doppiamente lincata
bool remove_subtree(const TNumeric_id lastnode_id);
// @cmember genera/setta il nuovo id
TNumeric_id &new_id(TNumeric_id);
void goto_node(const TNumeric_id id);
void goto_node(TRectype &node) {*_currnode = node;}
virtual void put_headkey(TRectype &) pure;
virtual const char * idfather_fieldname() pure ;
virtual const char * idson_fieldname() pure;
virtual const char * idsucc_fieldname() pure;
virtual const char * idprec_fieldname() pure;
virtual const char * id_fieldname() pure;
virtual const char * get_headkey() pure;
TAssoc_array _status_node;
TRWrecord_cache * _local_cache;
TNumeric_id _last_insert_id;
TRectype *_currnode;
virtual const char * get_headkey() const {return NULL;}
virtual const char * id_fieldname() const {return NULL;}
public:
// debug
void write_cache() { _local_cache->flush(); }
// @cmember Inserisce un nodo in una struttura di tipo lista doppiamente lincata: trasf_immes è un flag che dice se il nodo è trasferito o immesso
bool insert_node(TRectype &node, const TNumeric_id id_prec, const TNumeric_id id_padre, TNumeric_id id, const char trasf_immes = TRASFERITO);
// @cmember Elimina un nodo da una struttura di tipo lista doppiamente lincata
bool delete_node(const TNumeric_id &id);
// @cmember Lancia la rimozione di tutto l'albero
bool delete_tree();
// @cmember Lancia la rimozione di tutto l'albero
void zero();
// @cmember Restituisce il nodo corrente
TRectype & current() const {return *_currnode;}
void clear_cache()
{
_local_cache->clear();
_last_insert_id = 0;
}
// @cmember Restituisce TRUE se esiste un figlio di un nodo
virtual bool has_son();
// @cmember Si posizione sul primo figlio di un nodo
virtual bool goto_firstson();
// @cmember Restituisce TRUE se esiste il fratello destro di un nodo
virtual bool has_rbrother();
// @cmember Si posiziona sul fratello destro di un nodo
virtual bool goto_rbrother();
// @cmember Si posiziona sul primo nodo della struttura ad albero
virtual bool goto_root();
// @cmember Restituisce il nodo corrente
virtual bool insert_node(TRectype &node, const TNumeric_id id_prec, const TNumeric_id id_padre, TNumeric_id id, const char trasf_immes = TRASFERITO) {return FALSE;}
virtual bool delete_node(const TNumeric_id &id) {return FALSE;}
virtual bool delete_tree() { return FALSE;}
virtual void zero() {;}
virtual bool make_root(TBaseisamfile & saldi) {return FALSE;}
virtual void link_succ_zero(const TNumeric_id currid) {;}
virtual void link_son_zero(const TNumeric_id currid) {;}
virtual TObject * curr_node() const {return _currnode;}
TRectype & current() const {return (TRectype &)*curr_node();}
TRWrecord_cache & current_cache() const {return *_local_cache;}
// ***** gestione interfaccia Database/copia locale
// @cmember Estrae un nodo dall'albero
TRectype extract_dirtynode(TNumeric_id &id, TString& status);
// @cmember Ritorna il numero di elementi dell'assoc_array status_node
virtual TRectype extract_dirtynode(TString &id, TString& status) { TRectype rec(*_currnode); return rec;}
int dirty_nodes() { return _status_node.items();}
// @cmember Setta lo stato del nodo: valori ammessi = nodo <A>ggiunto, nodo <M>odificato, nodo <R>imosso
void set_status_node(const TNumeric_id &id, const char *status);
// @cmember Ritorna lo stato di un nodo
TString* get_status_node(const TNumeric_id &id)
{return (TString*)_status_node.objptr(id.string());}
void set_status_node(const TString &id, const char *status);
TString* get_status_node(const TString &id)
{return (TString*)_status_node.objptr(id);}
void link_succ_zero(const TNumeric_id currid);
void link_son_zero(const TNumeric_id currid);
// @cmember Costruttore
virtual void goto_node(const TNumeric_id id) {;}
virtual void goto_node(TRectype &node) {*_currnode = node;}
virtual bool goto_node(const TString & id) {TNumeric_id nid(id); goto_node(nid); return TRUE;}
virtual void node2id(const TObject* node, TString& id) const {;}
virtual bool goto_firstson() {return FALSE;}
virtual bool goto_rbrother() {return FALSE;}
virtual bool goto_root() {return FALSE;}
/* virtual const char * idfather_fieldname() const {return NULL;}
virtual const char * idson_fieldname() const {return NULL;}
virtual const char * idsucc_fieldname() const {return NULL;}
virtual const char * idprec_fieldname() const {return NULL;}
virtual void put_headkey(TRectype &) {;}
virtual bool remove_subtree(const TNumeric_id lastnode_id) { return TRUE;}
virtual TNumeric_id &new_id(TNumeric_id) { real i; return i;}
virtual bool has_father() const {return TRUE;}
virtual bool goto_father() {return TRUE;}
virtual bool has_rbrother() const {return TRUE;}
virtual bool has_lbrother() const {return TRUE;}
virtual bool goto_lbrother() {return TRUE;}
virtual bool goto_son_first_level() {return TRUE;}
virtual void curr_id(TString& id) const
{
node2id(curr_node(), id);
}
*/
TAlbero_locale(int filenum);
// @cmember Distruttore
virtual ~TAlbero_locale();
};
// Copia locale dell'albero di una tabella analisi
class TLocal_relana3 : public TAlbero_locale
{
protected:
virtual const char * idfather_fieldname() {return ABRA_IDPADRE;}
virtual const char * idson_fieldname(){return ABRA_IDFIGLIO;}
virtual const char * idsucc_fieldname(){return ABRA_IDSUCC;}
virtual const char * idprec_fieldname(){return ABRA_IDPREC;}
virtual const char * id_fieldname(){return ABRA_ID;}
virtual const char * get_headkey() {return " ";}
virtual void put_headkey(TRectype & node) {node.put(ABRA_CODAN,get_headkey());}
public:
class TAlbero_locale_link : public TAlbero_locale
{
// TLocalisamfile *_c;
// TRWrecord_cache * _local_cache_carad;
protected:
// @cmember Costruttore
virtual const char * idfather_fieldname() const pure ;
virtual const char * idson_fieldname() const pure;
virtual const char * idsucc_fieldname() const pure;
virtual const char * idprec_fieldname() const pure;
virtual const char * id_fieldname() const pure;
virtual const char * get_headkey() const pure;
virtual void put_headkey(TRectype &) pure;
virtual void node2id(const TObject* node, TString& id) const
{
const TRectype *rec = (const TRectype *)node;
id = rec->get_real(id_fieldname()).string();
}
virtual bool remove_subtree(const TNumeric_id lastnode_id);
virtual TNumeric_id &new_id(TNumeric_id);
public:
virtual bool insert_node(TRectype &node, const TNumeric_id id_prec, const TNumeric_id id_padre, TNumeric_id id, const char trasf_immes = TRASFERITO);
virtual bool delete_node(const TNumeric_id &id);
virtual bool delete_tree();
virtual void zero();
virtual void goto_node(const TNumeric_id id);
virtual void goto_node(TRectype &node) {*_currnode = node;}
virtual bool goto_node(const TString & id) {TNumeric_id nid(id); goto_node(nid); return TRUE;}
virtual bool make_root(TBaseisamfile & saldi) pure;
virtual bool get_description(TString& desc) const pure;
virtual bool has_son() const;
virtual bool goto_firstson();
virtual bool has_father() const;
virtual bool goto_father();
virtual bool has_rbrother() const;
virtual bool goto_rbrother();
virtual bool has_lbrother() const;
virtual bool goto_lbrother();
virtual bool goto_son_first_level();
// virtual bool has_root() const {return FALSE;}
virtual bool goto_root();
virtual void link_succ_zero(const TNumeric_id currid);
virtual void link_son_zero(const TNumeric_id currid);
virtual TRectype extract_dirtynode(TString &id, TString& status);
TAlbero_locale_link(int filenum);
virtual ~TAlbero_locale_link() {;}
};
class TAlbero_locale_relvoci: public TAlbero_locale
{
protected:
// virtual bool remove_subtree(const TNumeric_id lastnode_id);
public:
virtual bool insert_node(TRectype &node, const TNumeric_id id_prec, const TNumeric_id id_padre, TNumeric_id id, const char trasf_immes = TRASFERITO);
virtual bool delete_node(const TNumeric_id &id);
virtual bool goto_node(const TString &key);
/**********************/
virtual bool delete_tree() { return FALSE;}
virtual void zero() {;}
virtual bool make_root(TBaseisamfile & saldi) {return FALSE;}
virtual bool has_rbrother() const;
virtual bool goto_rbrother();
virtual bool has_lbrother() const;
virtual bool goto_lbrother();
virtual TRectype extract_dirtynode(TString &id, TString& status);
TNumeric_id new_id();
// virtual bool delete_tree();
// virtual bool has_son() const;
// virtual bool goto_firstson();
// virtual bool has_father() const;
// virtual bool goto_father();
// virtual bool goto_son_first_level();
TAlbero_locale_relvoci();
virtual ~TAlbero_locale_relvoci() {;}
};
// Copia locale dell'albero di una tabella analisi
class TLocal_relana3 : public TAlbero_locale_link
{
protected:
virtual const char * idfather_fieldname() const {return ABRA_IDPADRE;}
virtual const char * idson_fieldname() const {return ABRA_IDFIGLIO;}
virtual const char * idsucc_fieldname() const {return ABRA_IDSUCC;}
virtual const char * idprec_fieldname() const {return ABRA_IDPREC;}
virtual const char * id_fieldname() const {return ABRA_ID;}
virtual const char * get_headkey() const {return " ";}
virtual void put_headkey(TRectype & node) {node.put(ABRA_CODAN,get_headkey());}
public:
virtual bool make_root(TBaseisamfile & saldi);
virtual bool get_description(TString& desc) const;
TLocal_relana3();
// @cmember Distruttore
virtual ~TLocal_relana3();
};
// Copia locale dell'albero dei dettagli di un saldo
class TLocal_balance3 : public TAlbero_locale
class TLocal_balance3 : public TAlbero_locale_link
{
protected:
virtual const char * idfather_fieldname() {return ABMD_IDPADRE;}
virtual const char * idson_fieldname(){return ABMD_IDFIGLIO;}
virtual const char * idsucc_fieldname(){return ABMD_IDSUCC;}
virtual const char * idprec_fieldname(){return ABMD_IDPREC;}
virtual const char * id_fieldname(){return ABMD_ID;}
virtual const char * get_headkey() {return " | | | | ";}
virtual void put_headkey(TRectype & node) ;
protected:
virtual const char * idfather_fieldname() const {return ABMD_IDPADRE;}
virtual const char * idson_fieldname() const {return ABMD_IDFIGLIO;}
virtual const char * idsucc_fieldname() const {return ABMD_IDSUCC;}
virtual const char * idprec_fieldname() const {return ABMD_IDPREC;}
virtual const char * id_fieldname() const {return ABMD_ID;}
virtual const char * get_headkey() const {return " | | | | ";}
virtual void put_headkey(TRectype & node) ;
public:
// @cmember Costruttore
virtual bool make_root(TBaseisamfile & saldi);
virtual bool get_description(TString& desc) const;
TLocal_balance3();
// @cmember Distruttore
virtual ~TLocal_balance3();
};
@ -385,34 +326,68 @@ class TAlbero_AB: public TRectype
{
protected:
TAlbero_locale *_inter_tree;
// @cmember Esegue la scrittura del body del record
virtual int commit_body() const;
// @cmember Esegue la lettura del body del rocord
virtual int read_body(bool lockstruct) {return 0;} //DA FARE
// @cmember Copia la chiave sul record dei nodi dell'albero
virtual void put_headkey(TRectype &rec) const {;} //DA FARE
TRectype * _newrec; //buffer per l'inserimento dodo per nodo
public:
// @cmember Costruttore
TAlbero_AB(int filenum);
// #cmember Distruttore
virtual ~TAlbero_AB() {;} //DA FARE
// @cmember Esegue la lettura della testata di un record da LF_ANALISI e del suo "body"
virtual ~TAlbero_AB();
virtual int read(TBaseisamfile& analisi, word isop=_isequal, word lockop=_nolock);
// @cmember Esegue la lettura della testata di un record alla posizione nrec da LF_ANALISI e del suo "body"
virtual int readat(TBaseisamfile& f, TRecnotype nrec, word lockop = _nolock);
// @cmember Scrive una tabella di analisi
virtual int write(TBaseisamfile& analisi) const;
// @cmember Riscrive una tabella di analisi
virtual int rewrite(TBaseisamfile& analisi) const;
// @cmember Elimina una intera tabella di analisi con tutto il suo contenuto
virtual int remove(TBaseisamfile& f) const;
// @cmember Azzera l record
virtual bool remove_node(const TNumeric_id &id) {return FALSE;}
virtual bool insert_new_node() {return FALSE;}
virtual void zero();
TAlbero_locale * user_tree()
{return _inter_tree;}
};
class TRecord : public TObject
{
TLocalisamfile *_r; // da rimuovere !!
protected:
TAssoc_array _status_node_record;
TRWrecord_cache * _local_cache_record;
TRectype *_currrec;
public:
// debug
void write_cache() { _local_cache_record->flush(); }
TRectype & current_rec() const {return *_currrec;}
TRWrecord_cache & current_cache_record() const {return *_local_cache_record;}
virtual TRectype extract_dirtynode(TString &id, TString& status);
int dirty_nodes() { return _status_node_record.items();}
void set_status_node(const TString &id, const char *status);
TString* get_status_node(const TString &id)
{return (TString*)_status_node_record.objptr(id);}
TRecord(int filenum);
virtual ~TRecord();
};
class TRecord_caradd : public TRecord
{
public:
TRecord_caradd();
virtual ~TRecord_caradd() {;}
};
class TRecord_colldich : public TRecord
{
public:
TRecord_colldich();
virtual ~TRecord_colldich() {;}
};
class TAnalisi_bil: public TAlbero_AB
{
class TArray_fratelli: public TAssoc_array
@ -428,39 +403,56 @@ class TAnalisi_bil: public TAlbero_AB
TLocalisamfile *_voci;
TAlbero_relvoci *_relaz;
TAlbero_relana *_ana;
//TLocal_relana3 *_inter_tree;
TAlbero_locale *_inter_tree_relvoci;
TRecord *_record_caradd;
TRecord *_record_colldich;
TNumeric_id _last_id_caradd;
TNumeric_id _last_id_colldich;
void last_id_caradd();
void last_id_colldich();
protected:
// @cmember Esegue una navigazione dell'albero di rel_voci e di rel_ana
// @cmember parallelamente verificanto eventualmente delle inconsistenze
void naviga_relazioni(const TNumeric_id & id_relana,const TNumeric_id & prec,const TNumeric_id & padre );
// @cmember Sincronizza la copia locale basandosi su relvoci (per la struttura) e su relana (per le info aggiuntive)
TRectype * sincronizza_relana(const TNumeric_id &begin_relana,TNumeric_id &id_relana);
// @cmember Esegue un lock di una struttura ad albero
bool lock_struttura();
// @cmember Esegue un unlock di una struttura ad albero
bool unlock_struttura();
// @cmember Esegue un lock su una tabella di analisi
bool lock_tabella();
// @cmember Sblocca una tabella di analisi
bool unlock_tabella();
// @cmember Esegue la scrittura del body del record scrive il contenuto di una tabella di analisi
//virtual int commit_body() const;
// @cmember Esegue la lettura del body del rocord: legge il contenuto di una tabella di analisi
virtual int read_body(bool lockstruct);
// @cmember Copia la chiave sul record dei nodi dell'albero
virtual int commit_body() const;
virtual void put_headkey(TRectype &rec) const;
//Serve solo per il debug: lancia l'iserimento
//diretto e manuale di un nodo, testo la funzione di inserimento
void prova_inserimento();
public:
// @cmember Costruttore
TNumeric_id new_id_caradd()
{
_last_id_caradd = _last_id_caradd +1;
return _last_id_caradd;
}
TNumeric_id new_id_colldich()
{
_last_id_colldich = _last_id_colldich +1;
return _last_id_colldich;
}
virtual bool remove_node(const TNumeric_id &id);
virtual bool insert_new_node(TToken_string &codice);
virtual void modify_node(TToken_string &codice);
TAnalisi_bil();
// #cmember Distruttore
virtual ~TAnalisi_bil() ;
// @cmember Ritorna il tipo di analisi
TAlbero_locale * user_tree_voc()
{return _inter_tree_relvoci;}
TRecord *user_caradd()
{return _record_caradd;}
TRecord *user_colldich()
{return _record_colldich;}
const TString &type() {return get(ABAN_TIPOAN);}
// @cmember Setta il tipo di analisi
void set_type(const char * tipo) {put(ABAN_TIPOAN,tipo);}
};
class TABsaldo: public TAlbero_AB
@ -468,25 +460,15 @@ class TABsaldo: public TAlbero_AB
TLocalisamfile *_saldi;
TAlbero_movdett *_mov;
TLocalisamfile *_movdett;
//TLocal_balance3 *_inter_tree;
protected:
// @cmember Esegue la scrittura del body del record scrive il contenuto di una tabella di analisi
//virtual int commit_body() const;
// @cmember Esegue la lettura del body del rocord: legge il contenuto di una tabella di analisi
virtual int read_body(bool lockstruct);
// @cmember Copia la chiave sul record dei nodi dell'albero
virtual void put_headkey(TRectype &rec) const;
// @cmember Naviga l'albero dei movimenti e dettagli
void naviga_movdett();
//Serve solo per il debug: lancia l'iserimento
//diretto e manuale di un nodo, testo la funzione di inserimento
void prova_inserimento();
public:
// @cmember Costruttore
TABsaldo();
// #cmember Distruttore
virtual bool remove_node(const TNumeric_id &id) {return FALSE;} //da fare
TABsaldo();
virtual ~ TABsaldo();
};
#endif //__ANALISI_H

View File

@ -3,7 +3,7 @@
#define _ANALISI_H
#define ABAN_CODAN "CODAN"
#define ABAN_DESCRIZ "DESCR"
#define ABAN_DESCRIZ "DESCRIZ"
#define ABAN_TIPOAN "TIPOAN"
#define ABAN_NOTE "NOTE"

View File

@ -3,5 +3,24 @@
#define _CARADD_H
#define ABCA_ID "ID"
#define ABCA_STD "STD"
#define ABCA_CLI "CLI"
#define ABCA_SPI "SPI"
#define ABCA_STI "STI"
#define ABCA_DST "DST"
#define ABCA_CLT "CLT"
#define ABCA_SPT "SPT"
#define ABCA_STT "STT"
#define ABCA_SVT "SVT"
#define ABCA_LST "LST"
#define ABCA_ODA "ODA"
#define ABCA_SKI "SKI"
#define ABCA_SKT "SKT"
#define ABCA_NDV "NDV"
#define ABCA_RII "RII"
#define ABCA_RIT "RIT"
#define ABCA_TVL "TVL"
#endif //_CARADD_H

View File

@ -24,5 +24,6 @@
#define ABMD_IDPREC "IDPREC"
#define ABMD_IDSUCC "IDSUCC"
#define ABMD_TIPO_TRACCIATO "ORD_FIELD"
#define ABMD_DESCRIZ "DESCRIZ"
#endif //_MOVDETT_H

View File

@ -5,6 +5,8 @@
#define ABRL_TIPOCOD "TIPOCOD"
#define ABRL_CODVC "CODVC"
#define ABRL_IDCOMP "IDCOMP"
#define ABRL_NEXTCOMP "NEXTCOMP"
#define ABRL_PREVCOMP "PREVCOMP"
#define ABRL_DESCR "DESCR"
#define ABRL_CODCOMP "COMP"
#define ABRL_NEXTCOMP "NEXTCOMP"