Modifiche per l'introduzione della ricezione del Saldaconto
git-svn-id: svn://10.65.10.50/trunk@2962 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4d72002241
commit
bd2e2c034e
@ -18,8 +18,8 @@
|
||||
#include <nditte.h>
|
||||
|
||||
#include "cglib04.h"
|
||||
|
||||
#include "cg6400.h"
|
||||
#include "saldacon.h"
|
||||
|
||||
class TRic_archivi : public TApplication
|
||||
{
|
||||
@ -33,6 +33,9 @@ class TRic_archivi : public TApplication
|
||||
TLocalisamfile* _rmov;
|
||||
TLocalisamfile* _rmoviva;
|
||||
TLocalisamfile* _occas;
|
||||
TLocalisamfile* _part;
|
||||
TLocalisamfile* _scad;
|
||||
TLocalisamfile* _pagsca;
|
||||
TLocalisamfile* _tab;
|
||||
TArchive _arc;
|
||||
|
||||
@ -49,11 +52,9 @@ class TRic_archivi : public TApplication
|
||||
TDate _datatras,_datatrasp,_dataultras_tab,_dataultras;
|
||||
TString _sigle_file,_nrec_file,_trasfhard;
|
||||
char _agg_cau,_agg_pcon,_agg_cls,_agg_clifo,_agg_fatatt,_agg_fatpas;
|
||||
TString _titolo;
|
||||
|
||||
public:
|
||||
|
||||
const char* titolo() { return _titolo; }
|
||||
TString _titolo;
|
||||
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
@ -105,6 +106,9 @@ bool TRic_archivi::create()
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
_occas = new TLocalisamfile (LF_OCCAS);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
_tab = new TLocalisamfile (LF_TAB);
|
||||
|
||||
_numdisk = 1;
|
||||
@ -131,6 +135,9 @@ bool TRic_archivi::destroy()
|
||||
delete _rmov;
|
||||
delete _rmoviva;
|
||||
delete _occas;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
delete _tab;
|
||||
|
||||
return TApplication::destroy();
|
||||
@ -882,8 +889,8 @@ int cg6400 (int argc, char* argv[])
|
||||
if (argc > 4)
|
||||
p3 = *argv[3];
|
||||
|
||||
TRic_archivi app(*argv[2],p3);
|
||||
app.run(argc, argv, app.titolo());
|
||||
TRic_archivi main_app(*argv[2],p3);
|
||||
main_app.run(argc, argv,main_app._titolo);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -746,7 +746,7 @@ bool Tabinv_application::user_create()
|
||||
_msk->set_handler(F_USELAB, sigla_file);
|
||||
_msk->set_handler(F_CHIAVE, chiave_file);
|
||||
_msk->set_handler(F_GHOST_FIELD, controlli_hnd);
|
||||
_msk->disable(F_FATT);
|
||||
//_msk->disable(F_FATT);
|
||||
}
|
||||
|
||||
if (_tabname == "%INS")
|
||||
|
349
cg/cg6600.cpp
349
cg/cg6600.cpp
@ -23,10 +23,14 @@
|
||||
#include <rcausali.h>
|
||||
#include <causali.h>
|
||||
#include <occas.h>
|
||||
#include <partite.h>
|
||||
#include <scadenze.h>
|
||||
#include <pagsca.h>
|
||||
|
||||
#include "cglib04.h"
|
||||
#include "cglib.h"
|
||||
#include "cg2103.h"
|
||||
#include "saldacon.h"
|
||||
|
||||
#include "cg6600.h"
|
||||
|
||||
@ -34,8 +38,10 @@ class TRic_tab : public TApplication
|
||||
{
|
||||
|
||||
TTable* _tab_tra;
|
||||
TLocalisamfile* _caus,*_rcaus,*_clifo,*_pcon,*_mov,*_rmov,*_rmoviva,*_saldi,*_occas;
|
||||
TIsamtempfile* _tcaus,*_trcaus,*_tclifo,*_tpcon,*_tmov,*_trmov,*_triva,*_toccas;
|
||||
TLocalisamfile* _caus,*_rcaus,*_clifo,*_pcon,*_mov,*_rmov,*_rmoviva;
|
||||
TLocalisamfile* _saldi,*_occas,*_part,*_scad,*_pagsca;
|
||||
TIsamtempfile* _tcaus,*_trcaus,*_tclifo,*_tpcon,*_tmov,*_trmov,*_triva;
|
||||
TIsamtempfile* _toccas,*_tpart,*_tscad,*_tpagsca;
|
||||
TTable* _reg;
|
||||
TTransfer_file _tras_file;
|
||||
TArray _aggiorna;
|
||||
@ -43,7 +49,7 @@ class TRic_tab : public TApplication
|
||||
TSaldo_agg _sld;
|
||||
TProgind* _prog;
|
||||
|
||||
int _numinv,_nultras,_annoes,_g,_c;
|
||||
int _numinv,_nultras,_annoes,_g,_c,_nrig,_nrata;
|
||||
TString _trasf,_ragsoc_dittar,_sigle_file,_std,_key,_nomeid,_dittainv;
|
||||
long _dittaric,_numrec,_nreg,_s,_ndoc,_npiva,_nupiva;
|
||||
TDate _dataultras,_datareg,_dreg,_ddoc;
|
||||
@ -52,7 +58,8 @@ class TRic_tab : public TApplication
|
||||
long _protiva,_uprotiva,_nprotiva,_nuprotiva,_numreg,_numreg_p,_numreg_piva,_nuovareg;
|
||||
char _sez;
|
||||
real _importo,_totdoc;
|
||||
TString _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva,_tmpoccas;
|
||||
TString _tmpcaus,_tmprcaus,_tmpclifo,_tmpcon,_tmpmov,_tmprmov,_tmpriva;
|
||||
TString _tmpoccas,_tmppart,_tmpscad,_tmppagsca;
|
||||
|
||||
public:
|
||||
TString _titolo;
|
||||
@ -60,6 +67,7 @@ public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
virtual void on_config_change();
|
||||
bool main_loop();
|
||||
bool video();
|
||||
bool leggi_trasfer();
|
||||
@ -87,6 +95,7 @@ public:
|
||||
void scrivi_righePN(long numreg);
|
||||
void ricevi_movIVA(TString& key, char sigla);
|
||||
void scrivi_righeIVA(long numreg);
|
||||
void ricevi_movSC(TString& key,char sigla);
|
||||
long esiste_numreg(long nreg);
|
||||
void num_protocollo();
|
||||
long controlli_primanota();
|
||||
@ -94,8 +103,11 @@ public:
|
||||
long ultima_registrazione();
|
||||
void aggiorna_reg(int anno,TString& codreg,long ulnum);
|
||||
char ricerca_causale(TString& field);
|
||||
|
||||
bool esiste_partita(TString& key);
|
||||
void rigaErata(char,int,int,long,int,TString&,int,int);
|
||||
void aggiorna_temp_scad(char,int,int,long,int,TString&,int,int,int,int);
|
||||
bool occasionali(TString& ocfpi);
|
||||
long nuovaregSC(long nreg);
|
||||
|
||||
TRic_tab(char ric_tab_mov, char ric_auto = '\0');
|
||||
};
|
||||
@ -112,6 +124,11 @@ _scelta(toupper(ric_tab_mov)), _ric_auto(toupper(ric_auto))
|
||||
_titolo = "Ricezione movimenti";
|
||||
}
|
||||
|
||||
void TRic_tab::on_config_change()
|
||||
{
|
||||
TPartita::carica_allineamento(); // Necessario per utilizzare l'oggetto TPartita con un corretto allineamento
|
||||
}
|
||||
|
||||
bool TRic_tab::create()
|
||||
{
|
||||
TApplication::create();
|
||||
@ -134,6 +151,9 @@ bool TRic_tab::create()
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
_saldi = new TLocalisamfile (LF_SALDI);
|
||||
_occas = new TLocalisamfile (LF_OCCAS);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
}
|
||||
|
||||
_numrec = 1;
|
||||
@ -168,6 +188,9 @@ bool TRic_tab::destroy()
|
||||
delete _rmoviva;
|
||||
delete _saldi;
|
||||
delete _occas;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
}
|
||||
|
||||
return TApplication::destroy();
|
||||
@ -335,6 +358,10 @@ void TRic_tab::trasferimento()
|
||||
message = "Ricezione Movimenti iva in corso... Prego attendere.";
|
||||
cicli = _tmov->items();
|
||||
break;
|
||||
case 'B':
|
||||
message = "Ricezione Movimenti saldaconto in corso... Prego attendere.";
|
||||
cicli = _tpart->items();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
_prog = new TProgind(cicli,message,FALSE);
|
||||
@ -359,6 +386,9 @@ void TRic_tab::trasferimento()
|
||||
else
|
||||
if (sigla == 'U')
|
||||
ricevi_movIVA(key,sigla);
|
||||
else
|
||||
if (sigla == 'B')
|
||||
ricevi_movSC(key,sigla);
|
||||
}
|
||||
delete _prog;
|
||||
key = ""; //Altrimenti in caso di ripartenza mi ripristina sempre la situazione
|
||||
@ -1050,12 +1080,14 @@ void TRic_tab::ricevi_movPN(TString& key, char uselab)
|
||||
_sld.set_movprovv(FALSE);
|
||||
_sld.set_num_ulmov(_nreg);
|
||||
_sld.set_data_ulmov(datareg);
|
||||
|
||||
char movap = ricerca_causale(codcaus);
|
||||
if (movap == 'A')
|
||||
_sld.set_tipo_saldo(apertura);
|
||||
else if (movap == 'C')
|
||||
_sld.set_tipo_saldo(chiusura);
|
||||
|
||||
// if (movap == 'A') // Sostituire con la parte commentata sopra
|
||||
// _sld.set_movap(TRUE);
|
||||
scrivi_righePN(nreg);
|
||||
|
||||
_sld.registra();
|
||||
@ -1210,10 +1242,10 @@ void TRic_tab::ricevi_movIVA(TString& key, char uselab)
|
||||
if (ocfpi.not_empty())
|
||||
occasionali(ocfpi);
|
||||
|
||||
// TRecnotype rec = _tmov->recno(); // Salvo il nuovo numero di
|
||||
// _tmov->put("TOCFP", ocfpi); // registrazione sul file di lavoro
|
||||
// _tmov->rewrite();
|
||||
// _tmov->readat(rec);
|
||||
TRecnotype rec = _tmov->recno(); // Salvo il nuovo numero di
|
||||
_tmov->put("TOCFP", ocfpi); // registrazione sul file di lavoro
|
||||
_tmov->rewrite();
|
||||
_tmov->readat(rec);
|
||||
|
||||
TDate data74ter ( _tmov->get_date(MOV_DATA74TER) );
|
||||
TString codval ( _tmov->get (MOV_CODVALI) );
|
||||
@ -1254,6 +1286,276 @@ void TRic_tab::ricevi_movIVA(TString& key, char uselab)
|
||||
}
|
||||
}
|
||||
|
||||
long TRic_tab::nuovaregSC(long nreg)
|
||||
{
|
||||
long nuovareg = 0;
|
||||
|
||||
_tmov->zero();
|
||||
_tmov->put(MOV_NUMREG, nreg);
|
||||
if (_tmov->read() == NOERR)
|
||||
nuovareg = _tmov->get_long("TNUMREG");
|
||||
|
||||
return nuovareg;
|
||||
}
|
||||
|
||||
bool TRic_tab::esiste_partita(TString& key)
|
||||
{
|
||||
TLocalisamfile part (LF_PARTITE);
|
||||
|
||||
char tipoc = key.mid(0,1)[0];
|
||||
int gruppo = atoi(key.mid(1,3));
|
||||
int conto = atoi(key.mid(4,3));
|
||||
long sottoc = atol(key.mid(7,6));
|
||||
int anno = atoi(key.mid(13,4));
|
||||
TString npart = key.mid(17,7);
|
||||
int nriga = atoi(key.mid(24,4));
|
||||
|
||||
part.zero();
|
||||
part.put(PART_TIPOCF, tipoc);
|
||||
part.put(PART_GRUPPO, gruppo);
|
||||
part.put(PART_CONTO, conto);
|
||||
part.put(PART_SOTTOCONTO, sottoc);
|
||||
part.put(PART_ANNO, anno);
|
||||
part.put(PART_NUMPART, npart);
|
||||
part.put(PART_NRIGA, nriga);
|
||||
if (part.read() == NOERR)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TRic_tab::aggiorna_temp_scad(char tipocf,int gruppo,int conto,long codcf,int anno,TString& numpart,
|
||||
int nriga,int nrata,int nuova_riga,int nuova_rata)
|
||||
{
|
||||
TRecnotype rec = _tscad->recno();
|
||||
TIsamtempfile& scad = *_tscad;
|
||||
|
||||
scad.setkey(1);
|
||||
scad.zero();
|
||||
scad.put(SCAD_TIPOCF, tipocf);
|
||||
scad.put(SCAD_GRUPPO, gruppo);
|
||||
scad.put(SCAD_CONTO, conto);
|
||||
scad.put(SCAD_SOTTOCONTO, codcf);
|
||||
scad.put(SCAD_ANNO, anno);
|
||||
scad.put(SCAD_NUMPART, numpart);
|
||||
scad.put(SCAD_NRIGA, nriga);
|
||||
scad.put(SCAD_NRATA, nrata);
|
||||
if (scad.read() == NOERR)
|
||||
{
|
||||
scad.put(SCAD_TNRIGA, nuova_riga);
|
||||
scad.put(SCAD_TNRATA, nuova_rata);
|
||||
scad.rewrite();
|
||||
}
|
||||
_tscad->readat(rec);
|
||||
}
|
||||
|
||||
void TRic_tab::rigaErata(char tipocf,int gruppo,int conto,long codcf,int anno,
|
||||
TString& numpart,int nriga, int nrata)
|
||||
{
|
||||
TRecnotype rec = _tscad->recno();
|
||||
TIsamtempfile& scad = *_tscad;
|
||||
|
||||
scad.setkey(1);
|
||||
scad.zero();
|
||||
scad.put(SCAD_TIPOCF, tipocf);
|
||||
scad.put(SCAD_GRUPPO, gruppo);
|
||||
scad.put(SCAD_CONTO, conto);
|
||||
scad.put(SCAD_SOTTOCONTO, codcf);
|
||||
scad.put(SCAD_ANNO, anno);
|
||||
scad.put(SCAD_NUMPART, numpart);
|
||||
scad.put(SCAD_NRIGA, nriga);
|
||||
scad.put(SCAD_NRATA, nrata);
|
||||
if (scad.read() == NOERR)
|
||||
{
|
||||
_nrig = scad.get_int(SCAD_TNRIGA);
|
||||
_nrata = scad.get_int(SCAD_TNRATA);
|
||||
}
|
||||
_tscad->readat(rec);
|
||||
}
|
||||
|
||||
void TRic_tab::ricevi_movSC(TString& key, char uselab)
|
||||
{
|
||||
TString str;
|
||||
TPartita* newgame = NULL;
|
||||
bool chiave = FALSE;
|
||||
|
||||
_tpart->setkey(1);
|
||||
|
||||
if (key.empty())
|
||||
_tpart->first();
|
||||
else
|
||||
{
|
||||
char tipoc = key.mid(0,1)[0];
|
||||
int gruppo = atoi(key.mid(1,3));
|
||||
int conto = atoi(key.mid(4,3));
|
||||
long sottoc = atol(key.mid(7,6));
|
||||
int anno = atoi(key.mid(13,4));
|
||||
TString npart = key.mid(17,7);
|
||||
int nriga = atoi(key.mid(24,4));
|
||||
_tpart->zero();
|
||||
_tpart->put(PART_TIPOCF, tipoc);
|
||||
_tpart->put(PART_GRUPPO, gruppo);
|
||||
_tpart->put(PART_CONTO, conto);
|
||||
_tpart->put(PART_SOTTOCONTO, sottoc);
|
||||
_tpart->put(PART_ANNO, anno);
|
||||
_tpart->put(PART_NUMPART, npart);
|
||||
_tpart->put(PART_NRIGA, nriga);
|
||||
_tpart->read();
|
||||
chiave = TRUE;
|
||||
}
|
||||
|
||||
for(; !_tpart->eof(); _tpart->next())
|
||||
{
|
||||
_prog->addstatus(1);
|
||||
|
||||
if (chiave)
|
||||
if (esiste_partita(key))
|
||||
continue;
|
||||
|
||||
long nreg = _tpart->get_long(PART_NREG);
|
||||
_nuovareg = nuovaregSC(nreg);
|
||||
int anno = _tpart->get_int (PART_ANNO);
|
||||
TString numpart = _tpart->get (PART_NUMPART);
|
||||
char tipocf = _tpart->get_char(PART_TIPOCF);
|
||||
int gruppo = _tpart->get_int (PART_GRUPPO);
|
||||
int conto = _tpart->get_int (PART_CONTO);
|
||||
long codcf = _tpart->get_long(PART_SOTTOCONTO);
|
||||
int nriga = _tpart->get_int (PART_NRIGA);
|
||||
int tipomov = _tpart->get_int (PART_TIPOMOV);
|
||||
|
||||
TBill clifo;
|
||||
clifo.set(gruppo, conto, codcf, tipocf);
|
||||
|
||||
newgame = new TPartita(clifo, anno, numpart);
|
||||
|
||||
TRiga_partite& partita = newgame->new_row();
|
||||
int nuova_riga = partita.get_int(PART_NRIGA);
|
||||
// put data on partita
|
||||
partita.put(PART_TIPOMOV, _tpart->get_int (PART_TIPOMOV));
|
||||
partita.put(PART_TIPOPAG, _tpart->get_int (PART_TIPOPAG));
|
||||
partita.put(PART_NREG, _nuovareg);
|
||||
partita.put(PART_NUMRIG, _tpart->get_int (PART_NUMRIG));
|
||||
partita.put(PART_DATAREG, _tpart->get_date(PART_DATAREG));
|
||||
partita.put(PART_DATADOC, _tpart->get_date(PART_DATADOC));
|
||||
partita.put(PART_DATAPAG, _tpart->get_date(PART_DATAPAG));
|
||||
partita.put(PART_NUMDOC, _tpart->get (PART_NUMDOC));
|
||||
partita.put(PART_REG, _tpart->get (PART_REG));
|
||||
partita.put(PART_PROTIVA, _tpart->get_long(PART_PROTIVA));
|
||||
partita.put(PART_CODCAUS, _tpart->get (PART_CODCAUS));
|
||||
partita.put(PART_SEZ, _tpart->get (PART_SEZ));
|
||||
partita.put(PART_IMPORTO, _tpart->get_real(PART_IMPORTO));
|
||||
partita.put(PART_IMPOSTA, _tpart->get_real(PART_IMPOSTA));
|
||||
partita.put(PART_CODVAL, _tpart->get (PART_CODVAL));
|
||||
partita.put(PART_CAMBIO, _tpart->get_real(PART_CAMBIO));
|
||||
partita.put(PART_IMPORTOVAL, _tpart->get_real(PART_IMPORTOVAL));
|
||||
partita.put(PART_DATACAM, _tpart->get_date(PART_DATACAM));
|
||||
partita.put(PART_IMPTOTDOC, _tpart->get_real(PART_IMPTOTDOC));
|
||||
partita.put(PART_IMPTOTVAL, _tpart->get_real(PART_IMPTOTVAL));
|
||||
partita.put(PART_RITENUTE, _tpart->get_real(PART_RITENUTE));
|
||||
partita.put(PART_SEZABB, _tpart->get (PART_SEZABB));
|
||||
partita.put(PART_ABBUONI, _tpart->get_real(PART_ABBUONI));
|
||||
partita.put(PART_SEZDIFCAM, _tpart->get (PART_SEZDIFCAM));
|
||||
partita.put(PART_DIFFCAM, _tpart->get_real(PART_DIFFCAM));
|
||||
partita.put(PART_GRUPPOCL, _tpart->get_int (PART_GRUPPOCL));
|
||||
partita.put(PART_CONTOCL, _tpart->get_int (PART_CONTOCL));
|
||||
|
||||
if (tipomov == 1)
|
||||
{
|
||||
_tscad->zero();
|
||||
_tscad->put(SCAD_TIPOCF, tipocf);
|
||||
if (gruppo != 0)
|
||||
_tscad->put(SCAD_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_tscad->put(SCAD_CONTO, conto);
|
||||
if (codcf != 0)
|
||||
_tscad->put(SCAD_SOTTOCONTO, codcf);
|
||||
_tscad->put(SCAD_ANNO, anno);
|
||||
_tscad->put(SCAD_NUMPART, numpart);
|
||||
_tscad->put(SCAD_NRIGA, nriga);
|
||||
|
||||
TRectype scad (_tscad->curr());
|
||||
|
||||
for (_tscad->read(_isgteq); !_tscad->eof(); _tscad->next())
|
||||
{
|
||||
if (_tscad->curr() != scad) break;
|
||||
|
||||
TRiga_scadenze& scadenza = partita.new_row();
|
||||
|
||||
scadenza.put(SCAD_CODPAG, _tscad->get (SCAD_CODPAG));
|
||||
scadenza.put(SCAD_TIPOPAG, _tscad->get_int (SCAD_TIPOPAG));
|
||||
scadenza.put(SCAD_ULTCLASS, _tscad->get (SCAD_ULTCLASS));
|
||||
scadenza.put(SCAD_IMPORTO, _tscad->get_real(SCAD_IMPORTO));
|
||||
scadenza.put(SCAD_IMPORTOVAL, _tscad->get_real(SCAD_IMPORTOVAL));
|
||||
scadenza.put(SCAD_DATASCAD, _tscad->get_date(SCAD_DATASCAD));
|
||||
int nrata = _tscad->get_int(SCAD_NRATA);
|
||||
int nuova_rata = scadenza.get_int(SCAD_NRATA);
|
||||
aggiorna_temp_scad(tipocf,gruppo,conto,codcf,anno,numpart,nriga,nrata,nuova_riga,nuova_rata);
|
||||
}
|
||||
}
|
||||
|
||||
if (tipomov != 1)
|
||||
{
|
||||
_tpagsca->zero();
|
||||
_tpagsca->put(PAGSCA_TIPOC, tipocf);
|
||||
if (gruppo != 0)
|
||||
_tpagsca->put(PAGSCA_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_tpagsca->put(PAGSCA_CONTO, conto);
|
||||
if (codcf != 0)
|
||||
_tpagsca->put(PAGSCA_SOTTOCONTO, codcf);
|
||||
_tpagsca->put(PAGSCA_ANNO, anno);
|
||||
_tpagsca->put(PAGSCA_NUMPART, numpart);
|
||||
// _tpagsca->put(PAGSCA_NRIGA, nriga);
|
||||
|
||||
TRectype pagsca (_tpagsca->curr());
|
||||
|
||||
for (_tpagsca->read(_isgteq); !_tpagsca->eof(); _tpagsca->next())
|
||||
{
|
||||
int nrigp = _tpagsca->get_int(PAGSCA_NRIGP);
|
||||
|
||||
if (_tpagsca->curr() != pagsca) break;
|
||||
|
||||
if (nriga != nrigp) continue;
|
||||
|
||||
int nrig = _tpagsca->get_int(PAGSCA_NRIGA);
|
||||
int nrata = _tpagsca->get_int(PAGSCA_NRATA);
|
||||
_nrig = nrig;
|
||||
_nrata = nrata;
|
||||
rigaErata(tipocf,gruppo,conto,codcf,anno,numpart,nrig,nrata);
|
||||
|
||||
TRectype& pag = newgame->pagamento(_nrig,_nrata,nuova_riga);
|
||||
|
||||
if (_nrig == 9999 && _nrata == 9999)
|
||||
pag.put(PAGSCA_ACCSAL, "A");
|
||||
else
|
||||
{
|
||||
pag.put(PAGSCA_ACCSAL, _tpagsca->get (PAGSCA_ACCSAL));
|
||||
pag.put(PAGSCA_PASSATT, _tpagsca->get (PAGSCA_PASSATT));
|
||||
pag.put(PAGSCA_ABBUONI, _tpagsca->get_real(PAGSCA_ABBUONI));
|
||||
pag.put(PAGSCA_DIFFCAM, _tpagsca->get_real(PAGSCA_DIFFCAM));
|
||||
}
|
||||
pag.put(PAGSCA_IMPORTO, _tpagsca->get_real(PAGSCA_IMPORTO));
|
||||
pag.put(PAGSCA_IMPORTOVAL, _tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
||||
pag.put(PAGSCA_RITENUTE, _tpagsca->get_real(PAGSCA_RITENUTE));
|
||||
}
|
||||
}
|
||||
|
||||
if (newgame != NULL) // Se non ho cancellato il numero partita ...
|
||||
{
|
||||
newgame->write(); // Salva nuova partita
|
||||
delete newgame;
|
||||
}
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave;
|
||||
chiave.format("%c%03d%03d%06ld%04d%7s%04d", tipocf,gruppo,conto,codcf,anno,(const char*)numpart,nriga);
|
||||
TString sigla (format("%c", uselab));
|
||||
str = _record.overwrite(sigla,240);
|
||||
str = _record.overwrite(chiave,241);
|
||||
_tras_file.write_control_rec(str,1024);
|
||||
}
|
||||
}
|
||||
|
||||
bool TRic_tab::leggi_trasfer()
|
||||
{
|
||||
_nultras = 0;
|
||||
@ -1491,6 +1793,27 @@ void TRic_tab::apri_file_temp()
|
||||
_tmpoccas << ".dbf";
|
||||
if (fexist(_tmpoccas))
|
||||
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, 0);
|
||||
TString80 tmppart = "%";
|
||||
tmppart << get_firm_dir();
|
||||
tmppart << "\\" << TEMP_PART;
|
||||
_tmppart = tmppart.mid(1);
|
||||
_tmppart << ".dbf";
|
||||
if (fexist(_tmppart))
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
|
||||
TString80 tmpscad = "%";
|
||||
tmpscad << get_firm_dir();
|
||||
tmpscad << "\\" << TEMP_SCAD;
|
||||
_tmpscad = tmpscad.mid(1);
|
||||
_tmpscad << ".dbf";
|
||||
if (fexist(_tmpscad))
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
|
||||
TString80 tmppagsca = "%";
|
||||
tmppagsca << get_firm_dir();
|
||||
tmppagsca << "\\" << TEMP_PAGSCA;
|
||||
_tmppagsca = tmppagsca.mid(1);
|
||||
_tmppagsca << ".dbf";
|
||||
if (fexist(_tmppagsca))
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1517,6 +1840,12 @@ void TRic_tab::chiudi_file_temp()
|
||||
delete _triva;
|
||||
if (fexist(_tmpoccas))
|
||||
delete _toccas;
|
||||
if (fexist(_tmppart))
|
||||
delete _tpart;
|
||||
if (fexist(_tmpscad))
|
||||
delete _tscad;
|
||||
if (fexist(_tmppagsca))
|
||||
delete _tpagsca;
|
||||
}
|
||||
}
|
||||
|
||||
|
1777
cg/cg6700.cpp
1777
cg/cg6700.cpp
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,9 @@
|
||||
// Variazione movimenti di prima nota e movimenti iva
|
||||
// Variazione movimenti Primanota --> cg6 -7 P
|
||||
// Variazione movimenti Iva --> cg6 -7 I
|
||||
// Variazione movimenti Saldaconto --> cg6 -7 B
|
||||
// Visualizzazione stato ricezione --> cg6 -7 V
|
||||
// Scelta ditta per ricezione --> cg6 -7 S
|
||||
// Annullo movimenti ricezione --> cg6 -7 A
|
||||
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
@ -25,11 +30,12 @@
|
||||
#include "cg6801.h"
|
||||
#include "cg6802.h"
|
||||
#include "cg6803.h"
|
||||
#include "cg6804.h"
|
||||
|
||||
class TVar_mov : public TApplication
|
||||
{
|
||||
TIsamtempfile* _tmov,* _trmov,* _tiva, *_toccas;
|
||||
TLocalisamfile* _pcon,* _clifo, *_mov, *_rmov, *_rmoviva, *_occas;
|
||||
TIsamtempfile* _tmov, *_trmov, *_tiva, *_toccas;
|
||||
TLocalisamfile* _pcon, *_clifo, *_mov, *_rmov, *_rmoviva, *_occas;
|
||||
TTable* _tab_reg;
|
||||
TRectype* _rec_mov,* _rec_rmov,* _rec_riva;
|
||||
TTransfer_file _tras_file;
|
||||
@ -1607,32 +1613,38 @@ int cg6800 (int argc, char* argv[])
|
||||
}
|
||||
break;
|
||||
case 'I':
|
||||
{
|
||||
{
|
||||
TVar_mov main_app(*argv[2]);
|
||||
main_app.run(argc, argv,main_app._titolo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
{
|
||||
TVar_sc a;
|
||||
a.run(argc, argv,"Variazione movimenti Saldaconto");
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
{
|
||||
{
|
||||
TDitta_ric a;
|
||||
a.run(argc, argv,"Scelta ditta per ricezione");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
{
|
||||
{
|
||||
TAnn_mov a;
|
||||
a.run(argc, argv,"Annullamento movimenti da ricevere");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'V':
|
||||
{
|
||||
{
|
||||
TVis_ric a;
|
||||
a.run(argc, argv,"Visualizzazione stato ricezione");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//main_app.run(argc, argv,main_app._titolo);
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
209
cg/cg6802.cpp
209
cg/cg6802.cpp
@ -10,6 +10,9 @@ bool TAnn_mov::create()
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
|
||||
_rec_mov = new TRectype (LF_MOV);
|
||||
|
||||
@ -27,6 +30,9 @@ bool TAnn_mov::destroy()
|
||||
delete _mov;
|
||||
delete _rmov;
|
||||
delete _rmoviva;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
|
||||
delete _rec_mov;
|
||||
|
||||
@ -44,17 +50,37 @@ void TAnn_mov::apri_temp_file()
|
||||
TString80 tmprmoviva = "%";
|
||||
tmprmoviva << get_firm_dir();
|
||||
tmprmoviva << "\\" << TEMP_RMOVIVA;
|
||||
TString80 tmppart = "%";
|
||||
tmppart << get_firm_dir();
|
||||
tmppart << "\\" << TEMP_PART;
|
||||
TString80 tmpscad = "%";
|
||||
tmpscad << get_firm_dir();
|
||||
tmpscad << "\\" << TEMP_SCAD;
|
||||
TString80 tmppagsca = "%";
|
||||
tmppagsca << get_firm_dir();
|
||||
tmppagsca << "\\" << TEMP_PAGSCA;
|
||||
|
||||
_tmov = new TIsamtempfile(LF_MOV, tmpmov, 0);
|
||||
_trmov = new TIsamtempfile(LF_RMOV, tmprmov, 0);
|
||||
|
||||
_is_exist = FALSE;
|
||||
_is_iva = FALSE;
|
||||
TString tmp = tmprmoviva.mid(1);
|
||||
tmp << ".dbf";
|
||||
if (fexist(tmp))
|
||||
{
|
||||
_tiva = new TIsamtempfile(LF_RMOVIVA, tmprmoviva, 0);
|
||||
_is_exist = TRUE;
|
||||
_is_iva = TRUE;
|
||||
}
|
||||
|
||||
_is_salda = FALSE;
|
||||
tmp = tmppart.mid(1);
|
||||
tmp << ".dbf";
|
||||
if (fexist(tmp))
|
||||
{
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, 0);
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, 0);
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, 0);
|
||||
_is_salda = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,8 +88,14 @@ void TAnn_mov::chiudi_tempfile()
|
||||
{
|
||||
delete _tmov;
|
||||
delete _trmov;
|
||||
if (_is_exist)
|
||||
if (_is_iva)
|
||||
delete _tiva;
|
||||
if (_is_salda)
|
||||
{
|
||||
delete _tpart;
|
||||
delete _tscad;
|
||||
delete _tpagsca;
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnn_mov::set()
|
||||
@ -92,6 +124,8 @@ bool TAnn_mov::set()
|
||||
pack(TRUE,LF_RMOV,tprmov);
|
||||
pack(TRUE,LF_RMOVIVA,tprmoviva);*/
|
||||
}
|
||||
chiudi_tempfile();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -238,6 +272,172 @@ void TAnn_mov::annulla(TMask& m)
|
||||
}
|
||||
|
||||
delete rec_riva;
|
||||
|
||||
if (_is_salda)
|
||||
{
|
||||
TRectype* rec_part;
|
||||
|
||||
rec_part = new TRectype (LF_PARTITE);
|
||||
|
||||
_tpart->setkey(2);
|
||||
_tpart->zero();
|
||||
_tpart->put(PART_NREG, numreg);
|
||||
*rec_part = _tpart->curr();
|
||||
|
||||
for (_tpart->read(_isgteq); !_tpart->eof(); _tpart->next())
|
||||
{
|
||||
if (_tpart->curr() != *rec_part) break;
|
||||
|
||||
int tipomov = _tpart->get_int (PART_TIPOMOV);
|
||||
char tipocf = _tpart->get_char(PART_TIPOCF);
|
||||
int gruppo = _tpart->get_int (PART_GRUPPO);
|
||||
int conto = _tpart->get_int (PART_CONTO);
|
||||
long codcf = _tpart->get_long(PART_SOTTOCONTO);
|
||||
int anno = _tpart->get_int (PART_ANNO);
|
||||
TString numpart = _tpart->get (PART_NUMPART);
|
||||
int nriga = _tpart->get_int (PART_NRIGA);
|
||||
|
||||
if (!controlla_abbuoni_diffcam(tipocf,gruppo,conto,codcf,anno,numpart,nriga,0))
|
||||
continue;
|
||||
|
||||
if (tipomov == 1)
|
||||
{
|
||||
_tscad->zero();
|
||||
_tscad->put(SCAD_TIPOCF, tipocf);
|
||||
if (gruppo != 0)
|
||||
_tscad->put(SCAD_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_tscad->put(SCAD_CONTO, conto);
|
||||
if (codcf != 0)
|
||||
_tscad->put(SCAD_SOTTOCONTO, codcf);
|
||||
_tscad->put(SCAD_ANNO, anno);
|
||||
_tscad->put(SCAD_NUMPART, numpart);
|
||||
_tscad->put(SCAD_NRIGA, nriga);
|
||||
|
||||
TRectype scad (_tscad->curr());
|
||||
|
||||
for (_tscad->read(_isgteq); !_tscad->eof(); _tscad->next())
|
||||
{
|
||||
if (_tscad->curr() != scad) break;
|
||||
|
||||
int nrata = _tscad->get_int (SCAD_NRATA);
|
||||
|
||||
sgancia_pagamenti(tipocf,gruppo,conto,codcf,anno,numpart,nriga,nrata);
|
||||
|
||||
_tscad->remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (tipomov != 1)
|
||||
{
|
||||
_tpagsca->zero();
|
||||
_tpagsca->put(PAGSCA_TIPOC, tipocf);
|
||||
if (gruppo != 0)
|
||||
_tpagsca->put(PAGSCA_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_tpagsca->put(PAGSCA_CONTO, conto);
|
||||
if (codcf != 0)
|
||||
_tpagsca->put(PAGSCA_SOTTOCONTO, codcf);
|
||||
_tpagsca->put(PAGSCA_ANNO, anno);
|
||||
_tpagsca->put(PAGSCA_NUMPART, numpart);
|
||||
|
||||
TRectype pagsca (_tpagsca->curr());
|
||||
|
||||
for (_tpagsca->read(_isgteq); !_tpagsca->eof(); _tpagsca->next())
|
||||
{
|
||||
int nrigp = _tpagsca->get_int(PAGSCA_NRIGP);
|
||||
|
||||
if (_tpagsca->curr() != pagsca) break;
|
||||
|
||||
if (nriga != nrigp) continue;
|
||||
|
||||
_tpagsca->remove();
|
||||
}
|
||||
}
|
||||
_tpart->remove();
|
||||
}
|
||||
delete rec_part;
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnn_mov::controlla_abbuoni_diffcam(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata)
|
||||
{
|
||||
TIsamtempfile& pagsca = *_tpagsca;
|
||||
|
||||
pagsca.setkey(1);
|
||||
pagsca.zero();
|
||||
pagsca.put(PAGSCA_TIPOC, tipo);
|
||||
pagsca.put(PAGSCA_GRUPPO, g);
|
||||
pagsca.put(PAGSCA_CONTO, c);
|
||||
pagsca.put(PAGSCA_SOTTOCONTO, s);
|
||||
pagsca.put(PAGSCA_ANNO, anno);
|
||||
pagsca.put(PAGSCA_NUMPART, npart);
|
||||
pagsca.put(PAGSCA_NRIGA, nriga);
|
||||
if (nrata != 0)
|
||||
pagsca.put(PAGSCA_NRATA, nrata);
|
||||
|
||||
TRectype pagamenti (pagsca.curr());
|
||||
|
||||
for (pagsca.read(_isgteq); !pagsca.eof(); pagsca.next())
|
||||
{
|
||||
if (pagsca.curr() != pagamenti) break;
|
||||
|
||||
real abbuoni = pagsca.get_real(PAGSCA_ABBUONI);
|
||||
real diffcam = pagsca.get_real(PAGSCA_DIFFCAM);
|
||||
if (abbuoni != ZERO || diffcam != ZERO)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TAnn_mov::sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata)
|
||||
{
|
||||
TIsamtempfile& pagsca = *_tpagsca;
|
||||
|
||||
pagsca.setkey(1);
|
||||
pagsca.zero();
|
||||
pagsca.put(PAGSCA_TIPOC, tipo);
|
||||
pagsca.put(PAGSCA_GRUPPO, g);
|
||||
pagsca.put(PAGSCA_CONTO, c);
|
||||
pagsca.put(PAGSCA_SOTTOCONTO, s);
|
||||
pagsca.put(PAGSCA_ANNO, anno);
|
||||
pagsca.put(PAGSCA_NUMPART, npart);
|
||||
pagsca.put(PAGSCA_NRIGA, nriga);
|
||||
pagsca.put(PAGSCA_NRATA, nrata);
|
||||
|
||||
TRectype pagamenti (pagsca.curr());
|
||||
|
||||
for (pagsca.read(_isgteq); !pagsca.eof(); pagsca.next())
|
||||
{
|
||||
if (pagsca.curr() != pagamenti) break;
|
||||
|
||||
TRectype pag (pagsca.curr());
|
||||
|
||||
pag.put(PAGSCA_NRIGA, 9999);
|
||||
pag.put(PAGSCA_NRATA, 9999);
|
||||
|
||||
TRecnotype nrec = pagsca.recno();
|
||||
pagsca.remove();
|
||||
pagsca.curr() = pag;
|
||||
if (pagsca.read() == NOERR)
|
||||
{
|
||||
real importo = pagsca.get_real(PAGSCA_IMPORTO) + pag.get_real(PAGSCA_IMPORTO);
|
||||
real impval = pagsca.get_real(PAGSCA_IMPORTOVAL) + pag.get_real(PAGSCA_IMPORTOVAL);
|
||||
real ritenute = pagsca.get_real(PAGSCA_RITENUTE) + pag.get_real(PAGSCA_RITENUTE);
|
||||
pagsca.put(PAGSCA_IMPORTO, importo);
|
||||
pagsca.put(PAGSCA_IMPORTOVAL, impval);
|
||||
pagsca.put(PAGSCA_RITENUTE, ritenute);
|
||||
pagsca.put(PAGSCA_ACCSAL, "A");
|
||||
pagsca.rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
pagsca.curr() = pag;
|
||||
pagsca.write();
|
||||
}
|
||||
|
||||
pagsca.readat(nrec);
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnn_mov::leggi_trasfer()
|
||||
@ -338,6 +538,9 @@ bool TAnn_mov::controlli()
|
||||
if (_std == "M" && sigla == "U")
|
||||
return error_box("Variazione NON POSSIBILE: trasferimento movimenti gia' iniziato");
|
||||
|
||||
if (_std == "M" && sigla == "B")
|
||||
return error_box("Variazione NON POSSIBILE: trasferimento movimenti gia' iniziato");
|
||||
|
||||
if (_std == "*")
|
||||
{
|
||||
warning_box("Trasferimento interamente completato: proseguire per cancellare il file");
|
||||
|
@ -18,15 +18,15 @@
|
||||
|
||||
class TAnn_mov : public TApplication
|
||||
{
|
||||
TIsamtempfile* _tmov,* _trmov,* _tiva;
|
||||
TLocalisamfile* _pcon,* _clifo, *_mov, *_rmov, *_rmoviva;
|
||||
TIsamtempfile* _tmov,*_trmov,*_tiva,*_tpart,*_tscad,*_tpagsca;;
|
||||
TLocalisamfile* _pcon,*_clifo,*_mov,*_rmov,*_rmoviva,*_part,*_scad,*_pagsca;
|
||||
TRectype* _rec_mov;
|
||||
TTransfer_file _tras_file;
|
||||
|
||||
TString _trasf,_std,_uselab,_record,_nrec_file,_sigle_file,_key;
|
||||
long _dittaric,_numreg;
|
||||
TString _control_rec;
|
||||
bool _registra, _is_exist;
|
||||
bool _registra, _is_iva, _is_salda;
|
||||
|
||||
public:
|
||||
TString _titolo;
|
||||
@ -51,6 +51,9 @@ public:
|
||||
|
||||
void setta_parametri_record(const TString& sigla,const TString& flag);
|
||||
|
||||
void sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
||||
bool controlla_abbuoni_diffcam(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
||||
|
||||
static bool codice_registro_hnd (TMask_field& f, KEY k);
|
||||
static bool codice_causale_hnd (TMask_field& f, KEY k);
|
||||
|
||||
|
257
cg/cg6900.cpp
257
cg/cg6900.cpp
@ -303,6 +303,8 @@ bool TInv_cont::create()
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
_occas = new TLocalisamfile (LF_OCCAS);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
|
||||
@ -320,6 +322,8 @@ bool TInv_cont::destroy()
|
||||
delete _rmoviva;
|
||||
delete _occas;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
|
||||
return TApplication::destroy();
|
||||
}
|
||||
@ -423,6 +427,36 @@ void TInv_cont::apri_file_temp()
|
||||
else
|
||||
_toccas = new TIsamtempfile(LF_OCCAS, tmpoccas, TRUE);
|
||||
}
|
||||
if (sigla == 'B')
|
||||
{
|
||||
TString80 tmppart = "%";
|
||||
tmppart << firm2dir(0);
|
||||
tmppart << "\\" << TEMP_PART;
|
||||
tmp = tmppart.mid(1);
|
||||
tmp << ".dbf";
|
||||
if (fexist(tmp))
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, FALSE);
|
||||
else
|
||||
_tpart = new TIsamtempfile(LF_PARTITE, tmppart, TRUE);
|
||||
TString80 tmpscad = "%";
|
||||
tmpscad << firm2dir(0);
|
||||
tmpscad << "\\" << TEMP_SCAD;
|
||||
tmp = tmpscad.mid(1);
|
||||
tmp << ".dbf";
|
||||
if (fexist(tmp))
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, FALSE);
|
||||
else
|
||||
_tscad = new TIsamtempfile(LF_SCADENZE, tmpscad, TRUE);
|
||||
TString80 tmppagsca = "%";
|
||||
tmppagsca << firm2dir(0);
|
||||
tmppagsca << "\\" << TEMP_PAGSCA;
|
||||
tmp = tmppagsca.mid(1);
|
||||
tmp << ".dbf";
|
||||
if (fexist(tmp))
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, FALSE);
|
||||
else
|
||||
_tpagsca = new TIsamtempfile(LF_PAGSCA, tmppagsca, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -451,6 +485,12 @@ void TInv_cont::chiudi_file_temp()
|
||||
delete _triva;
|
||||
delete _toccas;
|
||||
}
|
||||
if (sigla == 'B')
|
||||
{
|
||||
delete _tpart;
|
||||
delete _tscad;
|
||||
delete _tpagsca;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -984,6 +1024,10 @@ bool TInv_cont::invio_tempfile(TMask& m)
|
||||
movIVA2tempfile(key,m);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
movSC2tempfile(key,m);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
@ -1066,7 +1110,7 @@ void TInv_cont::causali2tempfile(TString& key, TMask& m)
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-15s", (const char*) chiave);
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
@ -1186,7 +1230,7 @@ void TInv_cont::clifo2tempfile(TString& key, TMask& m)
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-15s", (const char*) chiave);
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
@ -1272,7 +1316,7 @@ void TInv_cont::pcon2tempfile(TString& key, TMask& m)
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-15s", (const char*) chiave);
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
@ -1393,7 +1437,7 @@ void TInv_cont::movPN2tempfile(TString& key, TMask& m)
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-15s", (const char*) chiave);
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
@ -1544,7 +1588,7 @@ void TInv_cont::movIVA2tempfile(TString& key, TMask& m)
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-15s", (const char*) chiave);
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
@ -1560,6 +1604,209 @@ void TInv_cont::movIVA2tempfile(TString& key, TMask& m)
|
||||
// setta_parametri_record(m,"D");
|
||||
}
|
||||
|
||||
void TInv_cont::SC_inviato(char tipo,int gruppo,int conto,long sottoc,
|
||||
int anno,TString& numpart,int nriga)
|
||||
{
|
||||
_part->setkey(1);
|
||||
_part->zero();
|
||||
_part->put(PART_TIPOCF, tipo);
|
||||
_part->put(PART_GRUPPO, gruppo);
|
||||
_part->put(PART_CONTO, conto);
|
||||
_part->put(PART_SOTTOCONTO, sottoc);
|
||||
_part->put(PART_ANNO, anno);
|
||||
_part->put(PART_NUMPART, numpart);
|
||||
_part->put(PART_NRIGA, nriga);
|
||||
|
||||
if (_part->read() == NOERR)
|
||||
{
|
||||
_part->put(PART_INVIATA, "X");
|
||||
_part->rewrite();
|
||||
}
|
||||
}
|
||||
|
||||
void TInv_cont::movSC2tempfile(TString& key, TMask& m)
|
||||
{
|
||||
int size = 1024;
|
||||
|
||||
_tras_file.open(_header);
|
||||
|
||||
long items = _part->items();
|
||||
_prog = new TProgind(items,"Invio movimenti di Saldaconto in corso... Prego attendere.",FALSE);
|
||||
|
||||
_part->setkey(1);
|
||||
|
||||
if (key.empty())
|
||||
_part->first();
|
||||
else
|
||||
{
|
||||
char tipo = key.mid(0,1)[0];
|
||||
int gruppo = atoi(key.mid(1,3));
|
||||
int conto = atoi(key.mid(4,3));
|
||||
long sottoc = atol(key.mid(7,6));
|
||||
int anno = atoi(key.mid(13,4));
|
||||
TString numpart = key.mid(17,7);
|
||||
int nriga = atoi(key.mid(24,4));
|
||||
_part->zero();
|
||||
_part->put(PART_TIPOCF, tipo);
|
||||
_part->put(PART_GRUPPO, gruppo);
|
||||
_part->put(PART_CONTO, conto);
|
||||
_part->put(PART_SOTTOCONTO, sottoc);
|
||||
_part->put(PART_ANNO, anno);
|
||||
_part->put(PART_NUMPART, numpart);
|
||||
_part->put(PART_NRIGA, nriga);
|
||||
_part->read();
|
||||
}
|
||||
|
||||
for(; !_part->eof(); _part->next())
|
||||
{
|
||||
_prog->addstatus(1);
|
||||
|
||||
char tipo = _part->get_char(PART_TIPOCF);
|
||||
int gruppo = _part->get_int (PART_GRUPPO);
|
||||
int conto = _part->get_int (PART_CONTO);
|
||||
long sottoc = _part->get_long(PART_SOTTOCONTO);
|
||||
int anno = _part->get_int (PART_ANNO);
|
||||
TString numpart = _part->get (PART_NUMPART);
|
||||
int nriga = _part->get_int (PART_NRIGA);
|
||||
int tipomov = _part->get_int (PART_TIPOMOV);
|
||||
|
||||
if (nriga == 9999) continue;
|
||||
|
||||
TDate datareg (_part->get_date(PART_DATAREG));
|
||||
|
||||
if ( _part->get_bool(PART_INVIATA) || datareg > _datalimsk ) continue;
|
||||
|
||||
_tpart->curr() = _part->curr();
|
||||
|
||||
if (_tpart->read() == NOERR)
|
||||
{
|
||||
_tpart->zero();
|
||||
_tpart->curr() = _part->curr();
|
||||
_tpart->rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
_tpart->zero();
|
||||
_tpart->curr() = _part->curr();
|
||||
_tpart->write();
|
||||
}
|
||||
|
||||
if (tipomov == 1)
|
||||
scrivi_righeSCAD(tipo,gruppo,conto,sottoc,anno,numpart,nriga);
|
||||
else
|
||||
scrivi_righePAGSCA(tipo,gruppo,conto,sottoc,anno,numpart,nriga);
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave;
|
||||
chiave.format("%c%03d%03d%06ld%04d%7s%04d", tipo,gruppo,conto,sottoc,anno,(const char*)numpart,nriga);
|
||||
TString sigla (format("%c", 'B'));
|
||||
_control_rec.overwrite(sigla,240);
|
||||
_control_rec.overwrite(chiave,241);
|
||||
_tras_file.write_control_rec(_control_rec,size);
|
||||
|
||||
SC_inviato(tipo,gruppo,conto,sottoc,anno,numpart,nriga);
|
||||
}
|
||||
delete _prog;
|
||||
|
||||
//Inizializzo l'ultima sigla file elaborato su trasfer con la sigla del file successivo da inviare
|
||||
//e inizializzo la chiave, altrimenti se si blocca l'invio subito dopo aver finito un file si rischia di
|
||||
//ritrasferire l'ultimo record quando si riparte; inoltre non si riesce a inviare il file successivo perche'
|
||||
//la chiave e' compilata con i dati del file precedente.
|
||||
|
||||
leggi_record_controllo();
|
||||
TString chiave,app,sigla;
|
||||
app.format("%-60s", (const char*) chiave);
|
||||
char sigla_p = _tras_file.ult_file()[0];
|
||||
int posiz = _files.find(sigla_p);
|
||||
TString nuova_sigla = " ";
|
||||
if (posiz < _files.len())
|
||||
nuova_sigla = _files.mid(posiz+1,1);
|
||||
|
||||
_control_rec.overwrite(nuova_sigla,240);
|
||||
_control_rec.overwrite(app,241);
|
||||
_tras_file.write_control_rec(_control_rec,size);
|
||||
_tras_file.close();
|
||||
}
|
||||
|
||||
void TInv_cont::scrivi_righeSCAD(char tipocf,int gruppo,int conto,long sottoc,
|
||||
int anno,TString& numpart,int nriga)
|
||||
{
|
||||
_scad->zero();
|
||||
_scad->put(SCAD_TIPOCF, tipocf);
|
||||
if (gruppo != 0)
|
||||
_scad->put(SCAD_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_scad->put(SCAD_CONTO, conto);
|
||||
if (sottoc != 0)
|
||||
_scad->put(SCAD_SOTTOCONTO, sottoc);
|
||||
_scad->put(SCAD_ANNO, anno);
|
||||
_scad->put(SCAD_NUMPART, numpart);
|
||||
_scad->put(SCAD_NRIGA, nriga);
|
||||
|
||||
TRectype scad (_scad->curr());
|
||||
|
||||
for (_scad->read(_isgteq); !_scad->eof(); _scad->next())
|
||||
{
|
||||
if (_scad->curr() != scad) break;
|
||||
|
||||
_tscad->curr() = _scad->curr();
|
||||
|
||||
if (_tscad->read() == NOERR)
|
||||
{
|
||||
_tscad->zero();
|
||||
_tscad->curr() = _scad->curr();
|
||||
_tscad->rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
_tscad->zero();
|
||||
_tscad->curr() = _scad->curr();
|
||||
_tscad->write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TInv_cont::scrivi_righePAGSCA(char tipocf,int gruppo,int conto,long sottoc,
|
||||
int anno,TString& numpart,int nriga)
|
||||
{
|
||||
_pagsca->zero();
|
||||
_pagsca->put(PAGSCA_TIPOC, tipocf);
|
||||
if (gruppo != 0)
|
||||
_pagsca->put(PAGSCA_GRUPPO, gruppo);
|
||||
if (conto != 0)
|
||||
_pagsca->put(PAGSCA_CONTO, conto);
|
||||
if (sottoc != 0)
|
||||
_pagsca->put(PAGSCA_SOTTOCONTO, sottoc);
|
||||
_pagsca->put(PAGSCA_ANNO, anno);
|
||||
_pagsca->put(PAGSCA_NUMPART, numpart);
|
||||
|
||||
TRectype pagsca (_pagsca->curr());
|
||||
|
||||
for (_pagsca->read(_isgteq); !_pagsca->eof(); _pagsca->next())
|
||||
{
|
||||
int nrigp = _pagsca->get_int(PAGSCA_NRIGP);
|
||||
|
||||
if (_pagsca->curr() != pagsca) break;
|
||||
|
||||
if (nriga != nrigp) continue;
|
||||
|
||||
_tpagsca->curr() = _pagsca->curr();
|
||||
|
||||
if (_tpagsca->read() == NOERR)
|
||||
{
|
||||
_tpagsca->zero();
|
||||
_tpagsca->curr() = _pagsca->curr();
|
||||
_tpagsca->rewrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
_tpagsca->zero();
|
||||
_tpagsca->curr() = _pagsca->curr();
|
||||
_tpagsca->write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TInv_cont::menu(MENU_TAG m)
|
||||
{
|
||||
if (m == BAR_ITEM(1))
|
||||
|
18
cg/cg6900.h
18
cg/cg6900.h
@ -31,6 +31,9 @@
|
||||
#include <pconti.h>
|
||||
#include <comuni.h>
|
||||
#include <occas.h>
|
||||
#include <partite.h>
|
||||
#include <scadenze.h>
|
||||
#include <pagsca.h>
|
||||
|
||||
#include "cg6901.h"
|
||||
#include "cg6903.h"
|
||||
@ -51,6 +54,8 @@ class TInv_cont : public TApplication
|
||||
TLocalisamfile* _rmoviva;
|
||||
TLocalisamfile* _occas;
|
||||
TLocalisamfile* _part;
|
||||
TLocalisamfile* _scad;
|
||||
TLocalisamfile* _pagsca;
|
||||
TIsamtempfile* _tcaus;
|
||||
TIsamtempfile* _trcaus;
|
||||
TIsamtempfile* _tclifo;
|
||||
@ -59,6 +64,9 @@ class TInv_cont : public TApplication
|
||||
TIsamtempfile* _trmov;
|
||||
TIsamtempfile* _triva;
|
||||
TIsamtempfile* _toccas;
|
||||
TIsamtempfile* _tpart;
|
||||
TIsamtempfile* _tscad;
|
||||
TIsamtempfile* _tpagsca;
|
||||
TArchive _arc;
|
||||
|
||||
char _scelta;
|
||||
@ -69,7 +77,7 @@ class TInv_cont : public TApplication
|
||||
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;
|
||||
long _numrec_cau,_numrec_clifo,_numrec_pcon,_numrec_pn,_numrec_iva,_numrec_sc;
|
||||
int _num,_annoes;
|
||||
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
|
||||
real _corrlire, _cambioi, _corrval;
|
||||
@ -125,6 +133,11 @@ public:
|
||||
bool occasionali(const TString& ocfpi);
|
||||
void iva_inviata(long numreg);
|
||||
|
||||
void movSC2tempfile(TString& key,TMask& m);
|
||||
void scrivi_righeSCAD(char,int,int,long,int,TString&,int);
|
||||
void scrivi_righePAGSCA(char,int,int,long,int,TString&,int);
|
||||
void SC_inviato(char,int,int,long,int,TString&,int);
|
||||
|
||||
bool invio_contabilita();
|
||||
bool invio_tab_cau();
|
||||
bool invio_clifo ();
|
||||
@ -161,6 +174,9 @@ public:
|
||||
void invio_righe_contabili();
|
||||
void invio_righe_IVA();
|
||||
void invio_occasionali(TString& record, TString& ocfpi);
|
||||
void invio_partite();
|
||||
void invio_scadenze();
|
||||
void invio_pagsca();
|
||||
void tipodocumento(long nreg,TString& tipodoc);
|
||||
|
||||
TInv_cont(char mov);
|
||||
|
@ -10,13 +10,14 @@
|
||||
#define F_DATALIM 109
|
||||
#define F_DITTAAS 110
|
||||
|
||||
// Campi maschera cg2900b.uml
|
||||
// Campi maschera cg6900b.uml
|
||||
|
||||
#define F_FLOPPY 201
|
||||
#define F_DIM 202
|
||||
|
||||
// Campi maschera cg2903a.uml
|
||||
// Campi maschera cg6903a.uml
|
||||
|
||||
#define F_RIPPN 250
|
||||
#define F_RIPIVA 251
|
||||
#define F_DATA 252
|
||||
#define F_RIPSC 253
|
@ -13,6 +13,9 @@ bool TLista_archivi::create()
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
_rmov = new TLocalisamfile (LF_RMOV);
|
||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||
|
||||
_errore_grave = FALSE;
|
||||
_risposta = 0;
|
||||
@ -56,6 +59,9 @@ bool TLista_archivi::destroy()
|
||||
delete _mov;
|
||||
delete _rmov;
|
||||
delete _rmoviva;
|
||||
delete _part;
|
||||
delete _scad;
|
||||
delete _pagsca;
|
||||
|
||||
return TApplication::destroy();
|
||||
}
|
||||
|
@ -26,6 +26,9 @@ class TLista_archivi : public TApplication
|
||||
TLocalisamfile* _mov;
|
||||
TLocalisamfile* _rmov;
|
||||
TLocalisamfile* _rmoviva;
|
||||
TLocalisamfile* _part;
|
||||
TLocalisamfile* _scad;
|
||||
TLocalisamfile* _pagsca;
|
||||
|
||||
TString _files, _ragsoc;
|
||||
TDate _datalimite;
|
||||
|
@ -273,6 +273,14 @@ void TInv_cont::aggiorna_header(TString& files)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
{
|
||||
TString app;
|
||||
app.format("%06ld", _numrec_sc);
|
||||
_control_rec.overwrite(app,((i * 6) + 95));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
@ -346,6 +354,14 @@ void TInv_cont::aggiorna_trasfer(TString& files)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
{
|
||||
TString app;
|
||||
app.format("%06ld", _numrec_sc);
|
||||
_control_rec.overwrite(app,((i * 6) + pos));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ bool TRip_flag::create()
|
||||
TApplication::create();
|
||||
|
||||
_mov = new TLocalisamfile (LF_MOV);
|
||||
_part = new TLocalisamfile (LF_PARTITE);
|
||||
|
||||
dispatch_e_menu (BAR_ITEM(1));
|
||||
|
||||
@ -15,6 +16,7 @@ bool TRip_flag::create()
|
||||
bool TRip_flag::destroy()
|
||||
{
|
||||
delete _mov;
|
||||
delete _part;
|
||||
|
||||
return TApplication::destroy();
|
||||
}
|
||||
@ -32,12 +34,15 @@ bool TRip_flag::set()
|
||||
TDate datalim (msk.get(F_DATA));
|
||||
bool rippn = msk.get_bool(F_RIPPN);
|
||||
bool ripiva = msk.get_bool(F_RIPIVA);
|
||||
bool ripsc = msk.get_bool(F_RIPSC);
|
||||
|
||||
if (!rippn && !ripiva) return FALSE; // Se non flaggo nessuno dei due non ha
|
||||
if (!rippn && !ripiva && !ripsc) return FALSE; // Se non flaggo nessuno dei tre non ha
|
||||
// senso scorrere l'archivio.
|
||||
|
||||
set_firm(ditta);
|
||||
|
||||
if (rippn || ripiva)
|
||||
{
|
||||
long cicli = _mov->items();
|
||||
_prog = new TProgind(cicli,"Ripristino movimenti in corso... Prego attendere.",FALSE);
|
||||
|
||||
@ -61,6 +66,29 @@ bool TRip_flag::set()
|
||||
}
|
||||
delete _prog;
|
||||
}
|
||||
if (ripsc)
|
||||
{
|
||||
long cicli = _part->items();
|
||||
_prog = new TProgind(cicli,"Ripristino movimenti saldaconto in corso... Prego attendere.",FALSE);
|
||||
|
||||
_part->setkey(1);
|
||||
_part->zero();
|
||||
|
||||
for (_part->first();!_part->eof();_part->next())
|
||||
{
|
||||
TDate datareg (_part->get_date(PART_DATAREG));
|
||||
|
||||
_prog->addstatus(1);
|
||||
|
||||
if (datareg < datalim) continue;
|
||||
|
||||
_part->zero(PART_INVIATA);
|
||||
|
||||
_part->rewrite();
|
||||
}
|
||||
delete _prog;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -9,10 +9,12 @@
|
||||
#include "cg2.h"
|
||||
|
||||
#include <mov.h>
|
||||
#include <partite.h>
|
||||
|
||||
class TRip_flag : public TApplication
|
||||
{
|
||||
TLocalisamfile* _mov;
|
||||
TLocalisamfile* _part;
|
||||
TProgind* _prog;
|
||||
|
||||
public:
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "cg6900a.h"
|
||||
|
||||
PAGE "Invio contabilita'" -1 -1 76 11
|
||||
PAGE "Invio contabilita'" -1 -1 76 12
|
||||
|
||||
NUMBER F_DITTAINV 5
|
||||
BEGIN
|
||||
@ -31,9 +31,14 @@ BEGIN
|
||||
PROMPT 2 5 "Ripristina movimenti iva"
|
||||
END
|
||||
|
||||
BOOLEAN F_RIPSC
|
||||
BEGIN
|
||||
PROMPT 2 6 "Ripristina movimenti saldaconto"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 7 "Data inizio ripristino "
|
||||
PROMPT 2 8 "Data inizio ripristino "
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
|
593
cg/cg6904.cpp
593
cg/cg6904.cpp
@ -14,6 +14,7 @@ bool TInv_cont::invio_contabilita_PC()
|
||||
_numrec_pcon = 0;
|
||||
_numrec_pn = 0;
|
||||
_numrec_iva = 0;
|
||||
_numrec_sc = 0;
|
||||
|
||||
_tras_file.open(_header);
|
||||
|
||||
@ -34,7 +35,7 @@ bool TInv_cont::invio_contabilita_PC()
|
||||
{
|
||||
_control_rec.cut(size);
|
||||
|
||||
_control_rec.overwrite(" ",300); //Nel caso di invio a PC pulisco la ditta aggiuntiva dal record di controllo
|
||||
_control_rec.overwrite(" ",301); //Nel caso di invio a PC pulisco la ditta aggiuntiva dal record di controllo
|
||||
|
||||
_tras_file.write_control_rec(_control_rec,size);
|
||||
header = FALSE;
|
||||
@ -72,6 +73,16 @@ bool TInv_cont::invio_contabilita_PC()
|
||||
invio_righe_IVA();
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
{
|
||||
long cicli = _tpart->items() + _tscad->items() + _tpagsca->items();
|
||||
_prog = new TProgind(cicli,"Movimenti di Saldaconto: generazione file TRASFER per PC\nPrego attendere.",FALSE);
|
||||
invio_partite();
|
||||
invio_scadenze();
|
||||
invio_pagsca();
|
||||
delete _prog;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
};
|
||||
@ -1080,3 +1091,583 @@ void TInv_cont::invio_righe_IVA()
|
||||
_tras_file.close();
|
||||
}
|
||||
|
||||
void TInv_cont::invio_partite()
|
||||
{
|
||||
int size = 1024;
|
||||
TString record(size);
|
||||
TString datastr;
|
||||
|
||||
_tras_file.open(_trasf,TRUE);
|
||||
|
||||
for (_tpart->first(); !_tpart->eof(); _tpart->next())
|
||||
{
|
||||
TString str;
|
||||
|
||||
_prog->addstatus(1);
|
||||
|
||||
record.spaces();
|
||||
|
||||
record.overwrite("B1",0); //Tipo record
|
||||
|
||||
char tipo = _tpart->get_char(PART_TIPOCF);
|
||||
str.format("%c", tipo);
|
||||
record.overwrite(str,2); //Tipo Cliente/Fornitore
|
||||
|
||||
int gruppo = _tpart->get_int(PART_GRUPPO);
|
||||
str.format("%03d", gruppo);
|
||||
record.overwrite(str,3); //Gruppo
|
||||
|
||||
int conto = _tpart->get_int(PART_CONTO);
|
||||
str.format("%03d", conto);
|
||||
record.overwrite(str,6); //Conto
|
||||
|
||||
long sottoc = _tpart->get_long(PART_SOTTOCONTO);
|
||||
str.format("%06ld", sottoc);
|
||||
record.overwrite(str,9); //Sottoconto
|
||||
|
||||
int anno = _tpart->get_int(PART_ANNO);
|
||||
str.format("%04d", anno);
|
||||
record.overwrite(str,15); //Anno
|
||||
|
||||
TString numpart = _tpart->get(PART_NUMPART);
|
||||
str.format("%-7s", (const char*) numpart);
|
||||
record.overwrite(str,19); //Numero partita
|
||||
|
||||
int nriga = _tpart->get_int(PART_NRIGA);
|
||||
str.format("%04d", nriga);
|
||||
record.overwrite(str,26); //Numero riga partita
|
||||
|
||||
int tipomov = _tpart->get_int(PART_TIPOMOV);
|
||||
str.format("%d", tipomov);
|
||||
record.overwrite(str,60); //Tipo del movimento
|
||||
|
||||
int tipopag = _tpart->get_int(PART_TIPOPAG);
|
||||
str.format("%d", tipopag);
|
||||
record.overwrite(str,61); //Tipo pagamento
|
||||
|
||||
TString tiporeg = _tpart->get(PART_TIPOREG);
|
||||
record.overwrite(tiporeg,62); //Tipo registrazione
|
||||
|
||||
long nreg = _tpart->get_long(PART_NREG);
|
||||
str.format("%07ld", nreg);
|
||||
record.overwrite(str,63); //Numero registrazione contabile
|
||||
|
||||
int numrig = _tpart->get_int(PART_NUMRIG);
|
||||
str.format("%03d", numrig);
|
||||
record.overwrite(str,70); //Numero riga registrazione contabile
|
||||
|
||||
TString datareg = _tpart->get(PART_DATAREG);
|
||||
datastr = riconverti(datareg,TRUE);
|
||||
str.format("%08s", (const char*) datastr);
|
||||
record.overwrite(str,73); //Data di registrazione
|
||||
|
||||
TString datadoc = _tpart->get(PART_DATADOC);
|
||||
datastr = riconverti(datadoc,TRUE);
|
||||
str.format("%08s", (const char*) datastr);
|
||||
record.overwrite(str,81); //Data documento
|
||||
|
||||
TString datapag = _tpart->get(PART_DATAPAG);
|
||||
datastr = riconverti(datapag,TRUE);
|
||||
str.format("%08s", (const char*) datastr);
|
||||
record.overwrite(str,89); //Data pagamento
|
||||
|
||||
TString numdoc = _tpart->get(PART_NUMDOC);
|
||||
str.format("%-7s", (const char*) numdoc);
|
||||
record.overwrite(str,97); //Numero documento
|
||||
|
||||
TString descr = _tpart->get(PART_DESCR);
|
||||
str.format("%-50s", (const char*) descr);
|
||||
record.overwrite(str,104); //Descrizione partita
|
||||
|
||||
const char* reg = _tpart->get(PART_REG);
|
||||
TString registro;
|
||||
if (real::is_natural(reg))
|
||||
{
|
||||
int app = atoi(reg);
|
||||
registro.format("%03d", app);
|
||||
}
|
||||
else
|
||||
registro.format("%-3s", (const char*) reg);
|
||||
record.overwrite(registro,154); //Codice registro IVA
|
||||
|
||||
long protiva = _tpart->get_long(PART_PROTIVA);
|
||||
str.format("%05ld", protiva);
|
||||
record.overwrite(str,157); //Numero protocollo IVA
|
||||
|
||||
const char* codcaus = _tpart->get(PART_CODCAUS);
|
||||
if (real::is_natural(codcaus))
|
||||
str.format("%03s", (const char*) codcaus);
|
||||
else
|
||||
str.format("%-3s", (const char*) codcaus);
|
||||
record.overwrite(str,162); //Codice causale
|
||||
|
||||
TString sezione = _tpart->get(PART_SEZ);
|
||||
record.overwrite(sezione,165); //Sezione
|
||||
|
||||
real importo (_tpart->get_real(PART_IMPORTO));
|
||||
if (importo.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",166);
|
||||
importo = importo * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",166);
|
||||
str.format("%014s", (const char*) importo.string());
|
||||
record.overwrite(str,167); //Importo
|
||||
|
||||
real imposta (_tpart->get_real(PART_IMPOSTA));
|
||||
if (imposta.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",181);
|
||||
imposta = imposta * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",181);
|
||||
str.format("%014s", (const char*) imposta.string());
|
||||
record.overwrite(str,182); //Imposta
|
||||
|
||||
real spese (_tpart->get_real(PART_SPESE));
|
||||
if (spese.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",196);
|
||||
spese = spese * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",196);
|
||||
str.format("%014s", (const char*) spese.string());
|
||||
record.overwrite(str,197); //Spese
|
||||
|
||||
TString codval = _tpart->get(PART_CODVAL);
|
||||
str.format("%-3s", (const char*) codval);
|
||||
record.overwrite(str,211); //Codice valuta
|
||||
|
||||
real cambio (_tpart->get_real(PART_CAMBIO));
|
||||
dec2integer(cambio,100000);
|
||||
str.format("%014s", (const char*) cambio.string());
|
||||
record.overwrite(str,214); //Cambio
|
||||
|
||||
real importoval (_tpart->get_real(PART_IMPORTOVAL));
|
||||
if (importoval.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",228);
|
||||
importoval = importoval * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",228);
|
||||
dec2integer(importoval,1000);
|
||||
str.format("%016s", (const char*) importoval.string());
|
||||
record.overwrite(str,229); //Importo in valuta
|
||||
|
||||
TString datacam = _tpart->get(PART_DATACAM);
|
||||
datastr = riconverti(datacam,TRUE);
|
||||
str.format("%08s", (const char*) datacam);
|
||||
record.overwrite(str,245); //Data cambio
|
||||
|
||||
real imptotdoc (_tpart->get_real(PART_IMPTOTDOC));
|
||||
if (imptotdoc.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",253);
|
||||
imptotdoc = imptotdoc * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",253);
|
||||
str.format("%014s", (const char*) imptotdoc.string());
|
||||
record.overwrite(str,254); //Importo totale documento
|
||||
|
||||
real imptotval (_tpart->get_real(PART_IMPTOTVAL));
|
||||
if (imptotval.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",268);
|
||||
imptotval = imptotval * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",268);
|
||||
dec2integer(imptotval,1000);
|
||||
str.format("%016s", (const char*) imptotval.string());
|
||||
record.overwrite(str,269); //Importo totale documento in valuta
|
||||
|
||||
real ritenute (_tpart->get_real(PART_RITENUTE));
|
||||
if (ritenute.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",285);
|
||||
ritenute = ritenute * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",285);
|
||||
str.format("%014s", (const char*) ritenute.string());
|
||||
record.overwrite(str,286); //Ritenute
|
||||
|
||||
TString sezabb = _tpart->get(PART_SEZABB);
|
||||
record.overwrite(sezabb,300); //Sezione abbuoni
|
||||
|
||||
real abbuoni (_tpart->get_real(PART_ABBUONI));
|
||||
if (abbuoni.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",301);
|
||||
abbuoni = abbuoni * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",301);
|
||||
dec2integer(abbuoni,1000);
|
||||
str.format("%016s", (const char*) abbuoni.string());
|
||||
record.overwrite(str,302); //Abbuoni
|
||||
|
||||
TString sezdifcam = _tpart->get(PART_SEZDIFCAM);
|
||||
record.overwrite(sezdifcam,318); //Sezione differenza cambio
|
||||
|
||||
real diffcam (_tpart->get_real(PART_DIFFCAM));
|
||||
if (diffcam.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",319);
|
||||
diffcam = diffcam * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",319);
|
||||
str.format("%014s", (const char*) diffcam.string());
|
||||
record.overwrite(str,320); //Differenza cambio
|
||||
|
||||
bool chiusa = _tpart->get_bool(PART_CHIUSA);
|
||||
if (chiusa)
|
||||
record.overwrite("X",334);
|
||||
else
|
||||
record.overwrite(" ",334);
|
||||
|
||||
bool ricaricata = _tpart->get_bool(PART_RICARICATA);
|
||||
if (ricaricata)
|
||||
record.overwrite("X",335);
|
||||
else
|
||||
record.overwrite(" ",335);
|
||||
|
||||
bool inviata = _tpart->get_bool(PART_INVIATA);
|
||||
if (inviata)
|
||||
record.overwrite("X",336);
|
||||
else
|
||||
record.overwrite(" ",336);
|
||||
|
||||
int gruppocl = _tpart->get_int(PART_GRUPPOCL);
|
||||
str.format("%03d", gruppocl);
|
||||
record.overwrite(str,336); //Gruppo cliente
|
||||
|
||||
int contocl = _tpart->get_int(PART_CONTOCL);
|
||||
str.format("%03d", contocl);
|
||||
record.overwrite(str,339); //Conto cliente
|
||||
|
||||
_tras_file.write_control_rec(record,size);
|
||||
_numrec_sc++;
|
||||
}
|
||||
_tras_file.close();
|
||||
}
|
||||
|
||||
void TInv_cont::invio_scadenze()
|
||||
{
|
||||
int size = 1024;
|
||||
TString record(size);
|
||||
|
||||
_tras_file.open(_trasf,TRUE);
|
||||
|
||||
for (_tscad->first(); !_tscad->eof(); _tscad->next())
|
||||
{
|
||||
TString str;
|
||||
|
||||
_prog->addstatus(1);
|
||||
|
||||
record.spaces();
|
||||
|
||||
record.overwrite("B2",0); //Tipo record
|
||||
|
||||
char tipo = _tscad->get_char(SCAD_TIPOCF);
|
||||
str.format("%c", tipo);
|
||||
record.overwrite(str,2); //Tipo Cliente/Fornitore
|
||||
|
||||
int gruppo = _tscad->get_int(SCAD_GRUPPO);
|
||||
str.format("%03d", gruppo);
|
||||
record.overwrite(str,3); //Gruppo
|
||||
|
||||
int conto = _tscad->get_int(SCAD_CONTO);
|
||||
str.format("%03d", conto);
|
||||
record.overwrite(str,6); //Conto
|
||||
|
||||
long sottoc = _tscad->get_long(SCAD_SOTTOCONTO);
|
||||
str.format("%06ld", sottoc);
|
||||
record.overwrite(str,9); //Sottoconto
|
||||
|
||||
int anno = _tscad->get_int(SCAD_ANNO);
|
||||
str.format("%04d", anno);
|
||||
record.overwrite(str,15); //Anno
|
||||
|
||||
TString numpart = _tscad->get(SCAD_NUMPART);
|
||||
str.format("%-7s", (const char*) numpart);
|
||||
record.overwrite(str,19); //Numero partita
|
||||
|
||||
int nriga = _tscad->get_int(SCAD_NRIGA);
|
||||
str.format("%04d", nriga);
|
||||
record.overwrite(str,26); //Numero riga partita
|
||||
|
||||
int nrata = _tscad->get_int(SCAD_NRATA);
|
||||
str.format("%04d", nrata);
|
||||
record.overwrite(str,30); //Numero di rata
|
||||
|
||||
TString descr = _tscad->get(SCAD_DESCR);
|
||||
str.format("%-50s", (const char*) descr);
|
||||
record.overwrite(str,60); //Descrizione
|
||||
|
||||
TString codpag = _tscad->get(SCAD_CODPAG);
|
||||
str.format("%-4s", (const char*) codpag);
|
||||
record.overwrite(str,110); //Codice pagamento
|
||||
|
||||
int tipopag = _tscad->get_int(SCAD_TIPOPAG);
|
||||
str.format("%d", tipopag);
|
||||
record.overwrite(str,114); //Tipo pagamento
|
||||
|
||||
TString ultclass = _tscad->get(SCAD_ULTCLASS);
|
||||
record.overwrite(ultclass,115); //Ulteriore classificazione
|
||||
|
||||
real importo (_tscad->get_real(SCAD_IMPORTO));
|
||||
if (importo.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",116);
|
||||
importo = importo * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",116);
|
||||
str.format("%014s", (const char*) importo.string());
|
||||
record.overwrite(str,117); //Importo
|
||||
|
||||
real importoval (_tscad->get_real(SCAD_IMPORTOVAL));
|
||||
if (importoval.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",131);
|
||||
importoval = importoval * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",131);
|
||||
dec2integer(importoval,1000);
|
||||
str.format("%016s", (const char*) importoval.string());
|
||||
record.overwrite(str,132); //Importo in valuta
|
||||
|
||||
TString datascad = _tscad->get(SCAD_DATASCAD);
|
||||
TString app = riconverti(datascad,TRUE);
|
||||
str.format("%08s", (const char*) app);
|
||||
record.overwrite(str,148); //Data scadenza
|
||||
|
||||
int nsoll = _tscad->get_int(SCAD_NSOLL);
|
||||
str.format("%02d", nsoll);
|
||||
record.overwrite(str,156); //Numero sollecito
|
||||
|
||||
TString datasoll = _tscad->get(SCAD_DATASOLL);
|
||||
app = riconverti(datasoll,TRUE);
|
||||
str.format("%08s", (const char*) app);
|
||||
record.overwrite(str,158); //Data sollecito
|
||||
|
||||
int ggrit = _tscad->get_int(SCAD_GGRIT);
|
||||
str.format("%04d", ggrit);
|
||||
record.overwrite(str,166); //Giorni di ritardo
|
||||
|
||||
bool pagata = _tscad->get_bool(SCAD_PAGATA);
|
||||
if (pagata)
|
||||
record.overwrite("X",170);
|
||||
else
|
||||
record.overwrite(" ",170); //Scadenza pagata
|
||||
|
||||
real importopag (_tscad->get_real(SCAD_IMPORTOPAG));
|
||||
if (importopag.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",171);
|
||||
importopag = importopag * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",171);
|
||||
str.format("%014s", (const char*) importopag.string());
|
||||
record.overwrite(str,172); //Importo pagato
|
||||
|
||||
long codabipr = _tscad->get_long(SCAD_CODABIPR);
|
||||
str.format("%05ld", codabipr);
|
||||
record.overwrite(str,186); //Codice ABI banca di presentazione
|
||||
|
||||
long codcabpr = _tscad->get_long(SCAD_CODCABPR);
|
||||
str.format("%05ld", codcabpr);
|
||||
record.overwrite(str,191); //Codice CAB banca di presentazione
|
||||
|
||||
long codabi = _tscad->get_long(SCAD_CODABI);
|
||||
str.format("%05ld", codabi);
|
||||
record.overwrite(str,196); //Codice ABI
|
||||
|
||||
long codcab = _tscad->get_long(SCAD_CODCAB);
|
||||
str.format("%05ld", codcab);
|
||||
record.overwrite(str,201); //Codice CAB
|
||||
|
||||
TString codag = _tscad->get(SCAD_CODAG);
|
||||
str.format("%-5s", (const char*) codag);
|
||||
record.overwrite(str,206); //Codice agente
|
||||
|
||||
bool bloccata = _tscad->get_bool(SCAD_BLOCCATA);
|
||||
if (bloccata)
|
||||
record.overwrite("X",211);
|
||||
else
|
||||
record.overwrite(" ",211);
|
||||
|
||||
_tras_file.write_control_rec(record,size);
|
||||
_numrec_sc++;
|
||||
}
|
||||
|
||||
_tras_file.close();
|
||||
}
|
||||
|
||||
void TInv_cont::invio_pagsca()
|
||||
{
|
||||
int size = 1024;
|
||||
TString record(size);
|
||||
|
||||
_tras_file.open(_trasf,TRUE);
|
||||
|
||||
for (_tpagsca->first(); !_tpagsca->eof(); _tpagsca->next())
|
||||
{
|
||||
TString str;
|
||||
|
||||
_prog->addstatus(1);
|
||||
|
||||
record.spaces();
|
||||
|
||||
record.overwrite("B3",0); //Tipo record
|
||||
|
||||
char tipo = _tpagsca->get_char(PAGSCA_TIPOC);
|
||||
str.format("%c", tipo);
|
||||
record.overwrite(str,2); //Tipo Cliente/Fornitore
|
||||
|
||||
int gruppo = _tpagsca->get_int(PAGSCA_GRUPPO);
|
||||
str.format("%03d", gruppo);
|
||||
record.overwrite(str,3); //Gruppo
|
||||
|
||||
int conto = _tpagsca->get_int(PAGSCA_CONTO);
|
||||
str.format("%03d", conto);
|
||||
record.overwrite(str,6); //Conto
|
||||
|
||||
long sottoc = _tpagsca->get_long(PAGSCA_SOTTOCONTO);
|
||||
str.format("%06ld", sottoc);
|
||||
record.overwrite(str,9); //Sottoconto
|
||||
|
||||
int anno = _tpagsca->get_int(PAGSCA_ANNO);
|
||||
str.format("%04d", anno);
|
||||
record.overwrite(str,15); //Anno
|
||||
|
||||
TString numpart = _tpagsca->get(PAGSCA_NUMPART);
|
||||
str.format("%-7s", (const char*) numpart);
|
||||
record.overwrite(str,19); //Numero partita
|
||||
|
||||
int nriga = _tpagsca->get_int(PAGSCA_NRIGA);
|
||||
str.format("%04d", nriga);
|
||||
record.overwrite(str,26); //Numero riga partita
|
||||
|
||||
int nrata = _tpagsca->get_int(PAGSCA_NRATA);
|
||||
str.format("%04d", nrata);
|
||||
record.overwrite(str,30); //Numero di rata
|
||||
|
||||
int nrigp = _tpagsca->get_int(PAGSCA_NRIGP);
|
||||
str.format("%04d", nrigp);
|
||||
record.overwrite(str,34); //Numero riga pagamento
|
||||
|
||||
TString accsal = _tpagsca->get(PAGSCA_ACCSAL);
|
||||
record.overwrite(accsal,60); //Acconto/Saldo
|
||||
|
||||
real importo (_tpagsca->get_real(PAGSCA_IMPORTO));
|
||||
if (importo.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",61);
|
||||
importo = importo * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",61);
|
||||
str.format("%014s", (const char*) importo.string());
|
||||
record.overwrite(str,62); //Importo
|
||||
|
||||
real importoval (_tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
||||
if (importoval.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",76);
|
||||
importoval = importoval * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",76);
|
||||
dec2integer(importoval,1000);
|
||||
str.format("%016s", (const char*) importoval.string());
|
||||
record.overwrite(str,77); //Importo in valuta
|
||||
|
||||
TString passat = _tpagsca->get(PAGSCA_PASSATT);
|
||||
record.overwrite(passat,93); //Abbuono attivo o passivo
|
||||
|
||||
real abbuoni (_tpagsca->get_real(PAGSCA_ABBUONI));
|
||||
if (abbuoni.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",94);
|
||||
abbuoni = abbuoni * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",94);
|
||||
dec2integer(abbuoni,1000);
|
||||
str.format("%016s", (const char*) abbuoni.string());
|
||||
record.overwrite(str,95); //Abbuoni
|
||||
|
||||
real diffcam (_tpagsca->get_real(PAGSCA_DIFFCAM));
|
||||
if (diffcam.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",111);
|
||||
diffcam = diffcam * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",111);
|
||||
str.format("%014s", (const char*) diffcam.string());
|
||||
record.overwrite(str,112); //Differenza cambio
|
||||
|
||||
real ritenute (_tpagsca->get_real(PAGSCA_RITENUTE));
|
||||
if (ritenute.sign() < 0)
|
||||
{
|
||||
record.overwrite("-",126);
|
||||
ritenute = ritenute * -1;
|
||||
}
|
||||
else
|
||||
record.overwrite("+",126);
|
||||
str.format("%014s", (const char*) ritenute.string());
|
||||
record.overwrite(str,127); //Ritenute
|
||||
|
||||
char tipoc = _tpagsca->get_char(PAGSCA_TIPOCC);
|
||||
str.format("%c", tipoc);
|
||||
record.overwrite(str,141); //Tipo Cliente/Fornitore contropartita
|
||||
|
||||
int gruppoc = _tpagsca->get_int(PAGSCA_GRUPPOC);
|
||||
str.format("%03d", gruppoc);
|
||||
record.overwrite(str,142); //Gruppo contropartita
|
||||
|
||||
int contoc = _tpagsca->get_int(PAGSCA_CONTOC);
|
||||
str.format("%03d", contoc);
|
||||
record.overwrite(str,145); //Conto contropartita
|
||||
|
||||
long sottocc = _tpagsca->get_long(PAGSCA_SOTTOCONTC);
|
||||
str.format("%06ld", sottocc);
|
||||
record.overwrite(str,148); //Sottoconto contropartita
|
||||
|
||||
long codabi = _tpagsca->get_long(PAGSCA_CODABI);
|
||||
str.format("%05ld", codabi);
|
||||
record.overwrite(str,154); //Codice ABI
|
||||
|
||||
long codcab = _tpagsca->get_long(PAGSCA_CODCAB);
|
||||
str.format("%05ld", codcab);
|
||||
record.overwrite(str,159); //Codice CAB
|
||||
|
||||
long codabipr = _tpagsca->get_long(PAGSCA_CODABIPR);
|
||||
str.format("%05ld", codabipr);
|
||||
record.overwrite(str,164); //Codice ABI banca di presentazione
|
||||
|
||||
long codcabpr = _tpagsca->get_long(PAGSCA_CODCABPR);
|
||||
str.format("%05ld", codcabpr);
|
||||
record.overwrite(str,169); //Codice CAB banca di presentazione
|
||||
|
||||
TString codag = _tpagsca->get(PAGSCA_CODAG);
|
||||
str.format("%-5s", (const char*) codag);
|
||||
record.overwrite(str,174); //Codice agente
|
||||
|
||||
_tras_file.write_control_rec(record,size);
|
||||
_numrec_sc++;
|
||||
}
|
||||
|
||||
_tras_file.close();
|
||||
}
|
||||
|
1577
cg/cglib04.cpp
1577
cg/cglib04.cpp
File diff suppressed because it is too large
Load Diff
56
cg/cglib04.h
56
cg/cglib04.h
@ -26,6 +26,9 @@
|
||||
#include <rcausali.h>
|
||||
#include <causali.h>
|
||||
#include <occas.h>
|
||||
#include <partite.h>
|
||||
#include <scadenze.h>
|
||||
#include <pagsca.h>
|
||||
|
||||
#include "cg2103.h"
|
||||
|
||||
@ -37,6 +40,9 @@
|
||||
#define TEMP_RMOV "trmov"
|
||||
#define TEMP_RMOVIVA "trmoviva"
|
||||
#define TEMP_OCC "toccas"
|
||||
#define TEMP_PART "tpart"
|
||||
#define TEMP_SCAD "tscad"
|
||||
#define TEMP_PAGSCA "tpagsca"
|
||||
#define TEMP_TAB "ttab"
|
||||
|
||||
#define SIZE 256
|
||||
@ -124,7 +130,6 @@ class TTransfer_file
|
||||
{
|
||||
FILE* _trasfer;
|
||||
TArray _index;
|
||||
// TAssoc_array _fis_index;
|
||||
TMappa_trc _trc;
|
||||
TString _curfile;
|
||||
TString256 _control_rec_t; // Buffer per il record di controllo del trasfer
|
||||
@ -140,6 +145,9 @@ class TTransfer_file
|
||||
TIsamtempfile* _trmov;
|
||||
TIsamtempfile* _triva;
|
||||
TIsamtempfile* _toccas;
|
||||
TIsamtempfile* _tpart;
|
||||
TIsamtempfile* _tscad;
|
||||
TIsamtempfile* _tpagsca;
|
||||
TIsamtempfile* _ttab;
|
||||
TRectype* _depcaus;
|
||||
TRectype* _deprcaus;
|
||||
@ -149,8 +157,17 @@ class TTransfer_file
|
||||
TRectype* _deprmov;
|
||||
TRectype* _depriva;
|
||||
TRectype* _depoccas;
|
||||
TRectype* _deppart;
|
||||
TRectype* _depscad;
|
||||
TRectype* _deppagsca;
|
||||
|
||||
TRecnotype _rec; //Serve alle funzioni per istanziare un Isamtempfile localmente
|
||||
|
||||
|
||||
long _numreg, _numreg_p, _numreg_piva, _npoccas;
|
||||
long _nregSC, _nregSC_p;
|
||||
int _numrigSC, _numrigSC_p, _annoSC, _annoSC_p, _nrigaSC;
|
||||
TString _numpartSC, _numpartSC_p;
|
||||
int _annoes;
|
||||
TDate _datareg;
|
||||
TString _cod_com;
|
||||
@ -169,19 +186,27 @@ class TTransfer_file
|
||||
TString _ult_file;
|
||||
TString _key;
|
||||
TString80 _tmpcaus,_tmprcaus,_tmpclifo,_tmppcon,_tmpmov;
|
||||
TString80 _tmprmov,_tmprmoviva;
|
||||
TString80 _tmprmov,_tmprmoviva,_tmppart,_tmpscad,_tmppagsca;
|
||||
TString _recprec;
|
||||
|
||||
long _SCAnreg,_SCAnreg_p;
|
||||
int _SCAnumrig,_SCAnumrig_p,_SCAanno,_SCAanno_p,_annoSCA,_nrigaSCA,_nrataSCA,_SCAnriga_p;
|
||||
TString _SCAnumpart,_SCAnumpart_p;
|
||||
real _imp,_impval;
|
||||
bool _esiste_pagsca;
|
||||
|
||||
private:
|
||||
// Inizializza l'indice leggendo il record di controllo
|
||||
void fill_index(TString&,TString&);
|
||||
|
||||
// Funzioni utilizzate da fcopytemp() nella ricezione da Sistema
|
||||
// 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);
|
||||
void scrivi_pcon(long nrec);
|
||||
void scrivi_PN(long nrec);
|
||||
void scrivi_IVA(long nrec);
|
||||
void scrivi_SC(long nrec);
|
||||
|
||||
void write_tmp_tabelle(TString& record, bool create);
|
||||
int trasfer_data_tab(TIsamtempfile& file, TRectype& dep);
|
||||
@ -189,7 +214,25 @@ private:
|
||||
int trasfer_data_mov(TIsamtempfile& file, TRectype& dep);
|
||||
void write_tmp_movIVA(TString& record, bool create);
|
||||
int trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln);
|
||||
// Funzioni per la ricezione del Saldaconto da Sistema
|
||||
void write_tmp_movSC(TString& record, bool create);
|
||||
void new_key(TString& key, int tipo, TString& buffer);
|
||||
void tipo_anagrafica(TString& record,TString& tipo);
|
||||
int ultima_riga_partita(TString& record);
|
||||
void partita (TString& record);
|
||||
void scadenza(TString& record);
|
||||
void pagsca (TString& record);
|
||||
void calcola_imposta(TString& numreg, real& imposta);
|
||||
void calcola_impdocval(long nreg,int nrig,TString& record);
|
||||
bool solo_SC(TString& numreg);
|
||||
void calcola_importo(TString& record);
|
||||
int recupera_scadenze(TString& record,TString& tipo);
|
||||
char what_is_this(TString& record,TString& tipo);
|
||||
void aggiorna_partita(TString& record,TString& tipo,real& importo,real& importoval,real& abbuoni,real& diffcam,real& ritenute);
|
||||
char leggi_sez_partita(TString& record,TString& tipo);
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Funzioni utilizzate nella ricezione da sistema e da PC
|
||||
char TipoConto (int gruppo, int conto);
|
||||
const char* numero_civico(TString& field);
|
||||
void leggi_record_controllo();
|
||||
@ -201,8 +244,9 @@ private:
|
||||
int look(unsigned char carattere);
|
||||
int cerca_annoes(long numreg, TString& tipodoc);
|
||||
const char* scrivi_occasionali(const TString& record);
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Funzioni utilizzate da fcopytemp_PC() nella ricezione da PC
|
||||
// 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);
|
||||
@ -210,6 +254,10 @@ private:
|
||||
void write_testata_movimenti(TString& record);
|
||||
void write_righe_contabili(TString& record);
|
||||
void write_righe_IVA(TString& record);
|
||||
// Funzioni utilizzate per la ricezione Saldaconto da PC
|
||||
void write_partite(TString& record);
|
||||
void write_scadenze(TString& record);
|
||||
void write_pagsca(TString& record);
|
||||
|
||||
int annoes_PC(TString& data);
|
||||
void causale(TString& cau,TString& tipo,TString& descr);
|
||||
|
111
cg/cgtrc.ini
111
cg/cgtrc.ini
@ -228,3 +228,114 @@ U1|52|109|126|||||
|
||||
U1|53|127|131|||||
|
||||
U1|54|132|133|||||
|
||||
U1|56|87|108|||||
|
||||
#
|
||||
# Tracciato Partite in caso di Fattura
|
||||
#
|
||||
B1|1|16|16|28|TIPOC|||
|
||||
B1|2|17|18|28|GRUPPO|||
|
||||
B1|3|19|20|28|CONTO|||
|
||||
B1|4|21|26|28|SOTTOCONTO|||
|
||||
B1|5|27|28|28|ANNO|||
|
||||
B1|6|29|35|28|NUMPART|||
|
||||
B1|7|11|13|28|NRIGA|||
|
||||
B1|8|3|8|28|NREG|||
|
||||
B1|9|9|10|28|NUMRIG|||
|
||||
B1|10|38|38|28|TIPOMOV|||
|
||||
B1|11|39|44|28|DATAREG|2||
|
||||
B1|12|45|50|28|DATADOC|2||
|
||||
B1|13|51|57|28|NUMDOC|||
|
||||
B1|14|58|58|28|REG|||
|
||||
B1|15|59|63|28|PROTIVA|||
|
||||
B1|16|64|66|28|CODCAUS|||
|
||||
B1|17|153|153|28|SEZ|||
|
||||
B1|18|80|82|28|CODVAL|||
|
||||
B1|19|96|106|28|CAMBIO|3|5|
|
||||
B1|20|107|112|28|DATACAM|2||
|
||||
B1|21|69|79|28|IMPTOTDOC|||
|
||||
B1|22|83|95|28|IMPTOTVAL|3|3|
|
||||
B1|23|169|170|28|GRUPPOCL|||
|
||||
B1|24|171|172|28|CONTOCL|||
|
||||
#
|
||||
# Tracciato Partite in caso di Nota Credito
|
||||
#
|
||||
B1|50|16|16|28|TIPOC|||
|
||||
B1|51|17|18|28|GRUPPO|||
|
||||
B1|52|19|20|28|CONTO|||
|
||||
B1|53|21|26|28|SOTTOCONTO|||
|
||||
B1|54|27|28|28|ANNO|||
|
||||
B1|55|29|35|28|NUMPART|||
|
||||
B1|56|11|13|28|NRIGA|||
|
||||
B1|57|3|8|28|NREG|||
|
||||
B1|58|9|10|28|NUMRIG|||
|
||||
B1|59|38|38|28|TIPOMOV|||
|
||||
B1|60|115|115|28|TIPOPAG|||
|
||||
B1|61|39|44|28|DATAREG|2||
|
||||
B1|62|45|50|28|DATADOC|2||
|
||||
B1|63|51|57|28|NUMDOC|||
|
||||
B1|64|141|146|28|DATAPAG|2||
|
||||
B1|65|58|58|28|REG|||
|
||||
B1|66|59|63|28|PROTIVA|||
|
||||
B1|67|64|66|28|CODCAUS|||
|
||||
B1|68|153|153|28|SEZ|||
|
||||
B1|69|80|82|28|CODVAL|||
|
||||
B1|70|96|106|28|CAMBIO|3|5|
|
||||
B1|71|107|112|28|DATACAM|2||
|
||||
B1|72|169|170|28|GRUPPOCL|||
|
||||
B1|73|171|172|28|CONTOCL|||
|
||||
#
|
||||
# Tracciato Partite in caso di Incassi/Pagamenti/Insoluti/Pagamenti insoluti
|
||||
#
|
||||
B1|100|16|16|28|TIPOC|||
|
||||
B1|101|17|18|28|GRUPPO|||
|
||||
B1|102|19|20|28|CONTO|||
|
||||
B1|103|21|26|28|SOTTOCONTO|||
|
||||
B1|104|27|28|28|ANNO|||
|
||||
B1|105|29|35|28|NUMPART|||
|
||||
B1|106|11|13|28|NRIGA|||
|
||||
B1|107|3|8|28|NREG|||
|
||||
B1|108|9|10|28|NUMRIG|||
|
||||
B1|109|38|38|28|TIPOMOV|||
|
||||
B1|110|115|115|28|TIPOPAG|||
|
||||
B1|111|39|44|28|DATAREG|2||
|
||||
B1|112|45|50|28|DATADOC|2||
|
||||
B1|113|51|57|28|NUMDOC|||
|
||||
B1|114|141|146|28|DATAPAG|2||
|
||||
B1|115|64|66|28|CODCAUS|||
|
||||
B1|116|153|153|28|SEZ|||
|
||||
B1|117|80|82|28|CODVAL|||
|
||||
B1|118|96|106|28|CAMBIO|3|5|
|
||||
B1|119|107|112|28|DATACAM|2||
|
||||
B1|120|169|170|28|GRUPPOCL|||
|
||||
B1|121|171|172|28|CONTOCL|||
|
||||
#
|
||||
# Tracciato Scadenze in caso di Fattura
|
||||
#
|
||||
B1|150|16|16|29|TIPOC|||
|
||||
B1|151|17|18|29|GRUPPO|||
|
||||
B1|152|19|20|29|CONTO|||
|
||||
B1|153|21|26|29|SOTTOCONTO|||
|
||||
B1|154|27|28|29|ANNO|||
|
||||
B1|155|29|35|29|NUMPART|||
|
||||
B1|156|11|13|29|NRIGA|||
|
||||
B1|157|36|37|29|NRATA|||
|
||||
B1|158|113|114|29|CODPAG|||
|
||||
B1|159|115|115|29|TIPOPAG|||
|
||||
B1|160|116|116|29|ULTCLASS|||
|
||||
B1|161|117|127|29|IMPORTO|||
|
||||
B1|162|128|140|29|IMPORTOVAL|3|3|
|
||||
B1|163|141|146|29|DATASCAD|2||
|
||||
#
|
||||
# Tracciato Pagamenti scadenze
|
||||
#
|
||||
B1|200|16|16|30|TIPOC|||
|
||||
B1|201|17|18|30|GRUPPO|||
|
||||
B1|202|19|20|30|CONTO|||
|
||||
B1|203|21|26|30|SOTTOCONTO|||
|
||||
B1|204|27|28|30|ANNO|||
|
||||
B1|205|29|35|30|NUMPART|||
|
||||
B1|206|11|13|30|NRIGA|||
|
||||
B1|207|36|37|30|NRATA|||
|
||||
B1|208|153|153|30|SEZ|||
|
||||
B1|209|117|127|30|IMPORTO|||
|
||||
B1|210|128|140|30|IMPORTOVAL|3|3|
|
||||
B1|211|1|1|30|IMP|||
|
@ -193,3 +193,93 @@ U1|11|102|104|25|CONTO|||
|
||||
U1|12|105|110|25|SOTTOCONTO|||
|
||||
U1|13|111|113|25|RIGAIMP|||
|
||||
U1|14|114|116|25|RIGAIVA|||
|
||||
B1|1|3|3|28|TIPOC|||
|
||||
B1|2|4|6|28|GRUPPO|||
|
||||
B1|3|7|9|28|CONTO|||
|
||||
B1|4|10|15|28|SOTTOCONTO|||
|
||||
B1|5|16|19|28|ANNO|||
|
||||
B1|6|20|26|28|NUMPART|||
|
||||
B1|7|27|30|28|NRIGA|||
|
||||
B1|8|61|61|28|TIPOMOV|||
|
||||
B1|9|62|62|28|TIPOPAG|||
|
||||
B1|10|63|63|28|TIPOREG|||
|
||||
B1|11|64|70|28|NREG|||
|
||||
B1|12|71|73|28|NUMRIG|||
|
||||
B1|13|74|81|28|DATAREG|2||
|
||||
B1|14|82|89|28|DATADOC|2||
|
||||
B1|15|90|97|28|DATAPAG|2||
|
||||
B1|16|98|104|28|NUMDOC|||
|
||||
B1|17|105|154|28|DESCR|||
|
||||
B1|18|155|157|28|REG|||
|
||||
B1|19|158|162|28|PROTIVA|||
|
||||
B1|20|163|165|28|CODCAUS|||
|
||||
B1|21|166|166|28|SEZ|||
|
||||
B1|22|168|181|28|IMPORTO|||
|
||||
B1|23|183|196|28|IMPOSTA|||
|
||||
B1|24|198|211|28|SPESE|||
|
||||
B1|25|212|214|28|CODVAL|||
|
||||
B1|26|215|228|28|CAMBIO|3|5|
|
||||
B1|27|230|245|28|IMPORTOVAL|3|3|
|
||||
B1|28|246|253|28|DATACAM|2||
|
||||
B1|29|255|268|28|IMPTOTDOC|||
|
||||
B1|30|270|285|28|IMPTOTVAL|3|3|
|
||||
B1|31|287|300|28|RITENUTE|||
|
||||
B1|32|301|301|28|SEZABB|||
|
||||
B1|33|303|318|28|ABBUONI|3|3|
|
||||
B1|34|319|319|28|SEZDIFCAM|||
|
||||
B1|35|321|334|28|DIFFCAM|||
|
||||
B1|36|335|335|28|CHIUSA|||
|
||||
B1|37|336|336|28|RICARICATA|||
|
||||
B1|38|337|339|28|GRUPPOCL|||
|
||||
B1|39|340|342|28|CONTOCL|||
|
||||
B2|1|3|3|29|TIPOC|||
|
||||
B2|2|4|6|29|GRUPPO|||
|
||||
B2|3|7|9|29|CONTO|||
|
||||
B2|4|10|15|29|SOTTOCONTO|||
|
||||
B2|5|16|19|29|ANNO|||
|
||||
B2|6|20|26|29|NUMPART|||
|
||||
B2|7|27|30|29|NRIGA|||
|
||||
B2|8|31|34|29|NRATA|||
|
||||
B2|9|61|110|29|DESCR|||
|
||||
B2|10|111|114|29|CODPAG|||
|
||||
B2|11|115|115|29|TIPOPAG|||
|
||||
B2|12|116|116|29|ULTCLASS|||
|
||||
B2|13|118|131|29|IMPORTO|||
|
||||
B2|14|133|148|29|IMPORTOVAL|3|3|
|
||||
B2|15|149|156|29|DATASCAD|2||
|
||||
B2|16|157|158|29|NSOLL|||
|
||||
B2|17|159|166|29|DATASOLL|2||
|
||||
B2|18|167|170|29|GGRIT|||
|
||||
B2|19|171|171|29|PAGATA|||
|
||||
B2|20|173|186|29|IMPORTOPAG|||
|
||||
B2|21|187|191|29|CODABIPR|||
|
||||
B2|22|192|196|29|CODCABPR|||
|
||||
B2|23|197|201|29|CODABI|||
|
||||
B2|24|202|206|29|CODCAB|||
|
||||
B2|25|207|211|29|CODAG|||
|
||||
B2|26|212|212|29|BLOCCATA|||
|
||||
B3|1|3|3|30|TIPOC|||
|
||||
B3|2|4|6|30|GRUPPO|||
|
||||
B3|3|7|9|30|CONTO|||
|
||||
B3|4|10|15|30|SOTTOCONTO|||
|
||||
B3|5|16|19|30|ANNO|||
|
||||
B3|6|20|26|30|NUMPART|||
|
||||
B3|7|27|30|30|NRIGA|||
|
||||
B3|8|31|34|30|NRATA|||
|
||||
B3|9|35|38|30|NRIGP|||
|
||||
B3|10|61|61|30|ACCSAL|||
|
||||
B3|11|63|76|30|IMPORTO|||
|
||||
B3|12|78|93|30|IMPORTOVAL|3|3|
|
||||
B3|13|94|94|30|PASSATT|||
|
||||
B3|14|96|111|30|ABBUONI|3|3|
|
||||
B3|15|113|126|30|DIFFCAM|||
|
||||
B3|16|128|141|30|RITENUTE|||
|
||||
B3|17|142|142|30|TIPOCC|||
|
||||
B3|18|143|145|30|GRUPPOC|||
|
||||
B3|19|146|148|30|CONTOC|||
|
||||
B3|20|149|154|30|SOTTOCONTC|||
|
||||
B3|21|155|159|30|CODABI|||
|
||||
B3|22|160|164|30|CODCAB|||
|
||||
B3|23|165|169|30|CODABIPR|||
|
||||
B3|24|170|174|30|CODCABPR|||
|
||||
B3|25|175|179|30|CODAG|||
|
@ -23,3 +23,8 @@
|
||||
#define PAGSCA_CONTO "CONTO"
|
||||
#define PAGSCA_SOTTOCONTO "SOTTOCONTO"
|
||||
|
||||
#define PAGSCA_TIPOCC "TIPOCC"
|
||||
#define PAGSCA_GRUPPOC "GRUPPOC"
|
||||
#define PAGSCA_CONTOC "CONTOC"
|
||||
#define PAGSCA_SOTTOCONTC "SOTTOCONTC"
|
||||
|
||||
|
@ -44,4 +44,7 @@
|
||||
#define PART_NUMRIFPAG "NUMRIFPAG"
|
||||
#define PART_GRUPPOCL "GRUPPOCL"
|
||||
#define PART_CONTOCL "CONTOCL"
|
||||
|
||||
#define PART_TIPOREG "TIPOREG"
|
||||
#define PART_INVIATA "INVIATA"
|
||||
#endif
|
||||
|
@ -27,6 +27,8 @@
|
||||
#define SCAD_CODAG "CODAG"
|
||||
#define SCAD_DESCR "DESCR"
|
||||
#define SCAD_BLOCCATA "BLOCCATA"
|
||||
#define SCAD_TNRIGA "TNRIGA"
|
||||
#define SCAD_TNRATA "TNRATA"
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user