How to prevent discount in Acumatica?

189 views Asked by At

I create Invoice by call graph, I want my invoice does not apply discount. Do we have tips to do that by code?

Thank everyone.

2

There are 2 answers

2
Sin On

TRY [Not tested]

The following code in your extension will help you to disable the discount feature for the invoice screen.

    [PXOverride]
    public virtual void RecalculateDiscounts(PXCache sender, ARTran line, Action<PXCache, ARTran> del)
    {
        //Dont call del here to disable discount
        //OR call del, only certain conditions matches to enable discount
    }
1
srodionov On

usually we call base method for UI but not for import, please look at the next approach

public class SOOrderEntryExtension : PXGraphExtension<SOOrderEntry>
{
    [PXOverride]
    public virtual void RecalculateDiscounts(PXCache sender, SOLine line, Action<PXCache, SOLine> del)
    {
        if (!Base.IsImport) del(sender, line);
    }
}