In my code not any display method .
I have created only one temp table and fetching the data from vend table & vend trans table for Total payable and total invoice , And i am able to do this . here i created one Real field which logic is like below
public NQDPOFinalTmp populateRecordAll()
{
NQDPOTmp DPO ;
NQDPOFinalTmp finaltmp;
VendTrans transation;
VendTable vendtable;
Name categorystr = Category.valueStr();
FromDate _fromdate = FromDates.dateValue();
ToDate _toDate = ToDates.dateValue();
Date d= prevYr(_toDate);
delete_from DPO;
while select * from transation join vendtable where transation.AccountNum ==vendtable.AccountNum &&
transation.ApprovedDate >= _fromdate &&
transation.ApprovedDate <= _toDate &&
((transation.Voucher like "*NAQ*") || (transation.Voucher like "*API*") ||
(transation.Voucher like "*GJV*")||(transation.Voucher like "*APP*"))
{
DPO.VendorCode = transation.AccountNum;
DPO.VendorName = transation.vendTableName();
DPO.TotalPayable = transation.AmountCur;
DPO.Closed = transation.Closed;
DPO.VendGroup = vendtable.VendGroup;
DPO.ApprovedDate = transation.ApprovedDate;
DPO.Voucher = transation.Voucher;
DPO.insert();
}
update_recordSet DPO
setting TotalInvoice = DPO.TotalPayable
where DPO.ApprovedDate >= d && ((DPO.Voucher like "*API*") || (DPO.Voucher like "*NAQ*"));
while select sum(TotalInvoice),sum(TotalPayable),VendorName,VendorCode,VendGroup from DPO
group by DPO.VendorCode,DPO.VendorName,DPO.VendGroup
{
ttsBegin;
finaltmp.VendorCode = DPO.VendorCode;
finaltmp.VendorName = DPO.VendorName;
finaltmp.TotalPayable = DPO.TotalPayable;
finaltmp.TotalInvoice = DPO.TotalInvoice;
finaltmp.VendGroup = DPO.VendGroup;
if(finaltmp.TotalPayable )
{
finaltmp.DPODays = DPO.TotalPayable/ minOne (DPO.TotalInvoice );
}
-----------------------------------------------------------------------------------------------------------------------------
My above code is working fine and i am able to get data , but below i am just multiplying with 365 for DPO Dyas field .
here the problem is if any record DPO Value is zero that row taking above record DPO Days field value.
if(finaltmp.TotalInvoice)
finaltmp.Days = finaltmp.DPODays*365;
finaltmp.insert();
ttsCommit;
}
return finaltmp;
}