Trade agreements (Price/ discount agreement) in D365 F&O - Creation and it's Usage

Hello Readers, 
Happy to see an amazing response to my previous posts. It encourages me to share my understanding with all of you.

This post is a continuation of my last post: Trade agreements (Price/ discount agreement) in AX - Setup where I have explained the important setups required before we create trade agreements in AX.

In this post, I am going to explain the Trade agreement creation process and the importance of various fields in a trade agreement journal.

As mentioned in my previous post, trade agreement is the agreement between company & customer or company & vendor on various prices and discounts. As a part of trade agreement, different prices (Sales prices, purchase prices) and discounts (Line discounts, Multiline discounts and Total discounts) are agreed upon on various sales and purchases over a period of time and those are setup in the system. It is also called as Price/discount agreements, for a obvious reason of it being used to setup prices and discounts in the system.


1. Assumptions

Before creating trade agreements, all the required setups are being taken care of as per mentioned in my last post: Trade agreements (Price/ discount agreement) in AX - Setup. Few of those setups are:

- Activate the trade agreement combinations
- Trade agreement journal names creation
- Price/discount groups creation (if require)
- Managing the account receivable / procurement and sourcing parameter setups

2. Trade agreement path

Once setups are done in the system, we are good to create trade agreements. Trade agreement can be created from the following path in the system:

Sales and marketing > Journals > Price/discount agreement journals
                    or
Procurement and sourcing > Journals > Price/discount agreement journals
                    or
Account receivable > Journals > Price/discount > Price/discount agreement journals

3. Tables used in trade agreements 

When trade agreements are created and posted, the trade agreements data is inserted into below tables in AOT.  These are very useful during customization or for resolving any technical issues faced in agreements.

- PriceDiscAdmTable (Entry goes to this table when trade agreement journal is created)

- PriceDiscAdmTrans (Entry goes to this table when trade agreement journal lines are created) 

- PriceDiscTable (Entry goes to this table when trade agreement journal is posted. It has the same data which is visible from "View trade agreements" form for item, customer and vendor)

4. Steps to create trade agreements

1. Go to the path specified above
2. Form will open where you can see all the open journals available in the system at that moment. Those are nothing but journals which are created but not yet posted.



3. If you want to see 'Posted' journals, just select 'Posted'  in 'Show' field in place of 'Non posted'. 


NoteTo view both posted as well as open trade agreement journals, select option 'All' in the 'Show' field.

4. To create new journal, click on 'New' button (Make sure you have either 'Open' or 'All' selected in the Show field)

