I'm trying to simply add a new total field to the Purchase Receipts screen header (the Total Amt that was removed in a more recent release of Acumatica for some reason). It seems like this should have been pretty straightforward, but I haven't been able to get any method I've tried to work; and before I try to manually total all of the detail lines myself in custom code when any change is made in the detail lines, I wanted to find out how to do this the proper way. I've tried the following methods so far that just don't seem to work and my total field remains at zero:
1.) PXFormula on the new custom field on a POReceipt DAC extension (I also tried using PXUnboundFormula since this is an unbound field):
[PXFormula(typeof(Mult<POReceiptLine.unitCost, POReceiptLine.receiptQty>), typeof(SumCalc<POReceiptExt.usrTotalAmt>))]
2.) PXFormula on a new custom field on a POReceiptLine DAC extension (I also tried using PXUnboundFormula since this is an unbound field):
[PXFormula(typeof(Mult<POReceiptLine.unitCost, POReceiptLine.receiptQty>), typeof(SumCalc<POReceiptExt.usrTotalAmt>))]
3.) PXDBCalced on a new custom field on a POReceiptLine DAC extension to perform the calc on each line:
[PXDBCalced(typeof(Mult<POReceiptLine.unitCost, POReceiptLine.receiptQty>), typeof(decimal))]
then try to total that with a new view
public PXSelectGroupBy<POReceiptLine, Where<POReceiptLine.receiptNbr, Equal<Required<POReceipt.receiptNbr>>>,Aggregate<GroupBy<POReceiptLine.receiptNbr, Sum<POReceiptLineExtension.usrLineAmt>>>> Totals;
4.) Defining a dataview method to build the view contents and total manually.
What is the proper method? Or, even if you could point me to the code from the previous release that calculated this total, I can possibly use that.