Patch level : 4.0 680
Files correlati : cg7.exe cg7300a.msk sispac.ini Ricompilazione Demo : [ ] Commento : Aggiunto programma di invio a Sispac per Ruffo git-svn-id: svn://10.65.10.50/trunk@14650 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ce1bbc86a2
commit
861e489c55
@ -87,7 +87,7 @@ protected:
|
|||||||
void invio_sispac();
|
void invio_sispac();
|
||||||
long i_sispac_clifor(const bool invio = TRUE);
|
long i_sispac_clifor(const bool invio = TRUE);
|
||||||
long i_sispac_movcont(const bool invio = TRUE);
|
long i_sispac_movcont(const bool invio = TRUE);
|
||||||
long i_sispac_moviva(const char acqven, const bool invio = TRUE);
|
long i_sispac_moviva(const bool invio = TRUE);
|
||||||
public:
|
public:
|
||||||
int get_nfiles() {return _nfiles;};
|
int get_nfiles() {return _nfiles;};
|
||||||
long get_nrecords() {return _nrecords;};
|
long get_nrecords() {return _nrecords;};
|
||||||
@ -95,6 +95,8 @@ public:
|
|||||||
TString16& get_descrdettaglio() {return _descrdettaglio;};
|
TString16& get_descrdettaglio() {return _descrdettaglio;};
|
||||||
const bool totale() {return _totale;};
|
const bool totale() {return _totale;};
|
||||||
const bool finemov() {return _finemov;};
|
const bool finemov() {return _finemov;};
|
||||||
|
TInvioS_file* apri_file(const char* nome);
|
||||||
|
void chiudi_file(TInvioS_file* trasfile);
|
||||||
TInvioS() {} ;
|
TInvioS() {} ;
|
||||||
virtual ~TInvioS() {} ;
|
virtual ~TInvioS() {} ;
|
||||||
};
|
};
|
||||||
@ -276,6 +278,26 @@ void TInvioS_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TS
|
|||||||
str = valore;
|
str = valore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TInvioS_file* TInvioS::apri_file(const char* nome)
|
||||||
|
{
|
||||||
|
TFilename filename = _msk->get(F_DESTINAZIONE);
|
||||||
|
filename.add(nome);
|
||||||
|
filename.ext("txt");
|
||||||
|
if (filename.exist())
|
||||||
|
remove(filename);
|
||||||
|
|
||||||
|
TInvioS_file* trasfile = new TInvioS_file(filename);
|
||||||
|
trasfile->open(filename,'w');
|
||||||
|
trasfile->force_record_separator();
|
||||||
|
return trasfile;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TInvioS::chiudi_file(TInvioS_file* trasfile)
|
||||||
|
{
|
||||||
|
trasfile->close();
|
||||||
|
delete trasfile;
|
||||||
|
}
|
||||||
|
|
||||||
long TInvioS::i_sispac_movcont(const bool invio)
|
long TInvioS::i_sispac_movcont(const bool invio)
|
||||||
{
|
{
|
||||||
TRectype da(LF_MOV);
|
TRectype da(LF_MOV);
|
||||||
@ -320,7 +342,8 @@ long TInvioS::i_sispac_movcont(const bool invio)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long TInvioS::i_sispac_moviva(const char acqven, const bool invio)
|
|
||||||
|
long TInvioS::i_sispac_moviva(const bool invio)
|
||||||
{
|
{
|
||||||
TRectype da(LF_MOV);
|
TRectype da(LF_MOV);
|
||||||
TRectype a(LF_MOV);
|
TRectype a(LF_MOV);
|
||||||
@ -329,15 +352,10 @@ long TInvioS::i_sispac_moviva(const char acqven, const bool invio)
|
|||||||
TRelation rel(LF_MOV);
|
TRelation rel(LF_MOV);
|
||||||
rel.add(LF_RMOVIVA, "NUMREG==NUMREG", 1);
|
rel.add(LF_RMOVIVA, "NUMREG==NUMREG", 1);
|
||||||
rel.add("REG", "CODTAB[1,4]==ANNOIVA|CODTAB[5,7]==REG", 1);
|
rel.add("REG", "CODTAB[1,4]==ANNOIVA|CODTAB[5,7]==REG", 1);
|
||||||
//TString filtro = "(23->PROTIVA != \"\") && ";
|
|
||||||
//if (acqven == 'V')
|
|
||||||
// filtro << "(REG->I0 == 1)";
|
|
||||||
//else
|
|
||||||
// filtro << "(REG->I0 == 2)";
|
|
||||||
TCursor cur(&rel, "", 2, &da, &a);
|
TCursor cur(&rel, "", 2, &da, &a);
|
||||||
//cur.setfilter(filtro, TRUE);
|
|
||||||
const long cur_items = cur.items();
|
const long cur_items = cur.items();
|
||||||
if (cur_items != 0)
|
if (cur_items != 0)
|
||||||
|
|
||||||
{
|
{
|
||||||
cur.freeze();
|
cur.freeze();
|
||||||
TRectype& cur_rec = cur.curr();
|
TRectype& cur_rec = cur.curr();
|
||||||
@ -354,7 +372,7 @@ long TInvioS::i_sispac_moviva(const char acqven, const bool invio)
|
|||||||
{
|
{
|
||||||
TRectype& cur_rec_righe = cur.curr(LF_RMOVIVA);
|
TRectype& cur_rec_righe = cur.curr(LF_RMOVIVA);
|
||||||
TRecord_text recrighe;
|
TRecord_text recrighe;
|
||||||
recrighe.set_type("31");
|
recrighe.set_type("I");
|
||||||
cur.save_status();
|
cur.save_status();
|
||||||
_totale = !(cur.next_match(LF_RMOVIVA, "NUMREG"));
|
_totale = !(cur.next_match(LF_RMOVIVA, "NUMREG"));
|
||||||
cur.restore_status();
|
cur.restore_status();
|
||||||
@ -371,6 +389,7 @@ long TInvioS::i_sispac_moviva(const char acqven, const bool invio)
|
|||||||
|
|
||||||
long TInvioS::i_sispac_clifor(const bool invio)
|
long TInvioS::i_sispac_clifor(const bool invio)
|
||||||
{
|
{
|
||||||
|
TInvioS_file* trasfile = apri_file("clifor.txt");
|
||||||
TRelation rel(LF_CLIFO);
|
TRelation rel(LF_CLIFO);
|
||||||
TCursor cur(&rel);
|
TCursor cur(&rel);
|
||||||
const long cur_items = cur.items();
|
const long cur_items = cur.items();
|
||||||
@ -382,16 +401,15 @@ long TInvioS::i_sispac_clifor(const bool invio)
|
|||||||
{
|
{
|
||||||
TRecord_text rec;
|
TRecord_text rec;
|
||||||
const char tipocf = cur.curr().get_char(CLI_TIPOCF);
|
const char tipocf = cur.curr().get_char(CLI_TIPOCF);
|
||||||
|
if (tipocf == 'C')
|
||||||
rec.set_type("C");
|
rec.set_type("C");
|
||||||
_trasfile->autoload(rec, cur);
|
else
|
||||||
_trasfile->write(rec);
|
rec.set_type("F");
|
||||||
|
trasfile->autoload(rec, cur);
|
||||||
rec.set_type("11");
|
trasfile->write(rec);
|
||||||
_trasfile->autoload(rec, cur);
|
|
||||||
_trasfile->write(rec);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
chiudi_file(trasfile);
|
||||||
return cur_items+cur_items;
|
return cur_items+cur_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,9 +419,10 @@ void TInvioS::invio_sispac()
|
|||||||
//prende i parametri dal file di configurazione dell'applicazione
|
//prende i parametri dal file di configurazione dell'applicazione
|
||||||
TFilename configname = "cg7300a.ini";
|
TFilename configname = "cg7300a.ini";
|
||||||
TConfig configfile(configname);
|
TConfig configfile(configname);
|
||||||
|
|
||||||
//prepara il file su cui scrivere, ovvero il _trasfile
|
//prepara il file su cui scrivere, ovvero il _trasfile
|
||||||
TFilename filename = _msk->get(F_DESTINAZIONE);
|
TFilename filename = _msk->get(F_DESTINAZIONE);
|
||||||
filename.add(configfile.get("NOMEFILE", "OPZIONI"));
|
filename.add(configfile.get("FILEMOVIM", "OPZIONI"));
|
||||||
if (fexist(filename))
|
if (fexist(filename))
|
||||||
remove(filename);
|
remove(filename);
|
||||||
|
|
||||||
@ -413,11 +432,9 @@ void TInvioS::invio_sispac()
|
|||||||
if (_msk->get_bool(F_CLIFOR))
|
if (_msk->get_bool(F_CLIFOR))
|
||||||
i_sispac_clifor();
|
i_sispac_clifor();
|
||||||
if (_msk->get_bool(F_MOVCONT))
|
if (_msk->get_bool(F_MOVCONT))
|
||||||
i_sispac_movcont();
|
|
||||||
if (_msk->get_bool(F_MOVIVA))
|
|
||||||
{
|
{
|
||||||
i_sispac_moviva('V');
|
i_sispac_movcont();
|
||||||
i_sispac_moviva('A');
|
i_sispac_moviva();
|
||||||
}
|
}
|
||||||
_trasfile->close();
|
_trasfile->close();
|
||||||
delete _trasfile;
|
delete _trasfile;
|
||||||
|
@ -2,13 +2,8 @@
|
|||||||
|
|
||||||
#define F_CODDITTA 101
|
#define F_CODDITTA 101
|
||||||
#define F_RAGSOC 102
|
#define F_RAGSOC 102
|
||||||
#define F_CAUSALI 110
|
|
||||||
#define F_CONTI 111
|
|
||||||
#define F_CLIFOR 112
|
#define F_CLIFOR 112
|
||||||
#define F_MOVCONT 113
|
#define F_MOVCONT 113
|
||||||
#define F_MOVIVA 114
|
|
||||||
#define F_CORRISP 115
|
|
||||||
#define F_SALDACONTO 116
|
|
||||||
#define F_TIPOINVIO 120
|
#define F_TIPOINVIO 120
|
||||||
#define F_DESTINAZIONE 121
|
#define F_DESTINAZIONE 121
|
||||||
#define F_NUMEROINVIO 122
|
#define F_NUMEROINVIO 122
|
||||||
|
8
cg/cg7300a.ini
Executable file
8
cg/cg7300a.ini
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
[OPZIONI]
|
||||||
|
DATA =
|
||||||
|
FILECLIFO = clifo.txt
|
||||||
|
FILEMOVIM = movim.txt
|
||||||
|
NUMEROINVIO =
|
||||||
|
PERCORSO = c:\temp\
|
||||||
|
|
||||||
|
|
@ -28,17 +28,6 @@ BEGIN
|
|||||||
PROMPT 2 4 "Dati da inviare"
|
PROMPT 2 4 "Dati da inviare"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_CAUSALI
|
|
||||||
BEGIN
|
|
||||||
PROMPT 3 5 "Causali"
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_CONTI
|
|
||||||
BEGIN
|
|
||||||
PROMPT 3 6 "Conti"
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_CLIFOR
|
BOOLEAN F_CLIFOR
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 7 "Clienti/Fornitori"
|
PROMPT 3 7 "Clienti/Fornitori"
|
||||||
@ -46,28 +35,10 @@ END
|
|||||||
|
|
||||||
BOOLEAN F_MOVCONT
|
BOOLEAN F_MOVCONT
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 8 "Movimenti contabili"
|
PROMPT 3 8 "Movimenti"
|
||||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_MOVIVA
|
|
||||||
BEGIN
|
|
||||||
PROMPT 40 5 "Movimenti IVA"
|
|
||||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_CORRISP
|
|
||||||
BEGIN
|
|
||||||
PROMPT 40 6 "Corrispettivi"
|
|
||||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
|
||||||
END
|
|
||||||
|
|
||||||
BOOLEAN F_SALDACONTO
|
|
||||||
BEGIN
|
|
||||||
PROMPT 40 7 "Saldaconto"
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
LISTBOX F_TIPOINVIO 20
|
LISTBOX F_TIPOINVIO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 10 "Invio a "
|
PROMPT 2 10 "Invio a "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user