PROJECT GOALS
Purpose
Custom solution – “NBS Promotion” design
Types of Promotions:
- Promotion Type – Minimum Order only on the 1st Order
- Description
- Buy any items
- minimum total order amount AND
- this is the customer 1st order
- and get total Z % discount
- optional start and end date
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
- Promotion Type – Buy X from Group of Items Get Y%
- Description
- Buy any items from a selected group of items
- minimum Y qty PER each item
- and get Z% discount for qualified items only
- optional start and end date
- optional only in the first X period of the customer lifetime
(fe only in the first 3 months)
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
- Promotion Type – Buy X from Group of Items Get Y% AND Minimum Order
- Description
- Buy selected group of items
- minimum Y qty PER each item AND
- minimum of total order amount
- and get Z% discount for qualified items only
- optional start and end date
- optional only in the first X period of the customer lifetime
(fe only in the first 3 months)
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
- Promotion Type – Buy Number of Items from Group of Items Get Y%
- Description
- Buy selected group of items
- minimum Y number of different items (any qty)
- and get Z% discount for all items
- optional start and end date
- optional only in the first X period of the customer lifetime
(fe only in the first 3 months)
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
- Promotion Type – Buy Number of Items from Group of Items Get Y% AND Minimum Order
- Description
- Buy selected group of items
- minimum Y number of different items (any qty) AND
- minimum of total order amount
- and get Z% discount for all items
- optional start and end date
- optional only in the first X period of the customer lifetime
(fe only in the first 3 months)
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
- Promotion Type – Promise Certain Payment Term and Get Y%
- Description
- Promise certain payment term (fe cash)
- and get Y% discount for all items
- optional start and end date
- optional only in the first X period of the customer lifetime
(fe only in the first 3 months)
- Solution
- Custom solution – “NBS Promotion”
- Result – discount item will be added under each discounted item
- Custom solution – “NBS Promotion”
- Description
Components:
- NBS Promotion custom record Structure
| Field Name | Type | Mandatory | Function |
| Promotion Name | text | Yes | |
| Buy Item | list / saved search items | Yes | define the items customer needs to buy from |
| Minimum Qty | Integer | Yes | define the minimum qty the customer has to buy from EACH item |
| Minimum SKU Qty | Integer | No | define the minimum different SKU qty the customer has to buy |
| Discount Item | list / discount items | Yes | define the discount item to use & the discount % (from the discount item record |
| Payment Term | list/terms | No | select the payment term to apply discount |
| Start Date | date | No | start of the promotion |
| End Date | date | No | end of the promotion |
| Minimum Order | amount | No | define the required minimum order amount (in the order currency) |
| 1st Order Only | checkbox | No | indicates if apply only to the 1st order of the customer |
| 1st X Period Only | Integer | No | indicates if apply only in the first X months of the customer |
| Customers Apply | list / saved search customers | Yes | define the eligible customers |
SOLUTION
Prerequisites of the task is as follows:
- Need to create a custom record with following fields
| Field Name | Type | Mandatory | Function |
| Promotion Name | text | Yes | |
| Buy Item | list / saved search items | Yes | define the items customer needs to buy from : single select, the user select one item’s saved search and promotion need to apply to these list of items |
| Minimum Qty | Integer | Yes | define the minimum qty the customer has to buy from EACH item |
| Minimum SKU Qty | Integer | No | define the minimum different SKU qty the customer has to buy (All the items on the ‘Buy Item’ saved search should present in the transaction with the given ‘Minimum SKU Qty’ as total SKU quantity) |
| Discount Item | list / discount items | Yes | define the discount item to use & the discount % (from the discount item record) |
| Payment Term | list/terms | Yes | Always apply when payment term = cash |
| Combinable | checkbox | No | The checkbox indicates if the promotion can be combined with other promotions |
| Start Date | date | No | start of the promotion |
| End Date | date | No | end of the promotion |
| Minimum Order | amount | No | define the required minimum order amount (in the order currency) |
| 1st Order Only | checkbox | No | indicates if apply only to the 1st order of the customer |
| 1st X Period Only | Integer | No | indicates if apply only in the first X months of the customer Example : if a user enters 1 in a promotion entry, then that will be applicable only till “same day on next month of customer created date” |
| Customers Apply | list / saved search customers | Yes | define the eligible customers |
NB will create the custom record entries in the client’s account.
- Need to create a custom column field on the sales order to store the Promotion Name on the Discount item line. This can be used to identify the Discount items added by custom NBS Promotion script and reset will be done only for those discount lines on the Sales Order Edit
- Additional custom Record, attached as child record to Transaction. This will list all the applied NBTY Promotions on the transaction
The description of the task is as follows:
The requirement can be achieved by deploying a User Event Script, Client Script and Suitelet.
The User Event Script will add a button called ‘Calculate NBTY Promotions’ on Create event and Edit Event. The button action will be defined in Client Script. The user should manually click on the button to trigger NBTY Promotion calculation. When the user clicks on this button, the Client Script will create a JSON object containing the customer, list of items, their quantities (and line number) and make a POST request to Suitelet. Suitelet will load all the promotions and will check which all promotions are applicable to current customer. Then, the Suitelet will check which all items are present in each promotion. Then by comparing with the items and quantity on Suitelet request body, it will create a JSON response with details of the promotions that apply and the relevant discounts. Upon receiving the JSON response from Suitelet, the Client Script will inserts/updates discounts into the quote and will also set which is the promotion applied on the custom transaction column field .
The proposed script will fetch the the promotion code applicable for the items in a Quote by checking the following criterias
- Buy Item any of the Quote item
- Customers Apply is Quote Entity
- Start Date before Transaction Date –OR– Empty
- End date after Transaction Date –OR– Empty
- Minimum Order is less than or equal to Subtotal –OR– Empty
- Either Minimum Qty is empty –OR– greater than or equal to the line item quantity
- Either Minimum SKU Qty is empty –OR– greater than or equal to the total quantity of items listed in the ‘Buy Item’ saved search
- Payment Term is Cash
- If 1st Order Only is True, then check whether the Quote is customer’s first quote
- Exclude Promotions that are 1st X Period Only is over
The promotion code from the above steps will be filtered again based on the Minimum Qty from each line. From the results, script will consider the maximum discount promotion code for each item line based on the percentage defined on the corresponding Discount Item record and it will be added as the next line after the corresponding item on item sublist. Upon adding a discount item, Netsuite populates the amount automatically based on the previous item amount and the discount percentage.
Notes
- Applicable only to Quote/Estimate
- Applicable only for Spain Subsidiary
- Logic will apply only for Inventory Items and Assembly items
- Payment Terms should be always Cash on NBTY Promotion custom Record and the Quote terms should be Cash for promotion to apply
- Minimum Order Amount field on NBTY Promotion custom Record will consider only the numerical value irrespective of the currency
- No Server Side NBTY Promotion will occur. Such promotion can be triggered only by user interaction by clicking on the ‘Calculate NBTY Promotion’ button on Edit/Create mode. Discount lines will be added only after clicking on the ‘Calculate NBTY Promotion’ button
- There are cases where the applied discount will directly affect the Subtotal instead of being represented in the ‘Discount’ Field. We will always refer the Subtotal Field when ‘Minimum Order’ field is filled with an amount
- Large Number of NBTY Promotion can affect the performance of script
- The NBS Promotion code will be applied to each item based on the highest Discount corresponding to that item. This will be done for each item from the first line to last. That means that, if there are combinable promotions, it will check which promotion gives the highest discount/benefit to the customer and will apply that one only.
- Also, the custom promotion script will not consider whether the Discount/Free Items added or not by NS SuitePromotion. So the items from the Gift Promotion will be excluded if the “Free Gift Promotion” field on the item line is not empty.
- We assume that
- The field “1st Order Only“ is used to mark that promotion code can be applied only to the first Quote of a customer after creating that customer in Netsuite. So that second Quote onwards the script will not consider that Promotion Code even though that code is not applicable to the first Quote due to other criteria failure.
- The amount added on the Minimum Order will directly compare with the Subtotal of the order. The script will not perform any conversion on the minimum order amount based on currency. So if the Amount added is 1000, then it will take as $1000 for US currency transaction and €1000 for EUR currency transactions.
- If a single item entered multiple times in a Quote, then that line will be considered separately for identifying the applicable promotion. So the Minimum Qty will be compared only with the quantity from the current line.
- In case any Discount item that is used in the custom Promotion entry has been made inactive, then the proposed script will ignore those Promotions.
- The closed item lines will be ignored in the Promotion code setup script
RESULTS AND EVALUATION
- Login to Client’s Account
- Create a Quote with required details
- Click on apply NBTY Promotion button
- Check whether the Promotion codes are applied to each line if any codes are applicable based on the criterias.
TIMEFRAME
Estimated Effort: 40 hrs