Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@19890 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2010-01-08 09:56:26 +00:00
parent 8e1ae4334e
commit a21ddcc54c
2 changed files with 47 additions and 182 deletions

View File

@ -269,8 +269,7 @@ void TImporta_saldi::transfer(const TFilename& file)
bool TImporta_saldi::create()
{
_msk = new TImporta_saldi_mask();
_msk = new TImporta_saldi_mask();
return TSkeleton_application::create();
}

View File

@ -27,7 +27,7 @@
#include <rmov.h>
#include <rmoviva.h>
#define CGC_DITTA 0
#define CGC_DITTA 0
#define CGC_GRUPPO 1
#define CGC_SPECIE 2
#define CGC_CESPITE 3
@ -138,14 +138,13 @@ public:
void TImporta_cesp::transfer(const TFilename& file)
{
TFilename outdir(_msk->get(F_PATHOUT));
const TFilename outdir(_msk->get(F_PATHOUT));
TImporta_cogeco_recset s(file);
TProgind pi(s.items(),"Importazione cespiti in corso ...",true,true);
const long ditta = _msk->get_long(F_CODITTA);
long ntran = 1;
TString str(50);
const TEsercizi_contabili esc;
int lastes = esc.last();
int lastesc = esc.last();
long ntran = 1;
for (bool ok = s.move_to(1); ok ; ok = s.move_next())
{
@ -157,186 +156,53 @@ void TImporta_cesp::transfer(const TFilename& file)
if (ditta != dt)
continue;
TFilename temp(outdir);
temp << '/' << format("%05ld", ntran++);
temp.ext("ini");
if (fexist(temp))
remove_file(temp);
TConfig conf(temp);
conf.set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
conf.set("Action","INSERT");
conf.set("Mode","AUTO");
conf.set_paragraph("139"); // setto il paragrafo cespi
const long codces = s.get(CGC_NPROGR).as_int();
// verifico il codice cespite padre
const long codpadre = s.get(CGC_CEINCR).as_int();
//const long codpadre = s.get(CGC_CODPADRE); secondo me e' corretto questo! chiedere
conf.set(CESPI_IDCESPITE, format("%010ld", codces));
conf.set(CESPI_CODCGR, s.get(CGC_GRUPPO).as_string());
conf.set(CESPI_CODSP, s.get(CGC_SPECIE).as_string());
conf.set(CESPI_CODCAT, s.get(CGC_CESPITE).as_string());
conf.set(CESPI_DESC, s.get(CGC_DESCR).as_string());
if (codpadre == ZERO) // nuovo cespite
{
// creo record anagrafica cespi
TLocalisamfile cespi(LF_CESPI);
cespi.put(CESPI_IDCESPITE, format("%010ld", codces));
cespi.put(CESPI_CODCGR, s.get(CGC_GRUPPO).as_string());
cespi.put(CESPI_CODSP, s.get(CGC_SPECIE).as_string());
cespi.put(CESPI_CODCAT, s.get(CGC_CESPITE).as_string());
cespi.put(CESPI_DESC, s.get(CGC_DESCR).as_string());
cespi.put(CESPI_DTFUNZ, s.get(CGC_DATAINIZAMM).as_string());
cespi.put(CESPI_DTALIEN, s.get(CGC_DATAALIENENAZIONE).as_string());
cespi.put(CESPI_TPSPEMAN, 1);
conf.set(CESPI_DTFUNZ, s.get(CGC_DATAINIZAMM).as_string());
conf.set(CESPI_DTALIEN, s.get(CGC_DATAALIENENAZIONE).as_string());
conf.set(CESPI_TPSPEMAN, 1);
// creo record salce
TLocalisamfile salce(LF_SALCE);
salce.put(SALCE_IDCESPITE, cespi.get(CESPI_IDCESPITE));
salce.put(SALCE_CODES, lastesc); // verificare se ultimo esercizio va bene (2010?)
salce.put(SALCE_TPSALDO, 1); // verificare se saldo iniziale (1) va bene
salce.put(SALCE_NUMELE, 1);
salce.put(SALCE_CSTO, s.get(CGC_COSTOACQ).as_string());
/*
#define CESPI_CODCGRA "CODCGRA"
#define CESPI_CODSPA "CODSPA"
#define CESPI_CODIMP "CODIMP"
#define CESPI_CODLOC "CODLOC"
#define CESPI_CODORIG "CODORIG"
#define CESPI_DTCOMP "DTCOMP"
#define CESPI_AMMPROP "AMMPROP"
#define CESPI_ESCLPR "ESCLPR"
#define CESPI_TPSPEMAN "TPSPEMAN"
#define CESPI_USOPROM "USOPROM"
#define CESPI_LEASING "LEASING"
#define CESPI_TUIR "TUIR"
#define CESPI_USATO "USATO"
#define CESPI_ANNIRIC "ANNIRIC"
#define CESPI_PMAT "PMAT"
#define CESPI_PIMM "PIMM"
#define CESPI_VINCOLO "VINCOLO"
#define CESPI_PMINP "PMINP"
#define CESPI_PMAXP "PMAXP"
#define CESPI_CODVAL "CODVAL"
#define CESPI_FLGTPVEI "FLGTPVEI"
#define CESPI_VEIDIP "VEIDIP"
#define CESPI_STABILIM "STABILIM"
#define CESPI_REPARTO "REPARTO"
#define CESPI_IDIMP "IDIMP"
#define CESPI_PERCIMP "PERCIMP"
#define CESPI_FABBR06 "FABBR06"
// creo record ammce
TLocalisamfile ammce(LF_AMMCE);
ammce.put(AMMCE_IDCESPITE, salce.get(CESPI_IDCESPITE));
ammce.put(AMMCE_CODES, salce.get(SALCE_CODES));
ammce.put(AMMCE_TPSALDO, salce.get(SALCE_TPSALDO));
ammce.put(AMMCE_TPAMM, 1); // verificare se tipo amm = 1 va bene
ammce.put(AMMCE_QNORP, s.get(CGC_FONDOAMMORT).as_real());
ammce.put(AMMCE_QANTP, s.get(CGC_TOTAMMANTIC).as_real());
#define CEALIQ1 8
#define PERCAMMANTIC 9
#define COSTODAAMM 11
#define RIVALUTAZIONE 12
#define RETTIFICHE 13
#define FONDOAMMORT 14
#define TOTAMMANTIC 15
#define RIVALUTAMM 16
#define CEDIMRIVALUTAMM 17
#define AMMORTINDEDUCIBILE 18
#define CREDIMPOSTA 19
#define VENDCOSTOACQ 20
#define VENDFDOAMM 21
#define PLUSREINVEST 22
#define VALORVEN 23
#define PERCDAAMM 27
#define RIFERFATTVEN 28
#define RIFERFATTACQ 29
#define CODFOR 30
#define CEDITFIL 31
#define RIFERACQ 32
#define CODCLI 33
#define INAMMCOSTOES 34
#define IMMATERIALI 35
#define TIPOAMMORT 36
#define CESSIONE 37
#define RIFERVEN 38
#define CEMANRIP 39
#define PERCAMMSTD 40
#define NQUOTEANTCALC 41
#define NUMMOVCESP 42
#define VENDFDOANT 43
#define AMMDIPPADRE 44
*/
conf.set_paragraph("143"); // setto il paragrafo del file salce
conf.set(SALCE_NUMELE, 1);
conf.set(SALCE_CSTO, s.get(CGC_COSTOACQ).as_string());
/*
#define SALCE_IDCESPITE "IDCESPITE"
#define SALCE_CODES "CODES"
#define SALCE_TPSALDO "TPSALDO"
#define SALCE_NUMELE "NUMELE"
#define SALCE_CSTO "CSTO"
#define SALCE_VNONAMM "VNONAMM"
#define SALCE_VNONAMM06 "VNONAMM06"
#define SALCE_VNONAMMC "VNONAMMC"
#define SALCE_PLUSREIN "PLUSREIN"
#define SALCE_RIV75 "RIV75"
#define SALCE_RIV83 "RIV83"
#define SALCE_RIV90 "RIV90"
#define SALCE_ANNIPOST90 "ANNIPOST90"
#define SALCE_ANNIPOST91 "ANNIPOST91"
#define SALCE_RIV91 "RIV91"
#define SALCE_RIVGF "RIVGF"
#define SALCE_RIVGC "RIVGC"
#define SALCE_VSPMANU "VSPMANU"
#define SALCE_ANNIAMM "ANNIAMM"
#define SALCE_DTSTBOLL "DTSTBOLL"
val = s.get(VLICAS).as_real() + s.get(VVICAS).as_real(); // civ
val = s.get(VLINAS2).as_real() + s.get(VAVIAS2).as_real(); // gest */
conf.set_paragraph("136"); // setto il paragrafo del file ammce
/*
#define AMMCE_IDCESPITE "IDCESPITE"
#define AMMCE_CODES "CODES"
#define AMMCE_TPSALDO "TPSALDO"
#define AMMCE_TPAMM "TPAMM"
#define AMMCE_SCELTE "SCELTE"
#define AMMCE_AMMRIT "AMMRIT"
#define AMMCE_CSCEN "CSCEN"
#define AMMCE_FZPER "FZPER"
#define AMMCE_PNOR "PNOR"
#define AMMCE_PACC "PACC"
#define AMMCE_PANT "PANT"
#define AMMCE_FZQUO "FZQUO"
#define AMMCE_QNOR "QNOR"
#define AMMCE_QACC "QACC"
#define AMMCE_QANT "QANT"
#define AMMCE_QPERSE "QPERSE"
#define AMMCE_FPRIVATO "FPRIVATO"
#define AMMCE_QPPRIVATE "QPPRIVATE"
#define AMMCE_QNORP "QNORP"
#define AMMCE_QACCP "QACCP"
#define AMMCE_QANTP "QANTP"
#define AMMCE_QPERSEP "QPERSEP"
#define AMMCE_FPRIVATOP "FPRIVATOP"
#define AMMCE_QPPRIVATEP "QPPRIVATEP"
#define AMMCE_MSG01 "MSG01"
#define AMMCE_MSG02 "MSG02"
#define AMMCE_MSG03 "MSG03"
#define AMMCE_MSG04 "MSG04"
#define AMMCE_MSG05 "MSG05"
#define AMMCE_MSGD05 "MSGD05"
#define AMMCE_MSG06 "MSG06"
#define AMMCE_FRINGEBEN "FRINGEBEN"
val = s.get(VAMNAS).as_real(); val amm norm fisc
val = s.get(PFANAS).as_real() + s.get(VAFNAS).as_real(); prog amm norm fisc
val = s.get(VAMAAS).as_real(); val amm ant fisc
val = s.get(PFAAAS).as_real() + s.get(VAFAAS).as_real(); prog amm ant fisc
val = s.get(VALFAS).as_real(); val amm acc fisc
val = s.get(VANCAS).as_real(); val amm norm civ
val = s.get(FANCAS).as_real() + s.get(VFNCAS).as_real(); prog amm norm civ
val = s.get(VAACAS).as_real(); val amm ant civ
val = s.get(FAACAS).as_real() + s.get(VFACAS).as_real(); prog amm ant civ
val = s.get(VALCAS).as_real(); val amm acc civ
val = s.get(VAMNAS2).as_real(); val amm norm gest
val = s.get(PFANAS2).as_real() + s.get(VAFNAS2).as_real(); prog amm norm gest
val = s.get(VAMAAS2).as_real(); val amm ant gest
val = s.get(PFAAAS2).as_real() + s.get(VAFAAS2).as_real(); prog amm ant gest
val = s.get(VALCAS).as_real(); val amm acc gest
??? conf.set(, s.get(VLICAS2 51 // Valore Iniziale Civil.2 DIZSMAS - VLIN
conf.set(, s.get(VVICAS2 52 // Variaz. Valore Iniz. Civ.2 DIZSMAS - VAVI
conf.set(, s.get(VANCAS2 53 // Valore Ammort.Normale Civ.2 DIZSMAS - VAMN
conf.set(, s.get(VAACAS2 54 // Valore Ammort.Anti.Civil.2 DIZSMAS - VAMA
conf.set(, s.get(FANCAS2 55 // Progr.Fondo Amm.Norm Civ.2 DIZSMAS - PFAN
*/
}
if (yesno_box(FR("Si desidera confermare l'importazione di %ld record di cespiti"), ntran - 1))
{
TString app;
app << "ce0 -4 -i" << outdir << "/*.ini";
TExternal_app primanota(app);
primanota.run(true);
// scrivo i record dei cespiti
int err = cespi.write();
if (err == NOERR)
err = salce.write();
if (err == NOERR)
err = ammce.write();
}
else
{
// chiedere cosa fare perche' non ho capito cosa devo sommare!!
}
}
}