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
This commit is contained in:
alex 1995-06-28 12:29:40 +00:00
parent 4d8b8a661a
commit a84f5cdf6d
2 changed files with 75 additions and 1 deletions

View File

@ -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;

View File

@ -8,5 +8,7 @@ ACNV(24)=bacnv 1
ACNV(5)=bacnv 2
[199502]
ACNV(15)=bacnv 3
[199505]
ACNV(5)=bacnv 5
[EOF]