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@19945 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-01-19 08:59:45 +00:00
parent d2d9d96efb
commit f5e0bd1b32
4 changed files with 109 additions and 50 deletions

View File

@ -157,20 +157,19 @@ public:
virtual bool create();
virtual bool destroy();
virtual void main_loop();
void build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg);
void build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg, int nrigai);
void transfer(const TFilename& file);
TImporta_mov() {};
};
void TImporta_mov::build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg)
void TImporta_mov::build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg, int nrigai)
{
const int items = rows.items();
TString paragraph;
if (items > 0)
{
int nrigai = 1;
int i = 0;
TString *gcs = (TString *)concg.first_item();
real imptot = *((real *) impcg.first_item());
@ -232,6 +231,7 @@ void TImporta_mov::transfer(const TFilename& file)
TString8 reg;
TDate dataop;
int nrigac = 1;
int nrigai = 1;
long ntran = 1L;
bool iva = false;
TString4 gruppo;
@ -271,7 +271,7 @@ void TImporta_mov::transfer(const TFilename& file)
if (anno != a || reg != r || dataop != d || n != nmov )
{
if (iva && conf != NULL)
build_IVA(*conf, rows, concg, impcg);
build_IVA(*conf, rows, concg, impcg, nrigai);
anno = a;
reg = r;
dataop = d;
@ -336,6 +336,7 @@ void TImporta_mov::transfer(const TFilename& file)
}
conf->set(MOV_DESCR, descr);
nrigac = 1;
nrigai = 1;
rows.destroy();
impcg.destroy();
concg.destroy();
@ -343,8 +344,12 @@ void TImporta_mov::transfer(const TFilename& file)
const TString gcs = s.get(CONTCM).as_string();
TString4 sez("D");
if (gcs.full())
const TString4 codiva = s.get(CDIVCM).as_string();
gruppo = gcs.left(2);
conto = gcs.mid(2, 2);
sottoconto = gcs.right(6);
if (gcs.full() && codiva.blank())
{
TString8 paragraph;
real importo = s.get(IMPOCM).as_real();
@ -354,9 +359,6 @@ void TImporta_mov::transfer(const TFilename& file)
importo = -importo;
sez = "A";
}
gruppo = gcs.left(2);
conto = gcs.mid(2, 2);
sottoconto = gcs.right(6);
if (iva)
{
TToken_string key;
@ -418,34 +420,65 @@ void TImporta_mov::transfer(const TFilename& file)
if (ind > ZERO && ind < CENTO)
{
TRectype rec(LF_RMOVIVA);
real impind = importo * ind / 100;
real ivaind = importo * ind / 100;
real ivaind = imposta * ind / 100;
impind.round(2);
ivaind.round(2);
importo -= impind;
imposta -= ivaind;
if (gcs.blank())
{
TRectype rec(LF_RMOVIVA);
rec.put(RMI_CODIVA, codiva);
rec.put(RMI_TIPODET, "9");
rec.put(RMI_IMPONIBILE, impind.string());
rec.put(RMI_IMPOSTA, ivaind.string());
rec.put(RMI_GRUPPO, gruppo);
rec.put(RMI_CONTO, conto);
rec.put(RMI_SOTTOCONTO, sottoconto);
rows.add(rec);
}
else
{
paragraph.format("%d,%d",LF_RMOVIVA,nrigai++);
conf->set_paragraph(paragraph);
conf->set(RMI_CODIVA, codiva);
conf->set(RMI_TIPODET, "9");
conf->set(RMI_IMPONIBILE, impind.string());
conf->set(RMI_IMPOSTA, ivaind.string());
conf->set(RMI_GRUPPO, gruppo);
conf->set(RMI_CONTO, conto);
conf->set(RMI_SOTTOCONTO, sottoconto);
}
}
if (gcs.blank())
{
TRectype rec(LF_RMOVIVA);
rec.put(RMI_CODIVA, codiva);
rec.put(RMI_TIPODET, "9");
rec.put(RMI_IMPONIBILE, impind.string());
rec.put(RMI_IMPOSTA, ivaind.string());
if (ind >= CENTO)
rec.put(RMI_TIPODET, "9");
rec.put(RMI_IMPONIBILE, importo.string());
rec.put(RMI_IMPOSTA, imposta.string());
rec.put(RMI_GRUPPO, gruppo);
rec.put(RMI_CONTO, conto);
rec.put(RMI_SOTTOCONTO, sottoconto);
rows.add(rec);
}
TRectype rec(LF_RMOVIVA);
rec.put(RMI_CODIVA, codiva);
if (ind >= CENTO)
rec.put(RMI_TIPODET, "9");
rec.put(RMI_IMPONIBILE, importo.string());
rec.put(RMI_IMPOSTA, imposta.string());
rec.put(RMI_GRUPPO, gruppo);
rec.put(RMI_CONTO, conto);
rec.put(RMI_SOTTOCONTO, sottoconto);
rows.add(rec);
else
{
paragraph.format("%d,%d",LF_RMOVIVA,nrigai++);
conf->set_paragraph(paragraph);
conf->set(RMI_CODIVA, codiva);
if (ind >= CENTO)
conf->set(RMI_TIPODET, "9");
conf->set(RMI_IMPONIBILE, importo.string());
conf->set(RMI_IMPOSTA, imposta.string());
conf->set(RMI_GRUPPO, gruppo);
conf->set(RMI_CONTO, conto);
conf->set(RMI_SOTTOCONTO, sottoconto);
}
}
}
if (conf != NULL)

View File

@ -224,32 +224,39 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
TFilename outdir(_msk->get(F_PATHOUT));
TImporta_galileo_recset s(file);
TImporta_galileo_recset st(filesto);
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;
const int lastes = esc.last();
const int eschiuso = esc.pred(lastes);
const int codes = _msk->get_int(F_ANNOES);
real val;
TAssoc_array sto_keys;
TString16 key;
TString16 pos;
for (bool ok = st.move_first(); ok ; ok = st.move_next())
{
const long dtst = st.get(CDDTAS).as_int();
const int annoes = st.get(ANNOAS).as_int();
{
TProgind pk(s.items(),"Creazione indice storico ...",true,true);
if (ditta == dtst && annoes == eschiuso)
for (bool ok = st.move_first(); ok ; ok = st.move_next())
{
const long codces = st.get(CCESAS).as_int();
key.format("%010ld", codces);
pos.format("%ld", st.current_row());
sto_keys.add(key, pos);
if (!pk.addstatus(1))
break;
const long dtst = st.get(CDDTAS).as_int();
const int annoes = st.get(ANNOAS).as_int();
if (ditta == dtst && annoes == codes)
{
const long codces = st.get(CCESAS).as_int();
key.format("%010ld", codces);
pos.format("%ld", st.current_row());
sto_keys.add(key, pos);
}
}
}
for (bool ok = s.move_first(); ok ; ok = s.move_next())
TProgind pi(s.items(),"Importazione cespiti in corso ...",true,true);
for (bool ok = s.move_first(); ok ; ok = s.move_next())
{
if (!pi.addstatus(1))
break;
@ -276,11 +283,12 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
conf.set(CESPI_IDCESPITE, scodces);
str = s.get(DCESAA).as_string();
str << ' ' << s.get(SIGLAA).as_string();
/* str << ' ' << s.get(SIGLAA).as_string();
str << ' ' << s.get(DACEAA).as_string();
str << ' ' << s.get(MATRAA).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_TPSPEMAN, s.get(FLSMAA).as_bool() ? 2 : 1);
@ -320,9 +328,13 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
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));
conf.set_paragraph("143"); // setto il paragrafo del file salce
conf.set(SALCE_IDCESPITE, scodces);
conf.set(SALCE_CODES, eschiuso);
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();
@ -348,7 +360,7 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
*/
conf.set_paragraph("136"); // setto il paragrafo del file ammce fiscale
conf.set(AMMCE_IDCESPITE, scodces);
conf.set(AMMCE_CODES, eschiuso);
conf.set(AMMCE_CODES, codes);
val = s.get(PFANAS).as_real() + s.get(VAFNAS).as_real(); // prog amm norm fisc
conf.set(AMMCE_QNOR, val.string());
val = s.get(VAMAAS).as_real(); // val amm acc fisc
@ -358,7 +370,7 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
conf.set_paragraph("-1"); // setto il paragrafo del file ammce civilistico
conf.set(AMMCE_IDCESPITE, scodces);
conf.set(AMMCE_CODES, eschiuso);
conf.set(AMMCE_CODES, codes);
val = s.get(FANCAS).as_real() + s.get(VFNCAS).as_real(); // prog amm norm civ
conf.set(AMMCE_QNOR, val.string());
val = s.get(VALCAS).as_real(); // val amm acc civ
@ -368,7 +380,7 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
conf.set_paragraph("-2"); // setto il paragrafo del file ammce gestionale
conf.set(AMMCE_IDCESPITE, scodces);
conf.set(AMMCE_CODES, eschiuso);
conf.set(AMMCE_CODES, codes);
val = s.get(PFANAS2).as_real() + s.get(VAFNAS2).as_real(); // prog amm norm gest
conf.set(AMMCE_QNOR, val.string());
val = s.get(VALCAS).as_real(); // val amm acc gest
@ -454,7 +466,7 @@ void TImporta_cesp::main_loop()
TFilename name = _msk->get(F_PATH);
name.add(_msk->get(F_NAME));
TFilename namesto = _msk->get(F_PATH);
name.add(_msk->get(F_NAME_STO));
namesto.add(_msk->get(F_NAME_STO));
transfer(name, namesto);
}
}

View File

@ -6,3 +6,4 @@
#define F_NAME 104
#define F_NAME_STO 105
#define F_PATHOUT 106
#define F_ANNOES 107

View File

@ -49,7 +49,7 @@ BEGIN
FLAGS "D"
END
GROUPBOX DLG_NULL 90 5
GROUPBOX DLG_NULL 90 6
BEGIN
PROMPT 2 4 "@bSorgente"
END
@ -76,14 +76,27 @@ BEGIN
CHECKTYPE REQUIRED
END
NUMBER F_ANNOES 4
BEGIN
PROMPT 3 8 "Esercizio "
USE ESC
INPUT CODTAB F_ANNOES
DISPLAY "Codice Esercizio" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio " D1
OUTPUT F_ANNOES CODTAB
FIELD AnnoEs
CHECKTYPE REQUIRED
END
GROUPBOX DLG_NULL 90 4
BEGIN
PROMPT 2 9 "@bDestinazione"
PROMPT 2 10 "@bDestinazione"
END
STRING F_PATHOUT 256 39
BEGIN
PROMPT 3 10 "Cartella "
PROMPT 3 11 "Cartella "
DSELECT
CHECKTYPE REQUIRED
FIELD ComOutPath