{
CommaIo commaIO;
container conData;
boolean first = false;
str recordLength;
str errorMessage;
FcsInfoLogHandling infoLogHandling;
#define.batchDetail('BD')
Filename = this.getPath();
commaIO = new CommaIo(Filename,#IO_Read);
if(!commaIO && commaIO.status() != IO_Status::Ok)
{
throw error(strFmt("@SYS19312",Filename));
}
try
{
while (commaIO.status() == IO_Status::Ok)
{
infoLogHandling = FcsInfoLogHandling::construct();
conData = commaIO.read();// To read file
if (!first && conData != connull())
{
RecordLength = conpeek(conData, 1);
if(strScan(RecordLength,#batchDetail,1,strLen(RecordLength)))
{
CustomerAccount = subStr(RecordLength,3,11);
_journalVoucher = subStr(RecordLength,14,14);
responsecode = subStr(RecordLength,81,4);
ledgerdate = substr(RecordLength,71,10);
billingdate = str2Date(ledgerdate, 213);
responsecode2 = Incoming::find(responsecode,false).Responsecode;
if(responsecode2)
{
select forupdate ledgerjournaltable where ledgerjournaltable.Posted == NoYes::No
&& ledgerjournaltable.JournalNum == TEST-00042';//ledgerjournaltrans.JournalNum// '
{
ttsBegin;
this.postJournalLines(ledgerjournaltable);
ttsCommit;
}
}
}
}
}
}
catch
{
errorMessage = (strFmt("@SYS79", SysWorkflowHelper::getInfoLogMessage(2), fileName));
this.finalActions(errorMessage);
}
this.moveFile(errorMessage,fileName);
}