Correzione errori ricezione da sistema. Modifiche ricezione e invio, aggiunta ricezione in automatico.

git-svn-id: svn://10.65.10.50/trunk@2516 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1996-01-29 12:06:42 +00:00
parent a3f12ff8c0
commit bd2e5486f7
28 changed files with 11287 additions and 8309 deletions

View File

@ -9,6 +9,8 @@ int main(int argc,char** argv)
switch(n)
{
case 0:
cg6100(argc, argv); break;
case 2:
cg6300(argc, argv); break;
case 3:

View File

@ -1,6 +1,7 @@
#ifndef __CG6_H
#define __CG6_H
int cg6100(int argc, char* argv[]);
int cg6300(int argc, char* argv[]);
int cg6400(int argc, char* argv[]);
int cg6500(int argc, char* argv[]);

View File

@ -43,3 +43,12 @@ MENUBAR MENU_BAR(8)
MENU MENU_BAR(8)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(9)
MENU MENU_BAR(9)
SUBMENU MENU_FILE "~File"
MENUBAR MENU_BAR(10)
MENU MENU_BAR(10)
SUBMENU MENU_FILE "~File"

399
cg/cg6100.cpp Executable file
View File

@ -0,0 +1,399 @@
// Ricezione automatica
#include <applicat.h>
#include <mask.h>
#include <tabutil.h>
#include <utility.h>
#include <config.h>
#include <urldefid.h>
#include <prefix.h>
#include <execp.h>
#include <mailbox.h>
#include "cglib04.h"
class TRic_auto : public TApplication
{
TTransfer_file* _tras_file;
TString _control_rec, _sigle_file, _nrec_file;
TDate _dataultras;
int _nultras;
long _ditta;
char _trasfer;
char _tipo;
bool _cancella_header;
public:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
bool main_loop();
void stato_trasferimento(TString& std);
bool controlli_preliminari();
bool leggi_trasfer();
bool leggi_header();
bool set_flag();
TRic_auto(const char* ditta, char trasfer, char tipo);
};
HIDDEN TRic_auto& app() { return (TRic_auto &) main_app(); }
TRic_auto::TRic_auto(const char* ditta, char trasfer, char tipo) :
_ditta(atol(ditta)), _trasfer(trasfer), _tipo(tipo)
{}
void TRic_auto::stato_trasferimento(TString& std)
{
TConfig conf (CONFIG_DITTA); // Recupero stato trasferimento
std = conf.get("FlStTra"); // dai parametri ditta
}
bool TRic_auto::main_loop()
{
TString std = "";
if (!controlli_preliminari())
return FALSE;
set_flag();
stato_trasferimento(std);
if (std == "T")
{
TString appname = "cg6 -5 T A"; // Lancio il programma di ricezione delle tabelle
// con il parametro A perche' si tratta di ricezione
TExternal_app a (appname); // in automatico
a.run();
}
stato_trasferimento(std);
if (std == "C")
{
TString appname = "cg6 -6 A "; // Lancio il programma di lista controllo movimenti
appname << _tipo;
TExternal_app a (appname);
a.run();
TMailbox m;
TMessage* msg = m.next_s("");
int subj;
if (msg != NULL)
{
subj = atoi(msg->body());
TFilename dirtemp;
dirtemp.tempdir();
dirtemp << "cg6700.mbx";
fremove(dirtemp);
if (!subj)
return FALSE;
}
}
stato_trasferimento(std);
if (std == "M")
{
TString appname = "cg6 -5 M A"; // Lancio il programma di ricezione dei movimenti
// con il parametro A perche' si tratta di ricezione
TExternal_app a (appname); // in automatico
a.run();
}
stato_trasferimento(std);
if (std == "*")
{
_cancella_header = TRUE;
_tras_file->remove_all();
TString trasf;
trasf = _tras_file->path(_ditta);
trasf << "\\trasfer";
fremove(trasf);
TConfig conf (CONFIG_DITTA); // Inizializzo stato trasferimento
conf.set("FlStTra"," "); // dei parametri ditta
message_box("Il trasferimento e' stato INTERAMENTE COMPLETATO");
}
return FALSE;
}
bool TRic_auto::controlli_preliminari()
{
TString std = "";
if (!prefix().exist(_ditta)) // Controllo esistenza
return error_box("Rilevati ERRORI GRAVI nel trasferimento"); // direttorio della ditta
set_firm(_ditta);
stato_trasferimento(std);
if (std == "")
{
if (!leggi_trasfer()) // Controllo se esiste il file trasfer
return error_box("Il file di trasferimento non e' presente nella directory %s",_tras_file->path(_ditta));
TString appname = "cg6 -3 "; // Lancio il programma che trasferisce
appname << _trasfer << " A"; // i dati dal trasfer agli archivi temporanei
TExternal_app a (appname);
a.run();
}
if (!leggi_header()) // Controllo l'esistenza del record
return error_box("Rilevati ERRORI GRAVI nel trasferimento"); // di controllo nel file header
TString ult_file = _tras_file->ult_file();
TString key = _tras_file->key();
if ( (std != "*" && std != "") || (ult_file != "" || key != "") )
return error_box("Ultimo trasferimento NON COMPLETATO: completarlo");
if (std == "*")
{
_cancella_header = TRUE;
_tras_file->remove_all();
TString trasf;
trasf = _tras_file->path(_ditta);
trasf << "\\trasfer";
fremove(trasf);
TConfig conf (CONFIG_DITTA); // Inizializzo stato trasferimento
conf.set("FlStTra"," "); // dei parametri ditta
}
return TRUE;
}
bool TRic_auto::leggi_trasfer()
{
TString80 trasf;
trasf = _tras_file->path(_ditta);
trasf << "\\trasfer";
_tras_file->open(trasf);
if (_tras_file->exist())
return TRUE;
return FALSE;
}
bool TRic_auto::leggi_header()
{
TString header;
header = _tras_file->path(_ditta);
header << HEADER;
_tras_file->open(header);
if (_tras_file->exist())
{
if (_tras_file->read_control_rec())
{
_control_rec = _tras_file->record();
TString tiporecord = _control_rec.sub(0,2);
if (tiporecord != " 1")
return FALSE;
}
else
return FALSE;
}
else
return FALSE;
_tras_file->close();
return TRUE;
}
bool TRic_auto::set_flag()
{
TString sigla;
long nrec;
int j;
int k = 0;
TString flag;
TString record;
TString ana_com,pcon_cau;
TString uselab;
bool fatto = TRUE;
TConfig conf(CONFIG_DITTA);
ana_com = conf.get("AnCfCm","cg");
pcon_cau = conf.get("PcTcCm","cg");
TString header;
header = _tras_file->path(_ditta);
header << HEADER;
_tras_file->open(header);
if (_tras_file->exist())
{
if (_tras_file->read_control_rec())
{
_nultras = _tras_file->nultras();
_dataultras = _tras_file->dataultras();
_sigle_file = _tras_file->sigle_file();
_nrec_file = _tras_file->nrec_file();
record = _tras_file->record();
}
for (j = 0; j < _sigle_file.len(); j++)
{
sigla = _sigle_file.mid(j,1);
nrec = atol(_nrec_file.mid(k,6));
if (fatto)
{
if (sigla == "W" || sigla == "P")
{
if (nrec > 0 && pcon_cau == "")
{
flag = "T";
fatto = FALSE;
}
}
else
if (sigla == "A")
{
if (nrec > 0 && ana_com == "")
{
flag = "T";
fatto = FALSE;
}
}
else
if (sigla == "Z" || sigla == "U" || sigla == "B")
{
if (nrec > 0)
{
flag = "C";
fatto = FALSE;
}
}
else
{
flag = "*";
fatto = FALSE;
}
if (flag == "T")
uselab = sigla;
else
uselab = "";
}
if (sigla == "W" || sigla == "P")
{
if (pcon_cau == "X")
{
_sigle_file.overwrite(" ",j);
_nrec_file.overwrite("000000",k);
}
}
if (sigla == "A")
{
if (ana_com == "X")
{
_sigle_file.overwrite(" ",j);
_nrec_file.overwrite("000000",k);
}
}
k += 6;
}
record.overwrite(_sigle_file,86);
record.overwrite(_nrec_file,95);
TString agg(7);
agg[0] = ' ';
agg[1] = 'D';
agg[2] = 'D';
agg[3] = 'D';
agg[4] = ' ';
agg[5] = ' ';
agg[6] = '\0';
record.overwrite(agg,234);
record.overwrite(uselab,240);
TString str;
str.spaces(60);
record.overwrite(str,241);
const int size = 1024;
if (!_tras_file->write_control_rec(record, size))
return FALSE;
_tras_file->close();
}
conf.set("FlStTra", flag);
return TRUE;
}
bool TRic_auto::create()
{
TApplication::create();
_cancella_header = FALSE;
_tras_file = new TTransfer_file(_trasfer);
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
}
bool TRic_auto::destroy()
{
delete _tras_file;
if (_cancella_header)
{
TString header;
header = _tras_file->path(_ditta);
header << HEADER;
fremove(header);
}
return TApplication::destroy();
}
bool TRic_auto::menu(MENU_TAG m)
{
if (m == BAR_ITEM(1))
return main_loop();
return FALSE;
}
int cg6100 (int argc, char* argv[])
{
char p4 = '\0';
if (argc > 5)
p4 = *argv[4];
TRic_auto main_app(argv[2],*argv[3],p4);
main_app.run(argc, argv,"Ricezione automatica");
return TRUE;
}

View File

@ -38,7 +38,7 @@ class TRic_archivi : public TApplication
TString80 TEMP;
char _scelta;
char _scelta, _ric_auto;
int _numtotdisk,_progdisk,_numdisk,_numinv,_numinvp,_nultras;
int _stato_ripartenza,_nultras_tab;
@ -73,12 +73,13 @@ public:
static bool baipassa(TMask& m,KEY k);
TRic_archivi(char ric_trasfer);
TRic_archivi(char ric_trasfer,char ric_auto = '\0');
};
HIDDEN TRic_archivi& app() { return (TRic_archivi &) main_app(); }
TRic_archivi::TRic_archivi(char ric_trasfer) : _scelta(toupper(ric_trasfer))
TRic_archivi::TRic_archivi(char ric_trasfer,char ric_auto) :
_scelta(toupper(ric_trasfer)), _ric_auto(toupper(ric_auto))
{
if (_scelta == 'S')
_titolo = "Ricezione archivi da sistema";
@ -92,7 +93,7 @@ bool TRic_archivi::create()
TApplication::create();
_tab_tra = new TTable ("%TRA");
_tras_file = new TTransfer_file();
_tras_file = new TTransfer_file(_scelta);
_caus = new TLocalisamfile (LF_CAUSALI);
_rcaus = new TLocalisamfile (LF_RCAUSALI);
@ -135,8 +136,6 @@ bool TRic_archivi::destroy()
void TRic_archivi::componi_path(TMask& msk)
{
if (_scelta == 'S')
{
TString path,drive;
int pos;
@ -166,16 +165,6 @@ void TRic_archivi::componi_path(TMask& msk)
if (!_disketto)
_pathname << drive << "\\";
}
}
else
if (_scelta == 'P')
{
char drive;
drive = msk.get(F_DRIVE)[0];
_marker << drive << ":\\marker";
}
}
bool TRic_archivi::leggi_marker()
@ -259,7 +248,12 @@ bool TRic_archivi::leggi_marker_rep()
TString16 tmp;
if (!fexist(_marker))
{
if (_disketto)
return error_box("File marker non presente sul dischetto %d: impossibile proseguire", _numdisk);
else
return error_box("File marker non presente in %s: impossibile proseguire", (const char*)_pathname);
}
FILE* i;
@ -270,16 +264,40 @@ bool TRic_archivi::leggi_marker_rep()
{
const word letti = fread((char*)(const char*)buffer,sizeof(char),size,i);
_progdisk = atoi(buffer.sub(34,36));
_numtotdisk = atoi(buffer.sub(32,34));
if (_progdisk != _numdisk)
{
message_box("Il dischetto inserito non rispecchia la giusta sequenza");
_sequenza = FALSE;
fclose(i);
return TRUE;
}
else
_sequenza = TRUE;
if (letti == 0)
return error_box("Rilevati ERRORI nel file MARKER: impossibile proseguire");
_nomeid = buffer.sub(0,10);
_dittainv = atol(buffer.sub(10,15));
_totrectras = atol(buffer.sub(24,30));
_totrectras = atol(buffer.sub(26,32));
_numinv = atoi(buffer.sub(15,18));
tmp = buffer.sub(18,24);
tmp = buffer.sub(18,26);
_datatras = converti(tmp,TRUE);
if (_numdisk > 1) //Va fatto solo dal disco 2 in poi
if (_nomeid != _nomeidp || _dittainv != _dittainvp || _totrectras != _totrectrasp
|| _numinv != _numinvp || _datatras != _datatrasp)
return error_box("I dati del marker del disco %d, non corrispondono ai dati del marker del disco 1", _numdisk);
_nomeidp = _nomeid;
_dittainvp = _dittainv;
_totrectrasp = _totrectras;
_numinvp = _numinv;
_datatrasp = _datatras;
fclose(i);
if (_numdisk == 1) // Va fatto solo per il primo disco
@ -303,6 +321,36 @@ bool TRic_archivi::leggi_marker_rep()
bool TRic_archivi::main_loop()
{
if (_ric_auto == 'A')
{
_dittaric = get_firm();
_trasf = _tras_file->path(_dittaric);
_trasf << "\\trasfer";
_tras_file->open(_trasf);
if (_scelta == 'S')
{
trasfer2tempfile();
_tras_file->close(); // Chiude il trasfer letto dalla directory della ditta
fremove(_trasf);
TString80 tab = _tras_file->path(_dittaric);
TString tabcdx = tab;
TString tabdbf = tab;
tabcdx << "\\ttab.cdx";
tabdbf << "\\ttab.dbf";
fremove(tabcdx);
fremove(tabdbf);
}
else
if (_scelta == 'P')
{
trasfer2tempfile();
_tras_file->close(); // Chiude il trasfer letto dalla directory della ditta
fremove(_trasf);
}
}
else
{
if (_scelta == 'S')
{
TMask msk ("cg6400b");
@ -374,7 +422,7 @@ bool TRic_archivi::main_loop()
else
if (_scelta == 'P')
{
TMask msk ("cg6400c");
TMask msk ("cg6400b");
KEY tasto;
tasto = msk.run();
@ -383,43 +431,56 @@ bool TRic_archivi::main_loop()
{
componi_path(msk);
do
{
if (_disketto)
{
char drive = msk.get(F_DRIVE)[0];
if (yesno_box("Inserire il dischetto %d nell' unita' %c", _numdisk,drive))
{
if (!leggi_marker_rep())
return FALSE;
if (video_ripartenza())
if (_sequenza)
{
char floppy = msk.get(F_DRIVE)[0];
bool temp = FALSE;
if (video_ripartenza())
ripristina_trasfer();
else
return FALSE;
TFilename firm;
firm.tempdir();
firm << "\\ftemp";
set_firm(_dittaric);
TString dir = _tras_file->path(_dittaric);
_arc.restore(firm, floppy, temp);
TString head = firm;
head << "\\header";
_tras_file->open(head);
_tras_file->read_control_rec();
TString sigle = _tras_file->sigle_file();
sigle.trim();
_tras_file->close();
_tras_file->temp_dir(firm,dir,sigle); //Copio i file dalla directory temporanea ftemp alla directory della ditta
_tras_file->canc_file_dir_temp(firm); //Cancello i file nella directory temporanea ftemp
_numdisk++;
}
}
else
return FALSE;
}
else
{
if (!leggi_marker_rep())
return FALSE;
_trasfhard = _tras_file->path(_dittaric);
_trasfhard << HEADER;
if (_sequenza)
{
if (video_ripartenza())
ripristina_trasfer();
else
return FALSE;
_numdisk++;
}
else
return FALSE;
}
}
while (_numdisk <= _numtotdisk);
trasfer2tempfile();
set_flag();
aggiorna_tabella();
_tras_file->close(); // Chiude il trasfer letto dalla directory della ditta
fremove(_trasf);
}
}
}
return FALSE;
@ -435,6 +496,8 @@ void TRic_archivi::leggi_trasfer(const char* nome)
_tras_file->open(_trasf);
if (_tras_file->exist())
{
if (_scelta == 'S')
{
if (_tras_file->read_control_rec_t())
{
@ -442,6 +505,16 @@ void TRic_archivi::leggi_trasfer(const char* nome)
_dataultras = _tras_file->dataultras();
}
}
else
if (_scelta == 'P')
{
if (_tras_file->read_control_rec())
{
_nultras = _tras_file->nultras();
_dataultras = _tras_file->dataultras();
}
}
}
}
// Questa funzione ritorna:
@ -601,7 +674,11 @@ void TRic_archivi::trasfer2tempfile()
_trasfhard = _tras_file->path(_dittaric);
_trasfhard << HEADER;
if (_scelta == 'S')
_tras_file->fcopytemp(_trasf,_trasfhard);
else
if (_scelta == 'P')
_tras_file->fcopytemp_PC(_trasf,_trasfhard);
}
void TRic_archivi::ditta_ricevente()
@ -744,8 +821,8 @@ bool TRic_archivi::set_flag()
k += 6;
}
record.overwrite(_sigle_file,41);
record.overwrite(_nrec_file,50);
record.overwrite(_sigle_file,86);
record.overwrite(_nrec_file,95);
TString agg(7);
@ -759,9 +836,11 @@ bool TRic_archivi::set_flag()
record.overwrite(agg,234);
record.overwrite(uselab,240);
record.overwrite(" ",241);
TString str;
str.spaces(60);
record.overwrite(str,241);
const int size = 256;
const int size = 1024;
if (!_tras_file->write_control_rec(record, size))
return FALSE;
@ -796,7 +875,12 @@ bool TRic_archivi::menu(MENU_TAG m)
int cg6400 (int argc, char* argv[])
{
TRic_archivi main_app(*argv[2]);
char p3 = '\0';
if (argc > 4)
p3 = *argv[3];
TRic_archivi main_app(*argv[2],p3);
main_app.run(argc, argv,main_app._titolo);
return TRUE;

View File

@ -665,14 +665,14 @@ int Tabinv_application::write(const TMask& m)
{
_control_rec = _tras_file.record();
str = format("%03d", num);
_control_rec.overwrite(str,30);
_control_rec.overwrite(str,75);
str = riconverti(data,TRUE);
_control_rec.overwrite(str,33);
_control_rec.overwrite(str,78);
_control_rec.overwrite(sigla,240);
str = format("%-15s", (const char*) chiave);
str = format("%-60s", (const char*) chiave);
_control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,256);
_tras_file.write_control_rec(_control_rec,1024);
}
}
}
@ -708,14 +708,14 @@ int Tabinv_application::rewrite(const TMask& m)
{
_control_rec = _tras_file.record();
str = format("%03d", num);
_control_rec.overwrite(str,30);
_control_rec.overwrite(str,75);
str = riconverti(data,TRUE);
_control_rec.overwrite(str,33);
_control_rec.overwrite(str,78);
_control_rec.overwrite(sigla,240);
str = format("%-15s", (const char*) chiave);
str = format("%-60s", (const char*) chiave);
_control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,256);
_tras_file.write_control_rec(_control_rec,1024);
}
}
}