5. As you click on New button, the new line will be created where it asks for journal name which is mandatory (That's the reason it is important to create journal names beforehand while creating trade agreement. Different journal names can be setup for different purpose such as price agreement journal, discount agreement journal, price adjustment journal, price&discount journal from RFQ etc. so it will be easier to select an appropriate journal name for a specific purpose. In this way it will be easier to consolidate all the similar trade agreements journals for reporting and analysis purpose)



6. Select the journal name from the drop down. Let's say we have selected 'Pric' Here.



7. Click on Lines --> Journal lines form will open to add trade agreement lines with necessary information.



8. Press Ctrl+N to add a new line for adding the information

9. You can see Price (Purch) in the 'Relation' field in the line already (It is the same default relation which was selected against the  journal name 'Pric' during setup)

10. You can override this relation from the line and select appropriate relation from the following options if require:

      -Price (purch.)  --> For setting up the purchase price
      -Line disc. (purch.) --> For setting up the line discount for purchase 
   -Multiline disc. (purch.) --> For setting up the multiline discount for purchase
      -Total disc. (purch.)  --> For setting up the total discount for purchase
      -Price (sales)  --> For setting up the sales price
      -Line discount (sales)  --> For setting up the line discount for sales
      -Multiline disc. (sales) --> For setting up the multiline discount for sales
      -Total disc. (sales) -->  For setting up the total discount for sales

11. Here we can create lines for all the relation types in a single journal as well

Some information on Account code and Account selection in the journal line

a.  If you are selecting account code as 'Table', you  can see all the customers in the drop down for the account selection field. 
b.If account code is selected as 'Group', you can see customer price/discount groups in the drop down for the account selection field. It is the same customer price/discount groups which was created for price and discounts during setup
c. If account code is selected as 'All' , the account selection field is disabled as you don't have to select anything because it is applicable to all the customers. 

If trade agreements exist for Account code Table, Group and All, then trade agreement search engine gives preference to Table, Group and All respectively while returning the price or discounts for the orders (as described in my last post: Trade agreements (Price/ discount agreement) in AX - Setup)

Some information on Item code and Item relation in the journal line

a. If you are selecting item code as 'Table', you  can see items in the drop down for the item relation field.
b. If item code is selected as 'Group' , you can see item discount groups in the drop down for the Item relation field. It is the same item discount groups which were created during setup for line and multiline discounts..
c. If Item code is selected as 'All' , the Item relation field is disabled as you don't have to select anything because it is applicable to all the items. 

If trade agreements exist for item code Table, Group and All then trade agreement search engine gives preference to Table, Group and All respectively while returning the price or discounts for the orders (as described in my last post: Trade agreements (Price/ discount agreement) in AX - Setup) 

12. Select appropriate account code among the Table, Group and All and accordingly select value in the account selection field. 

13. Select appropriate item code among the Table, Group and All and accordingly select value in item relation field

14. Add the product dimensions (Configuration, Size, Color), Storage dimensions (Site, Warehouse, Location) and tracking dimensions (Batch number, serial number) in the journal line. These are the dimensions which are active in dimensions groups for the item . These dimensions can only be added for Item code: Table. (Refer my last post Trade agreements (Price/ discount agreement) in AX - Setup on the setup & importance of dimensions groups in the trade agreements)

15. 'From' & 'To' : Add 'From' quantity and 'To' quantity i.e the quantity range for the trade agreement. The trade agreement will be active for this quantity range upon posting. The active trade agreement will be applicable to sales/ purchase orders when order line quantity falls between the given quantity range. 

If 'From' and 'To' fields are blank, means there are no lower or upper limits to quantities. If  only 'To' field is blank, means there is no upper limit to quantity range. If  only 'From' field is blank, price is applicable to any lower quantities starting 1.

16. Unit (Unit of measure): It is either purchase or sales unit and can be flown from the item details form into the trade agreement lines automatically upon selecting the item. This unit can be override before posting a trade agreement. When trade agreement is created for a particular unit and the same unit is used in the order then when prices or discounts are requested from the order, the value from this trade agreement is returned. Also this 'unit' is used as a parameter for searching the active trade agreements. (Refer previous post Trade agreements (Price/ discount agreement) in AX - Setup to know how active trade agreements are searched)

17. Currency & Amount in currency: It is the currency in which the trade agreements are being created. Once currency is selected in the trade agreement line, we can add its corresponding amount in the amount in currency field in the agreement line. When orders are created in that currency and prices or discounts are requested from the orders, this 'currency' is also used as a parameter for searching the active trade agreements. Once active trade agreements are found, the amount (Amount in currency) will be automatically applicable to the orders. For price agreement, it is the sales or purchase price of the item. For discount agreement, it is the discount amount of the item or various discount groups

18. Include generic currencyThis field is enabled when the generic currency is selected in the trade agreement lines. But prior to that the generic currency needs to be setup in the account receivable parameter. When this field is enabled, it can be ticked only when instead of creating the trade agreement in different currencies, you want it to create in generic currency and then use exchange rate to convert the generic currency into a specific order currency in real time when price is requested from the sales or purchase order. It is only applicable to Price trade agreement

19. From date and To date: It is the duration in which the trade agreements are active. If the dates are blank, means it is applicable to any dates. There is no duration limit in that case

20. Price unit: It means the number of item units to which the unit price (Amount in currency) is applicable. Default it is set to 1. If price unit is changed to 10, then the price set in amount in currency is for 10 units of item. It is only applicable to price trade agreement

21. Price charges: It is the fixed charges on price applied once for each invoice

22. Discount percentage 1 and discount percentage 2 : It is to set the line discount, multiline discount and/or total discount percentage in the trade agreement on various sales or purchase transactions. We can either set the discount amount in the amount in currency field or discount percentage in the discount percentage fields or we can set both in trade agreement. When it happens, first the discount amount is applied on the order if given. Then the discount percentage 1 is applied on the remaining amount (after the deduction of discount amount). then the Discount percentage 2 is applied on the remaining amount (after the deduction of discount percentage 1). It is nothing but discount on discount.

23. Find next: It is used to find the valid trade agreement for the combination (Order) which is requesting the price or discount. When search engine finds the trade agreement for the combination, and if 'Find next' option is selected for that trade agreement, search continues for a specific trade agreement combinations. Search stops when all the combinations are searched or when valid trade agreement is found for which the Find next option is cleared.. If multiple trade agreements are found then appropriate action will be taken depending on whether price is requested or the discounts. (Refer previous post Trade agreements (Price/ discount agreement) in AX - Setup to know more about different actions which will be taken while returning price or discount)

26. Lead time: It is only used in price trade agreement and not in discount. When lead time is set in the price trade agreement, it is used in the purchase order to set the delivery date based on the lead time or in the sales order to set the requested ship date and requested receipt date based on the lead time (only if these dates aren’t already fulfilling the lead time or when delivery date control is not set to ATP or CTP in the sales order). Lead time from the trade agreement is only applicable when that trade agreement is applied to the order.

27. Working days: If it is ticked, only working days are considered in lead time.

28. Disregard lead time: When it is ticked, lead time is ignored and the delivery date control is applied to order lines. However lead time may still be used by master scheduling.


5. Trade agreements examples

A. Price (sales) - For sales price

Relation: Price (Sales)
Account code: All
Account selection: Blank (Non editable)
Item code: Table
Item relation: 1000
Product Dimensions: Select value if applicable (only in case of product master)
Storage dimensions/ Tracking dimensionsHere site is 1 and warehouse is 11 has been added
From: 0
To: 10 
Unit: ea
Price unit: 1
From date: 17-05-2020
To date: 28-05-2021
Amount in currency :15
Currency: USD
Discount percentage 1: Blank (as it is a price agreement and not the discount agreement)
Discount percentage 2: Blank (as it is a price agreement and not the discount agreement)



Expected result: The price sales agreement is created and sales price for item 1000 is set to 15 USD which is applicable to all the customers . This is valid for the quantity upto 10 and valid between 17-05-2020 to 28-05-2021. 
It means if sales order is created in currency USD for any customer which has the item 1000, quantity upto 10 and created during the validity period then the sales price of 15 USD is returned for that order. 
(This trade agreement is applied, provided it is the only agreement for the combinations given. If multiple trade agreements are exist for such combination, then the trade agreement search engine takes the appropriate preference and returns the sales price)


Note: You can setup the purchase price with the similar approach and with the relation as Price (purchase)

B. Line discount (Sales) - for sales order line discount

Relation: Line discount (sales)
Account code: Group
Account selection: 01
Item code: Table
Item relation: 1000
Product Dimensions: Select value if applicable (only in case of product master)
Storage dimensions/ Tracking dimensions: Here site is 1 and warehouse is 11 has been added
From: 5
To: 10 
Unit: ea
Price unit: field is disabled
From date: 17-05-2020
To date: 16-05-2021
Amount in currency:15
Currency: USD
Discount percentage 1: 2 
Discount percentage 2: Blank (as it is not for discount)



Expected result: The line discount sales agreement is created and the discount amount for the item  1000 is set to 15 USD which is applicable to customers which are part of customer price/discount group 01 selected in the agreement. Also the discount percentage is set to 2%. It is valid for the quantity between 5 to 10 and valid between 17-05-2020 to 16-05-2021. 
It means if sales order is created in currency USD for item 1000 and for the customer which is a part of customer price/discount group 01, on let's say 22-07-2020 and the quantity of the order is 7. In this case the line discount amount of 15 USD is applicable to the line's net amount and on top of that the discount percentage of 2 is also applied on the remaining amount. (Net line amount - Discount amount).  

Calculation
Net line amount: 15*6= 90 USD
Net amount after discount: 90 - 15 (discount amount)= 75 USD
Discount percentage: 75*0.02 (discount percentage) = 1.50 USD,
Discount amount on net amount after discount: 75 - 1.50 =73.50 USD (This is the final amount after deducting discount amount and discount percentage)

(This trade agreement is  applied, provided it is the only agreement for this combination. If multiple trade agreements are exist for such combinations, then the trade agreement search engine takes the appropriate preference and return the line discount)


Note: You can setup the purchase line discount with the similar approach and with the relation as Line disc. (purch.) 

C. Multiline disc. (Sales) - For sales order multiline discount

Relation: Multiline disc. (sales)
Account code: Table
Account selection: US-001
Item code: Group 
Item relation: 01
Product Dimensions: Blank
Storage dimension/ Tracking dimensions: Blank
From: 50
To: 99
Unit: ea
Price unit: Blank
From date: 17-05-2020
To date: 16-05-2021
Amount in currency :4
Currency: USD
Discount percentage 1: 3
Discount percentage 2: 4


Expected result: The multiline discount sales agreement is created and the discount amount is set to 4 USD for the all the items which are part of item discount group "01" selected in the agreement and is applicable to customer 'US-001'. Also two discount percentages are set as well. The discount percentage 1 is set to 3% and discount percentage 2 is set to 4%. It is valid for the quantity between 50 to 99 and valid between 17-05-2020 to 16-05-2021. 
In this case when sales order is created for the customer 'US-001' during the validity period in currency USD. The multiline discount amount is applicable to line items which are part of the item discount group selected in the agreement. here discount amount of 4 USD is applicable to the order lines and then discount percentage 1 and discount percentage 2 is applied respectively. 


When sales order is created, you need to calculate the multiline discount in order to get the multiline discount applied to the order line items (Path: Sales order --> Sell header tab --> 'Calculate' field group --> Multiline discount)


Once you click on 'Multiline discount' button in calculate section, the multiline discount is calculated and visible in the 'Totals' form for the sales order.


Note:
This trade agreement is  applied to orders, provided it is the only agreement for the combinations. If multiple trade agreements are exist for such combinations, then the trade agreement search engine takes the appropriate preference and returns the discount

If both line and multiline discount is valid for the order then it is used in combination as per the parameter set in the Account receivable parameter. Refer previous blog Trade agreements (Price/ discount agreement) in AX - Setup for more information.

Note: You can setup the purchase multiline discount with the similar approach and with the relation as Multiline disc. (purch.)


D. Total disc. (Sales) - Discount for the entire sales order

Relation: Total discount (sales)
Account code: Table
Account selection: US-002
Item code: All
Item relation: Blank
Product Dimensions: Blank
Storage dimension/ Tracking dimensions: Blank
From: 99
To: Blank
Unit: ea
Price unit: blank
From date: 17-05-2020
To date: 16-05-2021
Amount in currency:4
Currency: EUR
Discount percentage 1: 3
Discount percentage 2: Blank



Important: Please make sure to ticked 'Total discount' checkbox for the item for which total discount is to be applicable (Path: in item details form --> Sell fast tab --> Total discount)

(This trade agreement is  applied, provided it is the only agreement for the combinations. If multiple trade agreements are exist for such combinations, then the trade agreement search engine takes the appropriate preference and returns the discount)

Expected result: Total discount agreement is created and the discount amount is set to 4 EUR. It is applicable to customer 'US-002'. Also the discount percentage 1 is set to 3%. It is valid for any quantity starting from 99 and is valid between 17-05-2020 to 16-05-2021.

When sales order is created in currency EUR for the customer 'US-002 ' with quantity 150 during validity period. In this case the total discount of 4 EUR is applicable to the order and the discount percentage of 3 is also applied to same order on the remaining amount after the deduction of total discount amount. This discount is applied on the total order amount and not on the line's net amount. 


When sales order is created, you need to calculate the total discount in order to get the total discount applied to the order (Path: Sales order --> Sell header tab --> 'Calculate' field group --> Total discount)

Once you click on total discount button in calculate section, the total discount percentage is calculated and visible in the total discount field at path: Sales order --> Header view --> Price and discount fast tab --> Discount or charges field group --> Total discount %


Total discount is also visible in 'Totals' form for the sales order




Note: You can setup the purchase total discount with the similar approach and with the relation as Total disc. (purch.)

6. Validate and post the Agreement

Once trade agreements are created, those needs to be validated to know if all the mandatory fields are setup properly and no business logic is violated. To ease the validation, there are different options given such as 
- Validate all the lines in the agreement, 
- Validate only the selected lines, 
- Validate only the lines with errors or warnings




Click Ok to validate the journal. You can setup a batch for it as well.

Once validation is successful, you can post the journal in order make the price and discounts active in the trade agreement. Once it is active, it can be searched to get valid price and discounts for the orders. Click 'Ok' to post the journal. You can setup a batch for it as well.


In case of any discrepancies arise after posting the journal, it can be rectified by editing the journal. 

Details regarding how to edit the posted journals and other important utility functions of trade agreements can be seen in next blog post.

In this way, you can create, validate, post, view trade agreements in D365 F&O.  


Next post: Trade agreements (Price/ discount agreement) in D365 F&O :- Certain utilities


Please post if any queries or suggestions to be made regarding this topic !!!


Till then, Keep DAXing ðŸ˜Š

------------------------------------------------------------------------------------------------------------------------------------
Abhijeet Hele |  Dynamics AX Enthusiast | My Profile 
DisclaimerThe information provided on this site represents my own opinion/view and does not represent the opinion/view of my employer or Microsoft.

Manage contractual commitments with purchase agreement in D365 supply chain management

Hello Reader, In this post, I am going to deep dive into purchase agreement management in D365 supply chain and how it is useful in managing...