public void processReport()
{
FromDate FromDate;
ToDate Todate;
Name RealEntity;
Query query;
QueryRun queryRun;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
PurchTable purchTable;
PurchTableVersion purchTableVersion;
Accurate_SrsRdpContractSample dataContract;
int counter,counter1;
VendPackingSlipJour vendpackingslipjour;
VendPackingSlipVersion vendpackingslipjourversion;
VendInvoiceJour vendinvoicejour;
SalesTable salestable;
CustConfirmJour custconfirmjour;
ProjJournalTable projjournaltable;
InventJournalTrans inventjournaltrans;
LedgerJournalTable ledgerjournaltable;
LedgerJournalTrans ledgerjournaltrans;
CustInvoiceTable custinvoicetable;
dataContract = this.parmDataContract();
FromDate = dataContract.parmFromDate();
Todate= dataContract.parmToDate();
RealEntity = dataContract.parmRealEntity();
//fetching values for PO ENTERING
while select PurchId from purchTable where purchTable.dataAreaId==RealEntity
&& purchTable.PurchStatus==PurchStatus::Backorder
&& purchTable.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& purchTable.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
if(purchTable.PurchId)
{
counter++;
}
select count(RecId) from purchTableVersion group by purchTableVersion.PurchId where
purchTableVersion.PurchId==purchTable.PurchId
&& purchTableVersion.VersionDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& purchTableVersion.VersionDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
&& purchTableVersion.recVersion>1;
if(purchTableVersion.recId)
{
counter1++;
}
}
tmpAccuracyTbl.Type=" PO Entering ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//fetching values for PO RECEIVING
while select PurchId from vendpackingslipjour
where vendpackingslipjour.dataAreaId==RealEntity
&& vendpackingslipjour.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& vendpackingslipjour.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
if(vendpackingslipjour.PurchId)
{
counter=counter+1;
}
while select count(RecId) from vendpackingslipjourversion
where vendpackingslipjourversion.VendPackingSlipJour==vendpackingslipjour.RecId
&& vendpackingslipjourversion.VersionDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& vendpackingslipjourversion.VersionDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
if(vendpackingslipjourversion.RecId>1)
{
counter1=counter1+1;
}
}
}
tmpAccuracyTbl.Type=" PO Receiving ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//fetching values for PO INVOICING-----WRONG LOGIC-----------
select count(RecId) from vendinvoicejour where vendinvoicejour.dataAreaId==RealEntity
&& vendinvoicejour.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& vendinvoicejour.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"));
counter=vendinvoicejour.RecId;
while select PurchId,count(RecId) from vendinvoicejour group by vendinvoicejour.PurchId
where vendinvoicejour.dataAreaId==RealEntity
&& vendinvoicejour.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& vendinvoicejour.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
&& vendinvoicejour.PurchId!=""
{
counter1+=vendinvoicejour.RecId-1;
}
tmpAccuracyTbl.Type=" PO Invoicing ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//PO payments
while select JournalNum from ledgerjournaltable where ledgerjournaltable.JournalType==LedgerJournalType::Payment
&& ledgerjournaltable.dataAreaId==RealEntity
&& ledgerjournaltable.PostedDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& ledgerjournaltable.PostedDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
select count(RecId) from ledgerjournaltrans where ledgerjournaltrans.JournalNum==ledgerjournaltable.JournalNum
&& ledgerjournaltrans.TransDate==FromDate
&& ledgerjournaltrans.TransDate==Todate;
counter=counter+ledgerjournaltrans.RecId;
select count(RecId) from ledgerjournaltrans where ledgerjournaltrans.JournalNum==ledgerjournaltable.JournalNum
&& ledgerjournaltrans.AmountCurDebit<0
&& ledgerjournaltrans.TransDate==FromDate
&& ledgerjournaltrans.TransDate==Todate;
counter1=counter1+ledgerjournaltrans.RecId;
}
tmpAccuracyTbl.Type=" PO Payment ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//SalesOrder Entering
while select SalesId from salestable
where salestable.dataAreaId==RealEntity
&& salestable.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& salestable.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
if(salestable.SalesId)
{
counter++;
}
while select count(RecId) from custconfirmjour
where custconfirmjour.SalesId==salestable.SalesId
&& custconfirmjour.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& custconfirmjour.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
if(custconfirmjour.RecId>1)
{
counter1++;
}
}
}
tmpAccuracyTbl.Type=" SO Entering ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//SO payments
while select JournalNum from ledgerjournaltable where ledgerjournaltable.JournalType==LedgerJournalType::CustPayment
&& ledgerjournaltable.dataAreaId==RealEntity
&& ledgerjournaltable.PostedDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& ledgerjournaltable.PostedDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
select count(RecId) from ledgerjournaltrans where ledgerjournaltrans.JournalNum==ledgerjournaltable.JournalNum
&& ledgerjournaltrans.TransDate==FromDate
&& ledgerjournaltrans.TransDate==Todate;
counter=counter+ledgerjournaltrans.RecId;
select count(RecId) from ledgerjournaltrans where ledgerjournaltrans.JournalNum==ledgerjournaltable.JournalNum
&& ledgerjournaltrans.AmountCurDebit<0
&& ledgerjournaltrans.TransDate==FromDate
&& ledgerjournaltrans.TransDate==Todate;
counter1=counter1+ledgerjournaltrans.RecId;
}
tmpAccuracyTbl.Type=" SO Payment ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//SO_invoice freetext
while select RecId from custinvoicetable where custinvoicetable.createdDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& custinvoicetable.createdDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
{
counter++;
if(custinvoicetable.displayCorrectionState(custinvoicetable)=="Corrected")
{
counter1++;
}
}
tmpAccuracyTbl.Type=" SO Freetext Invoice ";
tmpAccuracyTbl.TotalRecords=counter-counter1;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//Project Hour journal
select count(RecId) from projjournaltable where projjournaltable.PostedDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& projjournaltable.PostedDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
&& projjournaltable.dataAreaId==RealEntity;
counter=projjournaltable.RecId;
select count(RecId) from projjournaltable where projjournaltable.ProjQty<0
&& projjournaltable.PostedDateTime>=DateTimeUtil::newDateTime(FromDate,str2time("00:00:00"))
&& projjournaltable.PostedDateTime<=DateTimeUtil::newDateTime(Todate,str2time("24:00:00"))
&& projjournaltable.dataAreaId==RealEntity;
counter1=projjournaltable.RecId;
tmpAccuracyTbl.Type=" Project Hour Journal ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
//Project Item journal
select count(RecId) from inventjournaltrans where inventjournaltrans.TransDate>=FromDate
&& inventjournaltrans.dataAreaId==RealEntity
&& inventjournaltrans.TransDate<=Todate;
counter=inventjournaltrans.RecId;
select count(RecId) from inventjournaltrans where inventjournaltrans.Qty<0
&& inventjournaltrans.TransDate>=FromDate
&& inventjournaltrans.dataAreaId==RealEntity
&& inventjournaltrans.TransDate<=Todate;
counter1=inventjournaltrans.RecId;
tmpAccuracyTbl.Type=" Project Item Journal ";
tmpAccuracyTbl.TotalRecords=counter;
tmpAccuracyTbl.CorrectedRecord=counter1;
tmpAccuracyTbl.Accuracy=((counter-counter1)/minOne(counter));
tmpAccuracyTbl.insert();
counter=0;
counter1=0;
}
Accuracy Report of AX 2012
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.