diff --git a/cg/cg2600.cpp b/cg/cg2600.cpp index b463a8949..dcac46f64 100755 --- a/cg/cg2600.cpp +++ b/cg/cg2600.cpp @@ -1,13 +1,18 @@ // Ricezione dati da sistema -#include #include #include -#include +#include #include -#include #include - +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -397,6 +402,16 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec) if (field == "2") field = "F"; } + //Il tipo persona (fisica/giuridica) su AS400 puo' assumere come valori 1 e 0 + //mentre quello su PC F o G; devo fare la conversione. + if (fname == "TIPOPERS") + { + if (field == "1") + field = "F"; + + if (field == "0") + field = "G"; + } //Il codice pagamento su AS400 e' un alfanumerico di due, mentre su PC e' un //alfanumerico di 4 trattato con il flag Z. Dunque in ricezione se si tratta @@ -423,10 +438,19 @@ void TRic_tab::scrivi_record_tab(TString& record,long rec) //Quando ricevo la IV direttiva del piano dei conti per evitare che nell'archivio, //in caso di numero romano vuoto, venga memorizzato la stringa letta sul trasfer ("000"), //vuoto la stringa prima di fare la put. - if ( (sigla == "P2" || sigla == "P3") && (fname == "NUMRIVD" || fname == "NUMRIVDOPP") ) - if (field == "000") - field = ""; - + if (sigla == "P2" || sigla == "P3") + { + if (fname == "NUMRIVD" || fname == "NUMRIVDOPP") + { + if (field == "000") + field = ""; + } + if (fname == "SEZIVD" || fname == "SEZIVDOPP") + { + if (field == " ") + field = "0"; + } + } dep->put(fname, (const char*)field); numfield++; @@ -554,11 +578,11 @@ int TRic_tab::trasfer_data_conto(TLocalisamfile& file, TRectype& dep) } else { - dep.zero(PCN_SEZIVD); + dep.put(PCN_SEZIVD, "0"); dep.zero(PCN_LETTIVD); dep.zero(PCN_NUMRIVD); dep.zero(PCN_NUMIVD); - dep.zero(PCN_SEZIVDOPP); + dep.put(PCN_SEZIVDOPP, "0"); dep.zero(PCN_LETTIVDOPP); dep.zero(PCN_NUMRIVDOPP); dep.zero(PCN_NUMIVDOPP); @@ -595,11 +619,11 @@ int TRic_tab::trasfer_data_conto(TLocalisamfile& file, TRectype& dep) g = dep.get_int(PCN_GRUPPO); c = dep.get_int(PCN_CONTO); - dep.zero(PCN_SEZIVD); + dep.put(PCN_SEZIVD, "0"); dep.zero(PCN_LETTIVD); dep.zero(PCN_NUMRIVD); dep.zero(PCN_NUMIVD); - dep.zero(PCN_SEZIVDOPP); + dep.put(PCN_SEZIVDOPP, "0"); dep.zero(PCN_LETTIVDOPP); dep.zero(PCN_NUMRIVDOPP); dep.zero(PCN_NUMIVDOPP); @@ -635,7 +659,7 @@ int TRic_tab::trasfer_data_sottoc(TLocalisamfile& file, TRectype& dep) if (flag_IV == 'T') { - if (sez != '\0') + if (sez != '0') _tras_file.annulla_classi(g,c,FALSE); file.zero(); @@ -644,11 +668,11 @@ int TRic_tab::trasfer_data_sottoc(TLocalisamfile& file, TRectype& dep) } else { - dep.zero(PCN_SEZIVD); + dep.put(PCN_SEZIVD, "0"); dep.zero(PCN_LETTIVD); dep.zero(PCN_NUMRIVD); dep.zero(PCN_NUMIVD); - dep.zero(PCN_SEZIVDOPP); + dep.put(PCN_SEZIVDOPP, "0"); dep.zero(PCN_LETTIVDOPP); dep.zero(PCN_NUMRIVDOPP); dep.zero(PCN_NUMIVDOPP); @@ -675,7 +699,7 @@ int TRic_tab::trasfer_data_sottoc(TLocalisamfile& file, TRectype& dep) if (flag_IV == 'T') { - if (sez != '\0') + if (sez != '0') _tras_file.annulla_classi(g,c,FALSE); file.zero(); @@ -687,11 +711,11 @@ int TRic_tab::trasfer_data_sottoc(TLocalisamfile& file, TRectype& dep) g = dep.get_int(PCN_GRUPPO); c = dep.get_int(PCN_CONTO); - dep.zero(PCN_SEZIVD); + dep.put(PCN_SEZIVD, "0"); dep.zero(PCN_LETTIVD); dep.zero(PCN_NUMRIVD); dep.zero(PCN_NUMIVD); - dep.zero(PCN_SEZIVDOPP); + dep.put(PCN_SEZIVDOPP, "0"); dep.zero(PCN_LETTIVDOPP); dep.zero(PCN_NUMRIVDOPP); dep.zero(PCN_NUMIVDOPP);