View File

@ -39,7 +39,7 @@ class TRic_tab : public TApplication
TTable* _reg;
TTransfer_file _tras_file;
TArray _aggiorna;
char _scelta;
char _scelta, _ric_auto;
TSaldo_agg _sld;
TProgind* _prog;
@ -97,12 +97,13 @@ public:
bool occasionali(const TString& ocfpi);
TRic_tab(char ric_tab_mov);
TRic_tab(char ric_tab_mov, char ric_auto = '\0');
};
HIDDEN TRic_tab& app() { return (TRic_tab &) main_app(); }
TRic_tab::TRic_tab(char ric_tab_mov) : _scelta(toupper(ric_tab_mov))
TRic_tab::TRic_tab(char ric_tab_mov, char ric_auto) :
_scelta(toupper(ric_tab_mov)), _ric_auto(toupper(ric_auto))
{
if (_scelta == 'T')
_titolo = "Ricezione tabelle";
@ -184,6 +185,51 @@ bool TRic_tab::main_loop()
_dittaric = get_firm();
if (_ric_auto == 'A')
{
leggi_trasfer();
if (_scelta == 'T')
{
apri_file_temp();
trasferimento();
posiz = _tras_file.num('Z'); //Ritorna la posizione della sigla all'interno dell'indice
if (posiz >= 0)
{
setta_parametri_record(" ","C");
//message_box("Aggiornamento tabelle terminato: proseguire con controllo movimenti");
leggi_record_controllo();
TString str;
str.spaces(60);
_record.overwrite(str,241);
_tras_file.write_control_rec(_record,1024);
}
else
{
chiudi_file_temp();
//message_box("Trasferimento interamente completato: proseguire per cancellare il file");
setta_parametri_record(" ","*");
//_tras_file.remove_all();
//setta_parametri_record(" "," ");
}
}
else
if (_scelta == 'M')
{
apri_file_temp();
trasferimento();
chiudi_file_temp();
//message_box("Trasferimento interamente completato: proseguire per cancellare il file");
setta_parametri_record(" ","*");
//_tras_file.remove_all();
//setta_parametri_record(" "," ");
}
}
else
{
if (_scelta == 'T')
{
if (video())
@ -202,8 +248,10 @@ bool TRic_tab::main_loop()
setta_parametri_record(" ","C");
message_box("Aggiornamento tabelle terminato: proseguire con controllo movimenti");
leggi_record_controllo();
TString str (_record.overwrite(" ",241));
_tras_file.write_control_rec(str,256);
TString str;
str.spaces(60);
_record.overwrite(str,241);
_tras_file.write_control_rec(_record,1024);
}
else
{
@ -230,6 +278,7 @@ bool TRic_tab::main_loop()
setta_parametri_record(" "," ");
}
}
}
return FALSE;
}
@ -348,7 +397,7 @@ void TRic_tab::ricevi_causali(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
continue;
}
else
@ -384,7 +433,7 @@ void TRic_tab::ricevi_causali(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -427,7 +476,7 @@ void TRic_tab::scrivi_righe_causali(TString& codcaus, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -470,7 +519,7 @@ void TRic_tab::ricevi_clifo(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
continue;
}
else
@ -519,7 +568,7 @@ void TRic_tab::ricevi_clifo(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -569,11 +618,11 @@ void TRic_tab::ricevi_pcon(TString& key, char uselab)
{
leggi_record_controllo();
TString chiave;
chiave.format("%3d%3d%6ld", g, c, s);
chiave.format("%03d%03d%06ld", g, c, s);
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
continue;
}
else
@ -619,11 +668,11 @@ void TRic_tab::ricevi_pcon(TString& key, char uselab)
leggi_record_controllo();
TString chiave;
chiave.format("%3d%3d%6ld", g, c, s);
chiave.format("%03d%03d%06ld", g, c, s);
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -835,7 +884,7 @@ void TRic_tab::aggiorna_reg(int anno,TString& codreg,long ulnum)
long TRic_tab::controlli_primanota()
{
TTable tpd ("%TPD");
bool corrisp;
bool corrisp = FALSE;
TDate datareg;
int anno;
long ulnum = 0;
@ -1013,7 +1062,7 @@ void TRic_tab::ricevi_movPN(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -1159,7 +1208,7 @@ void TRic_tab::ricevi_movIVA(TString& key, char uselab)
TString sigla (format("%c", uselab));
str = _record.overwrite(sigla,240);
str = _record.overwrite(chiave,241);
_tras_file.write_control_rec(str,256);
_tras_file.write_control_rec(str,1024);
}
}
@ -1239,7 +1288,7 @@ void TRic_tab::setta_parametri_record(const TString& sigla,const TString& flag)
leggi_record_controllo();
_record.overwrite(sigla,240);
const int size = 256;
const int size = 1024;
_tras_file.write_control_rec(_record, size);
}
@ -1438,7 +1487,12 @@ bool TRic_tab::menu(MENU_TAG m)
int cg6600 (int argc, char* argv[])
{
TRic_tab main_app(*argv[2]);
char p3 = '\0';
if (argc > 4)
p3 = *argv[3];
TRic_tab main_app(*argv[2],p3);
main_app.run(argc, argv,main_app._titolo);
return TRUE;
}

View File

@ -1,6 +1,6 @@
#include "cg6600.h"
PAGE "" -1 -1 70 11
PAGE "" -1 -1 78 13
NUMBER F_CODDITTA 5
BEGIN
@ -24,27 +24,32 @@ BEGIN
FLAGS "D"
END
TEXT DLG_NULL
BEGIN
PROMPT 1 5 "Data del"
END
DATE F_DATAULTRAS
BEGIN
PROMPT 1 5 "Data limite trasferimento "
PROMPT 1 6 "trasferimento "
FLAGS "D"
END
STRING F_STD 1
BEGIN
PROMPT 1 6 "Stato del trasferimento "
PROMPT 1 7 "Stato del "
FLAGS "DU"
END
STRING F_USELAB 1
BEGIN
PROMPT 31 6 ""
PROMPT 22 7 ""
FLAGS "DU"
END
STRING F_STATO 15
STRING F_STATO 60
BEGIN
PROMPT 35 6 ""
PROMPT 1 8 "trasferimento "
FLAGS "DU"
END

View File

@ -9,6 +9,7 @@
#include <progind.h>
#include <tabutil.h>
#include <utility.h>
#include <mailbox.h>
#include <nditte.h>
#include <mov.h>
@ -46,18 +47,20 @@ class TRic_ListaMov : public TPrintapp
TCursor* _cur;
TTransfer_file* _trasfer;
TLibro_giornale* _giornale;
char _ric_auto,_tipo_lista;
TString80 _pathfile, _descr_causale, _descr_conto;
TString16 _causale, _registro, _numdoc, _tipodoc, _codval;
TString16 _codpag, _codiva, _tipo_conto;
TString _record;
bool _mov_sez, _errore_grave, _esiste_conto, _is_exist;
bool _mov_sez, _errore_grave, _esiste_conto, _is_exist, _risposta, _continua;
char _sdt, _sezione, _tipocf;
int _ae, _anno, _gruppo, _conto, _tipocr, _tipod, _tiporeg;
int _gruppoc, _contoc, _n_rec, _gruppocr, _contocr;
int _gruppoc, _contoc, _gruppocr, _contocr, _annoiva;
TDate _datacomp, _datadoc, _datareg, _data74tr;
real _importo, _impo, _impos, _tot_dare, _tot_avere, _tot_doc;
long _codcf, _numero, _protiva, _sottoconto;
long _num_rec, _sottocontoc, _sottocontocr;
long _sottocontoc, _sottocontocr;
TBit_array _err;
byte _controllo;
@ -89,12 +92,16 @@ public:
TLibro_giornale& giornale() { return *_giornale; }
TTransfer_file& trasfer() { return *_trasfer; }
TRic_ListaMov(): _err(80) {}
TRic_ListaMov(char ric_auto = '\0',char tipo_lista = '\0');
virtual ~TRic_ListaMov() {}
};
HIDDEN inline TRic_ListaMov& app() { return (TRic_ListaMov&)main_app();}
TRic_ListaMov::TRic_ListaMov(char ric_auto,char tipo_lista):
_ric_auto(toupper(ric_auto)), _tipo_lista(toupper(tipo_lista)), _err(80)
{}
const char* TRic_ListaMov::look_sdt()
{
TConfig conf(CONFIG_DITTA);
@ -190,9 +197,6 @@ bool TRic_ListaMov::user_create()
{
_trasfer = new TTransfer_file();
TProgind* pnd = NULL;
pnd = new TProgind (3,"Controllo archivi\nPrego attendere",
FALSE, TRUE, 30);
_tab_tra = new TTable ("%TRA");
_tab_tpd = new TTable ("%TPD");
_tab_pag = new TTable ("%CPG");
@ -206,6 +210,11 @@ bool TRic_ListaMov::user_create()
_rmov = new TLocalisamfile (LF_RMOV);
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
if (_ric_auto != 'A')
{
TProgind* pnd = NULL;
pnd = new TProgind (3,"Controllo archivi\nPrego attendere",FALSE, TRUE, 30);
if (pnd) pnd->addstatus(1);
if (!check_archivi(pnd))
@ -216,6 +225,9 @@ bool TRic_ListaMov::user_create()
if (pnd) pnd->addstatus(1);
delete pnd;
}
TString80 tmpmov = "%";
tmpmov << get_firm_dir();
tmpmov << "\\" << TEMP_MOV;
@ -255,7 +267,8 @@ bool TRic_ListaMov::user_create()
printer().footerlen(5);
delete pnd;
_risposta = FALSE;
_continua = TRUE;
return TRUE;
}
@ -624,7 +637,7 @@ bool TRic_ListaMov::controlla_rmov()
_descr_conto = "";
}
_num_rec = rec.get_long(RMV_ANNOES);
//_num_rec = rec.get_long(RMV_ANNOES);
if (sezione == 'D')
dare += importo;
@ -741,7 +754,7 @@ bool TRic_ListaMov::controlla_riva()
{
TRectype rec (rmoviva.curr());
if (rec > recc) break;
_n_rec = rec.get_int(RMI_ANNOES);
//_n_rec = rec.get_int(RMI_ANNOES);
codiva = rec.get(RMI_CODIVA);
tipodet = rec.get_int(RMI_TIPODET);
tipocr = rec.get_int(RMI_TIPOCR);
@ -925,6 +938,7 @@ bool TRic_ListaMov::preprocess_page(int file,int counter)
_protiva = cur->curr(LF_MOV).get_long(MOV_PROTIVA);
_codval = cur->curr(LF_MOV).get(MOV_CODVALI);
_codpag = cur->curr(LF_MOV).get(MOV_CODPAG);
_annoiva = _datareg.year();
_tot_dare = _tot_avere = ZERO;
_tot_doc = ZERO;
@ -1087,22 +1101,45 @@ void TRic_ListaMov::postclose_print()
{
if (_errore_grave)
{
message_box("Rilevati errori gravi durante il controllo movimenti: \n trasferimento interrotto");
if (_ric_auto == 'A')
{
_risposta = TRUE;
_continua = yesno_box("Rilevati ERRORI GRAVI durante il controllo movimenti: \n Controllare gli errori sulla lista dei movimenti stampata per eseguire le correzioni. \n Continuare ugualmente?");
TTransfer_file& tr = trasfer();
if (!_continua)
_record.overwrite(" ",240); //_record e' letto nella read_control_rec()
const int size = 256;
else
{
TConfig conf (CONFIG_DITTA);
conf.set("FlStTra", "M");
_record.overwrite("Z",240);
}
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
}
else
{
message_box("CONTROLLO MOVIMENTI terminato: \n proseguire con AGGIORNAMENTO movimenti");
message_box("Rilevati errori gravi durante il controllo movimenti: \n trasferimento interrotto");
TTransfer_file& tr = trasfer();
_record.overwrite(" ",240); //_record e' letto nella read_control_rec()
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
}
}
else
{
if (_ric_auto == 'A')
_risposta = TRUE;
else
message_box("CONTROLLO MOVIMENTI terminato: \n proseguire con RICEZIONE movimenti");
TConfig conf (CONFIG_DITTA);
conf.set("FlStTra", "M");
TTransfer_file& tr = trasfer();
_record.overwrite("Z",240); //_record e' letto nella read_control_rec()
const int size = 256;
const int size = 1024;
tr.write_control_rec(_record, size);
tr.read_control_rec();
}
@ -1113,6 +1150,7 @@ void TRic_ListaMov::aggiorna_mov()
TLocalisamfile& mov = current_cursor()->file(LF_MOV);
mov.put(MOV_DATACOMP, _datacomp);
mov.put(MOV_ANNOIVA, _annoiva);
mov.put(MOV_REG, _registro);
mov.put(MOV_TIPODOC, _tipodoc);
mov.put(MOV_TIPO, _tipocf);
@ -1172,6 +1210,56 @@ bool TRic_ListaMov::user_destroy()
bool TRic_ListaMov::set_print(int m)
{
if (_ric_auto == 'A')
{
if (_risposta) // Metto questa variabile booleana per uscire, altrimenti
{ // il programma andrebbe in loop andando ancora in stampa
TString appname = "cg6 -0";
TString body = "";
if (_continua)
body = "1";
else
body = "0";
TMessage msg (appname,"",(const char*)body);
TMailbox mb;
mb.send(msg);
return FALSE;
}
TString80 nome;
long ditta_ric = get_firm();
TTransfer_file& tr = trasfer(); // Nella lista controllo movimenti lanciata da menu il record di
// controllo dell'header viene letto nella funzione check_archivi
// Nella ricezione in automatico devo leggerlo in questo punto
_pathfile = tr.path();
_pathfile = _pathfile << HEADER;
if (!tr.open(_pathfile))
return error_box("Al momento non presenti trasferimenti attivi sulla ditta selezionata");
if (!tr.read_control_rec())
return error_box("Rilevati errori gravi negli archivi: procedura interrotta");
else _record = tr.record();
if (_tipo_lista == 'A')
_controllo = 2;
else
_controllo = 1;
set_real_picture("###.###.###.###");
printer().footerlen(5);
_errore_grave = FALSE;
_err.reset();
}
else
{
TMask msk ("cg6700a");
TTransfer_file& tr = trasfer();
@ -1199,6 +1287,7 @@ bool TRic_ListaMov::set_print(int m)
_errore_grave = FALSE;
_err.reset();
}
return TRUE;
}
@ -1246,13 +1335,21 @@ void TRic_ListaMov::setta_parametri(const TString& sigla, const TString& flag)
TString rec = tr.record();
rec.overwrite(sigla,240);
const int size = 256;
const int size = 1024;
tr.write_control_rec(rec, size);
}
int cg6700 (int argc, char* argv[])
{
TRic_ListaMov a;
char p1 = '\0';
char p2 = '\0';
if (argc >= 4)
p1 = *argv[2];
if (argc >= 5)
p2 = *argv[3];
TRic_ListaMov a(p1,p2);
a.run(argc, argv,"Lista controllo movimenti");
return TRUE;
}

View File

@ -33,32 +33,37 @@ BEGIN
FLAGS "D"
END
DATE F_DATALIMITE
BEGIN
PROMPT 2 10 "Data limite trasferimento "
FLAGS "D"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 11 "Stato ricezione "
PROMPT 2 10 "Data limite"
END
DATE F_DATALIMITE
BEGIN
PROMPT 2 11 "trasferimento "
FLAGS "D"
END
STRING F_SDT 1
BEGIN
PROMPT 31 11 ""
PROMPT 2 12 "Stato della "
FLAGS "DU"
END
STRING F_SIGLA 1
BEGIN
PROMPT 34 11 ""
PROMPT 21 12 ""
FLAGS "DU"
END
STRING F_CHIAVE 15
TEXT DLG_NULL
BEGIN
PROMPT 37 11 ""
PROMPT 2 13 "ricezione "
END
STRING F_CHIAVE 60
BEGIN
PROMPT 17 13 ""
FLAGS "DU"
END

View File

@ -238,8 +238,10 @@ bool TVar_mov::main_loop()
{
setta_parametri_record(" ","C");
leggi_record_controllo();
TString str (_control_rec.overwrite(" ",241));
_tras_file.write_control_rec(str,256);
TString str;
str.spaces(60);
_control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,1024);
}
return FALSE;
}
@ -253,8 +255,10 @@ bool TVar_mov::main_loop()
{
setta_parametri_record(" ","C");
leggi_record_controllo();
TString str (_control_rec.overwrite(" ",241));
_tras_file.write_control_rec(str,256);
TString str;
str.spaces(60);
_control_rec.overwrite(str,241);
_tras_file.write_control_rec(_control_rec,1024);
}
return FALSE;
}
@ -285,7 +289,7 @@ bool TVar_mov::video_PN()
mask.set_handler(F_CODPAG, codice_pagamento_hnd);
mask.set_handler(F_DATAREG, data_stampa);
mask.set_handler(F_DATACOMP, data_competenza_hnd);
mask.set_handler(F_DATADOC, data);
//mask.set_handler(F_DATADOC, data);
if (_righe)
{
@ -363,7 +367,7 @@ bool TVar_mov::video_IVA()
return FALSE;
mask.set_handler(F_CODCF, codice_clifo_hnd);
mask.set_handler(F_DATA74TER, data);
//mask.set_handler(F_DATA74TER, data);
mask.set_handler(F_LOCALITA, localita_occasionali);
mask.set_handler(F_CAPOCC, cap_occasionali);
@ -1277,6 +1281,7 @@ void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate
_tmov->put(MOV_NUMREG, nr);
if (_tmov->read() == NOERR)
{
_tmov->put(MOV_NUMREG, nr);
_tmov->put(MOV_ANNOES, ae);
_tmov->put(MOV_DATAREG, dr);
_tmov->put(MOV_DATACOMP, dc);
@ -1287,6 +1292,8 @@ void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate
_tmov->put(MOV_UPROTIVA, upi);
_tmov->put(MOV_CODCAUS, cc);
_tmov->put(MOV_CODPAG, cp);
int ai = dr.year();
_tmov->put(MOV_ANNOIVA, ai);
_tmov->rewrite();
}
@ -1548,7 +1555,7 @@ void TVar_mov::setta_parametri_record(const TString& sigla,const TString& flag)
leggi_record_controllo();
_control_rec.overwrite(sigla,240);
const int size = 256;
const int size = 1024;
_tras_file.write_control_rec(_control_rec, size);
}

