PurchTable.setEndDiscFromVendInvoiceJour Method

On the PurchTable the DiscPercent is a percentage while on the VendInvoiceJour the EndDisc is an amount.

The algorithm to calculate the percentage based on enddisc and salesbalance from the vendinvoicejour and subsequently compare the result to that of the original PurchTable, if the difference is less than 0.1% then the original Purchtable's discpercent is utilized in order to mitigate from potential rounding issues.

If the original PurchTable is not available the calculated and rounded amount is used.

Syntax

public void setEndDiscFromVendInvoiceJour(VendInvoiceJour _vendInvoiceJour)

Run On

Called

Parameters

  • _vendInvoiceJour
    Type: VendInvoiceJour Table
    The VendInvoiceJour table buffer that is to calculate the PurchTable.DiscPercent field from.

Remarks

The algorithm that is used to calculate the percentage is based on the values of the EndDisc and SalesBalance fields from the VendInvoiceJour table. A comparison is made between the result of the calculation to that of the original PurchTable value. If the difference is less than 0.1%, then the original DiscPercent field value in the PurchTable table is used in order to reduce any potential rounding issues.

If the original PurchTable table values are not available, the calculated and rounded amount is used.

See Also

Reference

PurchTable Table