Correzione errori ricezione da sistema. Modifiche ricezione e invio, aggiunta ricezione in automatico.
git-svn-id: svn://10.65.10.50/trunk@2516 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a3f12ff8c0
commit
bd2e5486f7
@ -8,7 +8,9 @@ int main(int argc,char** argv)
|
||||
const int n = (argc > 1) ? atoi(&argv[1][1]) : 0;
|
||||
|
||||
switch(n)
|
||||
{
|
||||
{
|
||||
case 0:
|
||||
cg6100(argc, argv); break;
|
||||
case 2:
|
||||
cg6300(argc, argv); break;
|
||||
case 3:
|
||||
|
1
cg/cg6.h
1
cg/cg6.h
@ -1,6 +1,7 @@
|
||||
#ifndef __CG6_H
|
||||
#define __CG6_H
|
||||
|
||||
int cg6100(int argc, char* argv[]);
|
||||
int cg6300(int argc, char* argv[]);
|
||||
int cg6400(int argc, char* argv[]);
|
||||
int cg6500(int argc, char* argv[]);
|
||||
|
99
cg/cg6.url
99
cg/cg6.url
@ -1,45 +1,54 @@
|
||||
#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"
|
||||
|
||||
#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"
|
||||
|
||||
MENUBAR MENU_BAR(9)
|
||||
|
||||
MENU MENU_BAR(9)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
MENUBAR MENU_BAR(10)
|
||||
|
||||
MENU MENU_BAR(10)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
399
cg/cg6100.cpp
Executable file
399
cg/cg6100.cpp
Executable file
@ -0,0 +1,399 @@
|
||||
// Ricezione automatica
|
||||
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <config.h>
|
||||
#include <urldefid.h>
|
||||
#include <prefix.h>
|
||||
#include <execp.h>
|
||||
#include <mailbox.h>
|
||||
|
||||
#include "cglib04.h"
|
||||
|
||||
class TRic_auto : public TApplication
|
||||
{
|
||||
TTransfer_file* _tras_file;
|
||||
|
||||
TString _control_rec, _sigle_file, _nrec_file;
|
||||
TDate _dataultras;
|
||||
int _nultras;
|
||||
long _ditta;
|
||||
char _trasfer;
|
||||
char _tipo;
|
||||
bool _cancella_header;
|
||||
|
||||
public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
|
||||
bool main_loop();
|
||||
void stato_trasferimento(TString& std);
|
||||
bool controlli_preliminari();
|
||||
bool leggi_trasfer();
|
||||
bool leggi_header();
|
||||
bool set_flag();
|
||||
|
||||
TRic_auto(const char* ditta, char trasfer, char tipo);
|
||||
};
|
||||
|
||||
HIDDEN TRic_auto& app() { return (TRic_auto &) main_app(); }
|
||||
|
||||
TRic_auto::TRic_auto(const char* ditta, char trasfer, char tipo) :
|
||||
_ditta(atol(ditta)), _trasfer(trasfer), _tipo(tipo)
|
||||
{}
|
||||
|
||||
void TRic_auto::stato_trasferimento(TString& std)
|
||||
{
|
||||
TConfig conf (CONFIG_DITTA); // Recupero stato trasferimento
|
||||
std = conf.get("FlStTra"); // dai parametri ditta
|
||||
}
|
||||
|
||||
bool TRic_auto::main_loop()
|
||||
{
|
||||
TString std = "";
|
||||
|
||||
if (!controlli_preliminari())
|
||||
return FALSE;
|
||||
|
||||
set_flag();
|
||||
|
||||
stato_trasferimento(std);
|
||||
|
||||
if (std == "T")
|
||||
{
|
||||
TString appname = "cg6 -5 T A"; // Lancio il programma di ricezione delle tabelle
|
||||
// con il parametro A perche' si tratta di ricezione
|
||||
TExternal_app a (appname); // in automatico
|
||||
a.run();
|
||||
}
|
||||
|
||||
stato_trasferimento(std);
|
||||
|
||||
if (std == "C")
|
||||
{
|
||||
TString appname = "cg6 -6 A "; // Lancio il programma di lista controllo movimenti
|
||||
appname << _tipo;
|
||||
|
||||
TExternal_app a (appname);
|
||||
a.run();
|
||||
|
||||
TMailbox m;
|
||||
TMessage* msg = m.next_s("");
|
||||
int subj;
|
||||
|
||||
if (msg != NULL)
|
||||
{
|
||||
subj = atoi(msg->body());
|
||||
|
||||
TFilename dirtemp;
|
||||
dirtemp.tempdir();
|
||||
dirtemp << "cg6700.mbx";
|
||||
fremove(dirtemp);
|
||||
|
||||
if (!subj)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
stato_trasferimento(std);
|
||||
|
||||
if (std == "M")
|
||||
{
|
||||
TString appname = "cg6 -5 M A"; // Lancio il programma di ricezione dei movimenti
|
||||
// con il parametro A perche' si tratta di ricezione
|
||||
TExternal_app a (appname); // in automatico
|
||||
a.run();
|
||||
}
|
||||
|
||||
stato_trasferimento(std);
|
||||
|
||||
if (std == "*")
|
||||
{
|
||||
_cancella_header = TRUE;
|
||||
_tras_file->remove_all();
|
||||
TString trasf;
|
||||
trasf = _tras_file->path(_ditta);
|
||||
trasf << "\\trasfer";
|
||||
fremove(trasf);
|
||||
TConfig conf (CONFIG_DITTA); // Inizializzo stato trasferimento
|
||||
conf.set("FlStTra"," "); // dei parametri ditta
|
||||
message_box("Il trasferimento e' stato INTERAMENTE COMPLETATO");
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TRic_auto::controlli_preliminari()
|
||||
{
|
||||
TString std = "";
|
||||
|
||||
if (!prefix().exist(_ditta)) // Controllo esistenza
|
||||
return error_box("Rilevati ERRORI GRAVI nel trasferimento"); // direttorio della ditta
|
||||
|
||||
set_firm(_ditta);
|
||||
|
||||
stato_trasferimento(std);
|
||||
|
||||
if (std == "")
|
||||
{
|
||||
if (!leggi_trasfer()) // Controllo se esiste il file trasfer
|
||||
return error_box("Il file di trasferimento non e' presente nella directory %s",_tras_file->path(_ditta));
|
||||
|
||||
TString appname = "cg6 -3 "; // Lancio il programma che trasferisce
|
||||
appname << _trasfer << " A"; // i dati dal trasfer agli archivi temporanei
|
||||
|
||||
TExternal_app a (appname);
|
||||
a.run();
|
||||
}
|
||||
|
||||
if (!leggi_header()) // Controllo l'esistenza del record
|
||||
return error_box("Rilevati ERRORI GRAVI nel trasferimento"); // di controllo nel file header
|
||||
|
||||
TString ult_file = _tras_file->ult_file();
|
||||
TString key = _tras_file->key();
|
||||
|
||||
if ( (std != "*" && std != "") || (ult_file != "" || key != "") )
|
||||
return error_box("Ultimo trasferimento NON COMPLETATO: completarlo");
|
||||
|
||||
if (std == "*")
|
||||
{
|
||||
_cancella_header = TRUE;
|
||||
_tras_file->remove_all();
|
||||
TString trasf;
|
||||
trasf = _tras_file->path(_ditta);
|
||||
trasf << "\\trasfer";
|
||||
fremove(trasf);
|
||||
TConfig conf (CONFIG_DITTA); // Inizializzo stato trasferimento
|
||||
conf.set("FlStTra"," "); // dei parametri ditta
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TRic_auto::leggi_trasfer()
|
||||
{
|
||||
TString80 trasf;
|
||||
|
||||
trasf = _tras_file->path(_ditta);
|
||||
trasf << "\\trasfer";
|
||||
|
||||
_tras_file->open(trasf);
|
||||
|
||||
if (_tras_file->exist())
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TRic_auto::leggi_header()
|
||||
{
|
||||
TString header;
|
||||
|
||||
header = _tras_file->path(_ditta);
|
||||
header << HEADER;
|
||||
|
||||
_tras_file->open(header);
|
||||
|
||||
if (_tras_file->exist())
|
||||
{
|
||||
if (_tras_file->read_control_rec())
|
||||
{
|
||||
_control_rec = _tras_file->record();
|
||||
TString tiporecord = _control_rec.sub(0,2);
|
||||
|
||||
if (tiporecord != " 1")
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
_tras_file->close();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TRic_auto::set_flag()
|
||||
{
|
||||
TString sigla;
|
||||
long nrec;
|
||||
int j;
|
||||
int k = 0;
|
||||
TString flag;
|
||||
TString record;
|
||||
TString ana_com,pcon_cau;
|
||||
TString uselab;
|
||||
bool fatto = TRUE;
|
||||
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
|
||||
ana_com = conf.get("AnCfCm","cg");
|
||||
pcon_cau = conf.get("PcTcCm","cg");
|
||||
|
||||
TString header;
|
||||
header = _tras_file->path(_ditta);
|
||||
header << HEADER;
|
||||
_tras_file->open(header);
|
||||
|
||||
if (_tras_file->exist())
|
||||
{
|
||||
if (_tras_file->read_control_rec())
|
||||
{
|
||||
_nultras = _tras_file->nultras();
|
||||
_dataultras = _tras_file->dataultras();
|
||||
_sigle_file = _tras_file->sigle_file();
|
||||
_nrec_file = _tras_file->nrec_file();
|
||||
record = _tras_file->record();
|
||||
}
|
||||
|
||||
for (j = 0; j < _sigle_file.len(); j++)
|
||||
{
|
||||
sigla = _sigle_file.mid(j,1);
|
||||
nrec = atol(_nrec_file.mid(k,6));
|
||||
|
||||
if (fatto)
|
||||
{
|
||||
if (sigla == "W" || sigla == "P")
|
||||
{
|
||||
if (nrec > 0 && pcon_cau == "")
|
||||
{
|
||||
flag = "T";
|
||||
fatto = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (sigla == "A")
|
||||
{
|
||||
if (nrec > 0 && ana_com == "")
|
||||
{
|
||||
flag = "T";
|
||||
fatto = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (sigla == "Z" || sigla == "U" || sigla == "B")
|
||||
{
|
||||
if (nrec > 0)
|
||||
{
|
||||
flag = "C";
|
||||
fatto = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = "*";
|
||||
fatto = FALSE;
|
||||
}
|
||||
|
||||
if (flag == "T")
|
||||
uselab = sigla;
|
||||
else
|
||||
uselab = "";
|
||||
}
|
||||
|
||||
if (sigla == "W" || sigla == "P")
|
||||
{
|
||||
if (pcon_cau == "X")
|
||||
{
|
||||
_sigle_file.overwrite(" ",j);
|
||||
_nrec_file.overwrite("000000",k);
|
||||
}
|
||||
}
|
||||
|
||||
if (sigla == "A")
|
||||
{
|
||||
if (ana_com == "X")
|
||||
{
|
||||
_sigle_file.overwrite(" ",j);
|
||||
_nrec_file.overwrite("000000",k);
|
||||
}
|
||||
}
|
||||
k += 6;
|
||||
}
|
||||
|
||||
record.overwrite(_sigle_file,86);
|
||||
record.overwrite(_nrec_file,95);
|
||||
|
||||
TString agg(7);
|
||||
|
||||
agg[0] = ' ';
|
||||
agg[1] = 'D';
|
||||
agg[2] = 'D';
|
||||
agg[3] = 'D';
|
||||
agg[4] = ' ';
|
||||
agg[5] = ' ';
|
||||
agg[6] = '\0';
|
||||
|
||||
record.overwrite(agg,234);
|
||||
record.overwrite(uselab,240);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
record.overwrite(str,241);
|
||||
|
||||
const int size = 1024;
|
||||
|
||||
if (!_tras_file->write_control_rec(record, size))
|
||||
return FALSE;
|
||||
|
||||
_tras_file->close();
|
||||
}
|
||||
|
||||
conf.set("FlStTra", flag);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TRic_auto::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
_cancella_header = FALSE;
|
||||
|
||||
_tras_file = new TTransfer_file(_trasfer);
|
||||
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TRic_auto::destroy()
|
||||
{
|
||||
delete _tras_file;
|
||||
|
||||
if (_cancella_header)
|
||||
{
|
||||
TString header;
|
||||
|
||||
header = _tras_file->path(_ditta);
|
||||
header << HEADER;
|
||||
|
||||
fremove(header);
|
||||
}
|
||||
|
||||
return TApplication::destroy();
|
||||
}
|
||||
|
||||
bool TRic_auto::menu(MENU_TAG m)
|
||||
{
|
||||
if (m == BAR_ITEM(1))
|
||||
return main_loop();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int cg6100 (int argc, char* argv[])
|
||||
{
|
||||
char p4 = '\0';
|
||||
|
||||
if (argc > 5)
|
||||
p4 = *argv[4];
|
||||
|
||||
TRic_auto main_app(argv[2],*argv[3],p4);
|
||||
main_app.run(argc, argv,"Ricezione automatica");
|
||||
|
||||
return TRUE;
|
||||
}
|
1690
cg/cg6400.cpp
1690
cg/cg6400.cpp
File diff suppressed because it is too large
Load Diff
1540
cg/cg6500.cpp
1540
cg/cg6500.cpp
File diff suppressed because it is too large
Load Diff
2942
cg/cg6600.cpp
2942
cg/cg6600.cpp
File diff suppressed because it is too large
Load Diff
131
cg/cg6600a.uml
131
cg/cg6600a.uml
@ -1,63 +1,68 @@
|
||||
#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 "DU"
|
||||
END
|
||||
|
||||
STRING F_USELAB 1
|
||||
BEGIN
|
||||
PROMPT 31 6 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
STRING F_STATO 15
|
||||
BEGIN
|
||||
PROMPT 35 6 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
#include "cg6600.h"
|
||||
|
||||
PAGE "" -1 -1 78 13
|
||||
|
||||
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
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 1 5 "Data del"
|
||||
END
|
||||
|
||||
DATE F_DATAULTRAS
|
||||
BEGIN
|
||||
PROMPT 1 6 "trasferimento "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_STD 1
|
||||
BEGIN
|
||||
PROMPT 1 7 "Stato del "
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
STRING F_USELAB 1
|
||||
BEGIN
|
||||
PROMPT 22 7 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
STRING F_STATO 60
|
||||
BEGIN
|
||||
PROMPT 1 8 "trasferimento "
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
197
cg/cg6700.cpp
197
cg/cg6700.cpp
@ -8,7 +8,8 @@
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <utility.h>
|
||||
#include <mailbox.h>
|
||||
|
||||
#include <nditte.h>
|
||||
#include <mov.h>
|
||||
@ -46,18 +47,20 @@ class TRic_ListaMov : public TPrintapp
|
||||
TCursor* _cur;
|
||||
TTransfer_file* _trasfer;
|
||||
TLibro_giornale* _giornale;
|
||||
char _ric_auto,_tipo_lista;
|
||||
|
||||
TString80 _pathfile, _descr_causale, _descr_conto;
|
||||
TString16 _causale, _registro, _numdoc, _tipodoc, _codval;
|
||||
TString16 _codpag, _codiva, _tipo_conto;
|
||||
TString _record;
|
||||
bool _mov_sez, _errore_grave, _esiste_conto, _is_exist;
|
||||
bool _mov_sez, _errore_grave, _esiste_conto, _is_exist, _risposta, _continua;
|
||||
char _sdt, _sezione, _tipocf;
|
||||
int _ae, _anno, _gruppo, _conto, _tipocr, _tipod, _tiporeg;
|
||||
int _gruppoc, _contoc, _n_rec, _gruppocr, _contocr;
|
||||
int _gruppoc, _contoc, _gruppocr, _contocr, _annoiva;
|
||||
TDate _datacomp, _datadoc, _datareg, _data74tr;
|
||||
real _importo, _impo, _impos, _tot_dare, _tot_avere, _tot_doc;
|
||||
long _codcf, _numero, _protiva, _sottoconto;
|
||||
long _num_rec, _sottocontoc, _sottocontocr;
|
||||
long _sottocontoc, _sottocontocr;
|
||||
TBit_array _err;
|
||||
byte _controllo;
|
||||
|
||||
@ -89,12 +92,16 @@ public:
|
||||
TLibro_giornale& giornale() { return *_giornale; }
|
||||
TTransfer_file& trasfer() { return *_trasfer; }
|
||||
|
||||
TRic_ListaMov(): _err(80) {}
|
||||
TRic_ListaMov(char ric_auto = '\0',char tipo_lista = '\0');
|
||||
virtual ~TRic_ListaMov() {}
|
||||
};
|
||||
|
||||
HIDDEN inline TRic_ListaMov& app() { return (TRic_ListaMov&)main_app();}
|
||||
|
||||
TRic_ListaMov::TRic_ListaMov(char ric_auto,char tipo_lista):
|
||||
_ric_auto(toupper(ric_auto)), _tipo_lista(toupper(tipo_lista)), _err(80)
|
||||
{}
|
||||
|
||||
const char* TRic_ListaMov::look_sdt()
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
@ -189,10 +196,7 @@ bool TRic_ListaMov::DescrConto(int g, int c, long s)
|
||||
bool TRic_ListaMov::user_create()
|
||||
{
|
||||
_trasfer = new TTransfer_file();
|
||||
|
||||
TProgind* pnd = NULL;
|
||||
pnd = new TProgind (3,"Controllo archivi\nPrego attendere",
|
||||
FALSE, TRUE, 30);
|
||||
|
||||
_tab_tra = new TTable ("%TRA");
|
||||
_tab_tpd = new TTable ("%TPD");
|
||||
_tab_pag = new TTable ("%CPG");
|
||||
@ -206,15 +210,23 @@ bool TRic_ListaMov::user_create()
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
|
||||
if (pnd) pnd->addstatus(1);
|
||||
|
||||
if (!check_archivi(pnd))
|
||||
if (_ric_auto != 'A')
|
||||
{
|
||||
delete pnd;
|
||||
return FALSE;
|
||||
}
|
||||
TProgind* pnd = NULL;
|
||||
pnd = new TProgind (3,"Controllo archivi\nPrego attendere",FALSE, TRUE, 30);
|
||||
|
||||
if (pnd) pnd->addstatus(1);
|
||||
|
||||
if (pnd) pnd->addstatus(1);
|
||||
if (!check_archivi(pnd))
|
||||
{
|
||||
delete pnd;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (pnd) pnd->addstatus(1);
|
||||
|
||||
delete pnd;
|
||||
}
|
||||
|
||||
TString80 tmpmov = "%";
|
||||
tmpmov << get_firm_dir();
|
||||
@ -255,7 +267,8 @@ bool TRic_ListaMov::user_create()
|
||||
|
||||
printer().footerlen(5);
|
||||
|
||||
delete pnd;
|
||||
_risposta = FALSE;
|
||||
_continua = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -624,7 +637,7 @@ bool TRic_ListaMov::controlla_rmov()
|
||||
_descr_conto = "";
|
||||
}
|
||||
|
||||
_num_rec = rec.get_long(RMV_ANNOES);
|
||||
//_num_rec = rec.get_long(RMV_ANNOES);
|
||||
|
||||
if (sezione == 'D')
|
||||
dare += importo;
|
||||
@ -741,7 +754,7 @@ bool TRic_ListaMov::controlla_riva()
|
||||
{
|
||||
TRectype rec (rmoviva.curr());
|
||||
if (rec > recc) break;
|
||||
_n_rec = rec.get_int(RMI_ANNOES);
|
||||
//_n_rec = rec.get_int(RMI_ANNOES);
|
||||
codiva = rec.get(RMI_CODIVA);
|
||||
tipodet = rec.get_int(RMI_TIPODET);
|
||||
tipocr = rec.get_int(RMI_TIPOCR);
|
||||
@ -925,6 +938,7 @@ bool TRic_ListaMov::preprocess_page(int file,int counter)
|
||||
_protiva = cur->curr(LF_MOV).get_long(MOV_PROTIVA);
|
||||
_codval = cur->curr(LF_MOV).get(MOV_CODVALI);
|
||||
_codpag = cur->curr(LF_MOV).get(MOV_CODPAG);
|
||||
_annoiva = _datareg.year();
|
||||
|
||||
_tot_dare = _tot_avere = ZERO;
|
||||
_tot_doc = ZERO;
|
||||
@ -1086,23 +1100,46 @@ print_action TRic_ListaMov::postprocess_page(int file,int count)
|
||||
void TRic_ListaMov::postclose_print()
|
||||
{
|
||||
if (_errore_grave)
|
||||
{
|
||||
message_box("Rilevati errori gravi durante il controllo movimenti: \n trasferimento interrotto");
|
||||
TTransfer_file& tr = trasfer();
|
||||
_record.overwrite(" ",240); //_record e' letto nella read_control_rec()
|
||||
const int size = 256;
|
||||
tr.write_control_rec(_record, size);
|
||||
tr.read_control_rec();
|
||||
{
|
||||
if (_ric_auto == 'A')
|
||||
{
|
||||
_risposta = TRUE;
|
||||
_continua = yesno_box("Rilevati ERRORI GRAVI durante il controllo movimenti: \n Controllare gli errori sulla lista dei movimenti stampata per eseguire le correzioni. \n Continuare ugualmente?");
|
||||
TTransfer_file& tr = trasfer();
|
||||
if (!_continua)
|
||||
_record.overwrite(" ",240); //_record e' letto nella read_control_rec()
|
||||
else
|
||||
{
|
||||
TConfig conf (CONFIG_DITTA);
|
||||
conf.set("FlStTra", "M");
|
||||
_record.overwrite("Z",240);
|
||||
}
|
||||
const int size = 1024;
|
||||
tr.write_control_rec(_record, size);
|
||||
tr.read_control_rec();
|
||||
}
|
||||
else
|
||||
{
|
||||
message_box("Rilevati errori gravi durante il controllo movimenti: \n trasferimento interrotto");
|
||||
TTransfer_file& tr = trasfer();
|
||||
_record.overwrite(" ",240); //_record e' letto nella read_control_rec()
|
||||
const int size = 1024;
|
||||
tr.write_control_rec(_record, size);
|
||||
tr.read_control_rec();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_box("CONTROLLO MOVIMENTI terminato: \n proseguire con AGGIORNAMENTO movimenti");
|
||||
{
|
||||
if (_ric_auto == 'A')
|
||||
_risposta = TRUE;
|
||||
else
|
||||
message_box("CONTROLLO MOVIMENTI terminato: \n proseguire con RICEZIONE movimenti");
|
||||
TConfig conf (CONFIG_DITTA);
|
||||
conf.set("FlStTra", "M");
|
||||
|
||||
TTransfer_file& tr = trasfer();
|
||||
_record.overwrite("Z",240); //_record e' letto nella read_control_rec()
|
||||
const int size = 256;
|
||||
const int size = 1024;
|
||||
tr.write_control_rec(_record, size);
|
||||
tr.read_control_rec();
|
||||
}
|
||||
@ -1113,6 +1150,7 @@ void TRic_ListaMov::aggiorna_mov()
|
||||
TLocalisamfile& mov = current_cursor()->file(LF_MOV);
|
||||
|
||||
mov.put(MOV_DATACOMP, _datacomp);
|
||||
mov.put(MOV_ANNOIVA, _annoiva);
|
||||
mov.put(MOV_REG, _registro);
|
||||
mov.put(MOV_TIPODOC, _tipodoc);
|
||||
mov.put(MOV_TIPO, _tipocf);
|
||||
@ -1171,34 +1209,85 @@ bool TRic_ListaMov::user_destroy()
|
||||
}
|
||||
|
||||
bool TRic_ListaMov::set_print(int m)
|
||||
{
|
||||
TMask msk ("cg6700a");
|
||||
{
|
||||
if (_ric_auto == 'A')
|
||||
{
|
||||
if (_risposta) // Metto questa variabile booleana per uscire, altrimenti
|
||||
{ // il programma andrebbe in loop andando ancora in stampa
|
||||
TString appname = "cg6 -0";
|
||||
TString body = "";
|
||||
|
||||
TTransfer_file& tr = trasfer();
|
||||
if (_continua)
|
||||
body = "1";
|
||||
else
|
||||
body = "0";
|
||||
|
||||
TMessage msg (appname,"",(const char*)body);
|
||||
TMailbox mb;
|
||||
mb.send(msg);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TString80 nome;
|
||||
long ditta_ric = get_firm();
|
||||
|
||||
msk.set(F_NUMERO, tr.nultras());
|
||||
msk.set(F_DATALIMITE, tr.dataultras());
|
||||
msk.set(F_SDT, look_sdt());
|
||||
msk.set(F_SIGLA, tr.ult_file());
|
||||
msk.set(F_CHIAVE, tr.key());
|
||||
TTransfer_file& tr = trasfer(); // Nella lista controllo movimenti lanciata da menu il record di
|
||||
// controllo dell'header viene letto nella funzione check_archivi
|
||||
// Nella ricezione in automatico devo leggerlo in questo punto
|
||||
_pathfile = tr.path();
|
||||
|
||||
if (msk.run() != K_ENTER) return FALSE;
|
||||
_pathfile = _pathfile << HEADER;
|
||||
|
||||
_controllo = msk.get_int(F_LISTA);
|
||||
if (!tr.open(_pathfile))
|
||||
return error_box("Al momento non presenti trasferimenti attivi sulla ditta selezionata");
|
||||
|
||||
if (!tr.read_control_rec())
|
||||
return error_box("Rilevati errori gravi negli archivi: procedura interrotta");
|
||||
else _record = tr.record();
|
||||
|
||||
if (_tipo_lista == 'A')
|
||||
_controllo = 2;
|
||||
else
|
||||
_controllo = 1;
|
||||
|
||||
if (_sdt == '*')
|
||||
fremove(_pathfile);
|
||||
set_real_picture("###.###.###.###");
|
||||
|
||||
setta_parametri(" ", "C");
|
||||
printer().footerlen(5);
|
||||
|
||||
set_real_picture("###.###.###.###");
|
||||
_errore_grave = FALSE;
|
||||
_err.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
TMask msk ("cg6700a");
|
||||
|
||||
printer().footerlen(5);
|
||||
TTransfer_file& tr = trasfer();
|
||||
|
||||
setta_intestazione();
|
||||
msk.set(F_NUMERO, tr.nultras());
|
||||
msk.set(F_DATALIMITE, tr.dataultras());
|
||||
msk.set(F_SDT, look_sdt());
|
||||
msk.set(F_SIGLA, tr.ult_file());
|
||||
msk.set(F_CHIAVE, tr.key());
|
||||
|
||||
_errore_grave = FALSE;
|
||||
_err.reset();
|
||||
if (msk.run() != K_ENTER) return FALSE;
|
||||
|
||||
_controllo = msk.get_int(F_LISTA);
|
||||
|
||||
if (_sdt == '*')
|
||||
fremove(_pathfile);
|
||||
|
||||
setta_parametri(" ", "C");
|
||||
|
||||
set_real_picture("###.###.###.###");
|
||||
|
||||
printer().footerlen(5);
|
||||
|
||||
setta_intestazione();
|
||||
|
||||
_errore_grave = FALSE;
|
||||
_err.reset();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1246,13 +1335,21 @@ void TRic_ListaMov::setta_parametri(const TString& sigla, const TString& flag)
|
||||
TString rec = tr.record();
|
||||
rec.overwrite(sigla,240);
|
||||
|
||||
const int size = 256;
|
||||
const int size = 1024;
|
||||
tr.write_control_rec(rec, size);
|
||||
}
|
||||
|
||||
int cg6700 (int argc, char* argv[])
|
||||
{
|
||||
TRic_ListaMov a;
|
||||
{
|
||||
char p1 = '\0';
|
||||
char p2 = '\0';
|
||||
|
||||
if (argc >= 4)
|
||||
p1 = *argv[2];
|
||||
if (argc >= 5)
|
||||
p2 = *argv[3];
|
||||
|
||||
TRic_ListaMov a(p1,p2);
|
||||
a.run(argc, argv,"Lista controllo movimenti");
|
||||
return TRUE;
|
||||
}
|
||||
|
157
cg/cg6700a.uml
157
cg/cg6700a.uml
@ -1,77 +1,82 @@
|
||||
#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 "DU"
|
||||
END
|
||||
|
||||
STRING F_SIGLA 1
|
||||
BEGIN
|
||||
PROMPT 34 11 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
STRING F_CHIAVE 15
|
||||
BEGIN
|
||||
PROMPT 37 11 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
#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
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 10 "Data limite"
|
||||
END
|
||||
|
||||
DATE F_DATALIMITE
|
||||
BEGIN
|
||||
PROMPT 2 11 "trasferimento "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_SDT 1
|
||||
BEGIN
|
||||
PROMPT 2 12 "Stato della "
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
STRING F_SIGLA 1
|
||||
BEGIN
|
||||
PROMPT 21 12 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 13 "ricezione "
|
||||
END
|
||||
|
||||
STRING F_CHIAVE 60
|
||||
BEGIN
|
||||
PROMPT 17 13 ""
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
@ -238,8 +238,10 @@ bool TVar_mov::main_loop()
|
||||
{
|
||||
setta_parametri_record(" ","C");
|
||||
leggi_record_controllo();
|
||||
TString str (_control_rec.overwrite(" ",241));
|
||||
_tras_file.write_control_rec(str,256);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
_control_rec.overwrite(str,241);
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -253,8 +255,10 @@ bool TVar_mov::main_loop()
|
||||
{
|
||||
setta_parametri_record(" ","C");
|
||||
leggi_record_controllo();
|
||||
TString str (_control_rec.overwrite(" ",241));
|
||||
_tras_file.write_control_rec(str,256);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
_control_rec.overwrite(str,241);
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -285,7 +289,7 @@ bool TVar_mov::video_PN()
|
||||
mask.set_handler(F_CODPAG, codice_pagamento_hnd);
|
||||
mask.set_handler(F_DATAREG, data_stampa);
|
||||
mask.set_handler(F_DATACOMP, data_competenza_hnd);
|
||||
mask.set_handler(F_DATADOC, data);
|
||||
//mask.set_handler(F_DATADOC, data);
|
||||
|
||||
if (_righe)
|
||||
{
|
||||
@ -363,7 +367,7 @@ bool TVar_mov::video_IVA()
|
||||
return FALSE;
|
||||
|
||||
mask.set_handler(F_CODCF, codice_clifo_hnd);
|
||||
mask.set_handler(F_DATA74TER, data);
|
||||
//mask.set_handler(F_DATA74TER, data);
|
||||
mask.set_handler(F_LOCALITA, localita_occasionali);
|
||||
mask.set_handler(F_CAPOCC, cap_occasionali);
|
||||
|
||||
@ -1276,7 +1280,8 @@ void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate
|
||||
_tmov->zero();
|
||||
_tmov->put(MOV_NUMREG, nr);
|
||||
if (_tmov->read() == NOERR)
|
||||
{
|
||||
{
|
||||
_tmov->put(MOV_NUMREG, nr);
|
||||
_tmov->put(MOV_ANNOES, ae);
|
||||
_tmov->put(MOV_DATAREG, dr);
|
||||
_tmov->put(MOV_DATACOMP, dc);
|
||||
@ -1287,6 +1292,8 @@ void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate
|
||||
_tmov->put(MOV_UPROTIVA, upi);
|
||||
_tmov->put(MOV_CODCAUS, cc);
|
||||
_tmov->put(MOV_CODPAG, cp);
|
||||
int ai = dr.year();
|
||||
_tmov->put(MOV_ANNOIVA, ai);
|
||||
|
||||
_tmov->rewrite();
|
||||
}
|
||||
@ -1548,7 +1555,7 @@ void TVar_mov::setta_parametri_record(const TString& sigla,const TString& flag)
|
||||
leggi_record_controllo();
|
||||
_control_rec.overwrite(sigla,240);
|
||||
|
||||
const int size = 256;
|
||||
const int size = 1024;
|
||||
|
||||
_tras_file.write_control_rec(_control_rec, size);
|
||||
}
|
||||
|
498
cg/cg6801.cpp
498
cg/cg6801.cpp
@ -1,246 +1,252 @@
|
||||
#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,41);
|
||||
_control_rec.overwrite(_nrec_file,50);
|
||||
_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;
|
||||
}
|
||||
#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,86);
|
||||
_control_rec.overwrite(_nrec_file,95);
|
||||
_tras_file.write_control_rec(_control_rec,1024);
|
||||
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);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
_control_rec.overwrite(str,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);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
_control_rec.overwrite(str,241);
|
||||
}
|
||||
else
|
||||
{
|
||||
setta_parametri_record("","*",FALSE);
|
||||
_control_rec.overwrite(" ",240);
|
||||
TString str;
|
||||
str.spaces(60);
|
||||
_control_rec.overwrite(str,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 = 1024;
|
||||
|
||||
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 = 1024;
|
||||
|
||||
_tras_file.write_control_rec(_control_rec, size);
|
||||
}
|
||||
}
|
||||
|
||||
bool TDitta_ric::menu(MENU_TAG m)
|
||||
{
|
||||
if (m == BAR_ITEM(1))
|
||||
return set();
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ bool TAnn_mov::video()
|
||||
case K_QUIT :
|
||||
break;
|
||||
|
||||
case K_SAVE :
|
||||
case K_DEL :
|
||||
{
|
||||
annulla(mask);
|
||||
_registra = TRUE;
|
||||
@ -367,7 +367,7 @@ void TAnn_mov::setta_parametri_record(const TString& sigla,const TString& flag)
|
||||
leggi_record_controllo();
|
||||
_control_rec.overwrite(sigla,240);
|
||||
|
||||
const int size = 256;
|
||||
const int size = 1024;
|
||||
|
||||
_tras_file.write_control_rec(_control_rec, size);
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_SAVEREC 10 2
|
||||
BUTTON DLG_DELREC 8 2
|
||||
BEGIN
|
||||
PROMPT -15 -1 "~Annulla"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PROMPT -15 -1 "~Elimina"
|
||||
MESSAGE EXIT,K_DEL
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
|
639
cg/cg6803.cpp
639
cg/cg6803.cpp
@ -1,319 +1,320 @@
|
||||
#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,TRUE);
|
||||
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];
|
||||
if (riat_at =='\0')
|
||||
riat_at = ' ';
|
||||
|
||||
if (riat_pa == '\0')
|
||||
riat_pa = ' ';
|
||||
|
||||
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,30);
|
||||
_control_rec.overwrite(datault,33);
|
||||
_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 = _tras_file.nome_simb();
|
||||
_dittainv = _tras_file.ditta();
|
||||
_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;
|
||||
}
|
||||
#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,TRUE);
|
||||
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];
|
||||
if (riat_at =='\0')
|
||||
riat_at = ' ';
|
||||
|
||||
if (riat_pa == '\0')
|
||||
riat_pa = ' ';
|
||||
|
||||
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("%-60s", (const char*) str);
|
||||
|
||||
_control_rec.overwrite(nultras,75);
|
||||
_control_rec.overwrite(datault,78);
|
||||
_control_rec.overwrite(flags,234);
|
||||
_control_rec.overwrite(uselab,240);
|
||||
_control_rec.overwrite(chiave,241);
|
||||
//_control_rec.format("%-1024s", (const char*) _control_rec);
|
||||
|
||||
const int size = 1024;
|
||||
|
||||
_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 = _tras_file.nome_simb();
|
||||
_dittainv = _tras_file.ditta();
|
||||
_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;
|
||||
}
|
||||
|
112
cg/cg6803.h
112
cg/cg6803.h
@ -1,56 +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,_nomeid,_ragsoc_dittar;
|
||||
TString _agg_cau,_agg_clifo,_agg_pcon,_agg_IVdir,_riatt_att,_riatt_pas;
|
||||
long _dittaric,_dittainv;
|
||||
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() {};
|
||||
};
|
||||
// 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,_nomeid,_ragsoc_dittar;
|
||||
TString _agg_cau,_agg_clifo,_agg_pcon,_agg_IVdir,_riatt_att,_riatt_pas;
|
||||
long _dittaric,_dittainv;
|
||||
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() {};
|
||||
};
|
||||
|
225
cg/cg6803a.uml
225
cg/cg6803a.uml
@ -1,110 +1,115 @@
|
||||
#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 "GU"
|
||||
END
|
||||
|
||||
STRING F_USELAB 1
|
||||
BEGIN
|
||||
PROMPT 34 8 ""
|
||||
FLAGS "GU"
|
||||
END
|
||||
|
||||
STRING F_STATO 15
|
||||
BEGIN
|
||||
PROMPT 38 8 ""
|
||||
FLAGS "GU"
|
||||
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
|
||||
#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 "
|
||||
FLAGS "GU"
|
||||
END
|
||||
|
||||
STRING F_USELAB 1
|
||||
BEGIN
|
||||
PROMPT 21 8 ""
|
||||
FLAGS "GU"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 1 9 "trasferimento "
|
||||
END
|
||||
|
||||
STRING F_STATO 60
|
||||
BEGIN
|
||||
PROMPT 17 9 ""
|
||||
FLAGS "GU"
|
||||
END
|
||||
|
||||
LIST F_AGGCAUSALI 6
|
||||
BEGIN
|
||||
PROMPT 1 11 "Aggiornamento causali gia' presenti "
|
||||
ITEM "N|No"
|
||||
ITEM "D|Descr."
|
||||
ITEM "T|Tutto"
|
||||
FLAGS "G"
|
||||
END
|
||||
|
||||
LIST F_AGGCLIFO 6
|
||||
BEGIN
|
||||
PROMPT 1 12 "Aggiornamento Clienti/Fornitori gia' presenti "
|
||||
ITEM "N|No"
|
||||
ITEM "D|Descr."
|
||||
ITEM "T|Tutto"
|
||||
FLAGS "G"
|
||||
END
|
||||
|
||||
LIST F_AGGPCON 6
|
||||
BEGIN
|
||||
PROMPT 1 13 "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 14 "Aggiornamento classi Piano dei Conti "
|
||||
ITEM "N|No"
|
||||
ITEM "T|Tutto"
|
||||
FLAGS "G"
|
||||
END
|
||||
|
||||
BOOLEAN F_FATTEM
|
||||
BEGIN
|
||||
PROMPT 1 15 "Riattribuzione num. protocollo su fatture emesse "
|
||||
FLAGS "G"
|
||||
END
|
||||
|
||||
BOOLEAN F_FATTRIC
|
||||
BEGIN
|
||||
PROMPT 1 16 "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
|
||||
|
3147
cg/cg6900.cpp
3147
cg/cg6900.cpp
File diff suppressed because it is too large
Load Diff
324
cg/cg6900.h
324
cg/cg6900.h
@ -1,157 +1,167 @@
|
||||
// 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;
|
||||
long _numrec_cau,_numrec_clifo,_numrec_pcon,_numrec_pn,_numrec_iva;
|
||||
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);
|
||||
void sola_iva(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 aggiorna_header(TString& files);
|
||||
void aggiorna_trasfer(TString& files);
|
||||
|
||||
void negPC2negAS(TString& numero);
|
||||
void dec2integer(real& val, long dec);
|
||||
|
||||
void aggiorna_marker(TString& token, int pos);
|
||||
void calcola_totale_record();
|
||||
void scrivi_telefono(TString& app);
|
||||
|
||||
const char* cerca_provincia(const TString& comcf);
|
||||
|
||||
static bool setta_maschera_hnd(TMask_field& f, KEY k);
|
||||
static bool messaggio_hnd (TMask_field& f, KEY k);
|
||||
|
||||
int calcola_numero_dischi(TMask& m);
|
||||
FILE* chiedi_disco(const char* name, int disk, char floppy, bool lettura);
|
||||
bool scrivi_disco(char floppy, int disk, const char* work, FILE* i, TProgind& w);
|
||||
|
||||
TInv_cont(char mov);
|
||||
};
|
||||
|
||||
HIDDEN TInv_cont& app() { return (TInv_cont &) main_app(); }
|
||||
|
||||
// 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,_dittaAS;
|
||||
long _numrec_cau,_numrec_clifo,_numrec_pcon,_numrec_pn,_numrec_iva;
|
||||
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);
|
||||
void sola_iva(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 aggiorna_header(TString& files);
|
||||
void aggiorna_trasfer(TString& files);
|
||||
|
||||
void negPC2negAS(TString& numero);
|
||||
void dec2integer(real& val, long dec);
|
||||
|
||||
void aggiorna_marker(TString& token, int pos);
|
||||
void calcola_totale_record();
|
||||
void scrivi_telefono(TString& app);
|
||||
|
||||
const char* cerca_provincia(const TString& comcf);
|
||||
|
||||
static bool setta_maschera_hnd(TMask_field& f, KEY k);
|
||||
static bool messaggio_hnd (TMask_field& f, KEY k);
|
||||
|
||||
int calcola_numero_dischi(TMask& m);
|
||||
FILE* chiedi_disco(const char* name, int disk, char floppy, bool lettura);
|
||||
bool scrivi_disco(char floppy, int disk, const char* work, FILE* i, TProgind& w);
|
||||
|
||||
bool invio_contabilita_PC();
|
||||
void invio_testata_causali();
|
||||
void invio_righe_causali();
|
||||
void invio_clienti_fornitori();
|
||||
void invio_piano_conti();
|
||||
void invio_testata_movimenti();
|
||||
void invio_righe_contabili();
|
||||
void invio_righe_IVA();
|
||||
void invio_occasionali(TString& record, TString& ocfpi);
|
||||
|
||||
TInv_cont(char mov);
|
||||
};
|
||||
|
||||
HIDDEN TInv_cont& app() { return (TInv_cont &) main_app(); }
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define F_USELAB 107
|
||||
#define F_CHIAVE 108
|
||||
#define F_DATALIM 109
|
||||
#define F_DITTAAS 110
|
||||
|
||||
// Campi maschera cg2900b.uml
|
||||
|
||||
|
136
cg/cg6900a.uml
136
cg/cg6900a.uml
@ -1,62 +1,74 @@
|
||||
#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 "RG"
|
||||
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
|
||||
#include "cg6900a.h"
|
||||
|
||||
PAGE "Invio contabilita'" -1 -1 78 15
|
||||
|
||||
NUMBER F_DITTAINV 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice ditta inviante "
|
||||
FLAGS "ZG"
|
||||
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 "RG"
|
||||
END
|
||||
|
||||
DATE F_DATAULIN
|
||||
BEGIN
|
||||
PROMPT 45 4 "Data ultimo invio "
|
||||
END
|
||||
|
||||
STRING F_STATO 1
|
||||
BEGIN
|
||||
PROMPT 2 6 "Stato ultimo "
|
||||
END
|
||||
|
||||
STRING F_USELAB 1
|
||||
BEGIN
|
||||
PROMPT 19 6 ""
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 7 "invio "
|
||||
END
|
||||
|
||||
STRING F_CHIAVE 60
|
||||
BEGIN
|
||||
PROMPT 15 7 ""
|
||||
END
|
||||
|
||||
DATE F_DATALIM
|
||||
BEGIN
|
||||
PROMPT 2 9 "Data limite invio "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_DITTAAS 4
|
||||
BEGIN
|
||||
PROMPT 2 11 "Ditta da inviare a sistema "
|
||||
FLAGS "H"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
1934
cg/cg6901.cpp
1934
cg/cg6901.cpp
File diff suppressed because it is too large
Load Diff
108
cg/cg6901.h
108
cg/cg6901.h
@ -1,54 +1,54 @@
|
||||
// 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;
|
||||
TDate _datalimite;
|
||||
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() {};
|
||||
};
|
||||
// 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;
|
||||
TDate _datalimite;
|
||||
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, int len);
|
||||
|
||||
TLista_archivi() {};
|
||||
};
|
||||
|
2633
cg/cg6902.cpp
2633
cg/cg6902.cpp
File diff suppressed because it is too large
Load Diff
1056
cg/cg6904.cpp
Executable file
1056
cg/cg6904.cpp
Executable file
File diff suppressed because it is too large
Load Diff
1327
cg/cglib04.cpp
1327
cg/cglib04.cpp
File diff suppressed because it is too large
Load Diff
68
cg/cglib04.h
68
cg/cglib04.h
@ -23,7 +23,11 @@
|
||||
#include <pconti.h>
|
||||
#include <comuni.h>
|
||||
#include <clifo.h>
|
||||
#include <rcausali.h>
|
||||
#include <rcausali.h>
|
||||
#include <causali.h>
|
||||
#include <occas.h>
|
||||
|
||||
#include "cg2103.h"
|
||||
|
||||
#define TEMP_CAUS "tcaus"
|
||||
#define TEMP_RCAUS "trcaus"
|
||||
@ -37,7 +41,7 @@
|
||||
|
||||
#define SIZE 256
|
||||
|
||||
static unsigned char _tabella[10] = {0x8a,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52};
|
||||
static unsigned char _tabella[10] = {0x7d,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52};
|
||||
|
||||
HIDDEN TString80 TEMP;
|
||||
HIDDEN TString16 HEADER = "\\header";
|
||||
@ -46,6 +50,8 @@ const int CAMPI_RCAUS = 6;
|
||||
|
||||
// Tracciato del record di controllo
|
||||
HIDDEN int pos[15] = {0,15,25,29,32,38,47,234,235,236,237,238,239,240,241};
|
||||
|
||||
const int LEN_REC_HEAD = 1025;
|
||||
|
||||
/*HIDDEN*/ const char* converti (TString& data_AS400,bool anno_di_quattro);
|
||||
/*HIDDEN*/ const char* riconverti (TString& data_PC,bool anno_di_quattro);
|
||||
@ -101,8 +107,8 @@ class TRic_recfield : public TObject
|
||||
|
||||
class TMappa_trc : public TAssoc_array
|
||||
{
|
||||
public :
|
||||
void leggi_modulo();
|
||||
public :
|
||||
void leggi_modulo(const char* tracciato);
|
||||
|
||||
int from (const char* key);
|
||||
int to (const char* key);
|
||||
@ -121,11 +127,28 @@ class TTransfer_file
|
||||
// TAssoc_array _fis_index;
|
||||
TMappa_trc _trc;
|
||||
TString _curfile;
|
||||
TString256 _control_rec; // Buffer per il record di controllo
|
||||
TString256 _control_rec_t; // Buffer per il record di controllo del trasfer
|
||||
TFixed_string* _control_rec; // Buffer per il record di controllo
|
||||
// TString _control_rec; // Buffer per il record di controllo dell'header
|
||||
TString256 _record; // Buffer per il record corrente
|
||||
TProgind* _prog;
|
||||
TProgind* _prog;
|
||||
TIsamtempfile* _tcaus;
|
||||
TIsamtempfile* _trcaus;
|
||||
TIsamtempfile* _tclifo;
|
||||
TIsamtempfile* _tpcon;
|
||||
TIsamtempfile* _tmov;
|
||||
TIsamtempfile* _trmov;
|
||||
TIsamtempfile* _triva;
|
||||
TIsamtempfile* _toccas;
|
||||
TIsamtempfile* _ttab;
|
||||
TIsamtempfile* _ttab;
|
||||
TRectype* _depcaus;
|
||||
TRectype* _deprcaus;
|
||||
TRectype* _depclifo;
|
||||
TRectype* _deppcon;
|
||||
TRectype* _depmov;
|
||||
TRectype* _deprmov;
|
||||
TRectype* _depriva;
|
||||
TRectype* _depoccas;
|
||||
|
||||
long _numreg, _numreg_p, _numreg_piva, _npoccas;
|
||||
int _annoes;
|
||||
@ -152,7 +175,7 @@ private:
|
||||
// Inizializza l'indice leggendo il record di controllo
|
||||
void fill_index(TString&,TString&);
|
||||
|
||||
// Funzioni utilizzate da fcopytemp()
|
||||
// Funzioni utilizzate da fcopytemp() nella ricezione da Sistema
|
||||
void scrivi_header(const char* dest,const char* wflag);
|
||||
void scrivi_causali(long nrec);
|
||||
void scrivi_clifo(long nrec);
|
||||
@ -176,11 +199,24 @@ private:
|
||||
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);
|
||||
int cerca_annoes(long numreg, TString& tipodoc);
|
||||
const char* scrivi_occasionali(const TString& record);
|
||||
|
||||
public:
|
||||
// Funzioni utilizzate da fcopytemp_PC() nella ricezione da PC
|
||||
void write_testata_causali(TString& record);
|
||||
void write_righe_causali(TString& record);
|
||||
void write_clienti_fornitori(TString& record);
|
||||
void write_piano_conti(TString& record);
|
||||
void write_testata_movimenti(TString& record);
|
||||
void write_righe_contabili(TString& record);
|
||||
void write_righe_IVA(TString& record);
|
||||
|
||||
int annoes_PC(TString& data);
|
||||
void causale(TString& cau,TString& tipo,TString& descr);
|
||||
int registro(TString& reg,int anno);
|
||||
|
||||
public:
|
||||
|
||||
void remove_all(bool file_ditta = TRUE);
|
||||
void canc_file_dir_temp(const char* dir);
|
||||
void temp_dir(TString& orig,TString& dest,TString& sigle);
|
||||
@ -192,6 +228,8 @@ private:
|
||||
bool fcopytemp(const char* orig, const char* dest);
|
||||
bool ordina_trasfer(const char* orig);
|
||||
long determina_dimensione(FILE* f);
|
||||
|
||||
bool fcopytemp_PC(const char* orig, const char* dest);
|
||||
|
||||
int dataes(const TDate&, int*, TDate&);
|
||||
|
||||
@ -199,7 +237,9 @@ private:
|
||||
bool open (const char* path, bool create=FALSE);
|
||||
void close ();
|
||||
bool exist() const { return _trasfer != NULL; }
|
||||
|
||||
|
||||
void setta_sistema(char scelta);
|
||||
|
||||
long get_pos(const char* key);
|
||||
|
||||
// Funzioni che agiscono sul record di controllo del file trasfer.
|
||||
@ -221,7 +261,7 @@ private:
|
||||
char flg_agg_IV(char sigla); // Ritorna il flag tipo aggiornamento classi piano dei conti
|
||||
const char* ult_file () const { return (const char*) _ult_file; } // Ritorna l'ultima sigla file elaborato
|
||||
const char* key () const { return (const char*) _key; } // Ritorna la chiave ultimo record elaborato
|
||||
const char* record () const { return (const char*) _control_rec; } // Ritorna il record di controllo del trasfer
|
||||
const char* record () const; // Ritorna il record di controllo del trasfer
|
||||
|
||||
// Funzioni per il posizionamento e la gestione dei record del trasfer (escluso il record di controllo)
|
||||
|
||||
@ -268,7 +308,7 @@ private:
|
||||
|
||||
TMappa_trc& mappa() {return _trc; }
|
||||
|
||||
TTransfer_file();
|
||||
TTransfer_file(char scelta = '\0');
|
||||
~TTransfer_file();
|
||||
};
|
||||
|
||||
|
195
cg/cgtrcpc.ini
Executable file
195
cg/cgtrcpc.ini
Executable file
@ -0,0 +1,195 @@
|
||||
# Istruzioni per l' uso della mappa cgtrc.ini
|
||||
#
|
||||
# A | B | C | D | E | F | G | H |
|
||||
#
|
||||
# A = Sigla di identificazione dei vari archivi all' interno del trasfer
|
||||
# W1 = Testata Tabella Causali
|
||||
# W2 = Righe Tabella Causali
|
||||
# A1 = Clienti / Fornitori
|
||||
# P1-P2-P3 = Piano dei Conti
|
||||
# Z1 = Testata Movimenti
|
||||
# Z2 = Righe Movimenti Contabili
|
||||
# U1 = Righe Movimenti Iva
|
||||
#
|
||||
# B = Numero progressivo del campo all'interno dell'archivio
|
||||
#
|
||||
# C = Posizione iniziale del campo sul record del trasfer
|
||||
#
|
||||
# D = Posizione finale del campo sul record del trasfer
|
||||
#
|
||||
# E = Numero di identificazione degli archivi su PC
|
||||
#
|
||||
# F = Nome del campo degli archivi su PC
|
||||
#
|
||||
# G = Questo e' un campo jolly che permette di eseguire determinate operazioni all'interno del programma
|
||||
# e puo' assumere i seguenti valori:
|
||||
# 1 -> indica quali sono i campi che devono essere trasferiti se i flag sulla
|
||||
# tabella della ricezione indica di non trasferire tutto il record.
|
||||
# 2 -> se il campo in questione e' una data.
|
||||
# 3 -> se il campo in questione e' un reale con dei decimali.
|
||||
# 4 -> se il campo in questione deve essere trasferito sugli occasionali.
|
||||
#
|
||||
# H = E' un ulteriore campo jolly da accostare ai campi reali con decimali.
|
||||
# Serve per indicare il numero di decimali. ES: se il campo in questione
|
||||
# e' un reale con 2 decimali il flag G deve essere 3 mentre il flag H
|
||||
# deve essere 2.
|
||||
#
|
||||
W1|1|3|5|26|CODCAUS|||
|
||||
W1|2|61|110|26|DESCR|1||
|
||||
W1|3|111|112|26|TIPODOC|||
|
||||
W1|4|113|113|26|MOVAP|||
|
||||
W1|5|114|114|26|ALLEG|||
|
||||
W1|6|115|115|26|INTRACOM|||
|
||||
W1|7|116|118|26|REG|||
|
||||
W1|8|119|119|26|MOVVAL|||
|
||||
W1|9|120|120|26|TIPOMOV|||
|
||||
W1|10|121|121|26|DATADOC|||
|
||||
W1|11|122|122|26|NUMDOC|||
|
||||
W1|12|123|123|26|AUTOFATT|||
|
||||
W1|13|124|124|26|RITFATT|||
|
||||
W1|14|125|125|26|COLLCESP|||
|
||||
W1|15|126|126|26|M770|||
|
||||
W1|16|127|129|26|CODCAUSIM|||
|
||||
W1|17|130|130|26|SOSPESO|||
|
||||
W1|18|131|131|26|VALINTRA|||
|
||||
W2|1|3|5|27|CODCAUS|||
|
||||
W2|2|6|8|27|NRIGA|||
|
||||
W2|3|61|63|27|GRUPPO|||
|
||||
W2|4|64|66|27|CONTO|||
|
||||
W2|5|67|72|27|SOTTOCONTO|||
|
||||
W2|6|73|77|27|CODDESC|||
|
||||
W2|7|78|78|27|SEZIONE|||
|
||||
A1|1|3|3|20|TIPOCF|||
|
||||
A1|2|4|9|20|CODCF|||
|
||||
A1|3|61|110|20|RAGSOC|1||
|
||||
A1|4|111|145|20|INDCF|1||
|
||||
A1|5|146|155|20|CIVCF|1||
|
||||
A1|6|156|190|20|LOCALITACF|1||
|
||||
A1|7|191|193|20|STATOCF|1||
|
||||
A1|8|194|197|20|COMCF|1||
|
||||
A1|9|248|252|20|CAPCF|1||
|
||||
A1|10|253|268|20|COFI|1||
|
||||
A1|11|269|270|20|STATOPAIV|1||
|
||||
A1|12|271|282|20|PAIV|1||
|
||||
A1|13|283|283|20|TIPOPERS|||
|
||||
A1|14|284|284|20|ALLEG|||
|
||||
A1|15|285|290|20|CODALLEG|||
|
||||
A1|16|291|293|20|GRUPPO|||
|
||||
A1|17|294|296|20|CONTO|||
|
||||
A1|18|297|299|20|GRUPPORIC|||
|
||||
A1|19|300|302|20|CONTORIC|||
|
||||
A1|20|303|308|20|SOTTOCRIC|||
|
||||
A1|21|309|318|20|PTEL|1||
|
||||
A1|22|319|348|20|TEL|1||
|
||||
A1|23|349|358|20|PTEL2|1||
|
||||
A1|24|359|388|20|TEL2|1||
|
||||
A1|25|389|398|20|PTEL3|1||
|
||||
A1|26|399|428|20|TEL3|1||
|
||||
A1|27|429|438|20|PFAX|1||
|
||||
A1|28|439|468|20|FAX|1||
|
||||
A1|29|469|478|20|PTELEX|1||
|
||||
A1|30|479|508|20|TELEX|1||
|
||||
A1|31|509|516|20|DATANASC|2||
|
||||
A1|32|517|519|20|STATONASC|||
|
||||
A1|33|520|523|20|COMNASC|||
|
||||
A1|34|574|580|20|CODSTAT|||
|
||||
A1|35|581|585|20|CODABI|||
|
||||
A1|36|586|590|20|CODCAB|||
|
||||
A1|37|591|591|20|OCCAS|||
|
||||
A1|38|592|594|20|CODVAL|||
|
||||
A1|39|595|595|20|CODLIN|||
|
||||
A1|40|596|610|20|FIDO|||
|
||||
A1|41|611|614|20|CODPAG|||
|
||||
A1|42|615|615|20|SOSPESO|||
|
||||
P1|1|3|5|19|GRUPPO|||
|
||||
P1|2|61|110|19|DESCR|1||
|
||||
P2|1|3|5|19|GRUPPO|||
|
||||
P2|2|6|8|19|CONTO|||
|
||||
P2|3|61|110|19|DESCR|1||
|
||||
P2|4|111|111|19|INDBIL|||
|
||||
P2|5|112|112|19|TMCF|||
|
||||
P2|6|113|113|19|STSOTTBIL|||
|
||||
P2|7|114|114|19|COMPENS|||
|
||||
P2|8|115|115|19|SEZIVD|||
|
||||
P2|9|116|116|19|LETTIVD|||
|
||||
P2|10|117|124|19|NUMRIVD|||
|
||||
P2|11|125|126|19|NUMIVD|||
|
||||
P2|12|127|127|19|SEZIVDOPP|||
|
||||
P2|13|128|128|19|LETTIVDOPP|||
|
||||
P2|14|129|136|19|NUMRIVDOPP|||
|
||||
P2|15|137|138|19|NUMIVDOPP|||
|
||||
P3|1|3|5|19|GRUPPO|||
|
||||
P3|2|6|8|19|CONTO|||
|
||||
P3|3|9|14|19|SOTTOCONTO|||
|
||||
P3|4|61|110|19|DESCR|1||
|
||||
P3|5|111|111|19|TIPOSPRIC|||
|
||||
P3|6|112|112|19|SEZSALDI|||
|
||||
P3|7|113|113|19|SOSPESO|||
|
||||
P3|8|114|114|19|SEZIVD|||
|
||||
P3|9|115|115|19|LETTIVD|||
|
||||
P3|10|116|123|19|NUMRIVD|||
|
||||
P3|11|124|125|19|NUMIVD|||
|
||||
P3|12|126|126|19|SEZIVDOPP|||
|
||||
P3|13|127|127|19|LETTIVDOPP|||
|
||||
P3|14|128|135|19|NUMRIVDOPP|||
|
||||
P3|15|136|137|19|NUMIVDOPP|||
|
||||
P3|16|138|138|19|RICSER|||
|
||||
Z1|1|3|9|23|NUMREG|||
|
||||
Z1|2|61|68|23|DATAREG|2||
|
||||
Z1|3|69|76|23|DATACOMP|2||
|
||||
Z1|4|77|84|23|DATADOC|2||
|
||||
Z1|5|85|92|23|DATA74TER|2||
|
||||
Z1|6|93|99|23|NUMDOC|||
|
||||
Z1|7|100|102|23|CODCAUS|||
|
||||
Z1|8|103|152|23|DESCR|||
|
||||
Z1|9|153|155|23|REG|||
|
||||
Z1|10|156|160|23|PROTIVA|||
|
||||
Z1|11|161|165|23|UPROTIVA|||
|
||||
Z1|12|166|166|23|REGST|||
|
||||
Z1|13|167|167|23|STAMPATO|||
|
||||
Z1|14|168|174|23|NUMGIO|||
|
||||
Z1|15|175|180|23|CODCF|||
|
||||
Z1|16|182|195|23|TOTDOC|||
|
||||
Z1|17|197|210|23|RITFIS|||
|
||||
Z1|18|212|225|23|RITSOC|||
|
||||
Z1|19|226|228|23|CODVALI|||
|
||||
Z1|20|229|242|23|CAMBIOI|3|5|
|
||||
Z1|21|244|257|23|CORRLIRE|||
|
||||
Z1|22|259|274|23|CORRVALUTA|3|2|
|
||||
Z1|23|275|290|23|OCFPI|||
|
||||
Z1|24|291|340|18|RAGSOC|4||
|
||||
Z1|25|341|390|18|INDIR|4||
|
||||
Z1|26|391|396|18|CIV|4||
|
||||
Z1|27|397|399|18|STATO|4||
|
||||
Z1|28|400|403|18|COM|4||
|
||||
Z1|29|454|458|18|CAP|4||
|
||||
Z1|30|459|466|18|DNASC|4||
|
||||
Z1|31|467|469|18|STATONASC|4||
|
||||
Z1|32|470|473|18|COMNASC|4||
|
||||
Z2|1|3|9|24|NUMREG|||
|
||||
Z2|2|10|12|24|NUMRIG|||
|
||||
Z2|3|61|61|24|SEZIONE|||
|
||||
Z2|4|62|69|24|DATAREG|2||
|
||||
Z2|5|70|72|24|GRUPPO|||
|
||||
Z2|6|73|75|24|CONTO|||
|
||||
Z2|7|76|81|24|SOTTOCONTO|||
|
||||
Z2|8|82|131|24|DESCR|||
|
||||
Z2|9|132|134|24|GRUPPOC|||
|
||||
Z2|10|135|137|24|CONTOC|||
|
||||
Z2|11|138|143|24|SOTTOCONTC|||
|
||||
Z2|12|145|158|24|IMPORTO|||
|
||||
Z2|13|159|159|24|ROWTYPE|||
|
||||
U1|1|3|9|25|NUMREG|||
|
||||
U1|2|10|12|25|NUMRIG|||
|
||||
U1|3|61|64|25|CODIVA|||
|
||||
U1|4|66|79|25|IMPONIBILE|||
|
||||
U1|5|81|94|25|IMPOSTA|||
|
||||
U1|6|95|95|25|TIPODET|||
|
||||
U1|7|96|96|25|TIPOCR|||
|
||||
U1|8|97|97|25|INTRA|||
|
||||
U1|9|98|98|25|TIPOATT|||
|
||||
U1|10|99|101|25|GRUPPO|||
|
||||
U1|11|102|104|25|CONTO|||
|
||||
U1|12|105|110|25|SOTTOCONTO|||
|
||||
U1|13|111|113|25|RIGAIMP|||
|
||||
U1|14|114|116|25|RIGAIVA|||
|
Loading…
x
Reference in New Issue
Block a user