View File

@ -139,9 +139,9 @@ bool TDitta_ric::controlli()
}
}
_control_rec.overwrite(_sigle_file,41);
_control_rec.overwrite(_nrec_file,50);
_tras_file.write_control_rec(_control_rec,256);
_control_rec.overwrite(_sigle_file,86);
_control_rec.overwrite(_nrec_file,95);
_tras_file.write_control_rec(_control_rec,1024);
leggi_record_controllo();
}
@ -160,7 +160,9 @@ bool TDitta_ric::controlli()
{
uselab = sigla;
_control_rec.overwrite(uselab,240);
_control_rec.overwrite(" ",241);
TString str;
str.spaces(60);
_control_rec.overwrite(str,241);
fatto = TRUE;
break;
}
@ -175,13 +177,17 @@ bool TDitta_ric::controlli()
{
setta_parametri_record("","C",FALSE);
_control_rec.overwrite(" ",240);
_control_rec.overwrite(" ",241);
TString str;
str.spaces(60);
_control_rec.overwrite(str,241);
}
else
{
setta_parametri_record("","*",FALSE);
_control_rec.overwrite(" ",240);
_control_rec.overwrite(" ",241);
TString str;
str.spaces(60);
_control_rec.overwrite(str,241);
fremove(_trasf);
setta_parametri_record(""," ",FALSE);
}
@ -207,7 +213,7 @@ bool TDitta_ric::controlli()
_control_rec.overwrite(agg,235);
const int size = 256;
const int size = 1024;
if (!_tras_file.write_control_rec(_control_rec, size))
return FALSE;
@ -232,7 +238,7 @@ void TDitta_ric::setta_parametri_record(const TString& sigla,const TString& flag
leggi_record_controllo();
_control_rec.overwrite(sigla,240);
const int size = 256;
const int size = 1024;
_tras_file.write_control_rec(_control_rec, size);
}

