From a755b63affa48aff989d85b80ebadf6924e9c194 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 14 Jan 2010 07:43:30 +0000 Subject: [PATCH] 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@19920 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ps/pi0001100.cpp | 14 +++++++++++++- ps/pi0001200.cpp | 9 +-------- ps/pi0001200.h | 8 ++++++++ ps/pi0001300.cpp | 42 +++++++++++++++++++++--------------------- 4 files changed, 43 insertions(+), 30 deletions(-) create mode 100755 ps/pi0001200.h diff --git a/ps/pi0001100.cpp b/ps/pi0001100.cpp index 6ae05731a..72479cdc8 100755 --- a/ps/pi0001100.cpp +++ b/ps/pi0001100.cpp @@ -7,10 +7,13 @@ #include #include "../cg/cglib01.h" +#include "../cg/cg2103.h" + #include "pi0001.h" #include "pi0001100.h" #include "pi0001100a.h" +#include "pi0001200.h" #include #include @@ -241,6 +244,8 @@ void TImporta_mov::transfer(const TFilename& file) TArray rows; TArray impcg; TString_array concg; + TCausali_cache cache_causali; + for (bool ok=s.move_first();ok;ok=s.move_next()) { @@ -288,9 +293,17 @@ void TImporta_mov::transfer(const TFilename& file) conf->set("Mode","AUTO"); conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata) + TString8 codcaus = s.get(CAUSCM).as_string(); + + iva = s.get(TPMVCM).as_string() == "I"; if (atoi(codcaus) != 0) + { codcaus << '0'; + const TCausale & c = cache_causali.causale(codcaus, codes); + if (!iva && c.iva() != nessuna_iva) + codcaus.cut(0); + } conf->set(MOV_CODCAUS, codcaus); conf->set(MOV_DATAREG, datareg.string()); const int codpag = s.get(CDPGCM).as_int(); @@ -310,7 +323,6 @@ void TImporta_mov::transfer(const TFilename& file) conf->set(MOV_REGST, "X"); descr = s.get(DSUPCM).as_string(); - iva = s.get(TPMVCM).as_string() == "I"; if (iva) { diff --git a/ps/pi0001200.cpp b/ps/pi0001200.cpp index 0a42f1cb5..c1a7a487c 100755 --- a/ps/pi0001200.cpp +++ b/ps/pi0001200.cpp @@ -13,6 +13,7 @@ #include "pi0001.h" #include "pi0001100.h" +#include "pi0001200.h" #include "pi0001200a.h" #include @@ -75,14 +76,6 @@ #define CAMBPA2 29 // Cambio EURO DIZSMAS - CAME #define IMPOPA2 30 // Importo val 2 DIZSMAS - IMPO -class TCausali_cache : public TCache -{ -protected: - virtual TObject* key2obj(const char* key); - -public: - const TCausale& causale(const char* codice, int annoiva); -}; TObject* TCausali_cache::key2obj(const char* key) { diff --git a/ps/pi0001200.h b/ps/pi0001200.h new file mode 100755 index 000000000..84cfb5b77 --- /dev/null +++ b/ps/pi0001200.h @@ -0,0 +1,8 @@ +class TCausali_cache : public TCache +{ +protected: + virtual TObject* key2obj(const char* key); + +public: + const TCausale& causale(const char* codice, int annoiva); +}; diff --git a/ps/pi0001300.cpp b/ps/pi0001300.cpp index 5dd57e36a..9bd62694f 100755 --- a/ps/pi0001300.cpp +++ b/ps/pi0001300.cpp @@ -232,8 +232,24 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto) const int lastes = esc.last(); const int eschiuso = esc.pred(lastes); real val; + TAssoc_array sto_keys; + TString16 key; + TString16 pos; - for (bool ok = s.move_first() && st.move_first(); ok ; ok = s.move_next() && st.move_next()) + 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(); + + if (ditta == dtst && annoes == eschiuso) + { + 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()) { if (!pi.addstatus(1)) break; @@ -300,27 +316,11 @@ void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto) #define CESPI_FABBR06 "FABBR06" */ - long dtst = st.get(CDDTAS).as_int(); - long codcesst = st.get(CCESAS).as_int(); - - if (ditta == dtst && codces == codcesst) + TString * p = (TString *) sto_keys.objptr(key); + if (p != NULL) { - int annoes = st.get(ANNOAS).as_bool(); - - while (annoes != eschiuso) - { - ok = st.move_next(); - if (ok) - { - dtst = st.get(CDDTAS).as_int(); - codcesst = st.get(CCESAS).as_int(); - annoes = st.get(ANNOAS).as_bool(); - - if (ditta != dtst || codces != codcesst) - break; - } - } - conf.set_paragraph("143"); // setto il paragrafo del file salce + st.move_to(atol(*p)); + conf.set_paragraph("143"); // setto il paragrafo del file salce conf.set(SALCE_IDCESPITE, scodces); conf.set(SALCE_CODES, eschiuso); conf.set(SALCE_ANNIAMM, 1);