Patch level : 10.0 no patch
Files correlati :pi0001.exe Ricompilazione Demo : [ ] Commento : Conversione movimenti partite e cespiti GALILEO git-svn-id: svn://10.65.10.50/trunk@19973 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3af9d31177
commit
e57f1b6542
@ -167,6 +167,7 @@ void TImporta_mov::build_IVA(TConfig & conf, TArray & rows, TString_array & conc
|
||||
{
|
||||
const int items = rows.items();
|
||||
TString paragraph;
|
||||
TToken_string key;
|
||||
|
||||
if (items > 0)
|
||||
{
|
||||
@ -198,11 +199,15 @@ void TImporta_mov::build_IVA(TConfig & conf, TArray & rows, TString_array & conc
|
||||
}
|
||||
imptot -= imp;
|
||||
paragraph.format("%d,%d",LF_RMOVIVA,nrigai++);
|
||||
key.add(gruppo);
|
||||
key.add(conto);
|
||||
const TString4 tipocf = cache().get(LF_PCON, key, PCN_TMCF);
|
||||
conf.set_paragraph(paragraph);
|
||||
conf.set(RMI_CODIVA, rec.get(RMI_CODIVA));
|
||||
conf.set(RMI_TIPODET, rec.get(RMI_TIPODET));
|
||||
conf.set(RMI_IMPONIBILE, imp.string());
|
||||
conf.set(RMI_IMPOSTA, iva.string());
|
||||
conf.set(RMI_TIPOC, tipocf);
|
||||
conf.set(RMI_GRUPPO, gruppo);
|
||||
conf.set(RMI_CONTO, conto);
|
||||
conf.set(RMI_SOTTOCONTO, sottoconto);
|
||||
@ -359,14 +364,15 @@ void TImporta_mov::transfer(const TFilename& file)
|
||||
importo = -importo;
|
||||
sez = "A";
|
||||
}
|
||||
TToken_string key;
|
||||
|
||||
key.add(gruppo);
|
||||
key.add(conto);
|
||||
|
||||
const TString4 tipocf = cache().get(LF_PCON, key, PCN_TMCF);
|
||||
|
||||
if (iva)
|
||||
{
|
||||
TToken_string key;
|
||||
|
||||
key.add(gruppo);
|
||||
key.add(conto);
|
||||
const TString4 tipocf = cache().get(LF_PCON, key, PCN_TMCF);
|
||||
|
||||
if (tipocf.full())
|
||||
{
|
||||
conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
@ -398,6 +404,7 @@ void TImporta_mov::transfer(const TFilename& file)
|
||||
conf->set(RMV_GRUPPO, gruppo);
|
||||
conf->set(RMV_CONTO, conto);
|
||||
conf->set(RMV_SOTTOCONTO, sottoconto);
|
||||
conf->set(RMV_TIPOC, tipocf);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
120
ps/pi0001200.cpp
120
ps/pi0001200.cpp
@ -21,7 +21,7 @@
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
|
||||
// Tracciato File: FGA5DAT/CGSCA00F - CGSCA : Scadenze INDEX 9/12/09 17:43:05 Pag. 1
|
||||
/* // Tracciato File: FGA5DAT/CGSCA00F - CGSCA : Scadenze INDEX 9/12/09 17:43:05 Pag. 1
|
||||
#define TR01CD 0 // A=Att./Sosp./Ann/Estr.ant.ft DIZSMAS - ATTI
|
||||
#define DT01CD 1 // Data ult.manut. DIZSMAS - DATS
|
||||
#define NR01CD 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
@ -41,7 +41,7 @@
|
||||
#define TIPOCD 16 // Tipo Effetto DIZSMAS - TIPO
|
||||
#define GEINCD 17 // * = Generato RCD su Insoluti DIZSMAS - FLAG
|
||||
#define CAMBCD2 18 // Cambio EURO DIZSMAS - CAME
|
||||
#define IMVACD2 19 // Importo val2 DIZSMAS - IMPO
|
||||
#define IMVACD2 19 // Importo val2 DIZSMAS - IMPO */
|
||||
|
||||
// Tracciato File: FGA5DAT/CGSPA00F - CGSPA : Scadenze partite aperte 9/12/09 17:43:12 Pag. 1
|
||||
#define AT01PA 0 // Tipo provvisorio DIZSMAS - ATTI
|
||||
@ -184,7 +184,8 @@ bool build_rec(const TRelation& rel, void* pJolly)
|
||||
const int p1 = key.find(" ", p);
|
||||
|
||||
gmm->zero();
|
||||
key.cut(p1);
|
||||
if (p1 > p)
|
||||
key.cut(p1);
|
||||
key = key.mid(p);
|
||||
gmm->put("CODTAB", key);
|
||||
gmm->put("I0", nmov);
|
||||
@ -213,11 +214,12 @@ void TImporta_sc::transfer(const TFilename& file)
|
||||
TString4 conto;
|
||||
TString8 sottoconto;
|
||||
TString descr(50);
|
||||
TPartita * game;
|
||||
TPartita * game = NULL;
|
||||
long nreg;
|
||||
TCausali_cache cache_causali;
|
||||
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
build_table();
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
@ -230,15 +232,10 @@ void TImporta_sc::transfer(const TFilename& file)
|
||||
anno = a;
|
||||
part = p;
|
||||
|
||||
const TString8 reg = s.get(DIVIPA).as_string();
|
||||
const TDate dataop(s.get(DTRGPA).as_int());
|
||||
const long nmov = s.get(NONPPA).as_int();
|
||||
TToken_string key(25, ',');
|
||||
|
||||
key.add(part);
|
||||
key.add(anno);
|
||||
key.add(reg);
|
||||
key.add(dataop.string());
|
||||
key.add(nmov);
|
||||
|
||||
nreg = cache().get("GMM", key).get_long("I0");
|
||||
|
||||
@ -250,57 +247,60 @@ void TImporta_sc::transfer(const TFilename& file)
|
||||
game = NULL;
|
||||
}
|
||||
|
||||
TToken_string keymov;
|
||||
|
||||
keymov.add(nreg);
|
||||
const TRectype & mov = cache().get(LF_MOV, keymov);
|
||||
|
||||
keymov.add(1);
|
||||
|
||||
const TRectype & rmov = cache().get(LF_RMOV, keymov);
|
||||
TBill clifo(rmov);
|
||||
|
||||
const TCausale & c = cache_causali.causale(mov.get(MOV_CODCAUS), mov.get_int(MOV_ANNOIVA));
|
||||
|
||||
if (game == NULL)
|
||||
game = new TPartita(clifo, anno, format("%7d", part));
|
||||
|
||||
TRiga_partite& partita = game->new_row();
|
||||
|
||||
partita.put(PART_TIPOMOV, c.tipomov());
|
||||
partita.put(PART_DATAREG, mov.get(MOV_DATAREG));
|
||||
partita.put(PART_DATADOC, mov.get(MOV_DATADOC));
|
||||
partita.put(PART_NUMDOC, mov.get(MOV_NUMDOC));
|
||||
descr = s.get(DSTIPA).as_string();
|
||||
if (descr.blank())
|
||||
descr = mov.get(MOV_DESCR);
|
||||
partita.put(PART_DESCR, descr);
|
||||
partita.put(PART_CODCAUS, c.codice());
|
||||
partita.put(PART_REG, c.reg().name());
|
||||
partita.put(PART_SEZ, c.sezione(1));
|
||||
|
||||
partita.put(PART_SOTTOCONTO, clifo.sottoconto());
|
||||
const TString8 codpag(mov.get(MOV_CODPAG));
|
||||
TPagamento pag(codpag);
|
||||
partita.put(PART_CODPAG, codpag);
|
||||
partita.put(PART_TIPOPAG, pag.tipo_rata(0));
|
||||
|
||||
partita.put(PART_GRUPPOCL, clifo.gruppo());
|
||||
partita.put(PART_CONTOCL, clifo.conto());
|
||||
partita.put(PART_PROTIVA, mov.get(MOV_PROTIVA));
|
||||
|
||||
real residuo = s.get(IMPOPA).as_real();
|
||||
TImporto importo(residuo.sign() < 0 ? 'A' : 'D', abs(residuo));
|
||||
importo.normalize(c.sezione(1));
|
||||
partita.add(PART_IMPTOTDOC, importo.valore());
|
||||
partita.put(PART_IMPORTO, importo.valore());
|
||||
|
||||
TRiga_scadenze& scadenza = partita.new_row();
|
||||
if (residuo !=ZERO)
|
||||
{
|
||||
TToken_string keymov;
|
||||
|
||||
scadenza.put(SCAD_CODPAG, mov.get(MOV_CODPAG));
|
||||
scadenza.put(SCAD_DATASCAD, s.get(DTSCPA).as_string());
|
||||
scadenza.put(SCAD_IMPORTO, importo.valore());
|
||||
scadenza.put(SCAD_TIPOPAG, partita.get(PART_TIPOPAG));
|
||||
keymov.add(nreg);
|
||||
const TRectype & mov = cache().get(LF_MOV, keymov);
|
||||
|
||||
keymov.add(1);
|
||||
|
||||
const TRectype & rmov = cache().get(LF_RMOV, keymov);
|
||||
TBill clifo(rmov);
|
||||
|
||||
const TCausale & c = cache_causali.causale(mov.get(MOV_CODCAUS), mov.get_int(MOV_ANNOIVA));
|
||||
|
||||
if (game == NULL)
|
||||
game = new TPartita(clifo, anno, format("%7d", part));
|
||||
|
||||
TRiga_partite& partita = game->new_row();
|
||||
|
||||
partita.put(PART_TIPOMOV, c.tipomov());
|
||||
partita.put(PART_DATAREG, mov.get(MOV_DATAREG));
|
||||
partita.put(PART_DATADOC, mov.get(MOV_DATADOC));
|
||||
partita.put(PART_NUMDOC, mov.get(MOV_NUMDOC));
|
||||
descr = s.get(DSTIPA).as_string();
|
||||
if (descr.blank())
|
||||
descr = mov.get(MOV_DESCR);
|
||||
partita.put(PART_DESCR, descr);
|
||||
partita.put(PART_CODCAUS, c.codice());
|
||||
partita.put(PART_REG, c.reg().name());
|
||||
partita.put(PART_SEZ, c.sezione(1));
|
||||
|
||||
partita.put(PART_SOTTOCONTO, clifo.sottoconto());
|
||||
const TString8 codpag(mov.get(MOV_CODPAG));
|
||||
TPagamento pag(codpag);
|
||||
partita.put(PART_TIPOPAG, pag.n_rate() > 0 ? pag.tipo_rata(0) : _rim_dir);
|
||||
|
||||
partita.put(PART_GRUPPOCL, clifo.gruppo());
|
||||
partita.put(PART_CONTOCL, clifo.conto());
|
||||
partita.put(PART_PROTIVA, mov.get(MOV_PROTIVA));
|
||||
int sign = residuo.sign();
|
||||
|
||||
TImporto importo(sign < 0 ? 'A' : 'D', abs(residuo));
|
||||
importo.normalize(c.sezione(1));
|
||||
partita.add(PART_IMPTOTDOC, sign * importo.valore());
|
||||
partita.put(PART_IMPORTO, sign * importo.valore());
|
||||
|
||||
TRiga_scadenze& scadenza = partita.new_row();
|
||||
|
||||
scadenza.put(SCAD_CODPAG, codpag);
|
||||
scadenza.put(SCAD_DATASCAD, s.get(DTSCPA).as_string());
|
||||
scadenza.put(SCAD_IMPORTO, sign * importo.valore());
|
||||
scadenza.put(SCAD_TIPOPAG, partita.get(PART_TIPOPAG));
|
||||
}
|
||||
}
|
||||
if (game != NULL)
|
||||
{
|
||||
|
@ -215,10 +215,21 @@ public:
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
void transfer(const TFilename& file, const TFilename& filesto);
|
||||
const char * galileo2campo(const TString & codces);
|
||||
|
||||
TImporta_cesp() {};
|
||||
};
|
||||
|
||||
const char * TImporta_cesp::galileo2campo(const TString & codces)
|
||||
{
|
||||
TString & str = get_tmp_string(16);
|
||||
const long cod = atoi(codces.left(6));
|
||||
const long prog = atoi(codces.mid(7));
|
||||
|
||||
str.format("%06ld%04ld", cod, prog);
|
||||
return str;
|
||||
}
|
||||
|
||||
void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
{
|
||||
TFilename outdir(_msk->get(F_PATHOUT));
|
||||
@ -230,7 +241,6 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
const int codes = _msk->get_int(F_ANNOES);
|
||||
real val;
|
||||
TAssoc_array sto_keys;
|
||||
TString16 key;
|
||||
TString16 pos;
|
||||
|
||||
{
|
||||
@ -246,10 +256,9 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
|
||||
if (ditta == dtst && annoes == codes)
|
||||
{
|
||||
const long codces = st.get(CCESAS).as_int();
|
||||
key.format("%010ld", codces);
|
||||
const TString16 codces(galileo2campo(st.get(CCESAS).as_string()));
|
||||
pos.format("%ld", st.current_row());
|
||||
sto_keys.add(key, pos);
|
||||
sto_keys.add(codces, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -278,19 +287,17 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
conf.set("Mode","AUTO");
|
||||
|
||||
conf.set_paragraph("139"); // setto il paragrafo cespi
|
||||
const long codces = s.get(CCESAA).as_int();
|
||||
const TString16 scodces(format("%010ld", codces));
|
||||
const TString16 codces(galileo2campo(s.get(CCESAA).as_string()));
|
||||
|
||||
conf.set(CESPI_IDCESPITE, codces);
|
||||
conf.set(CESPI_CODCAT, str = s.get(CDNAAA).as_string());
|
||||
|
||||
conf.set(CESPI_IDCESPITE, scodces);
|
||||
str = s.get(DCESAA).as_string();
|
||||
/* str << ' ' << s.get(SIGLAA).as_string();
|
||||
str << ' ' << s.get(DACEAA).as_string();
|
||||
str << ' ' << s.get(MATRAA).as_string(); */
|
||||
str.left(60);
|
||||
conf.set(CESPI_DESC, str);
|
||||
conf.set(CESPI_DTCOMP, s.get(DTIAAA).as_string());
|
||||
conf.set(CESPI_DTFUNZ, s.get(DTIAAA).as_string());
|
||||
conf.set(CESPI_DTALIEN, s.get(DTFAAA).as_string());
|
||||
conf.set(CESPI_DTCOMP, s.get(DTIAAA).as_date());
|
||||
conf.set(CESPI_DTFUNZ, s.get(DTIAAA).as_date());
|
||||
conf.set(CESPI_DTALIEN, s.get(DTFAAA).as_date());
|
||||
conf.set(CESPI_TPSPEMAN, s.get(FLSMAA).as_bool() ? 2 : 1);
|
||||
/*
|
||||
#define CESPI_CODCGRA "CODCGRA"
|
||||
@ -324,20 +331,20 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
#define CESPI_FABBR06 "FABBR06"
|
||||
|
||||
*/
|
||||
TString * p = (TString *) sto_keys.objptr(key);
|
||||
conf.set_paragraph("143"); // setto il paragrafo del file salce
|
||||
conf.set(SALCE_IDCESPITE, codces);
|
||||
conf.set(SALCE_CODES, codes);
|
||||
conf.set(SALCE_ANNIAMM, 1);
|
||||
conf.set(SALCE_NUMELE, 1);
|
||||
TString * p = (TString *) sto_keys.objptr(codces);
|
||||
if (p != NULL)
|
||||
{
|
||||
st.move_to(atol(*p));
|
||||
|
||||
const int wcodces = s.get(CCESAS).as_int();
|
||||
CHECK(codces == wcodces, format("Errore di posizionamento Cespite %ld - %ld", codces, wcodces));
|
||||
const TString16 wcodces(galileo2campo(st.get(CCESAS).as_string()));
|
||||
|
||||
conf.set_paragraph("143"); // setto il paragrafo del file salce
|
||||
conf.set(SALCE_IDCESPITE, scodces);
|
||||
conf.set(SALCE_CODES, codes);
|
||||
conf.set(SALCE_ANNIAMM, 1);
|
||||
conf.set(SALCE_NUMELE, 1);
|
||||
val = s.get(VLINAS).as_real() + s.get(VAVIAS).as_real();
|
||||
CHECK(codces == wcodces, format("Errore di posizionamento Cespite %s - %s", (const char *)codces, (const char *) wcodces));
|
||||
val = st.get(VLINAS).as_real() + st.get(VAVIAS).as_real();
|
||||
conf.set(SALCE_CSTO, val.string());
|
||||
/*
|
||||
#define SALCE_VNONAMM "VNONAMM"
|
||||
@ -359,33 +366,33 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
val = s.get(VLINAS2).as_real() + s.get(VAVIAS2).as_real(); // gest
|
||||
*/
|
||||
conf.set_paragraph("136"); // setto il paragrafo del file ammce fiscale
|
||||
conf.set(AMMCE_IDCESPITE, scodces);
|
||||
conf.set(AMMCE_IDCESPITE, codces);
|
||||
conf.set(AMMCE_CODES, codes);
|
||||
val = s.get(PFANAS).as_real() + s.get(VAFNAS).as_real(); // prog amm norm fisc
|
||||
val = st.get(PFANAS).as_real() + st.get(VAFNAS).as_real(); // prog amm norm fisc
|
||||
conf.set(AMMCE_QNOR, val.string());
|
||||
val = s.get(VAMAAS).as_real(); // val amm acc fisc
|
||||
val = st.get(VAMAAS).as_real(); // val amm acc fisc
|
||||
conf.set(AMMCE_QACC, val.string());
|
||||
val = s.get(PFAAAS).as_real() + s.get(VAFAAS).as_real(); // prog amm ant fisc
|
||||
val = st.get(PFAAAS).as_real() + st.get(VAFAAS).as_real(); // prog amm ant fisc
|
||||
conf.set(AMMCE_QANT, val.string());
|
||||
|
||||
conf.set_paragraph("-1"); // setto il paragrafo del file ammce civilistico
|
||||
conf.set(AMMCE_IDCESPITE, scodces);
|
||||
conf.set(AMMCE_IDCESPITE, codces);
|
||||
conf.set(AMMCE_CODES, codes);
|
||||
val = s.get(FANCAS).as_real() + s.get(VFNCAS).as_real(); // prog amm norm civ
|
||||
val = st.get(FANCAS).as_real() + st.get(VFNCAS).as_real(); // prog amm norm civ
|
||||
conf.set(AMMCE_QNOR, val.string());
|
||||
val = s.get(VALCAS).as_real(); // val amm acc civ
|
||||
val = st.get(VALCAS).as_real(); // val amm acc civ
|
||||
conf.set(AMMCE_QACC, val.string());
|
||||
val = s.get(FAACAS).as_real() + s.get(VFACAS).as_real(); // prog amm ant civ
|
||||
val = st.get(FAACAS).as_real() + st.get(VFACAS).as_real(); // prog amm ant civ
|
||||
conf.set(AMMCE_QANT, val.string());
|
||||
|
||||
conf.set_paragraph("-2"); // setto il paragrafo del file ammce gestionale
|
||||
conf.set(AMMCE_IDCESPITE, scodces);
|
||||
conf.set(AMMCE_IDCESPITE, codces);
|
||||
conf.set(AMMCE_CODES, codes);
|
||||
val = s.get(PFANAS2).as_real() + s.get(VAFNAS2).as_real(); // prog amm norm gest
|
||||
val = st.get(PFANAS2).as_real() + st.get(VAFNAS2).as_real(); // prog amm norm gest
|
||||
conf.set(AMMCE_QNOR, val.string());
|
||||
val = s.get(VALCAS).as_real(); // val amm acc gest
|
||||
val = st.get(VALCAS).as_real(); // val amm acc gest
|
||||
conf.set(AMMCE_QACC, val.string());
|
||||
val = s.get(PFAAAS2).as_real() + s.get(VAFAAS2).as_real(); // prog amm ant gest
|
||||
val = st.get(PFAAAS2).as_real() + st.get(VAFAAS2).as_real(); // prog amm ant gest
|
||||
conf.set(AMMCE_QANT, val.string());
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user