View File

@ -130,7 +130,7 @@ bool TAnn_mov::video()
case K_QUIT :
break;
case K_SAVE :
case K_DEL :
{
annulla(mask);
_registra = TRUE;
@ -367,7 +367,7 @@ void TAnn_mov::setta_parametri_record(const TString& sigla,const TString& flag)
leggi_record_controllo();
_control_rec.overwrite(sigla,240);
const int size = 256;
const int size = 1024;
_tras_file.write_control_rec(_control_rec, size);
}

View File

@ -2,10 +2,10 @@
TOOLBAR "" 0 20 0 2
BUTTON DLG_SAVEREC 10 2
BUTTON DLG_DELREC 8 2
BEGIN
PROMPT -15 -1 "~Annulla"
MESSAGE EXIT,K_SAVE
PROMPT -15 -1 "~Elimina"
MESSAGE EXIT,K_DEL
END
BUTTON DLG_CANCEL 10 2

View File

@ -208,15 +208,16 @@ void TVis_ric::registra(TMask& m)
uselab = " ";
str = m.get(F_STATO);
TString chiave = format("%-15s", (const char*) str);
TString chiave = format("%-60s", (const char*) str);
_control_rec.overwrite(nultras,30);
_control_rec.overwrite(datault,33);
_control_rec.overwrite(nultras,75);
_control_rec.overwrite(datault,78);
_control_rec.overwrite(flags,234);
_control_rec.overwrite(uselab,240);
_control_rec.overwrite(chiave,241);
//_control_rec.format("%-1024s", (const char*) _control_rec);
const int size = 256;
const int size = 1024;
_tras_file.write_control_rec(_control_rec, size);

