Invio Ricezione nuova
git-svn-id: svn://10.65.10.50/trunk@1991 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7092eb8ea3
commit
318b0d683e
30
cg/cg6.cpp
Executable file
30
cg/cg6.cpp
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#include <xvt.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "cg6.h"
|
||||||
|
|
||||||
|
int main(int argc,char** argv)
|
||||||
|
{
|
||||||
|
const int n = (argc > 1) ? atoi(&argv[1][1]) : 0;
|
||||||
|
|
||||||
|
switch(n)
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
cg6300(argc, argv); break;
|
||||||
|
case 3:
|
||||||
|
cg6400(argc, argv); break;
|
||||||
|
case 4:
|
||||||
|
cg6500(argc, argv); break;
|
||||||
|
case 5:
|
||||||
|
cg6600(argc, argv); break;
|
||||||
|
case 6:
|
||||||
|
cg6700(argc, argv); break;
|
||||||
|
case 7:
|
||||||
|
cg6800(argc, argv); break;
|
||||||
|
case 8:
|
||||||
|
cg6900(argc, argv); break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
12
cg/cg6.h
Executable file
12
cg/cg6.h
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef __CG6_H
|
||||||
|
#define __CG6_H
|
||||||
|
|
||||||
|
int cg6300(int argc, char* argv[]);
|
||||||
|
int cg6400(int argc, char* argv[]);
|
||||||
|
int cg6500(int argc, char* argv[]);
|
||||||
|
int cg6600(int argc, char* argv[]);
|
||||||
|
int cg6700(int argc, char* argv[]);
|
||||||
|
int cg6800(int argc, char* argv[]);
|
||||||
|
int cg6900(int argc, char* argv[]);
|
||||||
|
|
||||||
|
#endif // __CG6_H
|
45
cg/cg6.url
Executable file
45
cg/cg6.url
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#include <default.url>
|
||||||
|
|
||||||
|
MENU TASK_MENUBAR
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(1)
|
||||||
|
|
||||||
|
MENU MENU_BAR(1)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(2)
|
||||||
|
|
||||||
|
MENU MENU_BAR(2)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(3)
|
||||||
|
|
||||||
|
MENU MENU_BAR(3)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(4)
|
||||||
|
|
||||||
|
MENU MENU_BAR(4)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(5)
|
||||||
|
|
||||||
|
MENU MENU_BAR(5)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(6)
|
||||||
|
|
||||||
|
MENU MENU_BAR(6)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(7)
|
||||||
|
|
||||||
|
MENU MENU_BAR(7)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(8)
|
||||||
|
|
||||||
|
MENU MENU_BAR(8)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
103
cg/cg6300.cpp
Executable file
103
cg/cg6300.cpp
Executable file
@ -0,0 +1,103 @@
|
|||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <tabapp.h>
|
||||||
|
#include <strings.h>
|
||||||
|
#include <stdtypes.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
|
||||||
|
#include "..\ba\batbtra.h"
|
||||||
|
|
||||||
|
class Tabtra_application : public Tab_application
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
TMask* _msk;
|
||||||
|
TString _tabname;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool user_create();
|
||||||
|
virtual void init_query_mode(TMask&);
|
||||||
|
virtual void init_modify_mode(TMask&);
|
||||||
|
virtual void init_insert_mode(TMask&);
|
||||||
|
|
||||||
|
Tabtra_application() {}
|
||||||
|
virtual ~Tabtra_application() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
HIDDEN inline Tabtra_application& app() {return (Tabtra_application&) main_app();}
|
||||||
|
|
||||||
|
HIDDEN bool ultimo_handler(TMask& m, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SHIFT+K_F12)
|
||||||
|
{
|
||||||
|
m.enable(F_NUMULTRAS);
|
||||||
|
m.enable(F_DATAULTRAS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
HIDDEN bool ditta_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_TAB)
|
||||||
|
{
|
||||||
|
long codditta = f.mask().get_long(F_CODDITTARIC);
|
||||||
|
|
||||||
|
if (codditta != 0)
|
||||||
|
{
|
||||||
|
if (prefix().exist(codditta))
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
f.error_box("La ditta selezionata non e' abilitata per la contabilita' ");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabtra_application::init_query_mode(TMask& m)
|
||||||
|
{
|
||||||
|
m.disable(F_NUMULTRAS);
|
||||||
|
m.disable(F_DATAULTRAS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabtra_application::init_modify_mode(TMask& m)
|
||||||
|
{
|
||||||
|
m.disable(F_NUMULTRAS);
|
||||||
|
m.disable(F_DATAULTRAS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabtra_application::init_insert_mode(TMask& m)
|
||||||
|
{
|
||||||
|
m.disable(F_NUMULTRAS);
|
||||||
|
m.disable(F_DATAULTRAS);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabtra_application::user_create()
|
||||||
|
{
|
||||||
|
Tab_application::user_create();
|
||||||
|
|
||||||
|
_msk = get_mask();
|
||||||
|
_tabname = get_tabname();
|
||||||
|
|
||||||
|
if (_tabname == "%TRA")
|
||||||
|
{
|
||||||
|
_msk->set_handler(ultimo_handler);
|
||||||
|
_msk->set_handler(F_CODDITTARIC, ditta_handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cg6300(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
Tabtra_application a;
|
||||||
|
|
||||||
|
a.run(argc,argv, "Tabelle");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
793
cg/cg6400.cpp
Executable file
793
cg/cg6400.cpp
Executable file
@ -0,0 +1,793 @@
|
|||||||
|
// Ricezione dati da sistema
|
||||||
|
#define STRICT
|
||||||
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
|
#include <colors.h>
|
||||||
|
#include <isam.h>
|
||||||
|
#include <archives.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <printapp.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <progind.h>
|
||||||
|
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
|
#include "cglib04.h"
|
||||||
|
|
||||||
|
#include "cg6400.h"
|
||||||
|
|
||||||
|
class TRic_archivi : public TApplication
|
||||||
|
{
|
||||||
|
TTable* _tab_tra;
|
||||||
|
TTransfer_file* _tras_file;
|
||||||
|
TLocalisamfile* _caus;
|
||||||
|
TLocalisamfile* _rcaus;
|
||||||
|
TLocalisamfile* _clifo;
|
||||||
|
TLocalisamfile* _pcon;
|
||||||
|
TLocalisamfile* _mov;
|
||||||
|
TLocalisamfile* _rmov;
|
||||||
|
TLocalisamfile* _rmoviva;
|
||||||
|
TLocalisamfile* _occas;
|
||||||
|
TArchive _arc;
|
||||||
|
|
||||||
|
TString80 TEMP;
|
||||||
|
|
||||||
|
char _scelta;
|
||||||
|
|
||||||
|
int _numtotdisk,_progdisk,_numdisk,_numinv,_numinvp,_nultras;
|
||||||
|
int _stato_ripartenza,_nultras_tab;
|
||||||
|
bool _sequenza,_disketto;
|
||||||
|
bool _prima_volta,_baipassa;
|
||||||
|
TString _nomeid,_nomeidp,_marker,_trasf,_trasfer,_pathname,_ragsoc_dittar;
|
||||||
|
long _dittainv,_dittainvp,_dittaric,_totrectras,_totrectrasp;
|
||||||
|
TDate _datatras,_datatrasp,_dataultras_tab,_dataultras;
|
||||||
|
TString _sigle_file,_nrec_file,_trasfhard;
|
||||||
|
char _agg_cau,_agg_pcon,_agg_cls,_agg_clifo,_agg_fatatt,_agg_fatpas;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
bool main_loop();
|
||||||
|
bool leggi_marker();
|
||||||
|
bool leggi_marker_rep();
|
||||||
|
void leggi_trasfer(const char* nome);
|
||||||
|
void ripristina_trasfer();
|
||||||
|
void trasfer2tempfile();
|
||||||
|
long leggi_tabella_tras();
|
||||||
|
void componi_path(TMask&);
|
||||||
|
bool video_ripartenza();
|
||||||
|
void ditta_ricevente();
|
||||||
|
bool ripartenza();
|
||||||
|
bool set_flag();
|
||||||
|
void aggiorna_tabella();
|
||||||
|
int controllo_ripartenza();
|
||||||
|
|
||||||
|
static bool baipassa(TMask& m,KEY k);
|
||||||
|
|
||||||
|
TRic_archivi(char ric_trasfer);
|
||||||
|
};
|
||||||
|
|
||||||
|
HIDDEN TRic_archivi& app() { return (TRic_archivi &) main_app(); }
|
||||||
|
|
||||||
|
TRic_archivi::TRic_archivi(char ric_trasfer) : _scelta(toupper(ric_trasfer))
|
||||||
|
{
|
||||||
|
if (_scelta == 'S')
|
||||||
|
_titolo = "Ricezione archivi da sistema";
|
||||||
|
|
||||||
|
if (_scelta == 'P')
|
||||||
|
_titolo = "Ricezione archivi da PC";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::create()
|
||||||
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
|
_tab_tra = new TTable ("%TRA");
|
||||||
|
_tras_file = new TTransfer_file();
|
||||||
|
|
||||||
|
_caus = new TLocalisamfile (LF_CAUSALI);
|
||||||
|
_rcaus = new TLocalisamfile (LF_RCAUSALI);
|
||||||
|
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||||
|
_pcon = new TLocalisamfile (LF_PCON);
|
||||||
|
_mov = new TLocalisamfile (LF_MOV);
|
||||||
|
_rmov = new TLocalisamfile (LF_RMOV);
|
||||||
|
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||||
|
_occas = new TLocalisamfile (LF_OCCAS);
|
||||||
|
|
||||||
|
_numdisk = 1;
|
||||||
|
_prima_volta = TRUE;
|
||||||
|
_nultras = 0;
|
||||||
|
_nultras_tab = 0;
|
||||||
|
_baipassa = FALSE;
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::destroy()
|
||||||
|
{
|
||||||
|
delete _tab_tra;
|
||||||
|
delete _tras_file;
|
||||||
|
|
||||||
|
delete _caus;
|
||||||
|
delete _rcaus;
|
||||||
|
delete _clifo;
|
||||||
|
delete _pcon;
|
||||||
|
delete _mov;
|
||||||
|
delete _rmov;
|
||||||
|
delete _rmoviva;
|
||||||
|
delete _occas;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::componi_path(TMask& msk)
|
||||||
|
{
|
||||||
|
if (_scelta == 'S')
|
||||||
|
{
|
||||||
|
TString path,drive;
|
||||||
|
int pos;
|
||||||
|
|
||||||
|
path = msk.get(F_PATHNAME);
|
||||||
|
drive = msk.get(F_DRIVE);
|
||||||
|
pos = path.find(':');
|
||||||
|
|
||||||
|
if (drive == "A:" || drive == "B:" || drive == "D:" || drive == "E:")
|
||||||
|
_disketto = TRUE;
|
||||||
|
else
|
||||||
|
_disketto = FALSE;
|
||||||
|
|
||||||
|
if (pos)
|
||||||
|
path = path.mid(pos+1);
|
||||||
|
|
||||||
|
if (path != "")
|
||||||
|
{
|
||||||
|
_marker << drive << "\\" << path << "\\marker";
|
||||||
|
_trasfer << drive << "\\" << path << "\\trasfer";
|
||||||
|
if (!_disketto)
|
||||||
|
_pathname << drive << "\\" << path;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_marker << drive << "\\marker";
|
||||||
|
_trasfer << drive << "\\trasfer";
|
||||||
|
if (!_disketto)
|
||||||
|
_pathname << drive << "\\";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_scelta == 'P')
|
||||||
|
{
|
||||||
|
char drive;
|
||||||
|
|
||||||
|
drive = msk.get(F_DRIVE)[0];
|
||||||
|
|
||||||
|
_marker << drive << ":\\marker";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::leggi_marker()
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
const word size = 64;
|
||||||
|
TString buffer(size);
|
||||||
|
|
||||||
|
if ( (i = fopen(_marker,"r+t")) != NULL)
|
||||||
|
{
|
||||||
|
const word letti = fread((char*)(const char*)buffer,sizeof(char),size,i);
|
||||||
|
|
||||||
|
_progdisk = atoi(buffer.sub(31,33));
|
||||||
|
_numtotdisk = atoi(buffer.sub(29,31));
|
||||||
|
|
||||||
|
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,14));
|
||||||
|
_totrectras = atol(buffer.sub(23,29));
|
||||||
|
_numinv = atoi(buffer.sub(14,17));
|
||||||
|
tmp = buffer.sub(17,23);
|
||||||
|
_datatras = converti(tmp);
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
_dittaric = leggi_tabella_tras();
|
||||||
|
|
||||||
|
if (_dittaric != 0)
|
||||||
|
{
|
||||||
|
if (!prefix().exist(_dittaric))
|
||||||
|
return error_box("Libreria archivi ditta non presente su disco");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::leggi_marker_rep()
|
||||||
|
{
|
||||||
|
TString16 tmp;
|
||||||
|
|
||||||
|
if (!fexist(_marker))
|
||||||
|
return error_box("File marker non presente sul dischetto %d: impossibile proseguire", _numdisk);
|
||||||
|
|
||||||
|
FILE* i;
|
||||||
|
|
||||||
|
const word size = 64;
|
||||||
|
TString buffer(size);
|
||||||
|
|
||||||
|
if ( (i = fopen(_marker,"r+t")) != NULL)
|
||||||
|
{
|
||||||
|
const word letti = fread((char*)(const char*)buffer,sizeof(char),size,i);
|
||||||
|
|
||||||
|
if (letti == 0)
|
||||||
|
return error_box("Rilevati ERRORI nel file MARKER: impossibile proseguire");
|
||||||
|
|
||||||
|
_nomeid = buffer.sub(0,10);
|
||||||
|
_dittainv = atol(buffer.sub(10,14));
|
||||||
|
_totrectras = atol(buffer.sub(23,29));
|
||||||
|
_numinv = atoi(buffer.sub(14,17));
|
||||||
|
tmp = buffer.sub(17,23);
|
||||||
|
_datatras = converti(tmp);
|
||||||
|
|
||||||
|
fclose(i);
|
||||||
|
|
||||||
|
if (_numdisk == 1) // Va fatto solo per il primo disco
|
||||||
|
{
|
||||||
|
_dittaric = leggi_tabella_tras();
|
||||||
|
|
||||||
|
if (_dittaric != 0)
|
||||||
|
{
|
||||||
|
if (!prefix().exist(_dittaric))
|
||||||
|
return error_box("Libreria archivi ditta non presente su disco");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return error_box("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::main_loop()
|
||||||
|
{
|
||||||
|
if (_scelta == 'S')
|
||||||
|
{
|
||||||
|
TMask msk ("cg6400b");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto == K_ENTER)
|
||||||
|
{
|
||||||
|
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())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (_sequenza)
|
||||||
|
{
|
||||||
|
if (video_ripartenza())
|
||||||
|
ripristina_trasfer();
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
_numdisk++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!leggi_marker())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (_scelta == 'P')
|
||||||
|
{
|
||||||
|
TMask msk ("cg6400c");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto == K_ENTER)
|
||||||
|
{
|
||||||
|
componi_path(msk);
|
||||||
|
|
||||||
|
if (!leggi_marker_rep())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (video_ripartenza())
|
||||||
|
{
|
||||||
|
char floppy = msk.get(F_DRIVE)[0];
|
||||||
|
bool temp = 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
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
_trasfhard = _tras_file->path(_dittaric);
|
||||||
|
_trasfhard << HEADER;
|
||||||
|
|
||||||
|
set_flag();
|
||||||
|
aggiorna_tabella();
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::leggi_trasfer(const char* nome)
|
||||||
|
{
|
||||||
|
_nultras = 0;
|
||||||
|
|
||||||
|
_trasf = _tras_file->path(_dittaric);
|
||||||
|
_trasf << nome;
|
||||||
|
|
||||||
|
_tras_file->open(_trasf);
|
||||||
|
|
||||||
|
if (_tras_file->exist())
|
||||||
|
{
|
||||||
|
if (_tras_file->read_control_rec())
|
||||||
|
{
|
||||||
|
_nultras = _tras_file->nultras();
|
||||||
|
_dataultras = _tras_file->dataultras();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Questa funzione ritorna:
|
||||||
|
// - 0 se non vengono rilevate condizioni di ripartenza o di trasferimento
|
||||||
|
// non completato.
|
||||||
|
// - 1 se viene rilevato uno stato di RIPARTENZA CON DATI CONTRADDITORI
|
||||||
|
// - 2 se viene rilevato un trasferimento precedente NON COMPLETATO
|
||||||
|
|
||||||
|
int TRic_archivi::controllo_ripartenza()
|
||||||
|
{
|
||||||
|
TString std;
|
||||||
|
bool flag = FALSE;
|
||||||
|
int var = 0;
|
||||||
|
|
||||||
|
TString trasfer;
|
||||||
|
trasfer = _tras_file->path(_dittaric);
|
||||||
|
trasfer << HEADER;
|
||||||
|
|
||||||
|
_tras_file->open(trasfer);
|
||||||
|
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
|
std = conf.get("FlStTra");
|
||||||
|
|
||||||
|
if (_tras_file->read_control_rec())
|
||||||
|
flag = TRUE;
|
||||||
|
|
||||||
|
if (std == "" && flag)
|
||||||
|
var = 1;
|
||||||
|
|
||||||
|
if (std == "*" && flag)
|
||||||
|
{
|
||||||
|
TString ult_file = _tras_file->ult_file();
|
||||||
|
TString key = _tras_file->key();
|
||||||
|
if (ult_file != "" || key != "")
|
||||||
|
var = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std != "" && std != "*")
|
||||||
|
var = 2;
|
||||||
|
|
||||||
|
_tras_file->close();
|
||||||
|
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::ripartenza()
|
||||||
|
{
|
||||||
|
if (_stato_ripartenza == 1)
|
||||||
|
return error_box("Rilevato stato di RIPARTENZA CON DATI CONTRADDITORI: procedura interrotta");
|
||||||
|
|
||||||
|
if (_stato_ripartenza == 2)
|
||||||
|
return error_box("Trasferimento precedente NON COMPLETATO: completarlo prima di questo");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::video_ripartenza()
|
||||||
|
{
|
||||||
|
TDate dataultras;
|
||||||
|
|
||||||
|
if (_prima_volta)
|
||||||
|
{
|
||||||
|
leggi_trasfer("\\trasfer");
|
||||||
|
|
||||||
|
_prima_volta = FALSE;
|
||||||
|
TMask msk ("cg6400a");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
ditta_ricevente();
|
||||||
|
_stato_ripartenza = controllo_ripartenza();
|
||||||
|
|
||||||
|
msk.set(F_NOMEID, _nomeid);
|
||||||
|
msk.set(F_CODDITTAINV, _dittainv);
|
||||||
|
msk.set(F_CODDITTARIC, _dittaric);
|
||||||
|
msk.set(F_RAGSOC, _ragsoc_dittar);
|
||||||
|
msk.set(F_NULTRASDSK, _numinv);
|
||||||
|
TString data1 = _datatras.string();
|
||||||
|
msk.set(F_DATAULTRASDSK, data1);
|
||||||
|
|
||||||
|
if (_nultras != 0)
|
||||||
|
{
|
||||||
|
msk.set(F_NULTRASTAB, _nultras);
|
||||||
|
TString data2 = _dataultras.string();
|
||||||
|
msk.set(F_DATAULTRASTAB, data2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msk.set(F_NULTRASTAB, _nultras_tab);
|
||||||
|
TString data2 = _dataultras_tab.string();
|
||||||
|
msk.set(F_DATAULTRASTAB, data2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_stato_ripartenza == 1 || _stato_ripartenza == 2 )
|
||||||
|
msk.set(F_STATO, "NON COMPLETO");
|
||||||
|
else
|
||||||
|
if (_stato_ripartenza == 0)
|
||||||
|
msk.set(F_STATO, "COMPLETO");
|
||||||
|
|
||||||
|
if (_numdisk == 1) // Va fatto solo per il primo disco
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
msk.set_handler(baipassa);
|
||||||
|
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto != K_ENTER)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (_baipassa)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (!ripartenza())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (_numinv > (_nultras_tab + 1))
|
||||||
|
warning_box("Trasferimento FUORI SEQUENZA: manca un trasferimento intermedio");
|
||||||
|
else
|
||||||
|
if (_numinv < (_nultras_tab +1))
|
||||||
|
warning_box("I dischetti risultano GIA' TRASFERITI");
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
while (tasto == K_ENTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::baipassa(TMask& m,KEY k)
|
||||||
|
{
|
||||||
|
if ( (k == K_SHIFT+K_F7) && (app()._stato_ripartenza == 0) )
|
||||||
|
app()._baipassa = TRUE;
|
||||||
|
else
|
||||||
|
app()._baipassa = FALSE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::ripristina_trasfer()
|
||||||
|
{
|
||||||
|
TProgind prg (1,"Trasferimento archivi in corso\nPrego attendere",FALSE, FALSE);
|
||||||
|
|
||||||
|
if (_numdisk == 1)
|
||||||
|
{
|
||||||
|
set_firm(_dittaric);
|
||||||
|
fcopy(_trasfer,_trasf,FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fcopy(_trasfer,_trasf,TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::trasfer2tempfile()
|
||||||
|
{
|
||||||
|
_trasfhard = _tras_file->path(_dittaric);
|
||||||
|
_trasfhard << HEADER;
|
||||||
|
|
||||||
|
_tras_file->fcopytemp(_trasf,_trasfhard);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::ditta_ricevente()
|
||||||
|
{
|
||||||
|
TLocalisamfile nditte (LF_NDITTE);
|
||||||
|
|
||||||
|
nditte.setkey(1);
|
||||||
|
nditte.zero();
|
||||||
|
nditte.put(NDT_CODDITTA, _dittaric);
|
||||||
|
if (nditte.read() == NOERR)
|
||||||
|
_ragsoc_dittar = nditte.get(NDT_RAGSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
long TRic_archivi::leggi_tabella_tras()
|
||||||
|
{
|
||||||
|
TString dep;
|
||||||
|
long ditta = 0;
|
||||||
|
bool agg_fatatt,agg_fatpas;
|
||||||
|
|
||||||
|
_tab_tra->zero();
|
||||||
|
dep = format("%10s%05d", (const char*) _nomeid, _dittainv);
|
||||||
|
_tab_tra->put("CODTAB", (const char*) dep);
|
||||||
|
if (_tab_tra->read() == NOERR)
|
||||||
|
{
|
||||||
|
ditta = _tab_tra->get_long("I0");
|
||||||
|
_nultras_tab = _tab_tra->get_int ("I1");
|
||||||
|
_dataultras_tab = _tab_tra->get_date("D0");
|
||||||
|
_agg_cau = _tab_tra->get_char("S0");
|
||||||
|
_agg_clifo = _tab_tra->get_char("S1");
|
||||||
|
_agg_pcon = _tab_tra->get_char("S2");
|
||||||
|
_agg_cls = _tab_tra->get_char("S3");
|
||||||
|
agg_fatatt = _tab_tra->get_bool("B0");
|
||||||
|
if (agg_fatatt)
|
||||||
|
_agg_fatatt = 'X';
|
||||||
|
else
|
||||||
|
_agg_fatatt = ' ';
|
||||||
|
|
||||||
|
agg_fatpas = _tab_tra->get_bool("B1");
|
||||||
|
if (agg_fatpas)
|
||||||
|
_agg_fatpas = 'X';
|
||||||
|
else
|
||||||
|
_agg_fatpas = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
return ditta;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::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");
|
||||||
|
|
||||||
|
_tras_file->open(_trasfhard);
|
||||||
|
|
||||||
|
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,38);
|
||||||
|
record.overwrite(_nrec_file,47);
|
||||||
|
|
||||||
|
TString agg(7);
|
||||||
|
|
||||||
|
agg[0] = _agg_cls;
|
||||||
|
agg[1] = _agg_cau;
|
||||||
|
agg[2] = _agg_clifo;
|
||||||
|
agg[3] = _agg_pcon;
|
||||||
|
agg[4] = _agg_fatatt;
|
||||||
|
agg[5] = _agg_fatpas;
|
||||||
|
agg[6] = '\0';
|
||||||
|
|
||||||
|
record.overwrite(agg,234);
|
||||||
|
record.overwrite(uselab,240);
|
||||||
|
record.overwrite(" ",241);
|
||||||
|
|
||||||
|
const int size = 256;
|
||||||
|
|
||||||
|
if (!_tras_file->write_control_rec(record, size))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf.set("FlStTra", flag);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TRic_archivi::aggiorna_tabella()
|
||||||
|
{
|
||||||
|
TString dep;
|
||||||
|
|
||||||
|
_tab_tra->zero();
|
||||||
|
dep = format("%10s%05d", (const char*) _nomeid, _dittainv);
|
||||||
|
_tab_tra->put("CODTAB", (const char*) dep);
|
||||||
|
if (_tab_tra->read() == NOERR)
|
||||||
|
{
|
||||||
|
_tab_tra->put("I1", (long)_nultras);
|
||||||
|
_tab_tra->put("D0", _dataultras);
|
||||||
|
_tab_tra->rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRic_archivi::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return main_loop();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cg6400 (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TRic_archivi main_app(*argv[2]);
|
||||||
|
main_app.run(argc, argv,main_app._titolo);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
17
cg/cg6400.h
Executable file
17
cg/cg6400.h
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
// Campi maschera ba7300a
|
||||||
|
|
||||||
|
#define F_NOMEID 101
|
||||||
|
#define F_CODDITTAINV 102
|
||||||
|
#define F_CODDITTARIC 103
|
||||||
|
#define F_RAGSOC 104
|
||||||
|
#define F_NULTRASDSK 105
|
||||||
|
#define F_NULTRASTAB 106
|
||||||
|
#define F_DATAULTRASDSK 107
|
||||||
|
#define F_DATAULTRASTAB 108
|
||||||
|
#define F_STATO 109
|
||||||
|
#define F_NOME 110
|
||||||
|
|
||||||
|
// Campi maschera ba7300b
|
||||||
|
|
||||||
|
#define F_DRIVE 150
|
||||||
|
#define F_PATHNAME 151
|
85
cg/cg6400a.uml
Executable file
85
cg/cg6400a.uml
Executable file
@ -0,0 +1,85 @@
|
|||||||
|
#include "cg6400.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 70 15
|
||||||
|
|
||||||
|
STRING F_NOMEID 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Nome simbolico sistema inviante "
|
||||||
|
FLAGS "ZD"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CODDITTAINV 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Codice ditta inviante "
|
||||||
|
FLAGS "ZD"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CODDITTARIC 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Ditta ricevente "
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
INPUT CODDITTA F_CODDITTARIC
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
FLAGS "RDZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 27 7 "Presente su dischetto"
|
||||||
|
END
|
||||||
|
|
||||||
|
TEXT DLG_NULL
|
||||||
|
BEGIN
|
||||||
|
PROMPT 51 7 "Ultimo intrapreso"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NULTRASDSK 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Numero invio "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NULTRASTAB 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 51 8 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAULTRASDSK
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Data limite trasferimento "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAULTRASTAB
|
||||||
|
BEGIN
|
||||||
|
PROMPT 51 9 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STATO 14
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 "Stato del trasferimento "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
36
cg/cg6400b.uml
Executable file
36
cg/cg6400b.uml
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#include "cg6400.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 44 8
|
||||||
|
|
||||||
|
LIST F_DRIVE 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Disco "
|
||||||
|
ITEM "A:|A:"
|
||||||
|
ITEM "B:|B:"
|
||||||
|
ITEM "C:|C:"
|
||||||
|
ITEM "D:|D:"
|
||||||
|
ITEM "E:|E:"
|
||||||
|
ITEM "F:|F:"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_PATHNAME 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Percorso "
|
||||||
|
HELP "Specificare il percorso completo dove ricercare il file di ricezione dati"
|
||||||
|
FLAGS "U"
|
||||||
|
//VALIDATE FILENAME_FUNC
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
24
cg/cg6400c.uml
Executable file
24
cg/cg6400c.uml
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#include "cg6400.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 40 6
|
||||||
|
|
||||||
|
LIST F_DRIVE 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 6 2 "Disco "
|
||||||
|
ITEM "A:|A:"
|
||||||
|
ITEM "B:|B:"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
651
cg/cg6500.cpp
Executable file
651
cg/cg6500.cpp
Executable file
@ -0,0 +1,651 @@
|
|||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <tabapp.h>
|
||||||
|
#include <strings.h>
|
||||||
|
#include <stdtypes.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
|
#include "..\ba\batbind.h"
|
||||||
|
#include "cglib04.h"
|
||||||
|
|
||||||
|
class Tabinv_application : public Tab_application
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
TMask* _msk;
|
||||||
|
TString _tabname;
|
||||||
|
TTransfer_file _tras_file;
|
||||||
|
|
||||||
|
TString _trasf,_control_rec;
|
||||||
|
long _ditta_tab, _ditta_tras;
|
||||||
|
bool _disable,_ditte_uguali,_salta_hnd;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool user_create();
|
||||||
|
virtual void init_query_mode(TMask&);
|
||||||
|
virtual void init_modify_mode(TMask&);
|
||||||
|
virtual void init_insert_mode(TMask&);
|
||||||
|
virtual int write(const TMask& m);
|
||||||
|
virtual int rewrite(const TMask& m);
|
||||||
|
|
||||||
|
void leggi_trasfer();
|
||||||
|
void confronta_ditta();
|
||||||
|
char cerca_stato(long codditta);
|
||||||
|
void codifica_ditta(TMask& m);
|
||||||
|
void tabella_ditta(TMask& m);
|
||||||
|
|
||||||
|
//void esegui_controlli(TMask& m);
|
||||||
|
static bool controlli_hnd (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
static bool nascosto_handler(TMask& m, KEY k);
|
||||||
|
static bool stato_invio (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
static bool ditta_handler (TMask_field& f, KEY k);
|
||||||
|
static bool almeno_un_flag(TMask_field& f, KEY k);
|
||||||
|
static bool clifo_comune (TMask_field& f, KEY k);
|
||||||
|
static bool pcon_comune (TMask_field& f, KEY k);
|
||||||
|
static bool prima_nota (TMask_field& f, KEY k);
|
||||||
|
static bool data_invio (TMask_field& f, KEY k);
|
||||||
|
static bool sigla_file (TMask_field& f, KEY k);
|
||||||
|
static bool chiave_file (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
static bool nome_id (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
Tabinv_application() {}
|
||||||
|
virtual ~Tabinv_application() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
HIDDEN inline Tabinv_application& app() {return (Tabinv_application&) main_app();}
|
||||||
|
|
||||||
|
char Tabinv_application::cerca_stato(long ditta)
|
||||||
|
{
|
||||||
|
TTable ind ("%IND");
|
||||||
|
TString dep;
|
||||||
|
char stato = '\0';
|
||||||
|
|
||||||
|
dep = format("%05d", ditta);
|
||||||
|
|
||||||
|
ind.zero();
|
||||||
|
ind.put("CODTAB", dep);
|
||||||
|
if (ind.read() == NOERR)
|
||||||
|
stato = ind.get_char("S6");
|
||||||
|
|
||||||
|
return stato;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::nascosto_handler(TMask& m, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SHIFT+K_F12)
|
||||||
|
{
|
||||||
|
if (app()._tabname == "%IND")
|
||||||
|
{
|
||||||
|
app()._disable = FALSE;
|
||||||
|
|
||||||
|
m.enable(F_NUMULINV);
|
||||||
|
m.enable(F_DATAULIN);
|
||||||
|
m.enable(F_STATO);
|
||||||
|
|
||||||
|
if (app()._ditta_tab == app()._ditta_tras)
|
||||||
|
{
|
||||||
|
m.enable(F_USELAB);
|
||||||
|
m.enable(F_CHIAVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (app()._tabname == "%INS")
|
||||||
|
{
|
||||||
|
m.enable(F_DITTAINV);
|
||||||
|
app()._salta_hnd = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::stato_invio(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if ( (k == K_ENTER || k == K_TAB) && f.mask().mode() != MODE_QUERY )
|
||||||
|
{
|
||||||
|
if ( k == K_ENTER)
|
||||||
|
{
|
||||||
|
TString stato = f.get();
|
||||||
|
int num = f.mask().get_int(F_NUMULINV);
|
||||||
|
|
||||||
|
if (num == 0 && stato != "")
|
||||||
|
return warning_box("Numero ultimo invio NON INDICATO: impossibile indicare lo stato ultimo invio");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (k == K_TAB)
|
||||||
|
{
|
||||||
|
long codditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
char stato = app().cerca_stato(codditta);
|
||||||
|
|
||||||
|
if (stato != '\0' && app()._disable)
|
||||||
|
return warning_box("Rilevato STATO DI RIPARTENZA: prima concludere il trasferimento");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::ditta_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_TAB && f.mask().mode() == MODE_QUERY)
|
||||||
|
{
|
||||||
|
long codditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
if (codditta != 0)
|
||||||
|
{
|
||||||
|
if (!prefix().exist(codditta))
|
||||||
|
{
|
||||||
|
f.error_box("La ditta selezionata non e' abilitata per la contabilita' ");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::almeno_un_flag(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
bool cau = f.mask().get_bool(F_CAUSALI);
|
||||||
|
bool clifo = f.mask().get_bool(F_CLIFO);
|
||||||
|
bool pcon = f.mask().get_bool(F_PCON);
|
||||||
|
bool pn = f.mask().get_bool(F_MOV);
|
||||||
|
bool iva = f.mask().get_bool(F_IVA);
|
||||||
|
bool fat = f.mask().get_bool(F_FATT);
|
||||||
|
|
||||||
|
if (!cau && !clifo && !pcon && !pn && !iva && !fat)
|
||||||
|
return warning_box("E' necessario indicare almeno una sigla file da trasferire");
|
||||||
|
|
||||||
|
long ditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
app().set_firm(ditta);
|
||||||
|
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
TString pcon_cau = conf.get("PcTcCm","cg");
|
||||||
|
|
||||||
|
bool causali = f.mask().get_bool(F_CAUSALI);
|
||||||
|
|
||||||
|
if (causali && pcon_cau != "")
|
||||||
|
return warning_box("Tabella causali in comune: impossibile trasferirla");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::clifo_comune(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
long ditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
app().set_firm(ditta);
|
||||||
|
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
TString ana_com = conf.get("AnCfCm","cg");
|
||||||
|
|
||||||
|
bool clifo = f.mask().get_bool(F_CLIFO);
|
||||||
|
|
||||||
|
if (clifo && ana_com != "")
|
||||||
|
return warning_box("Anagrafica clienti / fornitori in comune: impossibile trasferirla");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::pcon_comune(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
long ditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
app().set_firm(ditta);
|
||||||
|
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
TString pcon_cau = conf.get("PcTcCm","cg");
|
||||||
|
|
||||||
|
bool pcon = f.mask().get_bool(F_PCON);
|
||||||
|
|
||||||
|
if (pcon && pcon_cau != "")
|
||||||
|
return warning_box("Anagrafica Piano dei conti in comune: impossibile trasferirla");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::prima_nota(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
bool pn = f.mask().get_bool(F_MOV);
|
||||||
|
|
||||||
|
if (!pn && (f.mask().get_bool(F_IVA) || f.mask().get_bool(F_FATT)) )
|
||||||
|
return warning_box("Se si vuole inviare l' iva e' obbligatorio inviare anche la primanota");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::data_invio (TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
int num = f.mask().get_int(F_NUMULINV);
|
||||||
|
TDate data (f.get());
|
||||||
|
|
||||||
|
if (num != 0 && !data.ok())
|
||||||
|
return warning_box("Se indicato il numero deve essere indicata anche la data di invio");
|
||||||
|
|
||||||
|
if (num == 0 && data.ok())
|
||||||
|
return warning_box("Se non indicato il numero non puo' essere indicata la data di invio");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::sigla_file(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
int num = f.mask().get_int(F_NUMULINV);
|
||||||
|
TString sigla = f.get();
|
||||||
|
|
||||||
|
if (num == 0 && sigla != "")
|
||||||
|
return warning_box("Numero ultimo invio NON INDICATO: impossibile indicare la sigla ultimo file elaborato");
|
||||||
|
|
||||||
|
TString stato = f.mask().get(F_STATO);
|
||||||
|
|
||||||
|
if (stato != "F" && sigla != "")
|
||||||
|
return warning_box("La sigla ultimo file elaborato puo' essere indicata solo se lo stato ultimo invio e' F");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::chiave_file(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
TString sigla = f.mask().get(F_USELAB);
|
||||||
|
TString chiave = f.get();
|
||||||
|
|
||||||
|
if (sigla == "" && chiave != "")
|
||||||
|
return warning_box("Sigla ultimo file elaborato NON INDICATA: impossibile indicare la chiave ultimo record elaborato");
|
||||||
|
|
||||||
|
TString stato = f.mask().get(F_STATO);
|
||||||
|
|
||||||
|
if (stato != "F" && chiave == "" && sigla != "")
|
||||||
|
return warning_box("La chiave ultimo record elaborato deve essere indicata obbligatoriamente");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Tabinv_application::nome_id(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_TAB && !app()._salta_hnd && f.mask().mode() != MODE_QUERY)
|
||||||
|
{
|
||||||
|
long codditta = f.mask().get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
if (codditta != 0)
|
||||||
|
return warning_box("Rilevato STATO DI RIPARTENZA: prima concludere il trasferimento");
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//void Tabinv_application::esegui_controlli(TMask& m)
|
||||||
|
bool Tabinv_application::controlli_hnd(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_TAB && !f.mask().field(F_NUMULINV).enabled())
|
||||||
|
{
|
||||||
|
int num = f.mask().get_int(F_NUMULINV);
|
||||||
|
TDate data (f.mask().get(F_DATAULIN));
|
||||||
|
|
||||||
|
if (num != 0 && !data.ok())
|
||||||
|
return warning_box("Se indicato il numero deve essere indicata anche la data di invio");
|
||||||
|
|
||||||
|
if (num == 0 && data.ok())
|
||||||
|
return warning_box("Se non indicato il numero non puo' essere indicata la data di invio");
|
||||||
|
|
||||||
|
TString sigla = f.mask().get(F_USELAB);
|
||||||
|
|
||||||
|
if (num == 0 && sigla != "")
|
||||||
|
return warning_box("Numero ultimo invio NON INDICATO: impossibile indicare la sigla ultimo file elaborato");
|
||||||
|
|
||||||
|
TString stato = f.mask().get(F_STATO);
|
||||||
|
|
||||||
|
if (stato != "F" && sigla != "")
|
||||||
|
return warning_box("La sigla ultimo file elaborato puo' essere indicata solo se lo stato ultimo invio e' F");
|
||||||
|
|
||||||
|
TString chiave = f.mask().get(F_CHIAVE);
|
||||||
|
|
||||||
|
if (sigla == "" && chiave != "")
|
||||||
|
return warning_box("Sigla ultimo file elaborato NON INDICATA: impossibile indicare la chiave ultimo record elaborato");
|
||||||
|
|
||||||
|
if (stato != "F" && chiave == "" && sigla != "")
|
||||||
|
return warning_box("La chiave ultimo record elaborato deve essere indicata obbligatoriamente");
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::leggi_trasfer()
|
||||||
|
{
|
||||||
|
_trasf = "";
|
||||||
|
_trasf = firm2dir(0);
|
||||||
|
_trasf << HEADER;
|
||||||
|
|
||||||
|
_tras_file.open(_trasf);
|
||||||
|
|
||||||
|
if (_tras_file.exist())
|
||||||
|
{
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
{
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
_ditta_tras = atol(_control_rec.sub(25,29));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ditta_tras = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ditta_tras = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::confronta_ditta()
|
||||||
|
{
|
||||||
|
_ditta_tab = _msk->get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
if (_ditta_tab == _ditta_tras)
|
||||||
|
{
|
||||||
|
TString uselab = _tras_file.ult_file();
|
||||||
|
TString chiave = _tras_file.key();
|
||||||
|
|
||||||
|
_msk->set(F_USELAB, uselab);
|
||||||
|
_msk->set(F_CHIAVE, chiave);
|
||||||
|
_ditte_uguali = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ditte_uguali = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::codifica_ditta(TMask& m)
|
||||||
|
{
|
||||||
|
TLocalisamfile ditte ( LF_NDITTE);
|
||||||
|
|
||||||
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
ditte.setkey(1);
|
||||||
|
ditte.zero();
|
||||||
|
ditte.put(NDT_CODDITTA, ditta);
|
||||||
|
if (ditte.read() == NOERR)
|
||||||
|
{
|
||||||
|
TString ragsoc = ditte.get(NDT_RAGSOC);
|
||||||
|
m.set(F_RAGSOC, ragsoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::tabella_ditta(TMask& m)
|
||||||
|
{
|
||||||
|
TTable ind ("%IND");
|
||||||
|
TString dep;
|
||||||
|
|
||||||
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
|
|
||||||
|
if (ditta != 0)
|
||||||
|
{
|
||||||
|
dep = format("%05d", ditta);
|
||||||
|
|
||||||
|
ind.zero();
|
||||||
|
ind.put("CODTAB", dep);
|
||||||
|
if (ind.read() == NOERR)
|
||||||
|
{
|
||||||
|
TString stato = ind.get_char("S6");
|
||||||
|
int num = ind.get_int ("I0");
|
||||||
|
TDate data = ind.get_date("D0");
|
||||||
|
|
||||||
|
m.set(F_STATO, stato);
|
||||||
|
m.set(F_NUMULINV, num);
|
||||||
|
m.set(F_DATAULIN, data.string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::init_query_mode(TMask& m)
|
||||||
|
{
|
||||||
|
leggi_trasfer();
|
||||||
|
_disable = TRUE;
|
||||||
|
|
||||||
|
if (_tabname == "%INS")
|
||||||
|
{
|
||||||
|
m.disable(F_DITTAINV);
|
||||||
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
|
if (ditta != 0)
|
||||||
|
{
|
||||||
|
codifica_ditta(m);
|
||||||
|
tabella_ditta(m);
|
||||||
|
confronta_ditta();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.reset(F_NUMULINV);
|
||||||
|
m.reset(F_DATAULIN);
|
||||||
|
m.reset(F_STATO);
|
||||||
|
m.reset(F_USELAB);
|
||||||
|
m.reset(F_CHIAVE);
|
||||||
|
m.reset(F_RAGSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m.disable(F_NUMULINV);
|
||||||
|
m.disable(F_DATAULIN);
|
||||||
|
m.disable(F_STATO);
|
||||||
|
m.disable(F_USELAB);
|
||||||
|
m.disable(F_CHIAVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::init_modify_mode(TMask& m)
|
||||||
|
{
|
||||||
|
if (_tabname == "%IND")
|
||||||
|
{
|
||||||
|
leggi_trasfer();
|
||||||
|
confronta_ditta();
|
||||||
|
codifica_ditta(m);
|
||||||
|
//esegui_controlli(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_tabname == "%INS")
|
||||||
|
{
|
||||||
|
m.disable(F_DITTAINV);
|
||||||
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
|
if (ditta != 0)
|
||||||
|
{
|
||||||
|
codifica_ditta(m);
|
||||||
|
tabella_ditta(m);
|
||||||
|
confronta_ditta();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.reset(F_NUMULINV);
|
||||||
|
m.reset(F_DATAULIN);
|
||||||
|
m.reset(F_STATO);
|
||||||
|
m.reset(F_USELAB);
|
||||||
|
m.reset(F_CHIAVE);
|
||||||
|
m.reset(F_RAGSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m.disable(F_NUMULINV);
|
||||||
|
m.disable(F_DATAULIN);
|
||||||
|
m.disable(F_STATO);
|
||||||
|
m.disable(F_USELAB);
|
||||||
|
m.disable(F_CHIAVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tabinv_application::init_insert_mode(TMask& m)
|
||||||
|
{
|
||||||
|
if (_tabname == "%IND")
|
||||||
|
{
|
||||||
|
leggi_trasfer();
|
||||||
|
confronta_ditta();
|
||||||
|
codifica_ditta(m);
|
||||||
|
//esegui_controlli(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_tabname == "%INS")
|
||||||
|
{
|
||||||
|
m.disable(F_DITTAINV);
|
||||||
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
|
if (ditta != 0)
|
||||||
|
{
|
||||||
|
codifica_ditta(m);
|
||||||
|
tabella_ditta(m);
|
||||||
|
confronta_ditta();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.reset(F_NUMULINV);
|
||||||
|
m.reset(F_DATAULIN);
|
||||||
|
m.reset(F_STATO);
|
||||||
|
m.reset(F_USELAB);
|
||||||
|
m.reset(F_CHIAVE);
|
||||||
|
m.reset(F_RAGSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m.disable(F_NUMULINV);
|
||||||
|
m.disable(F_DATAULIN);
|
||||||
|
m.disable(F_STATO);
|
||||||
|
m.disable(F_USELAB);
|
||||||
|
m.disable(F_CHIAVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Tabinv_application::write(const TMask& m)
|
||||||
|
{
|
||||||
|
if (_tabname == "%IND")
|
||||||
|
{
|
||||||
|
TString str;
|
||||||
|
|
||||||
|
TString std = m.get(F_STATO);
|
||||||
|
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
conf.set("FlStInv", std);
|
||||||
|
|
||||||
|
int num = m.get_int(F_NUMULINV);
|
||||||
|
TString data = m.get (F_DATAULIN);
|
||||||
|
TString sigla = m.get (F_USELAB);
|
||||||
|
TString chiave = m.get (F_CHIAVE);
|
||||||
|
|
||||||
|
if (sigla == "")
|
||||||
|
sigla = " ";
|
||||||
|
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
{
|
||||||
|
if (_ditte_uguali)
|
||||||
|
{
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
str = format("%03d", num);
|
||||||
|
_control_rec.overwrite(str,29);
|
||||||
|
str = riconverti(data);
|
||||||
|
_control_rec.overwrite(str,32);
|
||||||
|
_control_rec.overwrite(sigla,240);
|
||||||
|
str = format("%-15s", (const char*) chiave);
|
||||||
|
_control_rec.overwrite(str,241);
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(_control_rec,256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Tab_application::write(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Tabinv_application::rewrite(const TMask& m)
|
||||||
|
{
|
||||||
|
if (_tabname == "%IND")
|
||||||
|
{
|
||||||
|
TString str;
|
||||||
|
|
||||||
|
TString std = m.get(F_STATO);
|
||||||
|
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
conf.set("FlStInv", std);
|
||||||
|
|
||||||
|
int num = m.get_int(F_NUMULINV);
|
||||||
|
TString data = m.get (F_DATAULIN);
|
||||||
|
TString sigla = m.get (F_USELAB);
|
||||||
|
TString chiave = m.get (F_CHIAVE);
|
||||||
|
|
||||||
|
if (sigla == "")
|
||||||
|
sigla = " ";
|
||||||
|
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
{
|
||||||
|
if (_ditte_uguali)
|
||||||
|
{
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
str = format("%03d", num);
|
||||||
|
_control_rec.overwrite(str,29);
|
||||||
|
str = riconverti(data);
|
||||||
|
_control_rec.overwrite(str,32);
|
||||||
|
_control_rec.overwrite(sigla,240);
|
||||||
|
str = format("%-15s", (const char*) chiave);
|
||||||
|
_control_rec.overwrite(str,241);
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(_control_rec,256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Tab_application::rewrite(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tabinv_application::user_create()
|
||||||
|
{
|
||||||
|
Tab_application::user_create();
|
||||||
|
|
||||||
|
_msk = get_mask();
|
||||||
|
_tabname = get_tabname();
|
||||||
|
|
||||||
|
if (_tabname == "%IND")
|
||||||
|
{
|
||||||
|
_msk->set_handler(nascosto_handler);
|
||||||
|
_msk->set_handler(F_STATO, stato_invio);
|
||||||
|
_msk->set_handler(F_DITTAINV, ditta_handler);
|
||||||
|
_msk->set_handler(F_CAUSALI, almeno_un_flag);
|
||||||
|
_msk->set_handler(F_CLIFO, clifo_comune);
|
||||||
|
_msk->set_handler(F_PCON, pcon_comune);
|
||||||
|
_msk->set_handler(F_MOV, prima_nota);
|
||||||
|
_msk->set_handler(F_DATAULIN, data_invio);
|
||||||
|
_msk->set_handler(F_USELAB, sigla_file);
|
||||||
|
_msk->set_handler(F_CHIAVE, chiave_file);
|
||||||
|
_msk->set_handler(F_GHOST_FIELD, controlli_hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_tabname == "%INS")
|
||||||
|
{
|
||||||
|
_msk->set_handler(nascosto_handler);
|
||||||
|
_msk->set_handler(F_DITTAINV, nome_id);
|
||||||
|
_salta_hnd = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cg6500(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
Tabinv_application a;
|
||||||
|
|
||||||
|
a.run(argc,argv, "Tabelle");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
1444
cg/cg6600.cpp
Executable file
1444
cg/cg6600.cpp
Executable file
File diff suppressed because it is too large
Load Diff
10
cg/cg6600.h
Executable file
10
cg/cg6600.h
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
// Campi maschera cg2600a.uml
|
||||||
|
|
||||||
|
#define F_CODDITTA 101
|
||||||
|
#define F_RAGSOC 102
|
||||||
|
#define F_NULTRAS 103
|
||||||
|
#define F_DATAULTRAS 104
|
||||||
|
#define F_STATO 105
|
||||||
|
#define F_USELAB 106
|
||||||
|
#define F_STD 107
|
||||||
|
|
63
cg/cg6600a.uml
Executable file
63
cg/cg6600a.uml
Executable file
@ -0,0 +1,63 @@
|
|||||||
|
#include "cg6600.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 70 11
|
||||||
|
|
||||||
|
NUMBER F_CODDITTA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Ditta ricevente "
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
INPUT CODDITTA F_CODDITTA
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
FLAGS "RDZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NULTRAS 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Numero invio "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAULTRAS
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Data limite trasferimento "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STD 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Stato del trasferimento "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_USELAB 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 31 6 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STATO 14
|
||||||
|
BEGIN
|
||||||
|
PROMPT 35 6 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
1258
cg/cg6700.cpp
Executable file
1258
cg/cg6700.cpp
Executable file
File diff suppressed because it is too large
Load Diff
8
cg/cg6700.h
Executable file
8
cg/cg6700.h
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#define F_CODDITTA 101
|
||||||
|
#define F_RAGSOC 102
|
||||||
|
#define F_LISTA 103
|
||||||
|
#define F_NUMERO 104
|
||||||
|
#define F_DATALIMITE 105
|
||||||
|
#define F_SDT 106
|
||||||
|
#define F_SIGLA 107
|
||||||
|
#define F_CHIAVE 108
|
77
cg/cg6700a.uml
Executable file
77
cg/cg6700a.uml
Executable file
@ -0,0 +1,77 @@
|
|||||||
|
#include "cg6700.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 78 17
|
||||||
|
|
||||||
|
NUMBER F_CODDITTA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Ditta ricevente "
|
||||||
|
FLAGS "FRD"
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
INPUT CODDITTA F_CODDITTA
|
||||||
|
OUTPUT F_CODDITTA CODDITTA
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_LISTA 31
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Scelta controllo "
|
||||||
|
HELP "Indicare il tipo di controllo"
|
||||||
|
ITEM "1|Lista controllo movim. errati"
|
||||||
|
ITEM "2|Lista controllo tutti movim."
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMERO 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 9 "Numero invio "
|
||||||
|
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 "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_SDT 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 31 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_SIGLA 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 34 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CHIAVE 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 37 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
1631
cg/cg6800.cpp
Executable file
1631
cg/cg6800.cpp
Executable file
File diff suppressed because it is too large
Load Diff
72
cg/cg6800.h
Executable file
72
cg/cg6800.h
Executable file
@ -0,0 +1,72 @@
|
|||||||
|
// Campi maschera cg2800a.uml
|
||||||
|
|
||||||
|
#define F_NUMREG 101
|
||||||
|
#define F_NUMRIG 102
|
||||||
|
|
||||||
|
// Campi maschera cg2800b.uml
|
||||||
|
|
||||||
|
#define F_DATAREG 103
|
||||||
|
#define F_DATADOC 104
|
||||||
|
#define F_ANNO 105
|
||||||
|
#define F_REGIVA 106
|
||||||
|
#define F_PROTIVA 107
|
||||||
|
#define F_NUPROTIVA 108
|
||||||
|
#define F_CODCAUS 109
|
||||||
|
#define F_CODPAG 110
|
||||||
|
#define F_GRUPPO 111
|
||||||
|
#define F_CONTO 112
|
||||||
|
#define F_SOTTOCONTO 113
|
||||||
|
#define F_SEZIONE 114
|
||||||
|
#define F_IMPORTO 115
|
||||||
|
#define F_DESCR 116
|
||||||
|
#define F_GRUPPOC 117
|
||||||
|
#define F_CONTOC 118
|
||||||
|
#define F_SOTTOC 119
|
||||||
|
#define F_NUMDOC 120
|
||||||
|
#define F_DESCRREG 121
|
||||||
|
#define F_DESCRCAU 122
|
||||||
|
#define F_DESCRPAG 123
|
||||||
|
#define F_DESCRPARTITA 124
|
||||||
|
#define F_DESCRCPARTITA 125
|
||||||
|
#define F_DATACOMP 126
|
||||||
|
|
||||||
|
// Campi maschera cg2800c.uml
|
||||||
|
|
||||||
|
#define F_CODCF 150
|
||||||
|
#define F_RAGSOCOCC 151
|
||||||
|
#define F_DATA74TER 152
|
||||||
|
#define F_INDOCC 153
|
||||||
|
#define F_LOCALITA 154
|
||||||
|
#define F_CAPOCC 155
|
||||||
|
#define F_PROVOCC 156
|
||||||
|
#define F_IMPONIBILE 157
|
||||||
|
#define F_IMPOSTA 158
|
||||||
|
#define F_CODIVA 159
|
||||||
|
#define F_TIPODET 160
|
||||||
|
#define F_TIPOCR 161
|
||||||
|
#define F_RAGSOCCF 162
|
||||||
|
#define F_DESCRCODIVA 163
|
||||||
|
#define F_CFPI 164
|
||||||
|
#define F_CIVOCC 165
|
||||||
|
#define F_COMOCC 166
|
||||||
|
|
||||||
|
// Campi maschera cg2801a.uml
|
||||||
|
|
||||||
|
#define F_CODDITTA 200
|
||||||
|
#define F_RAGDITTA 201
|
||||||
|
|
||||||
|
// Campi maschera cg2803a.uml
|
||||||
|
|
||||||
|
#define F_CODDITTARIC 250
|
||||||
|
#define F_RAGSOC 251
|
||||||
|
#define F_NULTRAS 252
|
||||||
|
#define F_DATAULTRAS 253
|
||||||
|
#define F_STD 254
|
||||||
|
#define F_USELAB 255
|
||||||
|
#define F_STATO 256
|
||||||
|
#define F_AGGCAUSALI 257
|
||||||
|
#define F_AGGCLIFO 258
|
||||||
|
#define F_AGGPCON 259
|
||||||
|
#define F_AGGIVD 260
|
||||||
|
#define F_FATTEM 261
|
||||||
|
#define F_FATTRIC 262
|
32
cg/cg6800a.uml
Executable file
32
cg/cg6800a.uml
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 50 8
|
||||||
|
|
||||||
|
NUMBER F_NUMREG 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Numero di registrazione "
|
||||||
|
HELP "Inserire il numero di registrazione che si vuole modificare"
|
||||||
|
FLAGS "RZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMRIG 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "Numero di riga "
|
||||||
|
HELP "Inserire il numero della riga desiderata. Se non viene specificata si entra in modifica della testata"
|
||||||
|
FLAGS "RZ"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
187
cg/cg6800b.uml
Executable file
187
cg/cg6800b.uml
Executable file
@ -0,0 +1,187 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_SAVEREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -15 -1 "~Registra"
|
||||||
|
MESSAGE EXIT,K_SAVE
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -45 -1 ""
|
||||||
|
MESSAGE EXIT,K_ESC
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -55 -1 ""
|
||||||
|
MESSAGE EXIT,K_QUIT
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "" -1 -1 78 18
|
||||||
|
|
||||||
|
NUMBER F_NUMREG 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Numero registrazione "
|
||||||
|
HELP "Inserire il numero di registrazione che si vuole modificare"
|
||||||
|
FLAGS "RZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMRIG 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 1 "Numero di riga "
|
||||||
|
HELP "Inserire il numero della riga desiderata. Se non viene specificata si entra in modifica della testata"
|
||||||
|
FLAGS "RZ"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAREG
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Data registrazione "
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATACOMP
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 3 "Data competenza "
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_ANNO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 68 3 "Anno "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATADOC
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Data del documento "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_NUMDOC 7
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 4 "Numero documento "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_REGIVA 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Registro IVA "
|
||||||
|
FLAGS "UZ"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRREG 49
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 6 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PROTIVA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Numero protocollo iva "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUPROTIVA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 40 7 "Ultimo protoc. riepilog. "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODCAUS 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Codice causale "
|
||||||
|
FLAGS "Z"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRCAU 49
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 8 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODPAG 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Codice pagamento "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRPAG 48
|
||||||
|
BEGIN
|
||||||
|
PROMPT 29 9 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_GRUPPO 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 11 "Sottoconto partita "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CONTO 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 29 11 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_SOTTOCONTO 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 34 11 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRPARTITA 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 12 "Descrizione partita "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_SEZIONE 9
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 13 "Sezione "
|
||||||
|
ITEM " |Nessuna"
|
||||||
|
ITEM "D|Dare"
|
||||||
|
ITEM "A|Avere"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
WARNING "Valore non valido per sezione"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCR 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 14 "Descrizione aggiuntiva "
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_IMPORTO 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 15 "Importo "
|
||||||
|
FLAGS "R"
|
||||||
|
PICTURE "."
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_GRUPPOC 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 16 "Sottoconto contropart. "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CONTOC 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 29 16 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_SOTTOC 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 34 16 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRCPARTITA 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 17 "Descrizione c/partita "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
187
cg/cg6800c.uml
Executable file
187
cg/cg6800c.uml
Executable file
@ -0,0 +1,187 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_SAVEREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -15 -1 "~Registra"
|
||||||
|
MESSAGE EXIT,K_SAVE
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -45 -1 ""
|
||||||
|
MESSAGE EXIT,K_ESC
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -55 -1 ""
|
||||||
|
MESSAGE EXIT,K_QUIT
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "" -1 -1 78 18
|
||||||
|
|
||||||
|
NUMBER F_NUMREG 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Numero registrazione "
|
||||||
|
HELP "Inserire il numero di registrazione che si vuole modificare"
|
||||||
|
FLAGS "RZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMRIG 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 52 1 "Numero di riga "
|
||||||
|
HELP "Inserire il numero della riga desiderata. Se non viene specificata si entra in modifica della testata"
|
||||||
|
FLAGS "RZ"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CODCF 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Codice C/F "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOCCF 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 26 3 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATA74TER
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Data reg. 74TER "
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 78 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 6 "Cliente occasionale"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CFPI 16
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
FLAGS "HG"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOCOCC 25
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Ragione sociale "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_INDOCC 22
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Indirizzo "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CIVOCC 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 41 8 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_LOCALITA 18
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Localita' "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CAPOCC 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 46 9 "C.A.P. "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_PROVOCC 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 62 9 "Provincia "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_COMOCC 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 ""
|
||||||
|
FLAGS "HG"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_IMPONIBILE 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 11 "Imponibile "
|
||||||
|
FLAGS "R"
|
||||||
|
PICTURE "."
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODIVA 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 12 "Codice IVA "
|
||||||
|
FLAGS "Z"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRCODIVA 48
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 12 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_IMPOSTA 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 13 "Imposta "
|
||||||
|
FLAGS "R"
|
||||||
|
PICTURE "."
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_TIPODET 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 14 "Tipo detraibilita' "
|
||||||
|
SHEET "Codice|Tipo detraibilita'@75"
|
||||||
|
INPUT F_TIPODET
|
||||||
|
ITEM " |Regime normale"
|
||||||
|
ITEM "1|IVA indetraibile su acquisti riferiti a ricavi esenti"
|
||||||
|
ITEM "3|IVA indicata per passaggi interni al solo fine del calcolo di ventilazione"
|
||||||
|
ITEM "9|IVA non detraibile per l'articolo 19"
|
||||||
|
OUTPUT F_TIPODET
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_TIPOCR 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 15 "Tipo Costo/Ricavo "
|
||||||
|
SHEET "Codice|Tipo costo ricavo@50"
|
||||||
|
INPUT F_TIPOCR
|
||||||
|
ITEM " |0. Acquisti o vendite in genere"
|
||||||
|
ITEM "1|1. Acquisti beni per rivendita"
|
||||||
|
ITEM "2|2. Acquisti beni ammortizzabili"
|
||||||
|
ITEM "3|3. Acquisti beni ammortizzabili con detr. 6%"
|
||||||
|
ITEM "4|4. Vendita beni strumentali art. 17"
|
||||||
|
ITEM "5|5. Beni per rivendita da non ventilare"
|
||||||
|
ITEM "8|8. Altri beni strumentali acquistati in leasing"
|
||||||
|
ITEM "9|9. Spese generali"
|
||||||
|
HELP "Tipo Costo/Ricavo del conto"
|
||||||
|
OUTPUT F_TIPOCR
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_GRUPPO 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 16 "Sottoconto costo/ricavo "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_CONTO 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 30 16 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_SOTTOCONTO 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 35 16 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRPARTITA 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 17 "Descrizione sottoconto "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
246
cg/cg6801.cpp
Executable file
246
cg/cg6801.cpp
Executable file
@ -0,0 +1,246 @@
|
|||||||
|
#include "cglib04.h"
|
||||||
|
#include "cg6801.h"
|
||||||
|
|
||||||
|
bool TDitta_ric::create()
|
||||||
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
|
_nditte = new TLocalisamfile (LF_PCON);
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::destroy()
|
||||||
|
{
|
||||||
|
delete _nditte;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::set()
|
||||||
|
{
|
||||||
|
TMask msk ("cg6801a");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
_old_ditta = get_firm();
|
||||||
|
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto != K_ENTER) return FALSE;
|
||||||
|
|
||||||
|
_dittaric = msk.get_int(F_CODDITTA);
|
||||||
|
set_firm(_dittaric);
|
||||||
|
|
||||||
|
if (!esegui_controlli())
|
||||||
|
{
|
||||||
|
set_firm(_old_ditta);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//set_firm(_dittaric);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::leggi_trasfer()
|
||||||
|
{
|
||||||
|
_trasf = _tras_file.path(_dittaric);
|
||||||
|
_trasf << HEADER;
|
||||||
|
|
||||||
|
_tras_file.open(_trasf);
|
||||||
|
|
||||||
|
if (_tras_file.exist())
|
||||||
|
{
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
{
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
_uselab = _tras_file.ult_file();
|
||||||
|
_key = _tras_file.key();
|
||||||
|
_sigle_file = _tras_file.sigle_file();
|
||||||
|
_nrec_file = _tras_file.nrec_file();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return error_box("Rilevati gravi errori negli archivi:procedura interrotta");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return error_box("Al momento non presenti trasferimenti attivi sulla ditta selezionata");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::esegui_controlli()
|
||||||
|
{
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
|
_std = conf.get("FlStTra");
|
||||||
|
|
||||||
|
if (!prefix().exist(_dittaric))
|
||||||
|
return error_box("Codice ditta NON PRESENTE in archivio oppure NON ATTIVATO in contabilita' generale");
|
||||||
|
|
||||||
|
if (_std == "")
|
||||||
|
{
|
||||||
|
if (!leggi_trasfer())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (_uselab != "")
|
||||||
|
return error_box("Ultimo trasferimento NON COMPLETATO: completarlo");
|
||||||
|
|
||||||
|
if (!controlli())
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TConfig cfd (CONFIG_DITTA);
|
||||||
|
|
||||||
|
TString std = cfd.get("FlStTra");
|
||||||
|
if (std == "")
|
||||||
|
return error_box ("Non risultano TRASFERIMENTI ATTIVI sulla ditta richiesta");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::controlli()
|
||||||
|
{
|
||||||
|
TString ana_com,pcon_cau,uselab;
|
||||||
|
bool fatto = FALSE;
|
||||||
|
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
|
ana_com = conf.get("AnCfCm","cg");
|
||||||
|
pcon_cau = conf.get("PcTcCm","cg");
|
||||||
|
|
||||||
|
if (ana_com == "X" || pcon_cau == "X")
|
||||||
|
{
|
||||||
|
if (ana_com == "X")
|
||||||
|
{
|
||||||
|
int p = _sigle_file.find('A');
|
||||||
|
if (p >= 0)
|
||||||
|
{
|
||||||
|
_sigle_file.overwrite(" ",p);
|
||||||
|
_nrec_file.overwrite("000000", p * 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pcon_cau == "X")
|
||||||
|
{
|
||||||
|
int p = _sigle_file.find('W');
|
||||||
|
if (p >= 0)
|
||||||
|
{
|
||||||
|
_sigle_file.overwrite(" ",p);
|
||||||
|
_nrec_file.overwrite("000000", p * 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
p = _sigle_file.find('P');
|
||||||
|
if (p >= 0)
|
||||||
|
{
|
||||||
|
_sigle_file.overwrite(" ",p);
|
||||||
|
_nrec_file.overwrite("000000", p * 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_control_rec.overwrite(_sigle_file,38);
|
||||||
|
_control_rec.overwrite(_nrec_file,47);
|
||||||
|
_tras_file.write_control_rec(_control_rec,256);
|
||||||
|
leggi_record_controllo();
|
||||||
|
}
|
||||||
|
|
||||||
|
setta_parametri_record("","T",FALSE);
|
||||||
|
|
||||||
|
int k = 0;
|
||||||
|
|
||||||
|
for ( int j = 0; j < _sigle_file.len(); j++)
|
||||||
|
{
|
||||||
|
TString sigla = _sigle_file.mid(j,1);
|
||||||
|
long nrec = atol(_nrec_file.mid(k,6));
|
||||||
|
|
||||||
|
if (sigla != "Z" && sigla != "U" && sigla != "B")
|
||||||
|
{
|
||||||
|
if (nrec != 0)
|
||||||
|
{
|
||||||
|
uselab = sigla;
|
||||||
|
_control_rec.overwrite(uselab,240);
|
||||||
|
_control_rec.overwrite(" ",241);
|
||||||
|
fatto = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
k += 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fatto)
|
||||||
|
{
|
||||||
|
int p = _sigle_file.find('Z');
|
||||||
|
if (p >= 0)
|
||||||
|
{
|
||||||
|
setta_parametri_record("","C",FALSE);
|
||||||
|
_control_rec.overwrite(" ",240);
|
||||||
|
_control_rec.overwrite(" ",241);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setta_parametri_record("","*",FALSE);
|
||||||
|
_control_rec.overwrite(" ",240);
|
||||||
|
_control_rec.overwrite(" ",241);
|
||||||
|
fremove(_trasf);
|
||||||
|
setta_parametri_record(""," ",FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char agg_cau = _control_rec.sub(235,236)[0];
|
||||||
|
char agg_clifo = _control_rec.sub(236,237)[0];
|
||||||
|
char agg_pcon = _control_rec.sub(237,238)[0];
|
||||||
|
|
||||||
|
if (agg_cau != ' ')
|
||||||
|
agg_cau = 'D';
|
||||||
|
if (agg_clifo != ' ')
|
||||||
|
agg_clifo = 'D';
|
||||||
|
if (agg_pcon != ' ')
|
||||||
|
agg_pcon = 'D';
|
||||||
|
|
||||||
|
TString agg(4);
|
||||||
|
|
||||||
|
agg[0] = agg_cau;
|
||||||
|
agg[1] = agg_clifo;
|
||||||
|
agg[2] = agg_pcon;
|
||||||
|
agg[3] = '\0';
|
||||||
|
|
||||||
|
_control_rec.overwrite(agg,235);
|
||||||
|
|
||||||
|
const int size = 256;
|
||||||
|
|
||||||
|
if (!_tras_file.write_control_rec(_control_rec, size))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TDitta_ric::leggi_record_controllo()
|
||||||
|
{
|
||||||
|
_tras_file.read_control_rec();
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TDitta_ric::setta_parametri_record(const TString& sigla,const TString& flag,bool uselab)
|
||||||
|
{
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
conf.set("FlStTra", flag);
|
||||||
|
|
||||||
|
if (uselab)
|
||||||
|
{
|
||||||
|
leggi_record_controllo();
|
||||||
|
_control_rec.overwrite(sigla,240);
|
||||||
|
|
||||||
|
const int size = 256;
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(_control_rec, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDitta_ric::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return set();
|
||||||
|
return FALSE;
|
||||||
|
}
|
43
cg/cg6801.h
Executable file
43
cg/cg6801.h
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
// Scelta ditta per ricezione
|
||||||
|
|
||||||
|
#include <mask.h>
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <execp.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <lffiles.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
|
#include "cg6800.h"
|
||||||
|
//#include "cglib04.h"
|
||||||
|
|
||||||
|
class TDitta_ric : public TApplication
|
||||||
|
{
|
||||||
|
TLocalisamfile* _nditte;
|
||||||
|
TTransfer_file _tras_file;
|
||||||
|
|
||||||
|
TString _trasf,_std,_uselab,_record,_nrec_file,_sigle_file,_key;
|
||||||
|
long _dittaric, _old_ditta;
|
||||||
|
TString _control_rec;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool set();
|
||||||
|
|
||||||
|
bool esegui_controlli();
|
||||||
|
bool leggi_trasfer();
|
||||||
|
bool controlli();
|
||||||
|
void leggi_record_controllo();
|
||||||
|
void setta_parametri_record(const TString& sigla,const TString& flag,bool uselab);
|
||||||
|
|
||||||
|
TDitta_ric() {};
|
||||||
|
};
|
47
cg/cg6801a.uml
Executable file
47
cg/cg6801a.uml
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
PAGE "Selezione Ditta" -1 -1 64 6
|
||||||
|
|
||||||
|
NUMBER F_CODDITTA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Codice "
|
||||||
|
HELP "Codice della ditta da attivare"
|
||||||
|
FLAGS "FR"
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
INPUT CODDITTA F_CODDITTA
|
||||||
|
DISPLAY "Codice" CODDITTA
|
||||||
|
DISPLAY "Ragione sociale@50" RAGSOC
|
||||||
|
OUTPUT F_CODDITTA CODDITTA
|
||||||
|
OUTPUT F_RAGDITTA RAGSOC
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Ditta assente"
|
||||||
|
KEY 1
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGDITTA 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Rag. Soc. "
|
||||||
|
USE LF_NDITTE KEY 2
|
||||||
|
HELP "Ragione sociale della ditta da selezionare"
|
||||||
|
INPUT RAGSOC F_RAGDITTA
|
||||||
|
DISPLAY "Ragione sociale@50" RAGSOC
|
||||||
|
DISPLAY "Codice" CODDITTA
|
||||||
|
COPY OUTPUT F_CODDITTA
|
||||||
|
KEY 2
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
380
cg/cg6802.cpp
Executable file
380
cg/cg6802.cpp
Executable file
@ -0,0 +1,380 @@
|
|||||||
|
#include "cglib04.h"
|
||||||
|
#include "cg6802.h"
|
||||||
|
|
||||||
|
bool TAnn_mov::create()
|
||||||
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
|
_pcon = new TLocalisamfile (LF_PCON);
|
||||||
|
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||||
|
_mov = new TLocalisamfile (LF_MOV);
|
||||||
|
_rmov = new TLocalisamfile (LF_RMOV);
|
||||||
|
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||||
|
|
||||||
|
_rec_mov = new TRectype (LF_MOV);
|
||||||
|
|
||||||
|
_registra = FALSE;
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::destroy()
|
||||||
|
{
|
||||||
|
delete _pcon;
|
||||||
|
delete _clifo;
|
||||||
|
delete _mov;
|
||||||
|
delete _rmov;
|
||||||
|
delete _rmoviva;
|
||||||
|
|
||||||
|
delete _rec_mov;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::apri_temp_file()
|
||||||
|
{
|
||||||
|
TString80 tmpmov = "%";
|
||||||
|
tmpmov << get_firm_dir();
|
||||||
|
tmpmov << "\\" << TEMP_MOV;
|
||||||
|
TString80 tmprmov = "%";
|
||||||
|
tmprmov << get_firm_dir();
|
||||||
|
tmprmov << "\\" << TEMP_RMOV;
|
||||||
|
TString80 tmprmoviva = "%";
|
||||||
|
tmprmoviva << get_firm_dir();
|
||||||
|
tmprmoviva << "\\" << TEMP_RMOVIVA;
|
||||||
|
|
||||||
|
_tmov = new TIsamtempfile(LF_MOV, tmpmov, 0);
|
||||||
|
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0);
|
||||||
|
|
||||||
|
_is_exist = FALSE;
|
||||||
|
TString tmp = tmprmoviva.mid(1);
|
||||||
|
tmp << ".dbf";
|
||||||
|
if (fexist(tmp))
|
||||||
|
{
|
||||||
|
_tiva = new TIsamtempfile(LF_RMOVIVA, tmprmoviva, 0);
|
||||||
|
_is_exist = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::chiudi_tempfile()
|
||||||
|
{
|
||||||
|
delete _tmov;
|
||||||
|
delete _trmov;
|
||||||
|
if (_is_exist)
|
||||||
|
delete _tiva;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::set()
|
||||||
|
{
|
||||||
|
_dittaric = get_firm();
|
||||||
|
|
||||||
|
if (!esegui_controlli()) return FALSE;
|
||||||
|
|
||||||
|
apri_temp_file();
|
||||||
|
|
||||||
|
if (!video())
|
||||||
|
{
|
||||||
|
if (_registra)
|
||||||
|
{
|
||||||
|
setta_parametri_record(" ","C");
|
||||||
|
chiudi_tempfile();
|
||||||
|
/*
|
||||||
|
TString80 tpmov = get_firm_dir();
|
||||||
|
tpmov << "\\" << TEMP_MOV;
|
||||||
|
TString80 tprmov = get_firm_dir();
|
||||||
|
tprmov << "\\" << TEMP_RMOV;
|
||||||
|
TString80 tprmoviva = get_firm_dir();
|
||||||
|
tprmoviva << "\\" << TEMP_RMOVIVA;
|
||||||
|
|
||||||
|
pack(TRUE,LF_MOV,tpmov);
|
||||||
|
pack(TRUE,LF_RMOV,tprmov);
|
||||||
|
pack(TRUE,LF_RMOVIVA,tprmoviva);*/
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
chiudi_tempfile();
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::video()
|
||||||
|
{
|
||||||
|
TMask msk ("cg6802a");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto != K_ENTER) return FALSE;
|
||||||
|
|
||||||
|
if (esiste_testata_mov(msk))
|
||||||
|
{
|
||||||
|
TMask mask ("cg6802b");
|
||||||
|
|
||||||
|
mask.set_handler(F_REGIVA, codice_registro_hnd);
|
||||||
|
mask.set_handler(F_CODCAUS, codice_causale_hnd);
|
||||||
|
|
||||||
|
setta_campi_maschera(mask);
|
||||||
|
|
||||||
|
tasto = mask.run();
|
||||||
|
|
||||||
|
switch (tasto)
|
||||||
|
{
|
||||||
|
case K_ESC :
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_QUIT :
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_SAVE :
|
||||||
|
{
|
||||||
|
annulla(mask);
|
||||||
|
_registra = TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (tasto != K_QUIT); //K_ENTER
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::esiste_testata_mov(TMask& m)
|
||||||
|
{
|
||||||
|
_numreg = m.get_long(F_NUMREG);
|
||||||
|
|
||||||
|
_tmov->setkey(1);
|
||||||
|
_tmov->zero();
|
||||||
|
_tmov->put(MOV_NUMREG, _numreg);
|
||||||
|
|
||||||
|
if (_tmov->read() == NOERR)
|
||||||
|
*_rec_mov = _tmov->curr();
|
||||||
|
else
|
||||||
|
return error_box("Registrazione richiesta NON PRESENTE tra i movimenti in trasferimento");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::setta_campi_maschera(TMask& m)
|
||||||
|
{
|
||||||
|
TDate datareg (_rec_mov->get_date(MOV_DATAREG));
|
||||||
|
TDate datadoc (_rec_mov->get_date(MOV_DATADOC));
|
||||||
|
TString numdoc = _rec_mov->get (MOV_NUMDOC);
|
||||||
|
TString regiva = _rec_mov->get (MOV_REG);
|
||||||
|
// regiva.trim();
|
||||||
|
long protiva = _rec_mov->get_long(MOV_PROTIVA);
|
||||||
|
TString codcaus = _rec_mov->get (MOV_CODCAUS);
|
||||||
|
|
||||||
|
m.set(F_NUMREG, _numreg);
|
||||||
|
m.set(F_DATAREG, datareg.string());
|
||||||
|
m.set(F_DATADOC, datadoc.string());
|
||||||
|
m.set(F_NUMDOC, numdoc);
|
||||||
|
m.set(F_REGIVA, regiva);
|
||||||
|
m.set(F_PROTIVA, protiva);
|
||||||
|
m.set(F_CODCAUS, codcaus);
|
||||||
|
|
||||||
|
m.disable(F_NUMREG);
|
||||||
|
m.disable(F_DATAREG);
|
||||||
|
m.disable(F_DATADOC);
|
||||||
|
m.disable(F_NUMDOC);
|
||||||
|
m.disable(F_REGIVA);
|
||||||
|
m.disable(F_PROTIVA);
|
||||||
|
m.disable(F_CODCAUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::annulla(TMask& m)
|
||||||
|
{
|
||||||
|
TRectype* rec_rmov,* rec_riva;
|
||||||
|
rec_rmov = new TRectype (LF_RMOV);
|
||||||
|
|
||||||
|
// Cancello la testata del movimento
|
||||||
|
|
||||||
|
long numreg = m.get_long(F_NUMREG);
|
||||||
|
|
||||||
|
_tmov->setkey(1);
|
||||||
|
_tmov->zero();
|
||||||
|
_tmov->put(MOV_NUMREG, numreg);
|
||||||
|
if (_tmov->read() == NOERR)
|
||||||
|
_tmov->remove();
|
||||||
|
|
||||||
|
// Cancello tutte le righe di Primanota
|
||||||
|
|
||||||
|
_trmov->setkey(1);
|
||||||
|
_trmov->zero();
|
||||||
|
_trmov->put(RMV_NUMREG, numreg);
|
||||||
|
*rec_rmov = _trmov->curr();
|
||||||
|
|
||||||
|
for (_trmov->read(); !_trmov->eof(); _trmov->next())
|
||||||
|
{
|
||||||
|
if (_trmov->curr() > *rec_rmov) break;
|
||||||
|
|
||||||
|
_trmov->remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
delete rec_rmov;
|
||||||
|
|
||||||
|
// Cancello tutte le righe iva
|
||||||
|
|
||||||
|
rec_riva = new TRectype (LF_RMOVIVA);
|
||||||
|
|
||||||
|
_tiva->setkey(1);
|
||||||
|
_tiva->zero();
|
||||||
|
_tiva->put(RMI_NUMREG, numreg);
|
||||||
|
*rec_riva = _tiva->curr();
|
||||||
|
|
||||||
|
for (_tiva->read(); !_tiva->eof(); _tiva->next())
|
||||||
|
{
|
||||||
|
if (_tiva->curr() > *rec_riva) break;
|
||||||
|
|
||||||
|
_tiva->remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
delete rec_riva;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::leggi_trasfer()
|
||||||
|
{
|
||||||
|
_trasf = _tras_file.path(_dittaric);
|
||||||
|
_trasf << HEADER;
|
||||||
|
|
||||||
|
_tras_file.open(_trasf);
|
||||||
|
|
||||||
|
if (_tras_file.exist())
|
||||||
|
{
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
else
|
||||||
|
return error_box("Rilevati gravi errori negli archivi:procedura interrotta");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return error_box("Al momento non presenti trasferimenti attivi sulla ditta selezionata");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::codice_registro_hnd(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
TTable reg ("REG");
|
||||||
|
TString descr,dep;
|
||||||
|
|
||||||
|
if (k == K_TAB)
|
||||||
|
{
|
||||||
|
TString codreg = f.get();
|
||||||
|
TDate datareg (f.mask().get(F_DATAREG));
|
||||||
|
int anno = date2esc(datareg);
|
||||||
|
|
||||||
|
reg.zero();
|
||||||
|
reg.put("CODTAB", codreg);
|
||||||
|
if (reg.read() == NOERR)
|
||||||
|
{
|
||||||
|
descr = reg.get("S0");
|
||||||
|
f.mask().set(F_DESCRREG, descr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::codice_causale_hnd(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
TLocalisamfile cau (LF_CAUSALI);
|
||||||
|
TString descr;
|
||||||
|
|
||||||
|
if (k == K_TAB)
|
||||||
|
{
|
||||||
|
TString codcau = f.get();
|
||||||
|
|
||||||
|
cau.setkey(1);
|
||||||
|
cau.zero();
|
||||||
|
cau.put("CODCAUS", codcau);
|
||||||
|
if (cau.read() == NOERR)
|
||||||
|
{
|
||||||
|
descr = cau.get("DESCR");
|
||||||
|
f.mask().set(F_DESCRCAU, descr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::esegui_controlli()
|
||||||
|
{
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
|
_std = conf.get("FlStTra");
|
||||||
|
|
||||||
|
if (!prefix().exist(_dittaric))
|
||||||
|
return error_box("Rilevati GRAVI ERRORI negli archivi: procedura interrotta");
|
||||||
|
|
||||||
|
if (!leggi_trasfer())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!controlli())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::controlli()
|
||||||
|
{
|
||||||
|
TString16 chiave,sigla;
|
||||||
|
|
||||||
|
chiave = _control_rec.sub(241,256);
|
||||||
|
chiave.trim();
|
||||||
|
sigla = _control_rec.sub(240,241);
|
||||||
|
sigla.trim();
|
||||||
|
|
||||||
|
if (_std == "M" && sigla == "Z" && chiave != "")
|
||||||
|
return error_box("Variazione NON POSSIBILE: trasferimento movimenti gia' iniziato");
|
||||||
|
|
||||||
|
if (_std == "M" && sigla == "U")
|
||||||
|
return error_box("Variazione NON POSSIBILE: trasferimento movimenti gia' iniziato");
|
||||||
|
|
||||||
|
if (_std == "*")
|
||||||
|
{
|
||||||
|
warning_box("Trasferimento interamente completato: proseguire per cancellare il file");
|
||||||
|
_tras_file.remove_all();
|
||||||
|
setta_parametri_record(""," ");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_std == "T")
|
||||||
|
return error_box("Variazione NON POSSIBILE: eseguire prima la ricezione delle tabelle");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::leggi_record_controllo()
|
||||||
|
{
|
||||||
|
_tras_file.read_control_rec();
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TAnn_mov::setta_parametri_record(const TString& sigla,const TString& flag)
|
||||||
|
{
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
conf.set("FlStTra", flag);
|
||||||
|
|
||||||
|
leggi_record_controllo();
|
||||||
|
_control_rec.overwrite(sigla,240);
|
||||||
|
|
||||||
|
const int size = 256;
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(_control_rec, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TAnn_mov::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return set();
|
||||||
|
return FALSE;
|
||||||
|
}
|
58
cg/cg6802.h
Executable file
58
cg/cg6802.h
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
// Annullamento movimenti da ricevere
|
||||||
|
|
||||||
|
#include <mask.h>
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <execp.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <lffiles.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
//HIDDEN int date2esc(const TDate& d, int* prevesc = NULL);
|
||||||
|
|
||||||
|
class TAnn_mov : public TApplication
|
||||||
|
{
|
||||||
|
TIsamtempfile* _tmov,* _trmov,* _tiva;
|
||||||
|
TLocalisamfile* _pcon,* _clifo, *_mov, *_rmov, *_rmoviva;
|
||||||
|
TRectype* _rec_mov;
|
||||||
|
TTransfer_file _tras_file;
|
||||||
|
|
||||||
|
TString _trasf,_std,_uselab,_record,_nrec_file,_sigle_file,_key;
|
||||||
|
long _dittaric,_numreg;
|
||||||
|
TString _control_rec;
|
||||||
|
bool _registra, _is_exist;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool set();
|
||||||
|
|
||||||
|
void apri_temp_file();
|
||||||
|
void chiudi_tempfile();
|
||||||
|
bool esegui_controlli();
|
||||||
|
bool leggi_trasfer();
|
||||||
|
bool controlli();
|
||||||
|
void leggi_record_controllo();
|
||||||
|
bool video();
|
||||||
|
void annulla(TMask& m);
|
||||||
|
bool esiste_testata_mov(TMask& m);
|
||||||
|
|
||||||
|
void setta_campi_maschera(TMask& m);
|
||||||
|
|
||||||
|
void setta_parametri_record(const TString& sigla,const TString& flag);
|
||||||
|
|
||||||
|
static bool codice_registro_hnd (TMask_field& f, KEY k);
|
||||||
|
static bool codice_causale_hnd (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
TAnn_mov() {};
|
||||||
|
};
|
25
cg/cg6802a.uml
Executable file
25
cg/cg6802a.uml
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 50 6
|
||||||
|
|
||||||
|
NUMBER F_NUMREG 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Numero di registrazione "
|
||||||
|
HELP "Inserire il numero di registrazione che si vuole modificare"
|
||||||
|
FLAGS "RZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
87
cg/cg6802b.uml
Executable file
87
cg/cg6802b.uml
Executable file
@ -0,0 +1,87 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_SAVEREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -15 -1 "~Annulla"
|
||||||
|
MESSAGE EXIT,K_SAVE
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -45 -1 ""
|
||||||
|
MESSAGE EXIT,K_ESC
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -55 -1 ""
|
||||||
|
MESSAGE EXIT,K_QUIT
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "" -1 -1 78 18
|
||||||
|
|
||||||
|
NUMBER F_NUMREG 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Numero registrazione "
|
||||||
|
HELP "Inserire il numero di registrazione che si vuole modificare"
|
||||||
|
FLAGS "RZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAREG
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Data registrazione "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_NUMDOC 7
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 5 "Numero documento "
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATADOC
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Data del documento "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_REGIVA 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Registro IVA "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRREG 49
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 8 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_PROTIVA 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Numero protocollo iva "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODCAUS 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 11 "Codice causale "
|
||||||
|
FLAGS "Z"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCRCAU 49
|
||||||
|
BEGIN
|
||||||
|
PROMPT 28 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCR 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 13 "Descrizione aggiuntiva "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
314
cg/cg6803.cpp
Executable file
314
cg/cg6803.cpp
Executable file
@ -0,0 +1,314 @@
|
|||||||
|
#include "cglib04.h"
|
||||||
|
#include "cg6803.h"
|
||||||
|
|
||||||
|
HIDDEN TVis_ric& app() { return (TVis_ric &) main_app(); }
|
||||||
|
|
||||||
|
bool TVis_ric::create()
|
||||||
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
|
_tab_tra = new TTable ("%TRA");
|
||||||
|
|
||||||
|
_registra = FALSE;
|
||||||
|
_ftrasfer = TRUE;
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::destroy()
|
||||||
|
{
|
||||||
|
delete _tab_tra;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::baipassa(TMask& m, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SHIFT+K_F12)
|
||||||
|
{
|
||||||
|
m.enable(F_NULTRAS);
|
||||||
|
m.enable(F_DATAULTRAS);
|
||||||
|
m.enable(F_STD);
|
||||||
|
m.enable(F_USELAB);
|
||||||
|
m.enable(F_STATO);
|
||||||
|
m.enable(F_AGGCAUSALI);
|
||||||
|
m.enable(F_AGGCLIFO);
|
||||||
|
m.enable(F_AGGPCON);
|
||||||
|
m.enable(F_AGGIVD);
|
||||||
|
m.enable(F_FATTEM);
|
||||||
|
m.enable(F_FATTRIC);
|
||||||
|
|
||||||
|
app()._registra = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::stato_hnd (TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER)
|
||||||
|
{
|
||||||
|
TString std = f.get();
|
||||||
|
TString uselab = f.mask().get(F_USELAB);
|
||||||
|
TString chiave = f.mask().get(F_STATO);
|
||||||
|
|
||||||
|
if (!app()._ftrasfer) //_ftrasfer dice se esiste il file trasfer o il suo record di controllo
|
||||||
|
{
|
||||||
|
if (std != "" && std != "*")
|
||||||
|
return warning_box("Valore non valido per stato ultima ricezione");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (std != "" && std != "T" && std != "C" && std != "M" && std != "*")
|
||||||
|
return warning_box("Valore non valido per stato ultima ricezione");
|
||||||
|
|
||||||
|
if (uselab != "" && (std == "" || std == "C" || std == "*") )
|
||||||
|
return warning_box("Valore non valido per stato ultima ricezione");
|
||||||
|
|
||||||
|
if (chiave != "" && (std == "" || std == "C" || std == "*") )
|
||||||
|
return warning_box("Valore non valido per stato ultima ricezione");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::uselab_hnd (TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER)
|
||||||
|
{
|
||||||
|
TString std = f.mask().get(F_STD);
|
||||||
|
TString uselab = f.get();
|
||||||
|
|
||||||
|
if (std == "" && uselab != "")
|
||||||
|
return warning_box("Lo stato ultima ricezione non e' significativo: la sigla ultimo file elaborato non puo' essere significativa");
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::chiave_hnd (TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_ENTER)
|
||||||
|
{
|
||||||
|
TString std = f.mask().get(F_STD);
|
||||||
|
TString uselab = f.mask().get(F_USELAB);
|
||||||
|
TString chiave = f.get();
|
||||||
|
|
||||||
|
if (std == "" && chiave != "")
|
||||||
|
return warning_box("Lo stato ultima ricezione non e' significativo: la chiave ultimo file elaborato non puo' essere significativa");
|
||||||
|
|
||||||
|
if (uselab == "" && chiave != "")
|
||||||
|
return warning_box("La sigla ultimo file elaborato non e' significativa: la chiave ultimo file elaborato non puo' essere significativa");
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::video()
|
||||||
|
{
|
||||||
|
if (!esegui_controlli())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
TMask msk ("cg6803a");
|
||||||
|
KEY tasto;
|
||||||
|
|
||||||
|
ditta_ricevente(); // Cerca la ragione sociale della ditta.
|
||||||
|
|
||||||
|
setta_campi_video(msk); // Setta i campi della maschera con i dati relativi
|
||||||
|
// alla ditta e alla tabella trasferimenti.
|
||||||
|
msk.set_handler(baipassa);
|
||||||
|
msk.set_handler(F_STD, stato_hnd);
|
||||||
|
msk.set_handler(F_USELAB, uselab_hnd);
|
||||||
|
msk.set_handler(F_STATO, chiave_hnd);
|
||||||
|
|
||||||
|
tasto = msk.run();
|
||||||
|
|
||||||
|
if (tasto != K_ENTER)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
registra(msk);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TVis_ric::setta_campi_video(TMask& msk)
|
||||||
|
{
|
||||||
|
if (_ftrasfer)
|
||||||
|
{
|
||||||
|
msk.set(F_CODDITTARIC, _dittaric);
|
||||||
|
msk.set(F_RAGSOC, _ragsoc_dittar);
|
||||||
|
msk.set(F_NULTRAS, _nultras);
|
||||||
|
|
||||||
|
if (_nultras != 0)
|
||||||
|
{
|
||||||
|
TString data1 = _dataultras.string();
|
||||||
|
msk.set(F_DATAULTRAS, data1);
|
||||||
|
}
|
||||||
|
msk.set(F_USELAB, _uselab);
|
||||||
|
msk.set(F_STATO, _key);
|
||||||
|
msk.set(F_AGGCAUSALI, _agg_cau);
|
||||||
|
msk.set(F_AGGCLIFO, _agg_clifo);
|
||||||
|
msk.set(F_AGGPCON, _agg_pcon);
|
||||||
|
msk.set(F_AGGIVD, _agg_IVdir);
|
||||||
|
msk.set(F_FATTEM, _riatt_att);
|
||||||
|
msk.set(F_FATTRIC, _riatt_pas);
|
||||||
|
}
|
||||||
|
|
||||||
|
msk.set(F_STD, _std);
|
||||||
|
|
||||||
|
msk.disable(F_CODDITTARIC);
|
||||||
|
msk.disable(F_RAGSOC);
|
||||||
|
msk.disable(F_NULTRAS);
|
||||||
|
msk.disable(F_DATAULTRAS);
|
||||||
|
msk.disable(F_STD);
|
||||||
|
msk.disable(F_USELAB);
|
||||||
|
msk.disable(F_STATO);
|
||||||
|
msk.disable(F_AGGCAUSALI);
|
||||||
|
msk.disable(F_AGGCLIFO);
|
||||||
|
msk.disable(F_AGGPCON);
|
||||||
|
msk.disable(F_AGGIVD);
|
||||||
|
msk.disable(F_FATTEM);
|
||||||
|
msk.disable(F_FATTRIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TVis_ric::registra(TMask& m)
|
||||||
|
{
|
||||||
|
if (_registra)
|
||||||
|
{
|
||||||
|
TString str;
|
||||||
|
|
||||||
|
str = m.get(F_NULTRAS);
|
||||||
|
TString nultras = format("%03s", (const char*) str);
|
||||||
|
str = m.get(F_DATAULTRAS);
|
||||||
|
TString datault = riconverti(str);
|
||||||
|
char agg_cau = m.get(F_AGGCAUSALI)[0];
|
||||||
|
char agg_clf = m.get(F_AGGCLIFO)[0];
|
||||||
|
char agg_pco = m.get(F_AGGPCON)[0];
|
||||||
|
char agg_IV = m.get(F_AGGIVD)[0];
|
||||||
|
char riat_at = m.get(F_FATTEM)[0];
|
||||||
|
char riat_pa = m.get(F_FATTRIC)[0];
|
||||||
|
|
||||||
|
TString flags (7);
|
||||||
|
flags[0] = agg_IV;
|
||||||
|
flags[1] = agg_cau;
|
||||||
|
flags[2] = agg_clf;
|
||||||
|
flags[3] = agg_pco;
|
||||||
|
flags[4] = riat_at;
|
||||||
|
flags[5] = riat_pa;
|
||||||
|
flags[6] = '\0';
|
||||||
|
|
||||||
|
TString uselab = m.get(F_USELAB);
|
||||||
|
if (uselab == "")
|
||||||
|
uselab = " ";
|
||||||
|
|
||||||
|
str = m.get(F_STATO);
|
||||||
|
TString chiave = format("%-15s", (const char*) str);
|
||||||
|
|
||||||
|
_control_rec.overwrite(nultras,29);
|
||||||
|
_control_rec.overwrite(datault,32);
|
||||||
|
_control_rec.overwrite(flags,234);
|
||||||
|
_control_rec.overwrite(uselab,240);
|
||||||
|
_control_rec.overwrite(chiave,241);
|
||||||
|
|
||||||
|
const int size = 256;
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(_control_rec, size);
|
||||||
|
|
||||||
|
TString std = m.get(F_STD);
|
||||||
|
|
||||||
|
setta_std(std);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TVis_ric::setta_std(const TString& flag)
|
||||||
|
{
|
||||||
|
TConfig conf (CONFIG_DITTA);
|
||||||
|
|
||||||
|
conf.set("FlStTra", flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TVis_ric::ditta_ricevente()
|
||||||
|
{
|
||||||
|
TLocalisamfile nditte (LF_NDITTE);
|
||||||
|
|
||||||
|
nditte.setkey(1);
|
||||||
|
nditte.zero();
|
||||||
|
nditte.put(NDT_CODDITTA, _dittaric);
|
||||||
|
if (nditte.read() == NOERR)
|
||||||
|
_ragsoc_dittar = nditte.get(NDT_RAGSOC);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
long TVis_ric::leggi_tabella_tras()
|
||||||
|
{
|
||||||
|
TString dep;
|
||||||
|
long ditta = 0;
|
||||||
|
|
||||||
|
_tab_tra->zero();
|
||||||
|
dep = format("%10s%05d", (const char*) _nomeid, _dittainv);
|
||||||
|
_tab_tra->put("CODTAB", (const char*) dep);
|
||||||
|
if (_tab_tra->read() == NOERR)
|
||||||
|
ditta = _tab_tra->get_long("I0");
|
||||||
|
|
||||||
|
return ditta;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
bool TVis_ric::leggi_trasfer()
|
||||||
|
{
|
||||||
|
TString data,tmp;
|
||||||
|
|
||||||
|
_trasf = _tras_file.path(_dittaric);
|
||||||
|
_trasf << HEADER;
|
||||||
|
|
||||||
|
_tras_file.open(_trasf);
|
||||||
|
|
||||||
|
if (_tras_file.exist())
|
||||||
|
{
|
||||||
|
if (_tras_file.read_control_rec())
|
||||||
|
{
|
||||||
|
_control_rec = _tras_file.record();
|
||||||
|
_nomeid = _control_rec.sub(15,25);
|
||||||
|
_dittainv = _control_rec.sub(25,29);
|
||||||
|
_nultras = _tras_file.nultras();
|
||||||
|
_dataultras = _tras_file.dataultras();
|
||||||
|
_uselab = _tras_file.ult_file();
|
||||||
|
_key = _tras_file.key();
|
||||||
|
_agg_cau = _control_rec.sub(235,236);
|
||||||
|
_agg_clifo = _control_rec.sub(236,237);
|
||||||
|
_agg_pcon = _control_rec.sub(237,238);
|
||||||
|
_agg_IVdir = _control_rec.sub(234,235);
|
||||||
|
_riatt_att = _control_rec.sub(238,239);
|
||||||
|
_riatt_pas = _control_rec.sub(239,240);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ftrasfer = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ftrasfer = FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::esegui_controlli()
|
||||||
|
{
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
|
_std = conf.get("FlStTra");
|
||||||
|
|
||||||
|
_dittaric = get_firm();
|
||||||
|
|
||||||
|
if (!prefix().exist(_dittaric))
|
||||||
|
return error_box("Rilevati GRAVI ERRORI negli archivi: procedura interrotta");
|
||||||
|
|
||||||
|
if (!leggi_trasfer())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TVis_ric::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return video();
|
||||||
|
return FALSE;
|
||||||
|
}
|
56
cg/cg6803.h
Executable file
56
cg/cg6803.h
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
// Visualizzazione stato ricezione
|
||||||
|
|
||||||
|
#include <mask.h>
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <execp.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <lffiles.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
//HIDDEN TString80 TP;
|
||||||
|
|
||||||
|
class TVis_ric : public TApplication
|
||||||
|
{
|
||||||
|
TTable* _tab_tra;
|
||||||
|
TTransfer_file _tras_file;
|
||||||
|
|
||||||
|
TString _trasf,_std,_uselab,_key,_dittainv,_nomeid,_ragsoc_dittar;
|
||||||
|
TString _agg_cau,_agg_clifo,_agg_pcon,_agg_IVdir,_riatt_att,_riatt_pas;
|
||||||
|
long _dittaric;
|
||||||
|
TString _control_rec;
|
||||||
|
TDate _dataultras;
|
||||||
|
int _nultras;
|
||||||
|
bool _registra,_ftrasfer;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool video();
|
||||||
|
void setta_campi_video(TMask& m);
|
||||||
|
|
||||||
|
void ditta_ricevente();
|
||||||
|
long leggi_tabella_tras();
|
||||||
|
bool esegui_controlli();
|
||||||
|
bool leggi_trasfer();
|
||||||
|
void registra(TMask& m);
|
||||||
|
|
||||||
|
void setta_std(const TString& flag);
|
||||||
|
|
||||||
|
static bool baipassa (TMask& m, KEY k);
|
||||||
|
static bool stato_hnd (TMask_field& f, KEY k);
|
||||||
|
static bool uselab_hnd (TMask_field& f, KEY k);
|
||||||
|
static bool chiave_hnd (TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
TVis_ric() {};
|
||||||
|
};
|
110
cg/cg6803a.uml
Executable file
110
cg/cg6803a.uml
Executable file
@ -0,0 +1,110 @@
|
|||||||
|
#include "cg6800.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 78 20
|
||||||
|
|
||||||
|
NUMBER F_CODDITTARIC 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Ditta ricevente "
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
INPUT CODDITTA F_CODDITTARIC
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
FLAGS "RDZ"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NULTRAS 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Numero ultimo invio ricevuto "
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAULTRAS
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 6 "Data ultimo invio ricevuto "
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STD 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 8 "Stato del trasferimento "
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_USELAB 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 34 8 ""
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STATO 14
|
||||||
|
BEGIN
|
||||||
|
PROMPT 38 8 ""
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_AGGCAUSALI 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 "Aggiornamento causali gia' presenti "
|
||||||
|
ITEM "N|No"
|
||||||
|
ITEM "D|Descr."
|
||||||
|
ITEM "T|Tutto"
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_AGGCLIFO 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 11 "Aggiornamento Clienti/Fornitori gia' presenti "
|
||||||
|
ITEM "N|No"
|
||||||
|
ITEM "D|Descr."
|
||||||
|
ITEM "T|Tutto"
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_AGGPCON 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 12 "Aggiornamento voci Piano dei Conti gia' presenti "
|
||||||
|
ITEM "N|No"
|
||||||
|
ITEM "D|Descr."
|
||||||
|
ITEM "T|Tutto"
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_AGGIVD 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 13 "Aggiornamento classi Piano dei Conti "
|
||||||
|
ITEM "N|No"
|
||||||
|
ITEM "T|Tutto"
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_FATTEM
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 14 "Riattribuzione num. protocollo su fatture emesse "
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_FATTRIC
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 15 "Riattribuzione num. protocollo su fatture ricevute "
|
||||||
|
FLAGS "G"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
1528
cg/cg6900.cpp
Executable file
1528
cg/cg6900.cpp
Executable file
File diff suppressed because it is too large
Load Diff
150
cg/cg6900.h
Executable file
150
cg/cg6900.h
Executable file
@ -0,0 +1,150 @@
|
|||||||
|
// Invio contabilita'
|
||||||
|
#define STRICT
|
||||||
|
#include <windows.h>
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
|
#include <colors.h>
|
||||||
|
#include <isam.h>
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <lffiles.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <execp.h>
|
||||||
|
#include <mailbox.h>
|
||||||
|
#include <archives.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
#include <mov.h>
|
||||||
|
#include <rmov.h>
|
||||||
|
#include <rmoviva.h>
|
||||||
|
#include <causali.h>
|
||||||
|
#include <rcausali.h>
|
||||||
|
#include <clifo.h>
|
||||||
|
#include <pconti.h>
|
||||||
|
#include <comuni.h>
|
||||||
|
#include <occas.h>
|
||||||
|
|
||||||
|
#include "cg6901.h"
|
||||||
|
#include "cg6903.h"
|
||||||
|
#include "cglib04.h"
|
||||||
|
|
||||||
|
class TInv_cont : public TApplication
|
||||||
|
{
|
||||||
|
enum { BUFSIZE = 4096 };
|
||||||
|
|
||||||
|
TTransfer_file _tras_file;
|
||||||
|
TProgind* _prog;
|
||||||
|
TLocalisamfile* _caus;
|
||||||
|
TLocalisamfile* _rcaus;
|
||||||
|
TLocalisamfile* _clifo;
|
||||||
|
TLocalisamfile* _pcon;
|
||||||
|
TLocalisamfile* _mov;
|
||||||
|
TLocalisamfile* _rmov;
|
||||||
|
TLocalisamfile* _rmoviva;
|
||||||
|
TLocalisamfile* _occas;
|
||||||
|
TIsamtempfile* _tcaus;
|
||||||
|
TIsamtempfile* _trcaus;
|
||||||
|
TIsamtempfile* _tclifo;
|
||||||
|
TIsamtempfile* _tpcon;
|
||||||
|
TIsamtempfile* _tmov;
|
||||||
|
TIsamtempfile* _trmov;
|
||||||
|
TIsamtempfile* _triva;
|
||||||
|
TIsamtempfile* _toccas;
|
||||||
|
TArchive _arc;
|
||||||
|
|
||||||
|
char _scelta;
|
||||||
|
|
||||||
|
TString _control_rec, _header, _trasf, _std, _stato, _marker, _nome_simbolico;
|
||||||
|
TString _files, _codcaus, _numdoc, _reg, _codpag, _tipodoc, _codcausm, _sigle;
|
||||||
|
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;
|
||||||
|
int _num,_annoes;
|
||||||
|
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
|
||||||
|
real _corrlire, _cambioi, _corrval;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool main_loop();
|
||||||
|
|
||||||
|
bool esiste_tabella_studio();
|
||||||
|
bool record_controllo();
|
||||||
|
bool esegui_controlli();
|
||||||
|
bool leggi_header();
|
||||||
|
bool controlli();
|
||||||
|
bool sub_controlli();
|
||||||
|
bool tabella_ditta();
|
||||||
|
bool controlla_stato_invio();
|
||||||
|
bool numero_data();
|
||||||
|
void leggi_record_controllo();
|
||||||
|
void codifica_ditta (TMask& m);
|
||||||
|
void testata_mov_PN ();
|
||||||
|
void testata_trasfer(long nreg, int nrig, TString& record);
|
||||||
|
bool testata_mov_IVA(long numreg);
|
||||||
|
void cerca_occasionale();
|
||||||
|
void cerca_comune_occas(const TString& com);
|
||||||
|
|
||||||
|
void apri_file_temp();
|
||||||
|
void chiudi_file_temp();
|
||||||
|
|
||||||
|
void crea_marker(TMask& m);
|
||||||
|
void setta_parametri_record(TMask& m,const TString& flag);
|
||||||
|
void setta_tabella_studio(TMask& m, bool flag_ditta = TRUE);
|
||||||
|
void setta_tabella_ditta(TMask& m, const char* flag, bool comp = TRUE);
|
||||||
|
void crea_record_controllo(TMask& m);
|
||||||
|
|
||||||
|
bool invio_tempfile(TMask& m);
|
||||||
|
void causali2tempfile(TString& key,TMask& m);
|
||||||
|
void cancella_righe_causali(TString& codcaus);
|
||||||
|
void scrivi_righe_causali(TString& codcaus, char uselab);
|
||||||
|
void clifo2tempfile(TString& key,TMask& m);
|
||||||
|
void pcon2tempfile(TString& key,TMask& m);
|
||||||
|
|
||||||
|
void movPN2tempfile(TString& key,TMask& m);
|
||||||
|
void scrivi_righePN(long numreg);
|
||||||
|
void primanota_inviata(long numreg);
|
||||||
|
|
||||||
|
void movIVA2tempfile(TString& key,TMask& m);
|
||||||
|
bool occasionali(const TString& ocfpi);
|
||||||
|
void iva_inviata(long numreg);
|
||||||
|
|
||||||
|
bool invio_contabilita();
|
||||||
|
bool invio_tab_cau();
|
||||||
|
bool invio_clifo ();
|
||||||
|
bool invio_pcon ();
|
||||||
|
bool invio_mov_PN ();
|
||||||
|
bool invio_mov_IVA();
|
||||||
|
|
||||||
|
void negPC2negAS(TString& numero);
|
||||||
|
|
||||||
|
void aggiorna_marker(TString& token, int pos);
|
||||||
|
void calcola_totale_record();
|
||||||
|
|
||||||
|
const char* cerca_provincia(const TString& comcf);
|
||||||
|
|
||||||
|
static bool setta_maschera_hnd(TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
int calcola_numero_dischi(TMask& m);
|
||||||
|
FILE* chiedi_disco(const char* name, int disk, char floppy, bool lettura);
|
||||||
|
long determina_dimensione(FILE* f);
|
||||||
|
bool scrivi_disco(char floppy, int disk, const char* work, FILE* i, TProgind& w);
|
||||||
|
|
||||||
|
TInv_cont(char mov);
|
||||||
|
};
|
||||||
|
|
||||||
|
HIDDEN TInv_cont& app() { return (TInv_cont &) main_app(); }
|
||||||
|
|
21
cg/cg6900a.h
Executable file
21
cg/cg6900a.h
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
// Campi maschera tabella ditte per invio
|
||||||
|
|
||||||
|
#define F_DITTAINV 101
|
||||||
|
#define F_NUMULINV 103
|
||||||
|
#define F_DATAULIN 104
|
||||||
|
#define F_STATO 105
|
||||||
|
#define F_RAGSOC 106
|
||||||
|
#define F_USELAB 107
|
||||||
|
#define F_CHIAVE 108
|
||||||
|
#define F_DATALIM 109
|
||||||
|
|
||||||
|
// Campi maschera cg2900b.uml
|
||||||
|
|
||||||
|
#define F_FLOPPY 201
|
||||||
|
#define F_DIM 202
|
||||||
|
|
||||||
|
// Campi maschera cg2903a.uml
|
||||||
|
|
||||||
|
#define F_RIPPN 250
|
||||||
|
#define F_RIPIVA 251
|
||||||
|
#define F_DATA 252
|
62
cg/cg6900a.uml
Executable file
62
cg/cg6900a.uml
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#include "cg6900a.h"
|
||||||
|
|
||||||
|
PAGE "Invio contabilita'" -1 -1 76 11
|
||||||
|
|
||||||
|
NUMBER F_DITTAINV 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Codice ditta inviante "
|
||||||
|
FLAGS "Z"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_NUMULINV 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Numero ultimo invio "
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAULIN
|
||||||
|
BEGIN
|
||||||
|
PROMPT 44 4 "Data ultimo invio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_STATO 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Stato ultimo invio "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_USELAB 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 27 5 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CHIAVE 15
|
||||||
|
BEGIN
|
||||||
|
PROMPT 30 5 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATALIM
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Data limite invio "
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
34
cg/cg6900b.uml
Executable file
34
cg/cg6900b.uml
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#include "cg6900a.h"
|
||||||
|
|
||||||
|
PAGE "" -1 -1 40 7
|
||||||
|
|
||||||
|
LIST F_FLOPPY 1 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Disco "
|
||||||
|
ITEM "A|A:"
|
||||||
|
ITEM "B|B:"
|
||||||
|
END
|
||||||
|
|
||||||
|
LIST F_DIM 7
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Dimensione dischi "
|
||||||
|
ITEM "1|1,4 Mb"
|
||||||
|
ITEM "2|1,2 Mb"
|
||||||
|
ITEM "3|720 Kb"
|
||||||
|
ITEM "4|360 Kb"
|
||||||
|
HELP "Indicare la dimensione dei dischi che si vogliono usare"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
806
cg/cg6901.cpp
Executable file
806
cg/cg6901.cpp
Executable file
@ -0,0 +1,806 @@
|
|||||||
|
#include "cglib04.h"
|
||||||
|
#include "cg6901.h"
|
||||||
|
|
||||||
|
HIDDEN inline TLista_archivi& app() { return (TLista_archivi&)main_app();}
|
||||||
|
|
||||||
|
bool TLista_archivi::create()
|
||||||
|
{
|
||||||
|
_ditte = new TLocalisamfile (LF_NDITTE);
|
||||||
|
_caus = new TLocalisamfile (LF_CAUSALI);
|
||||||
|
_rcaus = new TLocalisamfile (LF_RCAUSALI);
|
||||||
|
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||||
|
_pcon = new TLocalisamfile (LF_PCON);
|
||||||
|
_mov = new TLocalisamfile (LF_MOV);
|
||||||
|
_rmov = new TLocalisamfile (LF_RMOV);
|
||||||
|
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||||
|
|
||||||
|
_errore_grave = FALSE;
|
||||||
|
_risposta = 0;
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TLista_archivi::destroy()
|
||||||
|
{
|
||||||
|
printer().close();
|
||||||
|
|
||||||
|
if (_risposta == 1)
|
||||||
|
message_box("Rilevati errori gravi durante il controllo archivi: \n trasferimento interrotto");
|
||||||
|
|
||||||
|
TString appname = "cg2b -8 S";
|
||||||
|
TString body = "";
|
||||||
|
|
||||||
|
body << _risposta;
|
||||||
|
|
||||||
|
TMessage msg (appname,"",(const char*)body);
|
||||||
|
TMailbox mb;
|
||||||
|
mb.send(msg);
|
||||||
|
|
||||||
|
delete _ditte;
|
||||||
|
delete _caus;
|
||||||
|
delete _rcaus;
|
||||||
|
delete _clifo;
|
||||||
|
delete _pcon;
|
||||||
|
delete _mov;
|
||||||
|
delete _rmov;
|
||||||
|
delete _rmoviva;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TLista_archivi::tabella_ditta()
|
||||||
|
{
|
||||||
|
TTable ind ("%IND");
|
||||||
|
TString dep;
|
||||||
|
|
||||||
|
dep.format("%05d", _ditta);
|
||||||
|
|
||||||
|
ind.zero();
|
||||||
|
ind.put("CODTAB", dep);
|
||||||
|
if (ind.read() == NOERR)
|
||||||
|
{
|
||||||
|
_files = "";
|
||||||
|
if (ind.get_bool("B0"))
|
||||||
|
_files << "W";
|
||||||
|
|
||||||
|
if (ind.get_bool("B1"))
|
||||||
|
_files << "A";
|
||||||
|
|
||||||
|
if (ind.get_bool("B2"))
|
||||||
|
_files << "P";
|
||||||
|
|
||||||
|
if (ind.get_bool("B3"))
|
||||||
|
_files << "Z";
|
||||||
|
|
||||||
|
if (ind.get_bool("B4"))
|
||||||
|
_files << "U";
|
||||||
|
|
||||||
|
if (ind.get_bool("B5"))
|
||||||
|
_files << "B";
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TLista_archivi::set()
|
||||||
|
{
|
||||||
|
//****************************************
|
||||||
|
//****** Apro la finestra di stampa ******
|
||||||
|
//****************************************
|
||||||
|
if (!(printer().isopen ()))
|
||||||
|
if (!printer().open ())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
printer().set_printtype(screenvis);
|
||||||
|
//****************************************
|
||||||
|
|
||||||
|
_ditta = get_firm();
|
||||||
|
|
||||||
|
_ditte->zero();
|
||||||
|
_ditte->put(NDT_CODDITTA, _ditta);
|
||||||
|
if (_ditte->read() == NOERR)
|
||||||
|
_ragsoc = _ditte->get(NDT_RAGSOC);
|
||||||
|
|
||||||
|
|
||||||
|
if (!tabella_ditta()) return FALSE;
|
||||||
|
|
||||||
|
if (_files.find('W') != -1)
|
||||||
|
controlla_causali('W');
|
||||||
|
|
||||||
|
if (_files.find('A') != -1)
|
||||||
|
controlla_clifo('A');
|
||||||
|
|
||||||
|
if (_files.find('P') != -1)
|
||||||
|
controlla_pcon('P');
|
||||||
|
|
||||||
|
if (_files.find('Z') != -1 || _files.find('U'))
|
||||||
|
controlla_PNIVA('Z');
|
||||||
|
|
||||||
|
if (_files.find('B') != -1)
|
||||||
|
controlla_fatture('B');
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TLista_archivi::controlla_valore(const TString& val,int lim)
|
||||||
|
{
|
||||||
|
if (real::is_natural(val))
|
||||||
|
{
|
||||||
|
int app = atoi(val);
|
||||||
|
if (app > lim)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (val.len() > 1)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::controlla_causali(char file)
|
||||||
|
{
|
||||||
|
TPrintrow row;
|
||||||
|
TString str;
|
||||||
|
bool errore = FALSE;
|
||||||
|
bool salto = FALSE;
|
||||||
|
bool intesta = TRUE;
|
||||||
|
TString_array stampa(50);
|
||||||
|
int num;
|
||||||
|
|
||||||
|
_caus->setkey(1);
|
||||||
|
_caus->zero();
|
||||||
|
|
||||||
|
for (_caus->first(); !_caus->eof(); _caus->next())
|
||||||
|
{
|
||||||
|
const char* codcau = _caus->get(CAU_CODCAUS);
|
||||||
|
TString codcaus = codcau;
|
||||||
|
if (codcau && *codcau && !real::is_natural(codcau) )
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato codice causale alfanumerico");
|
||||||
|
}
|
||||||
|
|
||||||
|
TString reg = _caus->get(CAU_REG);
|
||||||
|
if (!controlla_valore(reg,9))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato registro IVA con lunghezza superiore a 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* codcausim = _caus->get(CAU_CODCAUSIM);
|
||||||
|
if (codcausim && *codcausim && !real::is_natural(codcausim) )
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato codice causale per incasso immediato alfanumerico");
|
||||||
|
}
|
||||||
|
|
||||||
|
num = 0;
|
||||||
|
|
||||||
|
_rcaus->setkey(1);
|
||||||
|
_rcaus->zero();
|
||||||
|
_rcaus->put(RCA_CODCAUS, codcaus);
|
||||||
|
|
||||||
|
TRectype rcau (_rcaus->curr());
|
||||||
|
|
||||||
|
for (_rcaus->read(); !_rcaus->eof(); _rcaus->next())
|
||||||
|
{
|
||||||
|
bool tit_riga = FALSE;
|
||||||
|
|
||||||
|
if (_rcaus->curr() > rcau) break;
|
||||||
|
|
||||||
|
num++;
|
||||||
|
|
||||||
|
if (num > 15)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevata causale con numero righe superiore a 15");
|
||||||
|
}
|
||||||
|
|
||||||
|
int g = _rcaus->get_int (RCA_GRUPPO);
|
||||||
|
int c = _rcaus->get_int (RCA_CONTO);
|
||||||
|
int nr = _rcaus->get_int (RCA_NRIGA);
|
||||||
|
|
||||||
|
if (g > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
app.format("%9s%03d", (const char*)"@b - Riga ", nr);
|
||||||
|
app << " " << "@rRilevato un gruppo composto da 3 cifre";
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << " Rilevato un conto composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%9s%03d", (const char*)"@b - Riga ", nr);
|
||||||
|
app << " " << "@rRilevato un conto composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errore)
|
||||||
|
{
|
||||||
|
if (intesta)
|
||||||
|
{
|
||||||
|
setta_intestazione(file);
|
||||||
|
intesta = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TString app;
|
||||||
|
app << "@b- Codice causale " << codcaus;
|
||||||
|
row.put(app,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
long items = stampa.items();
|
||||||
|
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
str = stampa.row(i);
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.put(" ",0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
errore = FALSE;
|
||||||
|
salto = TRUE;
|
||||||
|
_risposta = 1;
|
||||||
|
}
|
||||||
|
stampa.destroy();
|
||||||
|
}
|
||||||
|
if (salto)
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::controlla_clifo(char file)
|
||||||
|
{
|
||||||
|
TPrintrow row;
|
||||||
|
TString str;
|
||||||
|
bool errore = FALSE;
|
||||||
|
bool salto = FALSE;
|
||||||
|
bool intesta = TRUE;
|
||||||
|
TString_array stampa(10);
|
||||||
|
|
||||||
|
_clifo->setkey(1);
|
||||||
|
_clifo->zero();
|
||||||
|
|
||||||
|
for (_clifo->first(); !_clifo->eof(); _clifo->next())
|
||||||
|
{
|
||||||
|
str = "";
|
||||||
|
|
||||||
|
char tipo = _clifo->get_char(CLI_TIPOCF);
|
||||||
|
long codice = _clifo->get_long(CLI_CODCF);
|
||||||
|
|
||||||
|
TString paiv = _clifo->get(CLI_PAIV);
|
||||||
|
if (paiv.len() > 11)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevata partita IVA con piu' di 11 caratteri");
|
||||||
|
}
|
||||||
|
|
||||||
|
TString ptel = _clifo->get(CLI_PTEL);
|
||||||
|
TString tel = _clifo->get(CLI_TEL);
|
||||||
|
TString appoggio;
|
||||||
|
appoggio << ptel << " " << tel;
|
||||||
|
if (appoggio.len() > 12)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato numero telefonico troppo lungo");
|
||||||
|
}
|
||||||
|
|
||||||
|
int gruppo = _clifo->get_int(CLI_GRUPPORIC);
|
||||||
|
int conto = _clifo->get_int(CLI_CONTORIC);
|
||||||
|
|
||||||
|
if (gruppo > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato gruppo costo/ricavo composto da 3 cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conto > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato conto costo/ricavo composto da 3 cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
TString codpag = _clifo->get(CLI_CODPAG);
|
||||||
|
if (!controlla_valore(codpag,99))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un codice di pagamento composto da 3 o piu' cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errore)
|
||||||
|
{
|
||||||
|
TString app;
|
||||||
|
|
||||||
|
if (intesta)
|
||||||
|
{
|
||||||
|
setta_intestazione(file);
|
||||||
|
intesta = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
str << "@b- Codice ";
|
||||||
|
app.format("%c %06d", tipo, codice);
|
||||||
|
str << app;
|
||||||
|
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
str = "";
|
||||||
|
|
||||||
|
long items = stampa.items();
|
||||||
|
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
str = stampa.row(i);
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.put(" ",0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
errore = FALSE;
|
||||||
|
salto = TRUE;
|
||||||
|
_risposta = 1;
|
||||||
|
}
|
||||||
|
stampa.destroy();
|
||||||
|
}
|
||||||
|
if (salto)
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::controlla_pcon(char file)
|
||||||
|
{
|
||||||
|
TPrintrow row;
|
||||||
|
TString str;
|
||||||
|
bool errore = FALSE;
|
||||||
|
bool salto = FALSE;
|
||||||
|
bool intesta = TRUE;
|
||||||
|
TString_array stampa(10);
|
||||||
|
|
||||||
|
_pcon->setkey(1);
|
||||||
|
_pcon->zero();
|
||||||
|
|
||||||
|
for (_pcon->first(); !_pcon->eof(); _pcon->next())
|
||||||
|
{
|
||||||
|
str = "";
|
||||||
|
|
||||||
|
int gruppo = _pcon->get_int (PCN_GRUPPO);
|
||||||
|
int conto = _pcon->get_int (PCN_CONTO);
|
||||||
|
long sottoc = _pcon->get_long(PCN_SOTTOCONTO);
|
||||||
|
|
||||||
|
if (gruppo > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un gruppo composto da 3 cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conto > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un conto composto da 3 cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errore)
|
||||||
|
{
|
||||||
|
TString app;
|
||||||
|
|
||||||
|
if (intesta)
|
||||||
|
{
|
||||||
|
setta_intestazione(file);
|
||||||
|
intesta = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
str << "@b- Conto ";
|
||||||
|
app.format("%3d %3d %6ld", gruppo, conto, sottoc);
|
||||||
|
str << app;
|
||||||
|
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
str = "";
|
||||||
|
|
||||||
|
long items = stampa.items();
|
||||||
|
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
str = stampa.row(i);
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.put(" ",0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
errore = FALSE;
|
||||||
|
salto = TRUE;
|
||||||
|
_risposta = 1;
|
||||||
|
}
|
||||||
|
stampa.destroy();
|
||||||
|
}
|
||||||
|
if (salto)
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::controlla_PNIVA(char file)
|
||||||
|
{
|
||||||
|
TPrintrow row;
|
||||||
|
TString str;
|
||||||
|
bool errore = FALSE;
|
||||||
|
bool salto = FALSE;
|
||||||
|
bool intesta = TRUE;
|
||||||
|
TString_array stampa(50);
|
||||||
|
int num;
|
||||||
|
|
||||||
|
_mov->setkey(1);
|
||||||
|
_mov->zero();
|
||||||
|
|
||||||
|
for (_mov->first(); !_mov->eof(); _mov->next())
|
||||||
|
{
|
||||||
|
|
||||||
|
long nreg = _mov->get_long(MOV_NUMREG);
|
||||||
|
bool inviato = _mov->get_bool(MOV_INVIATO);
|
||||||
|
bool inviva = _mov->get_bool(MOV_INVIVA);
|
||||||
|
|
||||||
|
if (inviato && inviva) continue; //Se il movimento e' gia' stato inviato non lo posso piu' inviare
|
||||||
|
//cosi' come le sue righe di primanota e iva
|
||||||
|
|
||||||
|
if (nreg > 999999)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un numero di registrazione composto da 7");
|
||||||
|
}
|
||||||
|
|
||||||
|
TString reg = _mov->get(MOV_REG);
|
||||||
|
if (!controlla_valore(reg,9))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un codice registro IVA composto da 2 o piu' cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* codcaus = _mov->get(MOV_CODCAUS);
|
||||||
|
if (codcaus && *codcaus)
|
||||||
|
if (!real::is_natural(codcaus))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un codice causale alfanumerico");
|
||||||
|
}
|
||||||
|
|
||||||
|
TString codpag = _mov->get(MOV_CODPAG);
|
||||||
|
if (!controlla_valore(codpag,99))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato un codice di pagamento composto da 3 o piu' cifre");
|
||||||
|
}
|
||||||
|
|
||||||
|
num = 0;
|
||||||
|
|
||||||
|
_rmov->setkey(1);
|
||||||
|
_rmov->zero();
|
||||||
|
_rmov->put(RMV_NUMREG, nreg);
|
||||||
|
|
||||||
|
TRectype rmov (_rmov->curr());
|
||||||
|
|
||||||
|
for (_rmov->read(); !_rmov->eof(); _rmov->next())
|
||||||
|
{
|
||||||
|
bool tit_riga = FALSE;
|
||||||
|
|
||||||
|
if (_rmov->curr() > rmov) break;
|
||||||
|
|
||||||
|
num++;
|
||||||
|
|
||||||
|
if (num > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato movimento di Primanota con numero righe superiore a 99");
|
||||||
|
}
|
||||||
|
|
||||||
|
int nr = _rmov->get_int (RMV_NUMRIG);
|
||||||
|
int g = _rmov->get_int (RMV_GRUPPO);
|
||||||
|
int c = _rmov->get_int (RMV_CONTO);
|
||||||
|
int gc = _rmov->get_int (RMV_GRUPPOC);
|
||||||
|
int cc = _rmov->get_int (RMV_CONTOC);
|
||||||
|
|
||||||
|
if (nr > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga P ", nr);
|
||||||
|
app << " " << "@rRilevato numero di riga con piu' di due cifre";
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un gruppo di partita composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga P ", nr);
|
||||||
|
app << " " << "@rRilevato un gruppo di partita composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un conto di partita composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("11s%03d", (const char*)"@b - Riga P ", nr);
|
||||||
|
app << " " << "@rRilevato un conto di partita composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gc > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un gruppo di contropartita composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga P ", nr);
|
||||||
|
app << " " << "@rRilevato un gruppo di contropartita composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cc > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un conto di contropartita composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga P ", nr);
|
||||||
|
app << " " << "@rRilevato un conto di contropartita composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
num = 0;
|
||||||
|
|
||||||
|
_rmoviva->setkey(1);
|
||||||
|
_rmoviva->zero();
|
||||||
|
_rmoviva->put(RMI_NUMREG, nreg);
|
||||||
|
|
||||||
|
TRectype rmoviva (_rmoviva->curr());
|
||||||
|
|
||||||
|
for (_rmoviva->read(); !_rmoviva->eof(); _rmoviva->next())
|
||||||
|
{
|
||||||
|
bool tit_riga = FALSE;
|
||||||
|
|
||||||
|
if (_rmoviva->curr() > rmoviva) break;
|
||||||
|
|
||||||
|
num++;
|
||||||
|
|
||||||
|
if (num > 9)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
stampa.add(" - Rilevato movimento Iva con numero righe superiore a 9");
|
||||||
|
}
|
||||||
|
|
||||||
|
int nr = _rmoviva->get_int (RMI_NUMRIG);
|
||||||
|
int g = _rmoviva->get_int (RMI_GRUPPO);
|
||||||
|
int c = _rmoviva->get_int (RMI_CONTO);
|
||||||
|
|
||||||
|
if (nr > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga I ", nr);
|
||||||
|
app << " " << "@rRilevato numero di riga con piu' di due cifre";
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un gruppo composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga I ", nr);
|
||||||
|
app << " " << "@rRilevato un gruppo composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c > 99)
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un conto composto da 3 cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga I ", nr);
|
||||||
|
app << " " << "@rRilevato un conto composto da 3 cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
}
|
||||||
|
const char* ci = _rmoviva->get (RMI_CODIVA);
|
||||||
|
if ( ci && *ci && !real::is_natural(ci) )
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un codice IVA alfanumerico";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga I ", nr);
|
||||||
|
app << " " << "@rRilevato un codice IVA alfanumerico";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!controlla_valore(ci,99))
|
||||||
|
{
|
||||||
|
errore = TRUE;
|
||||||
|
TString app;
|
||||||
|
if (tit_riga)
|
||||||
|
app << "@r Rilevato un codice IVA composto da 3 o piu' cifre";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.format("%11s%03d", (const char*)"@b - Riga I ", nr);
|
||||||
|
app << " " << "@rRilevato un codice IVA composto da 3 o piu' cifre";
|
||||||
|
}
|
||||||
|
stampa.add(app);
|
||||||
|
tit_riga = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errore)
|
||||||
|
{
|
||||||
|
TString app;
|
||||||
|
|
||||||
|
if (intesta)
|
||||||
|
{
|
||||||
|
setta_intestazione(file);
|
||||||
|
intesta = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
app << "@b- Registrazione numero " << nreg;
|
||||||
|
row.put(app,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
long items = stampa.items();
|
||||||
|
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
str = stampa.row(i);
|
||||||
|
row.put(str,0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.put(" ",0);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
errore = FALSE;
|
||||||
|
salto = TRUE;
|
||||||
|
_risposta = 1;
|
||||||
|
}
|
||||||
|
stampa.destroy();
|
||||||
|
}
|
||||||
|
if (salto)
|
||||||
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::controlla_fatture(char file)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TLista_archivi::setta_intestazione(char sigla)
|
||||||
|
{
|
||||||
|
TPrintrow row;
|
||||||
|
TString sep(132);
|
||||||
|
TString titolo;
|
||||||
|
|
||||||
|
switch (sigla)
|
||||||
|
{
|
||||||
|
case 'W':
|
||||||
|
titolo = "Archivio Causali e Righe Causali";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'A':
|
||||||
|
titolo = "Archivio Clienti / Fornitori";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'P':
|
||||||
|
titolo = "Archivio Piano dei Conti";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Z':
|
||||||
|
titolo = "Archivio Movimenti";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
printer().resetheader();
|
||||||
|
|
||||||
|
sep << "Ditta " << _ditta;
|
||||||
|
sep << " " << _ragsoc;
|
||||||
|
sep.left_just(132);
|
||||||
|
|
||||||
|
row.put(sep,0);
|
||||||
|
printer().setheaderline(1,row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
sep = "";
|
||||||
|
sep << "Data @< Pag. @#";
|
||||||
|
sep.right_just(127);
|
||||||
|
sep.overwrite ("LISTA DI CONTROLLO ARCHIVI IN TRASFERIMENTO");
|
||||||
|
row.put(sep,0);
|
||||||
|
printer().setheaderline(2,row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
sep = "";
|
||||||
|
sep.fill('-');
|
||||||
|
row.put(sep,0);
|
||||||
|
printer().setheaderline(3,row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
row.put(titolo,0);
|
||||||
|
printer().setheaderline(4,row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
sep = "";
|
||||||
|
sep.fill('-');
|
||||||
|
row.put(sep,0);
|
||||||
|
printer().setheaderline(5,row);
|
||||||
|
row.reset();
|
||||||
|
|
||||||
|
row.put(" ",0);
|
||||||
|
printer().setheaderline(6,row);
|
||||||
|
row.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TLista_archivi::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return set();
|
||||||
|
return FALSE;
|
||||||
|
}
|
53
cg/cg6901.h
Executable file
53
cg/cg6901.h
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
// Lista controllo archivi
|
||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <printer.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <lffiles.h>
|
||||||
|
#include <nditte.h>
|
||||||
|
#include <mailbox.h>
|
||||||
|
#include <causali.h>
|
||||||
|
#include <rcausali.h>
|
||||||
|
#include <clifo.h>
|
||||||
|
#include <pconti.h>
|
||||||
|
#include <mov.h>
|
||||||
|
#include <rmov.h>
|
||||||
|
#include <rmoviva.h>
|
||||||
|
|
||||||
|
class TLista_archivi : public TApplication
|
||||||
|
{
|
||||||
|
TLocalisamfile* _ditte;
|
||||||
|
TLocalisamfile* _caus;
|
||||||
|
TLocalisamfile* _rcaus;
|
||||||
|
TLocalisamfile* _clifo;
|
||||||
|
TLocalisamfile* _pcon;
|
||||||
|
TLocalisamfile* _mov;
|
||||||
|
TLocalisamfile* _rmov;
|
||||||
|
TLocalisamfile* _rmoviva;
|
||||||
|
|
||||||
|
TString _files, _ragsoc;
|
||||||
|
long _ditta;
|
||||||
|
bool _errore_grave;
|
||||||
|
int _risposta;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TString _titolo;
|
||||||
|
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool set();
|
||||||
|
bool tabella_ditta();
|
||||||
|
void controlla_causali (char sigla);
|
||||||
|
void controlla_clifo (char sigla);
|
||||||
|
void controlla_pcon (char sigla);
|
||||||
|
void controlla_PNIVA (char sigla);
|
||||||
|
void controlla_fatture (char sigla);
|
||||||
|
void setta_intestazione(char sigla);
|
||||||
|
bool controlla_valore (const TString& val,int lim);
|
||||||
|
|
||||||
|
TLista_archivi() {};
|
||||||
|
};
|
1080
cg/cg6902.cpp
Executable file
1080
cg/cg6902.cpp
Executable file
File diff suppressed because it is too large
Load Diff
74
cg/cg6903.cpp
Executable file
74
cg/cg6903.cpp
Executable file
@ -0,0 +1,74 @@
|
|||||||
|
#include "cg6903.h"
|
||||||
|
#include "cg6900a.h"
|
||||||
|
|
||||||
|
bool TRip_flag::create()
|
||||||
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
|
_mov = new TLocalisamfile (LF_MOV);
|
||||||
|
|
||||||
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRip_flag::destroy()
|
||||||
|
{
|
||||||
|
delete _mov;
|
||||||
|
|
||||||
|
return TApplication::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRip_flag::set()
|
||||||
|
{
|
||||||
|
TMask msk ("cg6903a");
|
||||||
|
KEY k;
|
||||||
|
|
||||||
|
k = msk.run();
|
||||||
|
|
||||||
|
if (k == K_ENTER)
|
||||||
|
{
|
||||||
|
long ditta = msk.get_long(F_DITTAINV);
|
||||||
|
TDate datalim (msk.get(F_DATA));
|
||||||
|
bool rippn = msk.get_bool(F_RIPPN);
|
||||||
|
bool ripiva = msk.get_bool(F_RIPIVA);
|
||||||
|
|
||||||
|
if (!rippn && !ripiva) return FALSE; // Se non flaggo nessuno dei due non ha
|
||||||
|
// senso scorrere l'archivio.
|
||||||
|
|
||||||
|
set_firm(ditta);
|
||||||
|
|
||||||
|
long cicli = _mov->items();
|
||||||
|
_prog = new TProgind(cicli,"Ripristino movimenti in corso... Prego attendere.",FALSE);
|
||||||
|
|
||||||
|
_mov->setkey(1);
|
||||||
|
_mov->zero();
|
||||||
|
|
||||||
|
for (_mov->first();!_mov->eof();_mov->next())
|
||||||
|
{
|
||||||
|
TDate datareg (_mov->get_date(MOV_DATAREG));
|
||||||
|
|
||||||
|
_prog->addstatus(1);
|
||||||
|
|
||||||
|
if (datareg < datalim) continue;
|
||||||
|
|
||||||
|
if (rippn)
|
||||||
|
_mov->zero(MOV_INVIATO);
|
||||||
|
if (ripiva)
|
||||||
|
_mov->zero(MOV_INVIVA);
|
||||||
|
|
||||||
|
_mov->rewrite();
|
||||||
|
}
|
||||||
|
delete _prog;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TRip_flag::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
|
return set();
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
26
cg/cg6903.h
Executable file
26
cg/cg6903.h
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
// Ripristino flag invio PN e IVA
|
||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <isam.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <progind.h>
|
||||||
|
|
||||||
|
#include "cg2.h"
|
||||||
|
|
||||||
|
#include <mov.h>
|
||||||
|
|
||||||
|
class TRip_flag : public TApplication
|
||||||
|
{
|
||||||
|
TLocalisamfile* _mov;
|
||||||
|
TProgind* _prog;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
bool set();
|
||||||
|
|
||||||
|
TRip_flag() {}
|
||||||
|
};
|
51
cg/cg6903a.uml
Executable file
51
cg/cg6903a.uml
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#include "cg6900a.h"
|
||||||
|
|
||||||
|
PAGE "Invio contabilita'" -1 -1 76 11
|
||||||
|
|
||||||
|
NUMBER F_DITTAINV 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Codice ditta inviante "
|
||||||
|
USE LF_NDITTE KEY 1
|
||||||
|
INPUT CODDITTA F_DITTAINV
|
||||||
|
DISPLAY "Ditta" CODDITTA
|
||||||
|
DISPLAY "Ragione sociale@50" RAGSOC
|
||||||
|
OUTPUT F_DITTAINV CODDITTA
|
||||||
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
|
FLAGS "Z"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_RAGSOC 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Ragione sociale "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_RIPPN
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Ripristina movimenti di primanota"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_RIPIVA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Ripristina movimenti iva"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Data inizio ripristino "
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
ENDMASK
|
1669
cg/cglib04.cpp
1669
cg/cglib04.cpp
File diff suppressed because it is too large
Load Diff
117
cg/cglib04.h
117
cg/cglib04.h
@ -10,20 +10,47 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <scanner.h>
|
#include <scanner.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <isam.h>
|
||||||
|
#include <codeb.h>
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
|
#include <pconti.h>
|
||||||
|
#include <comuni.h>
|
||||||
|
#include <clifo.h>
|
||||||
|
#include <rcausali.h>
|
||||||
|
|
||||||
|
#define TEMP_CAUS "tcaus"
|
||||||
|
#define TEMP_RCAUS "trcaus"
|
||||||
|
#define TEMP_CLIFO "tclifo"
|
||||||
|
#define TEMP_PCON "tpcon"
|
||||||
#define TEMP_MOV "tmov"
|
#define TEMP_MOV "tmov"
|
||||||
#define TEMP_RMOV "trmov"
|
#define TEMP_RMOV "trmov"
|
||||||
#define TEMP_RMOVIVA "triva"
|
#define TEMP_RMOVIVA "trmoviva"
|
||||||
|
#define TEMP_OCC "toccas"
|
||||||
|
|
||||||
#define SIZE 256
|
#define SIZE 256
|
||||||
|
|
||||||
|
static unsigned char _tabella[10] = {0x8a,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52};
|
||||||
|
|
||||||
|
HIDDEN TString80 TEMP;
|
||||||
|
|
||||||
|
HIDDEN TString16 HEADER = "\\header";
|
||||||
|
|
||||||
|
const int CAMPI_RCAUS = 6;
|
||||||
|
|
||||||
// Tracciato del record di controllo
|
// Tracciato del record di controllo
|
||||||
HIDDEN int pos[15] = {0,15,25,29,32,38,47,234,235,236,237,238,239,240,241};
|
HIDDEN int pos[15] = {0,15,25,29,32,38,47,234,235,236,237,238,239,240,241};
|
||||||
|
|
||||||
const char* converti(TString& data);
|
HIDDEN int date2esc(const TDate& d, int* prevesc = NULL);
|
||||||
|
|
||||||
|
int packindex(bool vis, int num, TString& name);
|
||||||
|
int pack(bool vis, int num, TString& name);
|
||||||
|
int packfile(bool vis, int num, TString& name);
|
||||||
|
|
||||||
|
//const char* converti(TString& data);
|
||||||
int fremove(const char* path);
|
int fremove(const char* path);
|
||||||
bool look_causale(const char* codcaus);
|
bool look_causale(const char* codcaus);
|
||||||
bool format_if_zero(TString&, int);
|
bool format_if_zero(TString&, int);
|
||||||
@ -52,6 +79,13 @@ class TTransfer_file
|
|||||||
TString _curfile;
|
TString _curfile;
|
||||||
TString256 _control_rec; // Buffer per il record di controllo
|
TString256 _control_rec; // Buffer per il record di controllo
|
||||||
TString256 _record; // Buffer per il record corrente
|
TString256 _record; // Buffer per il record corrente
|
||||||
|
TProgind* _prog;
|
||||||
|
TIsamtempfile* _toccas;
|
||||||
|
|
||||||
|
long _numreg, _numreg_p, _numreg_piva, _npoccas;
|
||||||
|
int _annoes;
|
||||||
|
TDate _datareg;
|
||||||
|
TString _cod_com;
|
||||||
|
|
||||||
long _curpos;
|
long _curpos;
|
||||||
long _tot_rec; // Numero totale di record nel transfer
|
long _tot_rec; // Numero totale di record nel transfer
|
||||||
@ -63,23 +97,47 @@ class TTransfer_file
|
|||||||
TString _nrec_file;
|
TString _nrec_file;
|
||||||
TString _ult_file;
|
TString _ult_file;
|
||||||
TString _key;
|
TString _key;
|
||||||
|
TString80 _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov;
|
||||||
|
TString80 _tmprmov,_tmprmoviva;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Inizializza l'indice leggendo il record di controllo
|
// Inizializza l'indice leggendo il record di controllo
|
||||||
void fill_index(TString&,TString&);
|
void fill_index(TString&,TString&);
|
||||||
|
|
||||||
// Funzioni utilizzate da fcopytemp()
|
// Funzioni utilizzate da fcopytemp()
|
||||||
void scrivi_nprog_testata(long numreg, long nprog_iva, TIsamtempfile& mov);
|
void write_tmp_tabelle(TString& record, bool create);
|
||||||
void look_mov(long nr, const char* data74, long cf, TIsamtempfile& mov);
|
int trasfer_data_tab(TIsamtempfile& file, TRectype& dep);
|
||||||
void write_tmp_mov(TIsamtempfile& mov, TIsamtempfile& rmov,
|
void write_tmp_movPN(TString& record, bool create);
|
||||||
const TString& rec, const int nprog_mov);
|
int trasfer_data_mov(TIsamtempfile& file, TRectype& dep);
|
||||||
int dataes(const TDate&, int*, TDate&);
|
void write_tmp_movIVA(TString& record, bool create);
|
||||||
void write_tmp_rmoviva(TIsamtempfile& rmov_iva, TIsamtempfile& mov,
|
int trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln);
|
||||||
const TString& rec, const int nprog_iva);
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
char TipoConto (int gruppo, int conto);
|
||||||
|
const char* numero_civico(TString& field);
|
||||||
|
void leggi_record_controllo();
|
||||||
|
int annoes_datacomp(const TString& record, TDate& datacomp);
|
||||||
|
void decimali(TString& campo, int dec);
|
||||||
|
void negativo(TString& importo);
|
||||||
|
int strip_zero(TString& importo);
|
||||||
|
bool my_isdigit(unsigned char ch);
|
||||||
|
int look(unsigned char carattere);
|
||||||
|
int cerca_annoes(long numreg);
|
||||||
|
const char* scrivi_occasionali(const TString& record);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
void remove_all(bool file_ditta = TRUE);
|
||||||
|
void canc_file_dir_temp(const char* dir);
|
||||||
|
void temp_dir(TString& orig,TString& dest,TString& sigle);
|
||||||
|
|
||||||
|
const char* cerca_comune_cap(TString& field);
|
||||||
|
const char* cerca_comune_den(TString& field);
|
||||||
|
void datafine_esprec(const int aep, TDate& datacomp);
|
||||||
|
|
||||||
|
bool fcopytemp(const char* orig, const char* dest);
|
||||||
|
|
||||||
|
int dataes(const TDate&, int*, TDate&);
|
||||||
|
|
||||||
const char* path (long codditta = 0);
|
const char* path (long codditta = 0);
|
||||||
bool open (const char* path, bool create=FALSE);
|
bool open (const char* path, bool create=FALSE);
|
||||||
void close ();
|
void close ();
|
||||||
@ -96,10 +154,10 @@ private:
|
|||||||
const char* dataultras() const { return (const char*) _dataultras; } // Ritorna la data ultimo trasferimento
|
const char* dataultras() const { return (const char*) _dataultras; } // Ritorna la data ultimo trasferimento
|
||||||
const char* sigle_file() const { return (const char*) _sigle_file; } // Ritorna una stringa contenente le sigle dei file da ricevere
|
const char* sigle_file() const { return (const char*) _sigle_file; } // Ritorna una stringa contenente le sigle dei file da ricevere
|
||||||
const char* nrec_file () const { return (const char*) _nrec_file; } // Ritorna una stringa con il numero totale di record corrispondenti ad ogni sigla dei file da ricevere
|
const char* nrec_file () const { return (const char*) _nrec_file; } // Ritorna una stringa con il numero totale di record corrispondenti ad ogni sigla dei file da ricevere
|
||||||
char flg_agg(); // Ritorna i flag tipo aggiornamento relativi alle tabelle
|
char flg_agg(char sigla); // Ritorna i flag tipo aggiornamento relativi alle tabelle
|
||||||
bool numprot_att(); // Ritorna il flag riattribuzione numero protocollo su fatture attive
|
bool numprot_att(); // Ritorna il flag riattribuzione numero protocollo su fatture attive
|
||||||
bool numprot_pas(); // Ritorna il flag riattribuzione numero protocollo su fatture passive
|
bool numprot_pas(); // Ritorna il flag riattribuzione numero protocollo su fatture passive
|
||||||
char flg_agg_IV(); // Ritorna il flag tipo aggiornamento classi piano dei conti
|
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* 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* 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 { return (const char*) _control_rec; } // Ritorna il record di controllo del trasfer
|
||||||
@ -126,8 +184,6 @@ private:
|
|||||||
|
|
||||||
void put(const char* val, const char* file, int fieldnum,long recnum=-1L);
|
void put(const char* val, const char* file, int fieldnum,long recnum=-1L);
|
||||||
|
|
||||||
int controllo_ripartenza();
|
|
||||||
|
|
||||||
// Funzioni per la gestione dell'array indice
|
// Funzioni per la gestione dell'array indice
|
||||||
int last_tab() const { return _last_tab; } // Ritorna la posizione dell'ultima sigla relativa alle tabelle presente nella schiera delle sigle file
|
int last_tab() const { return _last_tab; } // Ritorna la posizione dell'ultima sigla relativa alle tabelle presente nella schiera delle sigle file
|
||||||
int last_mov() const { return _last_mov; } // Ritorna la posizione dell'ultima sigla relativa ai movimenti presente nella schiera delle sigle file
|
int last_mov() const { return _last_mov; } // Ritorna la posizione dell'ultima sigla relativa ai movimenti presente nella schiera delle sigle file
|
||||||
@ -155,4 +211,37 @@ private:
|
|||||||
~TTransfer_file();
|
~TTransfer_file();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HIDDEN const char* converti (TString& data_AS400)
|
||||||
|
{
|
||||||
|
if (data_AS400 == "000000") return TEMP = "";
|
||||||
|
|
||||||
|
TEMP = data_AS400.mid(4,2);
|
||||||
|
TEMP << "-" <<data_AS400.mid(2,2);
|
||||||
|
TEMP << "-" << "19" <<data_AS400.mid(0,2);
|
||||||
|
return TEMP;
|
||||||
|
}
|
||||||
|
|
||||||
|
HIDDEN const char* riconverti (TString& data_PC)
|
||||||
|
{
|
||||||
|
TEMP = data_PC.mid(8,2);
|
||||||
|
TEMP << data_PC.mid(3,2);
|
||||||
|
TEMP << data_PC.mid(0,2);
|
||||||
|
return TEMP;
|
||||||
|
}
|
||||||
|
|
||||||
|
HIDDEN int date2esc(const TDate& d, int* prevesc)
|
||||||
|
{
|
||||||
|
if (prevesc) *prevesc = 0;
|
||||||
|
TTable esc("ESC");
|
||||||
|
for (int err = esc.first(); err == NOERR; err = esc.next())
|
||||||
|
{
|
||||||
|
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
||||||
|
const TDate fa(esc.get("D1")); // Data fine esercizio
|
||||||
|
const anno = esc.get_int("CODTAB");
|
||||||
|
if (d >= ia && d <= fa)
|
||||||
|
return anno;
|
||||||
|
if (prevesc) *prevesc = anno;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
424
cg/cgtrc.ini
424
cg/cgtrc.ini
@ -1,196 +1,228 @@
|
|||||||
W1|1|256|256|26|||
|
# Istruzioni per l' uso della mappa cgtrc.ini
|
||||||
W1|2|3|5|26|CODCAUS||
|
#
|
||||||
W1|3|16|35|26|DESCR|1|
|
# A | B | C | D | E | F | G | H |
|
||||||
W1|4|36|37|26|TIPODOC||
|
#
|
||||||
W1|5|38|38|26|REG||
|
# A = Sigla di identificazione dei vari archivi all' interno del trasfer
|
||||||
W1|6|39|39|26|ALLEG||
|
# W1 = Tabella causali
|
||||||
W1|7|40|40|26|M770||
|
# A1 = Clienti / Fornitori
|
||||||
W1|8|41|41|26|COLLCESP||
|
# P1-P2-P3 = Piano dei conti
|
||||||
W1|9|207|207|26|NUMDOC||
|
# Z1 = Movimenti di prima nota
|
||||||
W1|10|208|208|26|DATADOC||
|
# U1 = Movimenti Iva
|
||||||
W1|11|210|212|26|CODCAUSIM||
|
#
|
||||||
W1|12|247|247|26|INTRACOM||
|
# B = Numero progressivo del campo all'interno dell'archivio
|
||||||
W1|13|248|248|26|VALINTRA||
|
#
|
||||||
W1|14|249|249|26|RITFATT||
|
# C = Posizione iniziale del campo sul record del trasfer
|
||||||
W1|15|250|250|26|AUTOFATT||
|
#
|
||||||
W1|16|3|5|27|CODCAUS||
|
# D = Posizione finale del campo sul record del trasfer
|
||||||
W1|17|42|43|27|GRUPPO||
|
#
|
||||||
W1|18|44|45|27|CONTO||
|
# E = Numero di identificazione degli archivi su PC
|
||||||
W1|19|46|51|27|SOTTOCONTO||
|
#
|
||||||
W1|20|192|192|27|SEZIONE||
|
# F = Nome del campo degli archivi su PC
|
||||||
W1|21|3|5|27|CODCAUS||
|
#
|
||||||
W1|22|52|53|27|GRUPPO||
|
# G = Questo e' un campo jolly che permette di eseguire determinate operazioni all'interno del programma
|
||||||
W1|23|54|55|27|CONTO||
|
# e puo' assumere i seguenti valori:
|
||||||
W1|24|56|61|27|SOTTOCONTO||
|
# 1 -> indica quali sono i campi che devono essere trasferiti se i flag sulla
|
||||||
W1|25|193|193|27|SEZIONE||
|
# tabella della ricezione indica di non trasferire tutto il record.
|
||||||
W1|26|3|5|27|CODCAUS||
|
# 2 -> se il campo in questione e' una data.
|
||||||
W1|27|62|63|27|GRUPPO||
|
# 3 -> se il campo in questione e' un reale con dei decimali.
|
||||||
W1|28|64|65|27|CONTO||
|
#
|
||||||
W1|29|66|71|27|SOTTOCONTO||
|
# H = E' un ulteriore campo jolly da accostare ai campi reali con decimali.
|
||||||
W1|30|194|194|27|SEZIONE||
|
# Serve per indicare il numero di decimali. ES: se il campo in questione
|
||||||
W1|31|3|5|27|CODCAUS||
|
# e' un reale con 2 decimali il flag G deve essere 3 mentre il flag H
|
||||||
W1|32|72|73|27|GRUPPO||
|
# deve essere 2.
|
||||||
W1|33|74|75|27|CONTO||
|
#
|
||||||
W1|34|76|81|27|SOTTOCONTO||
|
W1|1|256|256|26||||
|
||||||
W1|35|195|195|27|SEZIONE||
|
W1|2|3|5|26|CODCAUS|||
|
||||||
W1|36|3|5|27|CODCAUS||
|
W1|3|16|35|26|DESCR|1||
|
||||||
W1|37|82|83|27|GRUPPO||
|
W1|4|36|37|26|TIPODOC|||
|
||||||
W1|38|84|85|27|CONTO||
|
W1|5|38|38|26|REG|||
|
||||||
W1|39|86|91|27|SOTTOCONTO||
|
W1|6|39|39|26|ALLEG|||
|
||||||
W1|40|196|196|27|SEZIONE||
|
W1|7|40|40|26|M770|||
|
||||||
W1|41|3|5|27|CODCAUS||
|
W1|8|41|41|26|COLLCESP|||
|
||||||
W1|42|92|93|27|GRUPPO||
|
W1|9|207|207|26|NUMDOC|||
|
||||||
W1|43|94|95|27|CONTO||
|
W1|10|208|208|26|DATADOC|||
|
||||||
W1|44|96|101|27|SOTTOCONTO||
|
W1|11|210|212|26|CODCAUSIM|||
|
||||||
W1|45|197|197|27|SEZIONE||
|
W1|12|247|247|26|INTRACOM|||
|
||||||
W1|46|3|5|27|CODCAUS||
|
W1|13|248|248|26|VALINTRA|||
|
||||||
W1|47|102|103|27|GRUPPO||
|
W1|14|249|249|26|RITFATT|||
|
||||||
W1|48|104|105|27|CONTO||
|
W1|15|250|250|26|AUTOFATT|||
|
||||||
W1|49|106|111|27|SOTTOCONTO||
|
W1|16|3|5|27|CODCAUS|||
|
||||||
W1|50|198|198|27|SEZIONE||
|
W1|17|42|43|27|GRUPPO|||
|
||||||
W1|51|3|5|27|CODCAUS||
|
W1|18|44|45|27|CONTO|||
|
||||||
W1|52|112|113|27|GRUPPO||
|
W1|19|46|51|27|SOTTOCONTO|||
|
||||||
W1|53|114|115|27|CONTO||
|
W1|20|192|192|27|SEZIONE|||
|
||||||
W1|54|116|121|27|SOTTOCONTO||
|
W1|21|3|5|27|CODCAUS|||
|
||||||
W1|55|199|199|27|SEZIONE||
|
W1|22|52|53|27|GRUPPO|||
|
||||||
W1|56|3|5|27|CODCAUS||
|
W1|23|54|55|27|CONTO|||
|
||||||
W1|57|122|123|27|GRUPPO||
|
W1|24|56|61|27|SOTTOCONTO|||
|
||||||
W1|58|124|125|27|CONTO||
|
W1|25|193|193|27|SEZIONE|||
|
||||||
W1|59|126|131|27|SOTTOCONTO||
|
W1|26|3|5|27|CODCAUS|||
|
||||||
W1|60|200|200|27|SEZIONE||
|
W1|27|62|63|27|GRUPPO|||
|
||||||
W1|61|3|5|27|CODCAUS||
|
W1|28|64|65|27|CONTO|||
|
||||||
W1|62|132|133|27|GRUPPO||
|
W1|29|66|71|27|SOTTOCONTO|||
|
||||||
W1|63|134|135|27|CONTO||
|
W1|30|194|194|27|SEZIONE|||
|
||||||
W1|64|136|141|27|SOTTOCONTO||
|
W1|31|3|5|27|CODCAUS|||
|
||||||
W1|65|201|201|27|SEZIONE||
|
W1|32|72|73|27|GRUPPO|||
|
||||||
W1|66|3|5|27|CODCAUS||
|
W1|33|74|75|27|CONTO|||
|
||||||
W1|67|142|143|27|GRUPPO||
|
W1|34|76|81|27|SOTTOCONTO|||
|
||||||
W1|68|144|145|27|CONTO||
|
W1|35|195|195|27|SEZIONE|||
|
||||||
W1|69|146|151|27|SOTTOCONTO||
|
W1|36|3|5|27|CODCAUS|||
|
||||||
W1|70|202|202|27|SEZIONE||
|
W1|37|82|83|27|GRUPPO|||
|
||||||
W1|71|3|5|27|CODCAUS||
|
W1|38|84|85|27|CONTO|||
|
||||||
W1|72|152|153|27|GRUPPO||
|
W1|39|86|91|27|SOTTOCONTO|||
|
||||||
W1|73|154|155|27|CONTO||
|
W1|40|196|196|27|SEZIONE|||
|
||||||
W1|74|156|161|27|SOTTOCONTO||
|
W1|41|3|5|27|CODCAUS|||
|
||||||
W1|75|203|203|27|SEZIONE||
|
W1|42|92|93|27|GRUPPO|||
|
||||||
W1|76|3|5|27|CODCAUS||
|
W1|43|94|95|27|CONTO|||
|
||||||
W1|77|162|163|27|GRUPPO||
|
W1|44|96|101|27|SOTTOCONTO|||
|
||||||
W1|78|164|165|27|CONTO||
|
W1|45|197|197|27|SEZIONE|||
|
||||||
W1|79|166|171|27|SOTTOCONTO||
|
W1|46|3|5|27|CODCAUS|||
|
||||||
W1|80|204|204|27|SEZIONE||
|
W1|47|102|103|27|GRUPPO|||
|
||||||
W1|81|3|5|27|CODCAUS||
|
W1|48|104|105|27|CONTO|||
|
||||||
W1|82|172|173|27|GRUPPO||
|
W1|49|106|111|27|SOTTOCONTO|||
|
||||||
W1|83|174|175|27|CONTO||
|
W1|50|198|198|27|SEZIONE|||
|
||||||
W1|84|176|181|27|SOTTOCONTO||
|
W1|51|3|5|27|CODCAUS|||
|
||||||
W1|85|205|205|27|SEZIONE||
|
W1|52|112|113|27|GRUPPO|||
|
||||||
W1|86|3|5|27|CODCAUS||
|
W1|53|114|115|27|CONTO|||
|
||||||
W1|87|182|183|27|GRUPPO||
|
W1|54|116|121|27|SOTTOCONTO|||
|
||||||
W1|88|184|185|27|CONTO||
|
W1|55|199|199|27|SEZIONE|||
|
||||||
W1|89|186|191|27|SOTTOCONTO||
|
W1|56|3|5|27|CODCAUS|||
|
||||||
W1|90|206|206|27|SEZIONE||
|
W1|57|122|123|27|GRUPPO|||
|
||||||
A1|1|256|256|20|||
|
W1|58|124|125|27|CONTO|||
|
||||||
A1|2|3|3|20|TIPOCF||
|
W1|59|126|131|27|SOTTOCONTO|||
|
||||||
A1|3|4|9|20|CODCF||
|
W1|60|200|200|27|SEZIONE|||
|
||||||
A1|4|16|16|20|TIPOPERS||
|
W1|61|3|5|27|CODCAUS|||
|
||||||
A1|5|17|66|20|RAGSOC|1|
|
W1|62|132|133|27|GRUPPO|||
|
||||||
A1|6|67|77|20|PAIV|1|
|
W1|63|134|135|27|CONTO|||
|
||||||
A1|7|78|93|20|COFI|1|
|
W1|64|136|141|27|SOTTOCONTO|||
|
||||||
A1|8|94|128|20|INDCF|1|
|
W1|65|201|201|27|SEZIONE|||
|
||||||
A1|9|129|133|20|CAPCF||
|
W1|66|3|5|27|CODCAUS|||
|
||||||
A1|10|134|153|20|LOCALITACF|1|
|
W1|67|142|143|27|GRUPPO|||
|
||||||
A1|11|156|167|20|TEL|1|
|
W1|68|144|145|27|CONTO|||
|
||||||
A1|12|168|168|20|ALLEG||
|
W1|69|146|151|27|SOTTOCONTO|||
|
||||||
A1|13|169|170|20|GRUPPORIC||
|
W1|70|202|202|27|SEZIONE|||
|
||||||
A1|14|171|172|20|CONTORIC||
|
W1|71|3|5|27|CODCAUS|||
|
||||||
A1|15|173|178|20|SOTTOCRIC||
|
W1|72|152|153|27|GRUPPO|||
|
||||||
A1|16|180|185|20|CODALLEG||
|
W1|73|154|155|27|CONTO|||
|
||||||
A1|17|186|187|20|CODPAG||
|
W1|74|156|161|27|SOTTOCONTO|||
|
||||||
P1|1|256|256|19|||
|
W1|75|203|203|27|SEZIONE|||
|
||||||
P1|2|3|4|19|GRUPPO||
|
W1|76|3|5|27|CODCAUS|||
|
||||||
P1|3|16|45|19|DESCR|1|
|
W1|77|162|163|27|GRUPPO|||
|
||||||
P2|1|256|256|19|||
|
W1|78|164|165|27|CONTO|||
|
||||||
P2|2|3|4|19|GRUPPO||
|
W1|79|166|171|27|SOTTOCONTO|||
|
||||||
P2|3|5|6|19|CONTO||
|
W1|80|204|204|27|SEZIONE|||
|
||||||
P2|4|16|45|19|DESCR|1|
|
W1|81|3|5|27|CODCAUS|||
|
||||||
P2|5|46|46|19|INDBIL||
|
W1|82|172|173|27|GRUPPO|||
|
||||||
P2|6|47|47|19|TMCF||
|
W1|83|174|175|27|CONTO|||
|
||||||
P2|7|48|48|19|STSOTTBIL||
|
W1|84|176|181|27|SOTTOCONTO|||
|
||||||
P2|8|49|49|19|SEZIVD||
|
W1|85|205|205|27|SEZIONE|||
|
||||||
P2|9|50|50|19|LETTIVD||
|
W1|86|3|5|27|CODCAUS|||
|
||||||
P2|10|61|63|19|NUMRIVD||
|
W1|87|182|183|27|GRUPPO|||
|
||||||
P2|11|59|60|19|NUMIVD||
|
W1|88|184|185|27|CONTO|||
|
||||||
P2|12|64|64|19|SEZIVDOPP||
|
W1|89|186|191|27|SOTTOCONTO|||
|
||||||
P2|13|65|65|19|LETTIVDOPP||
|
W1|90|206|206|27|SEZIONE|||
|
||||||
P2|14|76|78|19|NUMRIVDOPP||
|
A1|1|256|256|20||||
|
||||||
P2|15|74|75|19|NUMIVDOPP||
|
A1|2|3|3|20|TIPOCF|||
|
||||||
P3|1|256|256|19|||
|
A1|3|4|9|20|CODCF|||
|
||||||
P3|2|3|4|19|GRUPPO||
|
A1|4|16|16|20|TIPOPERS|||
|
||||||
P3|3|5|6|19|CONTO||
|
A1|5|17|66|20|RAGSOC|1||
|
||||||
P3|4|7|12|19|SOTTOCONTO||
|
A1|6|67|77|20|PAIV|1||
|
||||||
P3|5|16|45|19|DESCR|1|
|
A1|7|78|93|20|COFI|1||
|
||||||
P3|6|46|46|19|TIPOSPRIC||
|
A1|8|94|128|20|INDCF|1||
|
||||||
P3|7|47|47|19|RICSER||
|
A1|9|129|133|20|CAPCF|||
|
||||||
P3|8|48|48|19|SEZIVD||
|
A1|10|134|153|20|LOCALITACF|1||
|
||||||
P3|9|49|49|19|LETTIVD||
|
A1|11|156|167|20|TEL|1||
|
||||||
P3|10|60|62|19|NUMRIVD||
|
A1|12|168|168|20|ALLEG|||
|
||||||
P3|11|58|59|19|NUMIVD||
|
A1|13|169|170|20|GRUPPORIC|||
|
||||||
P3|12|63|63|19|SEZIVDOPP||
|
A1|14|171|172|20|CONTORIC|||
|
||||||
P3|13|64|64|19|LETTIVDOPP||
|
A1|15|173|178|20|SOTTOCRIC|||
|
||||||
P3|14|75|77|19|NUMRIVDOPP||
|
A1|16|180|185|20|CODALLEG|||
|
||||||
P3|15|73|74|19|NUMIVDOPP||
|
A1|17|186|187|20|CODPAG|||
|
||||||
Z1|50|22|22|23|||
|
P1|1|256|256|19||||
|
||||||
Z1|51|249|249|23|||
|
P1|2|3|4|19|GRUPPO|||
|
||||||
Z1|0|16|21|23|DATAREG||
|
P1|3|16|45|19|DESCR|1||
|
||||||
Z1|1|250|250|23|||
|
P2|1|256|256|19||||
|
||||||
Z1|2|251|256|23|||
|
P2|2|3|4|19|GRUPPO|||
|
||||||
Z1|3|3|8|23|NUMREG||
|
P2|3|5|6|19|CONTO|||
|
||||||
Z1|4|23|28|23|DATADOC|1|
|
P2|4|16|45|19|DESCR|1||
|
||||||
Z1|5|29|35|23|NUMDOC||
|
P2|5|46|46|19|INDBIL|||
|
||||||
Z1|6|36|36|23|REG||
|
P2|6|47|47|19|TMCF|||
|
||||||
Z1|7|37|41|23|PROTIVA||
|
P2|7|48|48|19|STSOTTBIL|||
|
||||||
Z1|8|42|44|23|CODCAUS||
|
#P2|8|49|49|19|SEZIVD|||
|
||||||
Z1|9|96|97|23|CODPAG||
|
#P2|9|50|50|19|LETTIVD|||
|
||||||
Z1|10|109|113|23|UPROTIVA||
|
#P2|10|61|63|19|NUMRIVD|||
|
||||||
Z1|11|220|220|23|TIPO||
|
#P2|11|59|60|19|NUMIVD|||
|
||||||
Z1|12|221|222|23|TIPODOC||
|
#P2|12|64|64|19|SEZIVDOPP|||
|
||||||
Z1|13|238|248|23|TOTDOC||
|
#P2|13|65|65|19|LETTIVDOPP|||
|
||||||
Z1|14|3|8|24|NUMREG||
|
#P2|14|76|78|19|NUMRIVDOPP|||
|
||||||
Z1|15|9|10|24|NUMRIG||
|
#P2|15|74|75|19|NUMIVDOPP|||
|
||||||
Z1|16|45|74|24|DESCR||
|
P3|1|256|256|19||||
|
||||||
Z1|17|75|76|24|GRUPPO||
|
P3|2|3|4|19|GRUPPO|||
|
||||||
Z1|18|77|78|24|CONTO||
|
P3|3|5|6|19|CONTO|||
|
||||||
Z1|19|79|84|24|SOTTOCONTO||
|
P3|4|7|12|19|SOTTOCONTO|||
|
||||||
Z1|20|85|85|24|SEZIONE||
|
P3|5|16|45|19|DESCR|1||
|
||||||
Z1|21|86|87|24|GRUPPOC||
|
P3|6|46|46|19|TIPOSPRIC|||
|
||||||
Z1|22|88|89|24|CONTOC||
|
P3|7|47|47|19|RICSER|||
|
||||||
Z1|23|90|95|24|SOTTOCONTC||
|
#P3|8|48|48|19|SEZIVD|||
|
||||||
Z1|24|98|108|24|IMPORTO||
|
#P3|9|49|49|19|LETTIVD|||
|
||||||
Z1|25|220|220|24|TIPOC||
|
#P3|10|60|62|19|NUMRIVD|||
|
||||||
Z1|26|223|223|24|||
|
#P3|11|58|59|19|NUMIVD|||
|
||||||
U1|51|249|249|23|||
|
#P3|12|63|63|19|SEZIVDOPP|||
|
||||||
U1|1|250|250|23|||
|
#P3|13|64|64|19|LETTIVDOPP|||
|
||||||
U1|2|251|256|23|||
|
#P3|14|75|77|19|NUMRIVDOPP|||
|
||||||
U1|3|3|8|23|NUMREG||
|
#P3|15|73|74|19|NUMIVDOPP|||
|
||||||
U1|4|56|61|23|DATA74TER|1|
|
Z1|0|16|21|23|DATAREG|||
|
||||||
U1|5|147|149|23|CODVAL||
|
Z1|1|250|250|23||||
|
||||||
U1|6|16|21|23|CODCF||
|
Z1|2|251|256|23||||
|
||||||
U1|7|238|248|23|TOTDOC||
|
Z1|3|3|8|23|NUMREG|||
|
||||||
U1|8|150|160|23|CAMBIOI|5|
|
Z1|4|23|28|23|DATADOC|2||
|
||||||
U1|9|136|146|23|CORRLIRE||
|
Z1|5|29|35|23|NUMDOC|||
|
||||||
U1|10|161|174|23|CORRVALUTA|3|
|
Z1|6|36|36|23|REG|||
|
||||||
U1|11|3|8|25|NUMREG||
|
Z1|7|37|41|23|PROTIVA|||
|
||||||
U1|12|9|10|25|NUMRIG||
|
Z1|8|42|44|23|CODCAUS|||
|
||||||
U1|13|33|34|25|CODIVA||
|
Z1|9|96|97|23|CODPAG|||
|
||||||
U1|14|22|32|25|IMPONIBILE||
|
Z1|10|109|113|23|UPROTIVA|||
|
||||||
U1|15|35|43|25|IMPOSTA||
|
Z1|11|221|222|23|TIPODOC|||
|
||||||
U1|16|45|45|25|TIPODET||
|
Z1|12|238|248|23|TOTDOC|||
|
||||||
U1|17|44|44|25|TIPOCR||
|
Z1|13|3|8|24|NUMREG|||
|
||||||
U1|18|134|134|25|TIPOATT||
|
Z1|14|9|10|24|NUMRIG|||
|
||||||
U1|19|46|47|25|GRUPPO||
|
Z1|15|45|74|24|DESCR|||
|
||||||
U1|20|48|49|25|CONTO||
|
Z1|16|75|76|24|GRUPPO|||
|
||||||
U1|21|50|55|25|SOTTOCONTO||
|
Z1|17|77|78|24|CONTO|||
|
||||||
U1|50|62|86||||
|
Z1|18|79|84|24|SOTTOCONTO|||
|
||||||
U1|51|87|108||||
|
Z1|19|85|85|24|SEZIONE|||
|
||||||
U1|52|109|126||||
|
Z1|20|86|87|24|GRUPPOC|||
|
||||||
U1|53|127|131||||
|
Z1|21|88|89|24|CONTOC|||
|
||||||
U1|54|132|133||||
|
Z1|22|90|95|24|SOTTOCONTC|||
|
||||||
|
Z1|23|98|108|24|IMPORTO|||
|
||||||
|
Z1|49|223|223|24||||
|
||||||
|
Z1|50|220|220|23||||
|
||||||
|
Z1|51|249|249|23||||
|
||||||
|
Z1|52|22|22|23||||
|
||||||
|
U1|1|250|250|23||||
|
||||||
|
U1|2|251|256|23||||
|
||||||
|
U1|3|3|8|23|NUMREG|||
|
||||||
|
U1|4|56|61|23|DATA74TER|2||
|
||||||
|
U1|5|147|149|23|CODVAL|||
|
||||||
|
U1|6|16|21|23|CODCF|||
|
||||||
|
U1|7|238|248|23|TOTDOC|||
|
||||||
|
U1|8|150|160|23|CAMBIOI|3|5|
|
||||||
|
U1|9|136|146|23|CORRLIRE|||
|
||||||
|
U1|10|161|174|23|CORRVALUTA|3|3|
|
||||||
|
U1|11|3|8|25|NUMREG|||
|
||||||
|
U1|12|9|10|25|NUMRIG|||
|
||||||
|
U1|13|33|34|25|CODIVA|||
|
||||||
|
U1|14|22|32|25|IMPONIBILE|||
|
||||||
|
U1|15|35|43|25|IMPOSTA|||
|
||||||
|
U1|16|45|45|25|TIPODET|||
|
||||||
|
U1|17|44|44|25|TIPOCR|||
|
||||||
|
U1|18|134|134|25|TIPOATT|||
|
||||||
|
U1|19|46|47|25|GRUPPO|||
|
||||||
|
U1|20|48|49|25|CONTO|||
|
||||||
|
U1|21|50|55|25|SOTTOCONTO|||
|
||||||
|
U1|50|62|86|||||
|
||||||
|
U1|51|249|249|23||||
|
||||||
|
U1|52|109|126|||||
|
||||||
|
U1|53|127|131|||||
|
||||||
|
U1|54|132|133|||||
|
||||||
|
U1|56|87|108|||||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user