Getting the above error in vendors details; Upgraded from 2020r2 to 2022r2.
what could be the issue?
kindly assist, all responses will be highly appreciated.
see full code below;
using System;
using System.Collections.Generic;
using System.Collections;
using PX.Data;
using PX.Objects.GL;
using PX.Objects.CS;
using PX.Objects.CM;
using PX.Objects;
using PX.Objects.AP;
namespace PX.Objects.AP
{
public class APDocumentEnq_Extension : PXGraphExtension<APDocumentEnq>
{
public PXSelectOrderBy<APDocumentEnq.APDocumentResult, OrderBy<Asc<APDocumentEnq.APDocumentResult.docDate>>> Documents;
protected virtual IEnumerable documents()
{
decimal decCurrRunningBal = 0;
decimal decRunningBal = 0;
Dictionary<string, decimal> curydict = new Dictionary<string, decimal>();
BqlCommand query = Base.Documents.View.BqlSelect;
PXView view = new PXView(Base, true, query, Base.Documents.View.BqlDelegate);
int intStartRow = PXView.StartRow;
int intTotalRows = 0;
List<Object> list = view.Select(PXView.Currents, PXView.Parameters, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref intStartRow, PXView.MaximumRows, ref intTotalRows);
PXView.StartRow = 0;
foreach (PXResult<APDocumentEnq.APDocumentResult> item in list)
{
APDocumentEnq.APDocumentResult row = item;
APRegisterExt registerExt = this.Base.Documents.Cache.GetExtension<APRegisterExt>(row);
//KES Running Balance
decRunningBal += row.OrigDocAmt ?? 0;
//ed
//Foreign Running Balance
if (row.CuryID != "KWH")
{
if (curydict.ContainsKey(row.CuryID))
{
curydict[row.CuryID] += row.CuryOrigDocAmt ?? 0;
decCurrRunningBal = curydict[row.CuryID];
}
else
{
curydict[row.CuryID] = row.CuryOrigDocAmt ?? 0;
decCurrRunningBal = curydict[row.CuryID];
}
//ed decCurrRunningBal += row.CuryOrigDocAmt ?? 0;
}
registerExt.UsrCurrencyRbal = decCurrRunningBal;
registerExt.UsrVenderbal = decRunningBal;
}
return list;
}
//CODE FOR DISPLAYING DOCUMENT TAX
protected void APDocumentResult_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
APDocumentEnq.APDocumentResult row = (APDocumentEnq.APDocumentResult)e.Row;
if(row == null) return;
APRegisterExt extObj = cache.GetExtension<APRegisterExt>(row);
APInvoice invoiceObj = PXSelect<APInvoice, Where<APInvoice.refNbr, Equal<Required<APInvoice.refNbr>>,
And<APInvoice.docType, Equal<Required<APInvoice.docType>>>>>.Select(this.Base, row.RefNbr, row.DocType);
if(invoiceObj != null)
{
extObj.UsrTaxAmt = invoiceObj.CuryTaxTotal;
//cache.SetValue<APRegisterExt.usrTaxAmt>(e.Row,invoiceObj.CuryTaxTotal);
if(invoiceObj.CuryTaxTotal> 0) extObj.UsrTwopercent = (invoiceObj.CuryTaxTotal * 0.125m);
//var result = invoiceObj.CuryTaxTotal * 0.125m;
//if(invoiceObj.CuryTaxTotal> 0) cache.SetValue<APRegisterExt.usrTwopercent> (e.Row,result);
}
}
}
}