View File

@ -32,25 +32,30 @@ END
STRING F_STD 1
BEGIN
PROMPT 1 8 "Stato del trasferimento "
PROMPT 1 8 "Stato del "
FLAGS "GU"
END
STRING F_USELAB 1
BEGIN
PROMPT 34 8 ""
PROMPT 21 8 ""
FLAGS "GU"
END
STRING F_STATO 15
TEXT DLG_NULL
BEGIN
PROMPT 38 8 ""
PROMPT 1 9 "trasferimento "
END
STRING F_STATO 60
BEGIN
PROMPT 17 9 ""
FLAGS "GU"
END
LIST F_AGGCAUSALI 6
BEGIN
PROMPT 1 10 "Aggiornamento causali gia' presenti "
PROMPT 1 11 "Aggiornamento causali gia' presenti "
ITEM "N|No"
ITEM "D|Descr."
ITEM "T|Tutto"
@ -59,7 +64,7 @@ END
LIST F_AGGCLIFO 6
BEGIN
PROMPT 1 11 "Aggiornamento Clienti/Fornitori gia' presenti "
PROMPT 1 12 "Aggiornamento Clienti/Fornitori gia' presenti "
ITEM "N|No"
ITEM "D|Descr."
ITEM "T|Tutto"
@ -68,7 +73,7 @@ END
LIST F_AGGPCON 6
BEGIN
PROMPT 1 12 "Aggiornamento voci Piano dei Conti gia' presenti "
PROMPT 1 13 "Aggiornamento voci Piano dei Conti gia' presenti "
ITEM "N|No"
ITEM "D|Descr."
ITEM "T|Tutto"
@ -77,7 +82,7 @@ END
LIST F_AGGIVD 6
BEGIN
PROMPT 1 13 "Aggiornamento classi Piano dei Conti "
PROMPT 1 14 "Aggiornamento classi Piano dei Conti "
ITEM "N|No"
ITEM "T|Tutto"
FLAGS "G"
@ -85,13 +90,13 @@ END
BOOLEAN F_FATTEM
BEGIN
PROMPT 1 14 "Riattribuzione num. protocollo su fatture emesse "
PROMPT 1 15 "Riattribuzione num. protocollo su fatture emesse "
FLAGS "G"
END
BOOLEAN F_FATTRIC
BEGIN
PROMPT 1 15 "Riattribuzione num. protocollo su fatture ricevute "
PROMPT 1 16 "Riattribuzione num. protocollo su fatture ricevute "
FLAGS "G"
END

View File

@ -54,6 +54,16 @@ bool TInv_cont::main_loop()
msk.set(F_DATALIM, _data.string());
msk.disable(F_DATALIM);
if (_scelta == 'S' && _ditta > 9999)
{
msk.show(F_DITTAAS);
msk.disable(F_DITTAAS);
long ditta = atol(_control_rec.sub(300,304));
msk.set(F_DITTAAS, ditta);
}
else
msk.hide(F_DITTAAS);
ripartenza = TRUE;
}
@ -72,6 +82,10 @@ bool TInv_cont::main_loop()
if (tasto != K_ENTER) return FALSE;
_dittaAS = msk.get_long(F_DITTAAS); //Se la ditta per l'invio ad AS non viene compilata perche' trattasi di invio a PC
if (_dittaAS == 0) //o perche' il codice e' di 4, gli assegno la ditta corrente. Nel caso di invio a
_dittaAS = _ditta; //PC non servirebbe il codice aggiuntivo, ma lo metto ugualmente per avere una situazione analoga
// Nel caso di invio PC --> SISTEMA eseguo prima la
// Lista controllo archivi per rilevare eventuali
// differenze.
@ -126,10 +140,20 @@ bool TInv_cont::main_loop()
int num = msk.get_int(F_NUMULINV);
TString data (msk.get(F_DATALIM));
if (_scelta == 'S')
{
app = riconverti(data,FALSE);
str.format("%03d%6s", num, (const char*) app);
aggiorna_marker(str,14);
}
else
if (_scelta == 'P')
{
app = riconverti(data,TRUE);
str.format("%03d%8s", num, (const char*) app);
aggiorna_marker(str,15);
}
}
apri_file_temp();
@ -188,10 +212,10 @@ bool TInv_cont::main_loop()
_tras_file.open(_header);
leggi_record_controllo();
TString record(256);
record.format("%-256s",(const char*) record);
TString record(1024);
record.spaces();
_control_rec.overwrite(record,0);
_tras_file.write_control_rec(_control_rec,256);
_tras_file.write_control_rec(_control_rec,1024);
chiudi_file_temp();
}
@ -201,45 +225,56 @@ bool TInv_cont::main_loop()
else
if (_scelta == 'P')
{
aggiorna_marker(str,24);
_trasf = "";
_trasf = firm2dir(0);
_trasf << "\\trasfer";
fremove(_trasf);
_tras_file.open(_trasf,TRUE);
invio_contabilita_PC(); //Costruisce il trasfer nella directory comune
TMask mask ("cg6900b");
KEY k;
mask.disable(F_DIM);
k = mask.run();
if (k == K_ENTER)
{
int num_disk = calcola_numero_dischi(mask);
char floppy = mask.get(F_FLOPPY)[0];
TString flp = mask.get(F_FLOPPY);
TFilename firm;
firm.tempdir();
firm << "\\ftemp";
TString desc = "";
make_dir(firm);
_tras_file.open(_header);
TString sigle = _tras_file.sigle_file();
sigle.trim();
str.format("%02d", num_disk);
aggiorna_marker(str,32);
TString dir = firm2dir(0);
const TFilename from(_trasf); // File da splittare
chiudi_file_temp();
TFilename work;
work << floppy << ":/" << from.name(); // File su dischetto
_tras_file.temp_dir(dir,firm,sigle);
FILE* i = fopen(from, "rb");
_arc.backup(firm, floppy, desc);
if (i == NULL) return error_box("Impossibile aprire il file '%s'", from);
TString orig = dir; orig << "\\marker";
TString dest = flp << ":"; dest << "\\marker";
fcopy(orig,dest);
TProgind w(_dim_tot, "Trasferimento su dischetti in corso... Prego attendere", TRUE, TRUE, 60);
for (int j = 0; j < num_disk; j++)
{
scrivi_disco(floppy,j+1,work,i,w);
}
fclose(i);
setta_tabella_studio(msk,FALSE); //Aggiorna la tabella studio per invio
setta_tabella_ditta(msk," ",FALSE); //Aggiorna la tabella ditta per invio
setta_parametri_record(msk," "); //Aggiorna parametri contabili ditta
_tras_file.canc_file_dir_temp(firm); //Cancella i file della directory temporanea ftemp
_tras_file.open(_header);
leggi_record_controllo();
TString record(1024);
record.spaces();
_control_rec.overwrite(record,0);
_tras_file.write_control_rec(_control_rec,1024);
chiudi_file_temp();
}
else
return FALSE;
@ -657,6 +692,13 @@ bool TInv_cont::setta_maschera_hnd(TMask_field& f, KEY k)
f.mask().set(F_NUMULINV, app()._num);
f.mask().set(F_DATAULIN, app()._data.string());
f.mask().set(F_STATO, app()._stato);
long ditta = atol(f.get());
if (app()._scelta == 'S' && ditta > 9999)
f.mask().show(F_DITTAAS);
else
f.mask().hide(F_DITTAAS);
}
return TRUE;
@ -683,6 +725,8 @@ void TInv_cont::crea_marker(TMask& m)
str = format("%-10s", (const char*) _nome_simbolico);
buffer.overwrite(str,0);
long ditta = m.get_long(F_DITTAINV);
if (ditta > 9999)
ditta = _dittaAS;
str = format("%04d", ditta);
buffer.overwrite(str,10);
int num = m.get_int(F_NUMULINV);
@ -706,7 +750,7 @@ void TInv_cont::crea_marker(TMask& m)
str = format("%03d", num);
buffer.overwrite(str,15);
TString data (m.get(F_DATALIM));
str = riconverti(data,FALSE);
str = riconverti(data,TRUE);
buffer.overwrite(str,18);
}
@ -758,7 +802,7 @@ void TInv_cont::calcola_totale_record()
for (int i = 0; i < sigle.len(); i++)
{
long tot_rec = atol(_control_rec.mid((i * 6) + 50,6));
long tot_rec = atol(_control_rec.mid((i * 6) + 95,6));
_tot_rec += tot_rec;
}
_tot_rec += 1;
@ -819,8 +863,8 @@ void TInv_cont::setta_tabella_ditta(TMask& m,const char* flag, bool comp)
void TInv_cont::crea_record_controllo(TMask& m)
{
int size = 256;
TString buffer(256);
int size = 1024;
TString buffer(1024);
TString str;
if (_tras_file.exist())
@ -833,30 +877,41 @@ void TInv_cont::crea_record_controllo(TMask& m)
buffer.overwrite(" 1",0); //Tipo record
str = format("%-10s", (const char*) _nome_simbolico);
buffer.overwrite(str,15); //Nome studio
buffer.overwrite(str,60); //Nome studio
long ditta = m.get_long(F_DITTAINV);
str = format("%05d", ditta);
buffer.overwrite(str,25); //Ditta inviante
buffer.overwrite(str,70); //Ditta inviante
int num = m.get_int(F_NUMULINV);
num++;
str = format("%03d", num);
buffer.overwrite(str,30); //Numero progr. invio
buffer.overwrite(str,75); //Numero progr. invio
TString data (m.get(F_DATALIM));
str = riconverti(data,TRUE);
buffer.overwrite(str,33); //Data limite invio
buffer.overwrite(str,78); //Data limite invio
str = format("%-9s", (const char*) _files);
buffer.overwrite(str,41);
buffer.overwrite(str,86);
str = _files.sub(0,1);
buffer.overwrite(str,240);
str = "";
str.format("%054d", 0);
buffer.overwrite(str,50);
buffer.overwrite(str,95);
if (_scelta == 'S')
{
str.format("%04ld", _dittaAS);
buffer.overwrite(str,300);
}
else
{
str.format("%05ld", _dittaAS);
buffer.overwrite(str,300);
}
if (!_tras_file.write_control_rec(buffer, size))
warning_box("Il record di controllo del file trasfer non e' stato aggiornato correttamente");
@ -937,7 +992,7 @@ bool TInv_cont::invio_tempfile(TMask& m)
_tras_file.open(_header);
leggi_record_controllo();
_control_rec.overwrite(" ",240);
_tras_file.write_control_rec(_control_rec,256);
_tras_file.write_control_rec(_control_rec,1024);
_tras_file.close();
setta_tabella_ditta(m,"D",FALSE);
@ -948,7 +1003,7 @@ bool TInv_cont::invio_tempfile(TMask& m)
void TInv_cont::causali2tempfile(TString& key, TMask& m)
{
int size = 256;
int size = 1024;
_tras_file.open(_header);
@ -1062,13 +1117,13 @@ void TInv_cont::scrivi_righe_causali(TString& codcaus, char uselab)
TString sigla (format("%c", uselab));
_control_rec.overwrite(sigla,240);
_control_rec.overwrite(chiave,241);
_tras_file.write_control_rec(_control_rec,256);
_tras_file.write_control_rec(_control_rec,1024);
}
}
void TInv_cont::clifo2tempfile(TString& key, TMask& m)
{
int size = 256;
int size = 1024;
_tras_file.open(_header);
@ -1148,7 +1203,7 @@ void TInv_cont::clifo2tempfile(TString& key, TMask& m)
void TInv_cont::pcon2tempfile(TString& key, TMask& m)
{
int size = 256;
int size = 1024;
_tras_file.open(_header);
@ -1248,7 +1303,7 @@ void TInv_cont::primanota_inviata(long numreg)
void TInv_cont::scrivi_righePN(long numreg)
{
int size = 256;
int size = 1024;
_tras_file.open(_header);
@ -1269,7 +1324,7 @@ void TInv_cont::scrivi_righePN(long numreg)
void TInv_cont::movPN2tempfile(TString& key, TMask& m)
{
int size = 256;
int size = 1024;
_tras_file.open(_header);
@ -1400,7 +1455,7 @@ void TInv_cont::movIVA2tempfile(TString& key, TMask& m)
TString ocfpi;
TDate datareg;
bool inviva;
int size = 256;
int size = 1024;
_tras_file.open(_header);

View File

@ -67,7 +67,7 @@ class TInv_cont : public TApplication
TString _ocfpi, _ragsococc, _indocc, _capocc, _localocc, _provocc, _codvali;
bool _esiste_ditta, _esiste_record, _inviato, _flag_bollato;
long _ditta, _protiva, _uprotiva, _codcf, _numrec, _tot_rec;
long _dim_tot, _dim_disk;
long _dim_tot, _dim_disk,_dittaAS;
long _numrec_cau,_numrec_clifo,_numrec_pcon,_numrec_pn,_numrec_iva;
int _num,_annoes;
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
@ -150,6 +150,16 @@ public:
FILE* chiedi_disco(const char* name, int disk, char floppy, bool lettura);
bool scrivi_disco(char floppy, int disk, const char* work, FILE* i, TProgind& w);
bool invio_contabilita_PC();
void invio_testata_causali();
void invio_righe_causali();
void invio_clienti_fornitori();
void invio_piano_conti();
void invio_testata_movimenti();
void invio_righe_contabili();
void invio_righe_IVA();
void invio_occasionali(TString& record, TString& ocfpi);
TInv_cont(char mov);
};

View File

@ -8,6 +8,7 @@
#define F_USELAB 107
#define F_CHIAVE 108
#define F_DATALIM 109
#define F_DITTAAS 110
// Campi maschera cg2900b.uml

View File

@ -1,11 +1,11 @@
#include "cg6900a.h"
PAGE "Invio contabilita'" -1 -1 76 11
PAGE "Invio contabilita'" -1 -1 78 15
NUMBER F_DITTAINV 5
BEGIN
PROMPT 2 1 "Codice ditta inviante "
FLAGS "Z"
FLAGS "ZG"
CHECKTYPE REQUIRED
END
@ -23,27 +23,39 @@ END
DATE F_DATAULIN
BEGIN
PROMPT 44 4 "Data ultimo invio "
PROMPT 45 4 "Data ultimo invio "
END
STRING F_STATO 1
BEGIN
PROMPT 2 5 "Stato ultimo invio "
PROMPT 2 6 "Stato ultimo "
END
STRING F_USELAB 1
BEGIN
PROMPT 27 5 ""
PROMPT 19 6 ""
END
STRING F_CHIAVE 15
TEXT DLG_NULL
BEGIN
PROMPT 30 5 ""
PROMPT 2 7 "invio "
END
STRING F_CHIAVE 60
BEGIN
PROMPT 15 7 ""
END
DATE F_DATALIM
BEGIN
PROMPT 2 7 "Data limite invio "
PROMPT 2 9 "Data limite invio "
CHECKTYPE REQUIRED
END
NUMBER F_DITTAAS 4
BEGIN
PROMPT 2 11 "Ditta da inviare a sistema "
FLAGS "H"
CHECKTYPE REQUIRED
END

View File

@ -137,7 +137,7 @@ bool TLista_archivi::set()
return FALSE;
}
bool TLista_archivi::controlla_valore(const TString& val,int lim)
bool TLista_archivi::controlla_valore(const TString& val,int lim, int len)
{
if (real::is_natural(val))
{
@ -146,7 +146,7 @@ bool TLista_archivi::controlla_valore(const TString& val,int lim)
return FALSE;
}
else
if (val.len() > 1)
if (val.len() > len)
return FALSE;
return TRUE;
@ -176,7 +176,7 @@ void TLista_archivi::controlla_causali(char file)
}
TString reg = _caus->get(CAU_REG);
if (!controlla_valore(reg,9))
if (!controlla_valore(reg,9,1))
{
errore = TRUE;
stampa.add(" - Rilevato registro IVA con lunghezza superiore a 1");
@ -330,7 +330,7 @@ void TLista_archivi::controlla_clifo(char file)
}
TString codpag = _clifo->get(CLI_CODPAG);
if (!controlla_valore(codpag,99))
if (!controlla_valore(codpag,99,2))
{
errore = TRUE;
stampa.add(" - Rilevato un codice di pagamento composto da 3 o piu' cifre");
@ -490,7 +490,7 @@ void TLista_archivi::controlla_PNIVA(char file)
}
TString reg = _mov->get(MOV_REG);
if (!controlla_valore(reg,9))
if (!controlla_valore(reg,9,1))
{
errore = TRUE;
stampa.add(" - Rilevato un codice registro IVA composto da 2 o piu' cifre");
@ -505,7 +505,7 @@ void TLista_archivi::controlla_PNIVA(char file)
}
TString codpag = _mov->get(MOV_CODPAG);
if (!controlla_valore(codpag,99))
if (!controlla_valore(codpag,99,2))
{
errore = TRUE;
stampa.add(" - Rilevato un codice di pagamento composto da 3 o piu' cifre");
@ -824,7 +824,7 @@ void TLista_archivi::controlla_PNIVA(char file)
tit_riga = TRUE;
}
if (!controlla_valore(ci,99))
if (!controlla_valore(ci,99,2))
{
errore = TRUE;
TString app;

View File

@ -48,7 +48,7 @@ public:
void controlla_PNIVA (char sigla);
void controlla_fatture (char sigla);
void setta_intestazione(char sigla);
bool controlla_valore (const TString& val,int lim);
bool controlla_valore (const TString& val,int lim, int len);
TLista_archivi() {};
};

View File

@ -32,7 +32,10 @@ bool TInv_cont::scrivi_disco(char floppy, int disk, const char* work,
TString str;
str.format("%02d", disk);
if (_scelta == 'S')
aggiorna_marker(str,31); // Aggiorna il num. progr. disco su marker
else
aggiorna_marker(str,34);
TString path_m;
path_m << floppy << ":\\marker";
@ -157,12 +160,18 @@ bool TInv_cont::invio_contabilita()
if (header)
{
TString app1 = _control_rec.mid(0,25);
TString app2 = _control_rec.mid(26,7);
TString app3 = _control_rec.mid(35);
_control_rec = app1 << app2 << app3;
_control_rec.insert(" ",232);
_tras_file.write_control_rec(_control_rec,size);
TString dittaAS = _control_rec.sub(300,304);
TString app1 = _control_rec.mid(0,15);
TString app2 = _control_rec.mid(60,10);
TString app3 = _control_rec.mid(71,7);
app3.overwrite(dittaAS,0); //Sostituisco l'eventuale ditta di 5 con quella di 4
TString app4 = _control_rec.mid(80,300);
TString app5 = app1 << app2 << app3 << app4;
app5.overwrite(" ",252); //Pulisco la ditta da inviare a sistema che non serve piu'
app5.cut(size);
_tras_file.write_control_rec(app5,size);
aggiorna_marker(dittaAS,10);
header = FALSE;
}
@ -213,7 +222,7 @@ bool TInv_cont::invio_contabilita()
void TInv_cont::aggiorna_header(TString& files)
{
char sigla;
int size = 256;
int size = 1024;
_tras_file.open(_header);
leggi_record_controllo();
@ -228,7 +237,7 @@ void TInv_cont::aggiorna_header(TString& files)
{
TString app;
app.format("%06ld", _numrec_cau);
_control_rec.overwrite(app,((i * 6) + 50));
_control_rec.overwrite(app,((i * 6) + 95));
}
break;
@ -236,7 +245,7 @@ void TInv_cont::aggiorna_header(TString& files)
{
TString app;
app.format("%06ld", _numrec_clifo);
_control_rec.overwrite(app,((i * 6) + 50));
_control_rec.overwrite(app,((i * 6) + 95));
}
break;
@ -244,7 +253,7 @@ void TInv_cont::aggiorna_header(TString& files)
{
TString app;
app.format("%06ld", _numrec_pcon);
_control_rec.overwrite(app,((i * 6) + 50));
_control_rec.overwrite(app,((i * 6) + 95));
}
break;
@ -252,7 +261,7 @@ void TInv_cont::aggiorna_header(TString& files)
{
TString app;
app.format("%06ld", _numrec_pn);
_control_rec.overwrite(app,((i * 6) + 50));
_control_rec.overwrite(app,((i * 6) + 95));
}
break;
@ -260,7 +269,7 @@ void TInv_cont::aggiorna_header(TString& files)
{
TString app;
app.format("%06ld", _numrec_iva);
_control_rec.overwrite(app,((i * 6) + 50));
_control_rec.overwrite(app,((i * 6) + 95));
}
break;
@ -275,7 +284,18 @@ void TInv_cont::aggiorna_header(TString& files)
void TInv_cont::aggiorna_trasfer(TString& files)
{
char sigla;
int size = 256;
int size,pos;
if (_scelta == 'S')
{
size = 256;
pos = 47;
}
else
{
size = 1024;
pos = 95;
}
_tras_file.open(_trasf);
leggi_record_controllo();
@ -290,7 +310,7 @@ void TInv_cont::aggiorna_trasfer(TString& files)
{
TString app;
app.format("%06ld", _numrec_cau);
_control_rec.overwrite(app,((i * 6) + 47));
_control_rec.overwrite(app,((i * 6) + pos));
}
break;
@ -298,7 +318,7 @@ void TInv_cont::aggiorna_trasfer(TString& files)
{
TString app;
app.format("%06ld", _numrec_clifo);
_control_rec.overwrite(app,((i * 6) + 47));
_control_rec.overwrite(app,((i * 6) + pos));
}
break;
@ -306,7 +326,7 @@ void TInv_cont::aggiorna_trasfer(TString& files)
{
TString app;
app.format("%06ld", _numrec_pcon);
_control_rec.overwrite(app,((i * 6) + 47));
_control_rec.overwrite(app,((i * 6) + pos));
}
break;
@ -314,7 +334,7 @@ void TInv_cont::aggiorna_trasfer(TString& files)
{
TString app;
app.format("%06ld", _numrec_pn);
_control_rec.overwrite(app,((i * 6) + 47));
_control_rec.overwrite(app,((i * 6) + pos));
}
break;
@ -322,7 +342,7 @@ void TInv_cont::aggiorna_trasfer(TString& files)
{
TString app;
app.format("%06ld", _numrec_iva);
_control_rec.overwrite(app,((i * 6) + 47));
_control_rec.overwrite(app,((i * 6) + pos));
}
break;
@ -426,6 +446,8 @@ bool TInv_cont::invio_tab_cau()
else //Autofattura art.34
record.overwrite(" ",249);
TString movap = _tcaus->get(CAU_MOVAP);
record.overwrite(movap,212); //Segnalino di causale apertura/chiusura
int num = 0;
int pos_gcs = 41;
@ -1086,6 +1108,7 @@ bool TInv_cont::testata_mov_IVA(long numreg)
_ocfpi = _tmov->get (MOV_OCFPI);
_dataregiva = _tmov->get_date(MOV_DATAREG);
_inviato = _tmov->get_bool(MOV_INVIVA);
_tipodoc = _tmov->get (MOV_TIPODOC);
if (_ocfpi.not_empty())
cerca_occasionale();
}
@ -1178,6 +1201,8 @@ bool TInv_cont::invio_mov_IVA()
record.overwrite(str,15); //Codice cliente/fornitore
real imponibile (_triva->get_real(RMI_IMPONIBILE));
if (_tipodoc == "NC" || _tipodoc == "ST")
imponibile = imponibile * -1;
TString numero = imponibile.string();
if (imponibile.sign() < 0)
negPC2negAS(numero);
@ -1189,6 +1214,8 @@ bool TInv_cont::invio_mov_IVA()
record.overwrite(str,32); //Codice iva
real imposta (_triva->get_real(RMI_IMPOSTA));
if (_tipodoc == "NC" || _tipodoc == "ST")
imposta = imposta * -1;
numero = imposta.string();
if (imposta.sign() < 0)
negPC2negAS(numero);
@ -1274,7 +1301,7 @@ bool TInv_cont::invio_mov_IVA()
_tras_file.write_control_rec(record,size);
iva_inviata(nreg);
//iva_inviata(nreg);
}
delete _prog;

1056
cg/cg6904.cpp Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,10 @@
#include <comuni.h>
#include <clifo.h>
#include <rcausali.h>
#include <causali.h>
#include <occas.h>
#include "cg2103.h"
#define TEMP_CAUS "tcaus"
#define TEMP_RCAUS "trcaus"
@ -37,7 +41,7 @@
#define SIZE 256
static unsigned char _tabella[10] = {0x8a,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52};
static unsigned char _tabella[10] = {0x7d,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52};
HIDDEN TString80 TEMP;
HIDDEN TString16 HEADER = "\\header";
@ -47,6 +51,8 @@ const int CAMPI_RCAUS = 6;
// Tracciato del record di controllo
HIDDEN int pos[15] = {0,15,25,29,32,38,47,234,235,236,237,238,239,240,241};
const int LEN_REC_HEAD = 1025;
/*HIDDEN*/ const char* converti (TString& data_AS400,bool anno_di_quattro);
/*HIDDEN*/ const char* riconverti (TString& data_PC,bool anno_di_quattro);
/*HIDDEN*/ int date2esc(const TDate& d, int* prevesc = NULL);
@ -102,7 +108,7 @@ class TRic_recfield : public TObject
class TMappa_trc : public TAssoc_array
{
public :
void leggi_modulo();
void leggi_modulo(const char* tracciato);
int from (const char* key);
int to (const char* key);
@ -121,11 +127,28 @@ class TTransfer_file
// TAssoc_array _fis_index;
TMappa_trc _trc;
TString _curfile;
TString256 _control_rec; // Buffer per il record di controllo
TString256 _control_rec_t; // Buffer per il record di controllo del trasfer
TFixed_string* _control_rec; // Buffer per il record di controllo
// TString _control_rec; // Buffer per il record di controllo dell'header
TString256 _record; // Buffer per il record corrente
TProgind* _prog;
TIsamtempfile* _tcaus;
TIsamtempfile* _trcaus;
TIsamtempfile* _tclifo;
TIsamtempfile* _tpcon;
TIsamtempfile* _tmov;
TIsamtempfile* _trmov;
TIsamtempfile* _triva;
TIsamtempfile* _toccas;
TIsamtempfile* _ttab;
TRectype* _depcaus;
TRectype* _deprcaus;
TRectype* _depclifo;
TRectype* _deppcon;
TRectype* _depmov;
TRectype* _deprmov;
TRectype* _depriva;
TRectype* _depoccas;
long _numreg, _numreg_p, _numreg_piva, _npoccas;
int _annoes;
@ -152,7 +175,7 @@ private:
// Inizializza l'indice leggendo il record di controllo
void fill_index(TString&,TString&);
// Funzioni utilizzate da fcopytemp()
// Funzioni utilizzate da fcopytemp() nella ricezione da Sistema
void scrivi_header(const char* dest,const char* wflag);
void scrivi_causali(long nrec);
void scrivi_clifo(long nrec);
@ -176,10 +199,23 @@ private:
int strip_zero(TString& importo);
bool my_isdigit(unsigned char ch);
int look(unsigned char carattere);
int cerca_annoes(long numreg);
int cerca_annoes(long numreg, TString& tipodoc);
const char* scrivi_occasionali(const TString& record);
public:
// Funzioni utilizzate da fcopytemp_PC() nella ricezione da PC
void write_testata_causali(TString& record);
void write_righe_causali(TString& record);
void write_clienti_fornitori(TString& record);
void write_piano_conti(TString& record);
void write_testata_movimenti(TString& record);
void write_righe_contabili(TString& record);
void write_righe_IVA(TString& record);
int annoes_PC(TString& data);
void causale(TString& cau,TString& tipo,TString& descr);
int registro(TString& reg,int anno);
public:
void remove_all(bool file_ditta = TRUE);
void canc_file_dir_temp(const char* dir);
@ -193,6 +229,8 @@ private:
bool ordina_trasfer(const char* orig);
long determina_dimensione(FILE* f);
bool fcopytemp_PC(const char* orig, const char* dest);
int dataes(const TDate&, int*, TDate&);
const char* path (long codditta = 0);
@ -200,6 +238,8 @@ private:
void close ();
bool exist() const { return _trasfer != NULL; }
void setta_sistema(char scelta);
long get_pos(const char* key);
// Funzioni che agiscono sul record di controllo del file trasfer.
@ -221,7 +261,7 @@ private:
char flg_agg_IV(char sigla); // Ritorna il flag tipo aggiornamento classi piano dei conti
const char* ult_file () const { return (const char*) _ult_file; } // Ritorna l'ultima sigla file elaborato
const char* key () const { return (const char*) _key; } // Ritorna la chiave ultimo record elaborato
const char* record () const { return (const char*) _control_rec; } // Ritorna il record di controllo del trasfer
const char* record () const; // Ritorna il record di controllo del trasfer
// Funzioni per il posizionamento e la gestione dei record del trasfer (escluso il record di controllo)
@ -268,7 +308,7 @@ private:
TMappa_trc& mappa() {return _trc; }
TTransfer_file();
TTransfer_file(char scelta = '\0');
~TTransfer_file();
};

195
cg/cgtrcpc.ini Executable file
View File

@ -0,0 +1,195 @@
# Istruzioni per l' uso della mappa cgtrc.ini
#
# A | B | C | D | E | F | G | H |
#
# A = Sigla di identificazione dei vari archivi all' interno del trasfer
# W1 = Testata Tabella Causali
# W2 = Righe Tabella Causali
# A1 = Clienti / Fornitori
# P1-P2-P3 = Piano dei Conti
# Z1 = Testata Movimenti
# Z2 = Righe Movimenti Contabili
# U1 = Righe Movimenti Iva
#
# B = Numero progressivo del campo all'interno dell'archivio
#
# C = Posizione iniziale del campo sul record del trasfer
#
# D = Posizione finale del campo sul record del trasfer
#
# E = Numero di identificazione degli archivi su PC
#
# F = Nome del campo degli archivi su PC
#
# G = Questo e' un campo jolly che permette di eseguire determinate operazioni all'interno del programma
# e puo' assumere i seguenti valori:
# 1 -> indica quali sono i campi che devono essere trasferiti se i flag sulla
# tabella della ricezione indica di non trasferire tutto il record.
# 2 -> se il campo in questione e' una data.
# 3 -> se il campo in questione e' un reale con dei decimali.
# 4 -> se il campo in questione deve essere trasferito sugli occasionali.
#
# H = E' un ulteriore campo jolly da accostare ai campi reali con decimali.
# Serve per indicare il numero di decimali. ES: se il campo in questione
# e' un reale con 2 decimali il flag G deve essere 3 mentre il flag H
# deve essere 2.
#
W1|1|3|5|26|CODCAUS|||
W1|2|61|110|26|DESCR|1||
W1|3|111|112|26|TIPODOC|||
W1|4|113|113|26|MOVAP|||
W1|5|114|114|26|ALLEG|||
W1|6|115|115|26|INTRACOM|||
W1|7|116|118|26|REG|||
W1|8|119|119|26|MOVVAL|||
W1|9|120|120|26|TIPOMOV|||
W1|10|121|121|26|DATADOC|||
W1|11|122|122|26|NUMDOC|||
W1|12|123|123|26|AUTOFATT|||
W1|13|124|124|26|RITFATT|||
W1|14|125|125|26|COLLCESP|||
W1|15|126|126|26|M770|||
W1|16|127|129|26|CODCAUSIM|||
W1|17|130|130|26|SOSPESO|||
W1|18|131|131|26|VALINTRA|||
W2|1|3|5|27|CODCAUS|||
W2|2|6|8|27|NRIGA|||
W2|3|61|63|27|GRUPPO|||
W2|4|64|66|27|CONTO|||
W2|5|67|72|27|SOTTOCONTO|||
W2|6|73|77|27|CODDESC|||
W2|7|78|78|27|SEZIONE|||
A1|1|3|3|20|TIPOCF|||
A1|2|4|9|20|CODCF|||
A1|3|61|110|20|RAGSOC|1||
A1|4|111|145|20|INDCF|1||
A1|5|146|155|20|CIVCF|1||
A1|6|156|190|20|LOCALITACF|1||
A1|7|191|193|20|STATOCF|1||
A1|8|194|197|20|COMCF|1||
A1|9|248|252|20|CAPCF|1||
A1|10|253|268|20|COFI|1||
A1|11|269|270|20|STATOPAIV|1||
A1|12|271|282|20|PAIV|1||
A1|13|283|283|20|TIPOPERS|||
A1|14|284|284|20|ALLEG|||
A1|15|285|290|20|CODALLEG|||
A1|16|291|293|20|GRUPPO|||
A1|17|294|296|20|CONTO|||
A1|18|297|299|20|GRUPPORIC|||
A1|19|300|302|20|CONTORIC|||
A1|20|303|308|20|SOTTOCRIC|||
A1|21|309|318|20|PTEL|1||
A1|22|319|348|20|TEL|1||
A1|23|349|358|20|PTEL2|1||
A1|24|359|388|20|TEL2|1||
A1|25|389|398|20|PTEL3|1||
A1|26|399|428|20|TEL3|1||
A1|27|429|438|20|PFAX|1||
A1|28|439|468|20|FAX|1||
A1|29|469|478|20|PTELEX|1||
A1|30|479|508|20|TELEX|1||
A1|31|509|516|20|DATANASC|2||
A1|32|517|519|20|STATONASC|||
A1|33|520|523|20|COMNASC|||
A1|34|574|580|20|CODSTAT|||
A1|35|581|585|20|CODABI|||
A1|36|586|590|20|CODCAB|||
A1|37|591|591|20|OCCAS|||
A1|38|592|594|20|CODVAL|||
A1|39|595|595|20|CODLIN|||
A1|40|596|610|20|FIDO|||
A1|41|611|614|20|CODPAG|||
A1|42|615|615|20|SOSPESO|||
P1|1|3|5|19|GRUPPO|||
P1|2|61|110|19|DESCR|1||
P2|1|3|5|19|GRUPPO|||
P2|2|6|8|19|CONTO|||
P2|3|61|110|19|DESCR|1||
P2|4|111|111|19|INDBIL|||
P2|5|112|112|19|TMCF|||
P2|6|113|113|19|STSOTTBIL|||
P2|7|114|114|19|COMPENS|||
P2|8|115|115|19|SEZIVD|||
P2|9|116|116|19|LETTIVD|||
P2|10|117|124|19|NUMRIVD|||
P2|11|125|126|19|NUMIVD|||
P2|12|127|127|19|SEZIVDOPP|||
P2|13|128|128|19|LETTIVDOPP|||
P2|14|129|136|19|NUMRIVDOPP|||
P2|15|137|138|19|NUMIVDOPP|||
P3|1|3|5|19|GRUPPO|||
P3|2|6|8|19|CONTO|||
P3|3|9|14|19|SOTTOCONTO|||
P3|4|61|110|19|DESCR|1||
P3|5|111|111|19|TIPOSPRIC|||
P3|6|112|112|19|SEZSALDI|||
P3|7|113|113|19|SOSPESO|||
P3|8|114|114|19|SEZIVD|||
P3|9|115|115|19|LETTIVD|||
P3|10|116|123|19|NUMRIVD|||
P3|11|124|125|19|NUMIVD|||
P3|12|126|126|19|SEZIVDOPP|||
P3|13|127|127|19|LETTIVDOPP|||
P3|14|128|135|19|NUMRIVDOPP|||
P3|15|136|137|19|NUMIVDOPP|||
P3|16|138|138|19|RICSER|||
Z1|1|3|9|23|NUMREG|||
Z1|2|61|68|23|DATAREG|2||
Z1|3|69|76|23|DATACOMP|2||
Z1|4|77|84|23|DATADOC|2||
Z1|5|85|92|23|DATA74TER|2||
Z1|6|93|99|23|NUMDOC|||
Z1|7|100|102|23|CODCAUS|||
Z1|8|103|152|23|DESCR|||
Z1|9|153|155|23|REG|||
Z1|10|156|160|23|PROTIVA|||
Z1|11|161|165|23|UPROTIVA|||
Z1|12|166|166|23|REGST|||
Z1|13|167|167|23|STAMPATO|||
Z1|14|168|174|23|NUMGIO|||
Z1|15|175|180|23|CODCF|||
Z1|16|182|195|23|TOTDOC|||
Z1|17|197|210|23|RITFIS|||
Z1|18|212|225|23|RITSOC|||
Z1|19|226|228|23|CODVALI|||
Z1|20|229|242|23|CAMBIOI|3|5|
Z1|21|244|257|23|CORRLIRE|||
Z1|22|259|274|23|CORRVALUTA|3|2|
Z1|23|275|290|23|OCFPI|||
Z1|24|291|340|18|RAGSOC|4||
Z1|25|341|390|18|INDIR|4||
Z1|26|391|396|18|CIV|4||
Z1|27|397|399|18|STATO|4||
Z1|28|400|403|18|COM|4||
Z1|29|454|458|18|CAP|4||
Z1|30|459|466|18|DNASC|4||
Z1|31|467|469|18|STATONASC|4||
Z1|32|470|473|18|COMNASC|4||
Z2|1|3|9|24|NUMREG|||
Z2|2|10|12|24|NUMRIG|||
Z2|3|61|61|24|SEZIONE|||
Z2|4|62|69|24|DATAREG|2||
Z2|5|70|72|24|GRUPPO|||
Z2|6|73|75|24|CONTO|||
Z2|7|76|81|24|SOTTOCONTO|||
Z2|8|82|131|24|DESCR|||
Z2|9|132|134|24|GRUPPOC|||
Z2|10|135|137|24|CONTOC|||
Z2|11|138|143|24|SOTTOCONTC|||
Z2|12|145|158|24|IMPORTO|||
Z2|13|159|159|24|ROWTYPE|||
U1|1|3|9|25|NUMREG|||
U1|2|10|12|25|NUMRIG|||
U1|3|61|64|25|CODIVA|||
U1|4|66|79|25|IMPONIBILE|||
U1|5|81|94|25|IMPOSTA|||
U1|6|95|95|25|TIPODET|||
U1|7|96|96|25|TIPOCR|||
U1|8|97|97|25|INTRA|||
U1|9|98|98|25|TIPOATT|||
U1|10|99|101|25|GRUPPO|||
U1|11|102|104|25|CONTO|||
U1|12|105|110|25|SOTTOCONTO|||
U1|13|111|113|25|RIGAIMP|||
U1|14|114|116|25|RIGAIVA|||