diff --git a/ps/ps0713500.cpp b/ps/ps0713500.cpp index ad49cafbb..8ef1bf687 100755 --- a/ps/ps0713500.cpp +++ b/ps/ps0713500.cpp @@ -106,6 +106,7 @@ long TImporta_spese_app::genera_movcg() mov.put(MOV_NUMREG, numreg); mov.put(MOV_DATACOMP, datareg); mov.put(MOV_DATAREG, datareg); + mov.put(MOV_CODCAUS, _msk->get(F_CODCAU)); mov.write(); return numreg; @@ -232,6 +233,9 @@ bool TImporta_spese_app::transfer() chiudi_movimento(configfile, tot_doc, data, numreg, righean); numreg = genera_movcg(); + TLocalisamfile mov(LF_MOV); + mov.put(MOV_NUMREG, numreg); + mov.remove(); TFilename filename(nomeini); filename.fremove(); @@ -258,7 +262,7 @@ bool TImporta_spese_app::transfer() tot_doc -= importo; TString8 paragraph; - paragraph.format("%d,%d",LF_RMOV,nriga++); + paragraph.format("%d,%d", LF_RMOV, nriga++); configfile.set_paragraph(paragraph); configfile.set(RMV_IMPORTO, importo.valore().string()); diff --git a/ps/ps0713600.cpp b/ps/ps0713600.cpp index be7d9105d..741c44868 100755 --- a/ps/ps0713600.cpp +++ b/ps/ps0713600.cpp @@ -202,6 +202,7 @@ long TImporta_fat_for_app::genera_movcg() mov.put(MOV_NUMREG, numreg); mov.put(MOV_DATACOMP, _msk->get_date(F_DATAREG)); mov.put(MOV_DATAREG, _msk->get_date(F_DATAREG)); + mov.write(); return numreg; @@ -374,10 +375,16 @@ void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TCommessa_string& real rimposta = imp * iva / CENTO; rimposta.round(2); + TCommessa comm(idlav); + TCommessa_string cmsstr = comm.cmsstr(); + configfile->set(RMI_ANNOES, anno); configfile->set(RMI_IMPONIBILE, importo.valore().string()); configfile->set(RMI_CODIVA, codiva); - configfile->set(RMI_IMPOSTA, rimposta.string()); + configfile->set(RMI_IMPOSTA, rimposta.string()); + configfile->set(RMI_GRUPPO, cmsstr.gruppo()); + configfile->set(RMI_CONTO, cmsstr.conto()); + configfile->set(RMI_SOTTOCONTO, cmsstr.sotco()); configfile->set(RMI_TIPOATT, 1); } } @@ -398,6 +405,9 @@ void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TCommessa_string& configfile->set(RMI_IMPONIBILE, importo.valore().string()); configfile->set(RMI_CODIVA, codiva); configfile->set(RMI_IMPOSTA, rimposta.string()); + configfile->set(RMI_GRUPPO, kmax.gruppo()); + configfile->set(RMI_CONTO, kmax.conto()); + configfile->set(RMI_SOTTOCONTO, kmax.sotco()); configfile->set(RMI_TIPOATT, 1); } @@ -444,10 +454,15 @@ void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TCommessa_stri TImporto importo(causale.get("SEZIONE")[0], totdoc); - configfile->set(RMV_ANNOES, anno); - configfile->set(RMV_SEZIONE, causale.get("SEZIONE")); - configfile->set(RMV_IMPORTO, importo.valore().string()); - configfile->set(RMV_TIPOC, causale.get("TIPOCF")); + configfile->set(RMV_ANNOES, anno); + configfile->set(RMV_SEZIONE, causale.get("SEZIONE")); + configfile->set(RMV_IMPORTO, importo.valore().string()); + configfile->set(RMV_TIPOC, causale.get("TIPOCF")); + configfile->set(RMV_GRUPPO, causale.get("GRUPPO")); + configfile->set(RMV_CONTO, causale.get("CONTO")); + configfile->set(RMV_SOTTOCONTO, _msk->get_long(F_CODFOR)); + configfile->set(RMV_TIPOC, "F"); + configfile->set(RMV_ROWTYPE, "T"); key.add(2,1); const TRectype& causale2 = cache().get(LF_RCAUSALI, key); @@ -500,7 +515,11 @@ void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TCommessa_stri //GESTIONE_INI: metodo che si occupa di generare il file ini e di importarlo effettivamente void TImporta_fat_for_app::gestione_ini(TAssoc_array& righe, TCommessa_string& kmax, const real& quad, const long numregcg) { - TConfig* configfile = NULL; + TLocalisamfile mov(LF_MOV); + mov.put(MOV_NUMREG, numregcg); + mov.remove(); + + TConfig* configfile = NULL; TFilename tmpdir; tmpdir.tempdir(); TFilename filename = tmpdir; @@ -509,7 +528,7 @@ void TImporta_fat_for_app::gestione_ini(TAssoc_array& righe, TCommessa_string& k configfile = new TConfig(filename, "Transaction"); //setto il paragrafo [Transaction] del file ini configfile->set_paragraph("Transaction"); - configfile->set("Action","MODIFY"); + configfile->set("Action","INSERT"); configfile->set("Mode","AUTO"); const int tipofat = _msk->get_int(F_TIPOFAT);