web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Add manual Line Discount

(0) ShareShare
ReportReport
Posted on by 505

Good day.

i hope someone is able to help me in this regard.

is it possible through code to apply a manual line discount on an existing line in POS?

any help would be appreciated.

*This post is locked for comments

I have the same question (0)
  • B.W Profile Picture
    505 on at

    Good day.

    i have tried programmatically adding a discount item to the sale line item. it seems to work by discounting the item but the VAT/TAX of the transaction does not seem to calculate, which also affects the total of the transaction.

    i am adding the discount in the Blank Operations dll with the below code:

     LSRetailPosis.Transaction.RetailTransaction retailTrans = posTransaction as LSRetailPosis.Transaction.RetailTransaction;
    
                            if ((TypeOfTransaction)retailTrans.TransactionType == TypeOfTransaction.Sales)
                            {
                                foreach (var val in retailTrans.SaleItems)
                                {
                                   LSRetailPosis.Transaction.Line.Discount.DiscountItem disc;
    
                                   disc = new LSRetailPosis.Transaction.Line.Discount.LineDiscountItem();
                                  
                                   disc.Percentage = Convert.ToDecimal(10);  
                                   val.DiscountLines.AddFirst(disc);
                                   
                                   val.Comment = "Test Discount ";
    
                                   val.CalculateLine();
                      
                                }
                            }
                            retailTrans.CalcTotals();
    
                         }

    has anyone been able to successfully add a discount line to an existing item?

    any help would be greatly appreciated.

  • Verified answer
    B.W Profile Picture
    505 on at

    Good day.

    i have managed to resolve me issue by adding the following line.

    this.Application.Services.Tax.CalculateTax(retailTrans);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans