Markup::mcrCalcFixedProRated Method [AX 2012]
Calculates pro-rated misc charges for SalesLine and SalesTable.
Syntax
server private static MarkupAmount mcrCalcFixedProRated(
MarkupTrans _markupTrans,
AmountCur _absoluteValue,
Qty _qty,
[boolean _postingInvoice,
ParmId _parmId])
Run On
Server
Parameters
- _markupTrans
Type: MarkupTrans Table
The markup transaction record on which the pro-rated markup calculation will be performed.
- _absoluteValue
Type: AmountCur Extended Data Type
The absolute value of the current order markup.
- _qty
Type: Qty Extended Data Type
The inventory quantity of the order.
- _postingInvoice
Type: boolean
A value indicating if the invoice is in the process of being invoiced.
- _parmId
Type: ParmId Extended Data Type
The parm value used in child methods only.
Return Value
Type: MarkupAmount Extended Data Type
The calculated pro rated markup amount.
Remarks
Pro-rated misc charges always store the REMAINING misc charge in the value field. The pro-rated amount is calculated in this method.
During invoicing the pro-rated amount is copied to the value field of a new MarkupTrans record in the insertJournalMarkupTrans method. The pro-rated amount is subtracted from the original remaining amount to find the new remaining amount.
Calculating percentage of pro-rated misc charges using a "remaining amount" approach rather than a "total amount" approach.
a) In the total amount approach the denominator of proportion is total order amount. The proportion is multiplied by the total value of the misc. charge.
b) In the remaining amount approach the denominator of the proportion is the remaining order amount. The proportion is multiplied by the remaining value of the misc. charge.
Procedure for pro-rating SalesTable charges 1) Calculate remaining sales balance 2) Make SalesTotals object from _salesTable and calculate absolute value balance.