From decfdd759a5ddda9b09b1aa12a3a8fd9f59458f0 Mon Sep 17 00:00:00 2001 From: angelo Date: Wed, 12 Nov 1997 16:47:01 +0000 Subject: [PATCH] Correzioni errori MI2371 e MI2373 relativi al trasferimento del codice IVA di compensazione sul piano dei conti. git-svn-id: svn://10.65.10.50/trunk@5607 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg6600.cpp | 2 ++ cg/cg6901.cpp | 10 ++++++- cg/cg6902.cpp | 4 +++ cg/cg6904.cpp | 73 ++++++++++++++++++++++++++------------------------ cg/cgtrc.ini | 3 ++- cg/cgtrcpc.ini | 1 + 6 files changed, 56 insertions(+), 37 deletions(-) diff --git a/cg/cg6600.cpp b/cg/cg6600.cpp index 8e15329fd..3a4cc6a2f 100755 --- a/cg/cg6600.cpp +++ b/cg/cg6600.cpp @@ -720,6 +720,7 @@ void TRic_tab::scrivi_pcon(TRectype& pcon,bool esiste) char sezsaldi = _tpcon->get_char(PCN_SEZSALDI); bool sospeso = _tpcon->get_bool(PCN_SOSPESO); int ricser = _tpcon->get_int (PCN_RICSER); + TString ivacomp = _tpcon->get(PCN_IVACOMP); pcon.zero(); pcon.put(PCN_GRUPPO, g); @@ -738,6 +739,7 @@ void TRic_tab::scrivi_pcon(TRectype& pcon,bool esiste) pcon.put(PCN_SEZSALDI, sezsaldi); pcon.put(PCN_SOSPESO, sospeso); pcon.put(PCN_RICSER, ricser); + pcon.put(PCN_IVACOMP, ivacomp); } void TRic_tab::conto(TRectype& pcon,char flag,bool esiste) diff --git a/cg/cg6901.cpp b/cg/cg6901.cpp index d3c1e44c1..2085e2e2e 100755 --- a/cg/cg6901.cpp +++ b/cg/cg6901.cpp @@ -399,12 +399,13 @@ void TLista_archivi::controlla_clifo(char file) void TLista_archivi::controlla_pcon(char file) { TPrintrow row; - TString str; + TString str, ivacomp; bool errore = FALSE; bool salto = FALSE; bool intesta = TRUE; TString_array stampa(10); + _pcon->setkey(1); _pcon->zero(); @@ -415,6 +416,7 @@ void TLista_archivi::controlla_pcon(char file) int gruppo = _pcon->get_int (PCN_GRUPPO); int conto = _pcon->get_int (PCN_CONTO); long sottoc = _pcon->get_long(PCN_SOTTOCONTO); + ivacomp = _pcon->get(PCN_IVACOMP); if (gruppo > 99) { @@ -428,6 +430,12 @@ void TLista_archivi::controlla_pcon(char file) stampa.add(" - Rilevato un conto composto da 3 cifre"); } + if (!controlla_valore(ivacomp,99,2)) + { + errore = TRUE; + stampa.add(" - Rilevato un codice IVA di compensazione non valido"); + } + if (errore) { TString app; diff --git a/cg/cg6902.cpp b/cg/cg6902.cpp index 1ed2ea137..32e158860 100755 --- a/cg/cg6902.cpp +++ b/cg/cg6902.cpp @@ -945,6 +945,10 @@ bool TInv_cont::invio_pcon() int numop = _tpcon->get_int(PCN_NUMIVDOPP); str.format("%02d", numop); record.overwrite(str,72); //Numero arabo IV dir + + int ivacomp = atoi(_tpcon->get(PCN_IVACOMP)); + str.format("%02d",ivacomp); + record.overwrite(str,89); // Codice IVA di compensazione } _numrec_pcon++; diff --git a/cg/cg6904.cpp b/cg/cg6904.cpp index 6d5aa0105..6429820bc 100755 --- a/cg/cg6904.cpp +++ b/cg/cg6904.cpp @@ -482,10 +482,10 @@ void TInv_cont::invio_piano_conti() _prog = new TProgind(cicli,"Anagrafica Piano Conti: generazione file TRASFER per PC\nPrego attendere.",FALSE); _tras_file.open(_trasf,TRUE); + TString str, work_string; for (_tpcon->first(); !_tpcon->eof(); _tpcon->next()) { - TString str; _prog->addstatus(1); @@ -503,8 +503,8 @@ void TInv_cont::invio_piano_conti() str.format("%03d", g); record.overwrite(str,2); //Gruppo - TString descr (_tpcon->get(PCN_DESCR)); - str.format("%-50s", (const char*) descr); + work_string = _tpcon->get(PCN_DESCR); + str.format("%-50s", (const char*) work_string); record.overwrite(str,60); //Descrizione gruppo } @@ -519,16 +519,16 @@ void TInv_cont::invio_piano_conti() str.format("%03d", c); record.overwrite(str,5); //Conto - TString descr (_tpcon->get(PCN_DESCR)); - str.format("%-50s", (const char*) descr); + work_string = _tpcon->get(PCN_DESCR); + str.format("%-50s", (const char*) work_string); record.overwrite(str,60); //Descrizione conto int indbil = _tpcon->get_int(PCN_INDBIL); str.format("%d", indbil); record.overwrite(str,110); //Indicatore di bilancio - TString tmcf = _tpcon->get(PCN_TMCF); - record.overwrite(tmcf,111); //Flag conto cliente/fornitore + work_string = _tpcon->get(PCN_TMCF); + record.overwrite(work_string,111); //Flag conto cliente/fornitore bool stsottbil = _tpcon->get_bool(PCN_STSOTTBIL); if (stsottbil) @@ -544,13 +544,13 @@ void TInv_cont::invio_piano_conti() // Classe IV direttiva CEE - TString sez = _tpcon->get(PCN_SEZIVD); - if (sez == "0") - sez = " "; - record.overwrite(sez,114); //Sezione IV dir + work_string = _tpcon->get(PCN_SEZIVD); + if (work_string == "0") + work_string = " "; + record.overwrite(work_string,114); //Sezione IV dir - TString let = _tpcon->get(PCN_LETTIVD); - record.overwrite(let,115); //Lettera IV dir + work_string = _tpcon->get(PCN_LETTIVD); + record.overwrite(work_string,115); //Lettera IV dir int numrom = atoi(_tpcon->get(PCN_NUMRIVD)); str.format("%8d", numrom); @@ -562,13 +562,13 @@ void TInv_cont::invio_piano_conti() // Classe IV direttiva CEE di segno opposto - TString sezop = _tpcon->get(PCN_SEZIVDOPP); - if (sezop == "0") - sezop = " "; - record.overwrite(sezop,126); //Sezione IV dir + work_string = _tpcon->get(PCN_SEZIVDOPP); + if (work_string == "0") + work_string = " "; + record.overwrite(work_string,126); //Sezione IV dir - TString letop = _tpcon->get(PCN_LETTIVDOPP); - record.overwrite(letop,127); //Lettera IV dir + work_string = _tpcon->get(PCN_LETTIVDOPP); + record.overwrite(work_string,127); //Lettera IV dir int numromop = atoi(_tpcon->get(PCN_NUMRIVDOPP)); str.format("%8d", numromop); @@ -593,16 +593,16 @@ void TInv_cont::invio_piano_conti() str.format("%06ld", s); record.overwrite(str,8); //Sottoconto - TString descr (_tpcon->get(PCN_DESCR)); - str.format("%-50s", (const char*) descr); + work_string = _tpcon->get(PCN_DESCR); + str.format("%-50s", (const char*) work_string); record.overwrite(str,60); //Descrizione sottoconto int tipospric = _tpcon->get_int(PCN_TIPOSPRIC); str.format("%d", tipospric); record.overwrite(str,110); //Tipo costo/ricavo - TString sezsaldi = _tpcon->get(PCN_SEZSALDI); - record.overwrite(sezsaldi,111); + work_string = _tpcon->get(PCN_SEZSALDI); + record.overwrite(work_string,111); bool sospeso = _tpcon->get_bool(PCN_SOSPESO); if (sospeso) @@ -612,13 +612,13 @@ void TInv_cont::invio_piano_conti() // Classe IV direttiva CEE - TString sez = _tpcon->get(PCN_SEZIVD); - if (sez == "0") - sez = " "; - record.overwrite(sez,113); //Sezione IV dir + work_string = _tpcon->get(PCN_SEZIVD); + if (work_string == "0") + work_string = " "; + record.overwrite(work_string,113); //Sezione IV dir - TString let = _tpcon->get(PCN_LETTIVD); - record.overwrite(let,114); //Lettera IV dir + work_string = _tpcon->get(PCN_LETTIVD); + record.overwrite(work_string,114); //Lettera IV dir int numrom = atoi(_tpcon->get(PCN_NUMRIVD)); str.format("%8d", numrom); @@ -630,13 +630,13 @@ void TInv_cont::invio_piano_conti() // Classe IV direttiva CEE di segno opposto - TString sezop = _tpcon->get(PCN_SEZIVDOPP); - if (sezop == "0") - sezop = " "; - record.overwrite(sezop,125); //Sezione IV dir + work_string = _tpcon->get(PCN_SEZIVDOPP); + if (work_string == "0") + work_string = " "; + record.overwrite(work_string,125); //Sezione IV dir - TString letop = _tpcon->get(PCN_LETTIVDOPP); - record.overwrite(letop,126); //Lettera IV dir + work_string = _tpcon->get(PCN_LETTIVDOPP); + record.overwrite(work_string,126); //Lettera IV dir int numromop = atoi(_tpcon->get(PCN_NUMRIVDOPP)); str.format("%8d", numromop); @@ -649,6 +649,9 @@ void TInv_cont::invio_piano_conti() int ricser = _tpcon->get_int(PCN_RICSER); str.format("%d", ricser); record.overwrite(str,137); //Tipo attivita' + + TString work_string = _tpcon->get(PCN_IVACOMP); + record.overwrite(work_string,138); //Codice IVA compensazine } _numrec_pcon++; diff --git a/cg/cgtrc.ini b/cg/cgtrc.ini index bd02b4db8..863542e10 100755 --- a/cg/cgtrc.ini +++ b/cg/cgtrc.ini @@ -164,6 +164,7 @@ P3|4|7|12|19|SOTTOCONTO||| P3|5|16|45|19|DESCR|1|| P3|6|46|46|19|TIPOSPRIC||| P3|7|47|47|19|RICSER||| +P3|8|90|91|19|IVACOMP||| #P3|8|48|48|19|SEZIVD||| #P3|9|49|49|19|LETTIVD||| #P3|10|60|62|19|NUMRIVD||| @@ -338,4 +339,4 @@ B1|207|36|37|30|NRATA||| B1|208|153|153|30|SEZ||| B1|209|117|127|30|IMPORTO||| B1|210|128|140|30|IMPORTOVAL|3|3| -B1|211|1|1|30|IMP||| \ No newline at end of file +B1|211|1|1|30|IMP||| diff --git a/cg/cgtrcpc.ini b/cg/cgtrcpc.ini index 8b7efa507..104c44ab7 100755 --- a/cg/cgtrcpc.ini +++ b/cg/cgtrcpc.ini @@ -134,6 +134,7 @@ P3|13|127|127|19|LETTIVDOPP||| P3|14|128|135|19|NUMRIVDOPP||| P3|15|136|137|19|NUMIVDOPP||| P3|16|138|138|19|RICSER||| +P3|17|139|142|19|IVACOMP||| Z1|1|3|9|23|NUMREG||| Z1|2|61|68|23|DATAREG|2|| Z1|3|69|76|23|DATACOMP|2||