From a84f5cdf6d105e05e0ea1667fd5ae37361c7d990 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 28 Jun 1995 12:29:40 +0000 Subject: [PATCH] Conversione tabelle tpd ivd, causali e movimetni (errori (MI4151 e MI4153) git-svn-id: svn://10.65.10.50/trunk@1522 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/bacnv.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++- ba/fconv.ini | 2 ++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/ba/bacnv.cpp b/ba/bacnv.cpp index d22d390cf..6d9db1339 100755 --- a/ba/bacnv.cpp +++ b/ba/bacnv.cpp @@ -41,6 +41,7 @@ public: bool collate(TRectype & rec, const char * f1, const char * f2); void patch_com(void); void zero_770(void); + void convert_patty(void); TConversione_archivi() : _oldditta(0), _codditta(0), _error(0) {} }; @@ -114,6 +115,8 @@ bool TConversione_archivi::menu(MENU_TAG) case 4: if (_codditta == 0) zero_770(); + case 5: + convert_patty(); default: break; } @@ -300,6 +303,75 @@ void TConversione_archivi::zero_770() } } +void TConversione_archivi::convert_patty() +{ +{ + TTable ivd("%IVD"); + ivd.zero(); + ivd.put("CODTAB", "9E0023"); + if (ivd.read(_isequal, _lock) == NOERR) + ivd.remove(); +} +{ + TTable doc("%TPD"); + doc.zero(); + doc.put("CODTAB", "AN"); + if (doc.read(_isequal, _lock) == NOERR) + doc.remove(); + doc.zero(); + doc.put("CODTAB", "IN"); + if (doc.read(_isequal, _lock) == NOERR) + doc.remove(); + doc.zero(); + doc.put("CODTAB", "PG"); + if (doc.read(_isequal, _lock) == NOERR) + doc.remove(); + doc.zero(); + doc.put("CODTAB", "NA"); + if (doc.read(_isequal, _lock) == NOERR) + doc.remove(); +} +TDir d; +d.get(LF_CAUSALI); +if (d.eod() > 0L) +{ + TLocalisamfile caus(LF_CAUSALI); + + for (caus.first(_lock); caus.good(); caus.next(_lock)) + { + const TString16 tpd = caus.get("TIPODOC"); + + if (tpd == "AN") caus.zero("TIPODOC"); + else + if (tpd == "IN") caus.zero("TIPODOC"); + else + if (tpd == "PG") caus.zero("TIPODOC"); + else + if (tpd == "NA") caus.put("TIPODOC","NC"); + caus.rewrite(); + } +} +d.get(LF_MOV); +if (d.eod() > 0L) +{ + TLocalisamfile mov(LF_MOV); + + for (mov.first(_lock); mov.good(); mov.next(_lock)) + { + const TString16 tpd = mov.get("TIPODOC"); + + if (tpd == "AN") mov.zero("TIPODOC"); + else + if (tpd == "IN") mov.zero("TIPODOC"); + else + if (tpd == "PG") mov.zero("TIPODOC"); + else + if (tpd == "NA") mov.put("TIPODOC","NC"); + mov.rewrite(); + } +} +} + /////////////////////////////////////////////////////////// // Programma di conversione archivi speciale /////////////////////////////////////////////////////////// @@ -308,7 +380,7 @@ int main(int argc,char** argv) { const int r = (argc > 1) ? atoi(argv[1]) : 0; - if (r <= 0 || r > 4) + if (r <= 0 || r > 5) { error_box(usage); return 100; diff --git a/ba/fconv.ini b/ba/fconv.ini index deb178ae8..20b60a1e9 100755 --- a/ba/fconv.ini +++ b/ba/fconv.ini @@ -8,5 +8,7 @@ ACNV(24)=bacnv 1 ACNV(5)=bacnv 2 [199502] ACNV(15)=bacnv 3 +[199505] +ACNV(5)=bacnv 5 [EOF]