Hi,
Just looking for some advice or input. When we know in a standard class it has function that in the middle of the process we want to modify it. Is that possible and how ?
To be precise, the issue I found is in a class named : RevRecCustPostInvoiceDeferredNew, in their function named : createDeferredLinesForInvoice(), if by any chance the line is same, I will be directing to Line 1059
it has this code :
if (RevRecUtil::findDiscountAccountForSalesOrder(salesLineBuffer))
{
netDeferredLine.LineAmount = _custInvoiceTrans.SalesPrice * _custInvoiceTrans.Qty;
}
else
{
netDeferredLine.LineAmount = _custInvoiceTrans.LineAmount;
}
Problem I found is with the netDeferredLine.LineAmount, as in "why the system need to check it has main account for Discount" ? I cannot find a good reason of checking this but this checking makes LineAmount in CustInvoiceTrans being calculate by multiplying SalesPrice & Qty, not following what already stated in LineAmount.
Unless my investigation is wrong, but if I'm using Price Include Sales Tax, the LineAmount which already excluded tax will be wrong again since Sales Price in this field still included tax.
In SQL, the CustInvoiceTrans will be like this ->

And the point to my question is, this is in the middle of the method processing and after these code, the Line Amount will be used for other calculation as well, still inside the same method/function. So if I want to lets say modify it, lets say to ignore the Discount main account checking, how am I going to do that ?
Thanks,