Hii,
I have a customized SSRS report based on RDP class that shows vendor advance payments.
The requirement is to show both currencies. Local accounting currency is SAR.
If all transactions/payments currency is e.g. EUR then dr, cr and balance is correct in Foreign Currency and SAR in above report.
But if pay in different currency as in above case SAR is not converting to foreign currency.
Please guide how we can convert SAR to foreign currency in this case. I am using RDP for business logic.
Here is the x++.
[SysEntryPointAttribute]
public void processReport()
{
CustVendTransDetails vendTransDetails;
VendPrepaymentContract4 vendPrepaymentContact4 = this.parmDataContract();
QueryRun queryRun_VendAccountStatementInt;
fromDate = vendPrepaymentContact4.parmFromDate();
toDate = vendPrepaymentContact4.parmToDate();
invoiceType = vendPrepaymentContact4.parmInvoiceType();
if (BankLCImportFeatureChecker::checkBankLCImportEnabled())
{
bankLCBankDocumentType = vendPrepaymentContact4.parmBankLCBankDocumentType();
}
custVendTransDetails = new CustVendTransDetails(vendTrans, this.assessmentDate());
queryRun_VendAccountStatementInt = new QueryRun(this.parmQuery());
this.initVendTransQuery();
this.init();
while (queryRun_VendAccountStatementInt.next())
{
vendTable = queryRun_VendAccountStatementInt.get(tableNum(VendTable));
vendTransQueryRun.reset();
vendTransQueryRun.query().dataSourceTable(tableNum(VendTrans)).rangeField(fieldNum(VendTrans,AccountNum)).value(SysQuery::value(vendTable.AccountNum));
while (vendTransQueryRun.next())
{
if (SysReportRun::changed(vendTransQueryRun,tableNum(VendTrans)))
{
vendTrans = vendTransQueryRun.get(tableNum(VendTrans));
select firstFast vendInvoiceJour where vendInvoiceJour.InvoiceId == vendTrans.Invoice;
this.insertVendPrepaymentTmp4();
}
}
}
}
private void insertVendPrepaymentTmp4()
{
vendPrepaymentTmp4.clear();
vendPrepaymentTmp4.AccountNum = vendTable.AccountNum;
vendPrepaymentTmp4.Voucher = vendTrans.Voucher;
vendPrepaymentTmp4.TransDate = vendTrans.TransDate;
vendPrepaymentTmp4.Txt = vendTrans.Txt;
vendPrepaymentTmp4.Debit = this.debitBalanceMST();
vendPrepaymentTmp4.Credit = -(this.creditBalanceMST());
vendPrepaymentTmp4.CurrencyCode = vendTrans.CurrencyCode;
vendPrepaymentTmp4.TraceNum = vendTrans.traceNum();
vendPrepaymentTmp4.Reversed = this.reversed();
vendPrepaymentTmp4.Name = vendTable.name();
vendPrepaymentTmp4.InternalInvoiceId = vendInvoiceJour.InternalInvoiceId;
vendPrepaymentTmp4.TransType = vendTrans.TransType;
vendPrepaymentTmp4.AmountCurrencyDebit = this.debitBalanceCur(); vendPrepaymentTmp4.AmountCurrencyCredit = -(this.creditBalanceCur()); balance = vendPrepaymentTmp4.Debit + this.creditBalanceMST(); balanceCur = vendPrepaymentTmp4.AmountCurrencyDebit + this.creditBalanceCur(); vendPrepaymentTmp4.Balance = balance; vendPrepaymentTmp4.BalanceCur = balanceCur;
if(vendTrans.Invoice)
vendPrepaymentTmp4.DocumentNum = vendTrans.Invoice;
else
vendPrepaymentTmp4.DocumentNum = vendTrans.DocumentNum;
vendPrepaymentTmp4.insert();
}
}
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (