How prices and discounts are set in the SalesInvoices system 

EESys contains a number of automations to ensure that customers can receive the correct price for their products based on negotiations, and to allow for promotions and special offers.

The Logic of the Price Computation in EESys

  1. The user creates a SalesInvoice with a Customer and DateWanted.
  2. The Status of the SalesInvoice is set. This can include options for "Free Sample", if this status is selected all Product Prices are set to zero.
  3. The user picks a product to send to the customer, if the invoice is not a "Free Sample" the system will find the "SalePrice" for the Product in the SalesDetails table, and pull this through to the "SalePrice" for the invoice-item. In general prices should be updated in the "SalesDetails" table, so all sales occur at the correct price.
  4. EESys then looks for entries in the CustomerProducts data-table matching the current Customer and Products in the SalesInvoiceItem with a DiscountsTypeID = "Default Discount". if any matching record is found this discount is used.
  5. If there is no entry for a "Default Discount" for a particular Product in the CustomerProducts data-table, the customer's discount (stored in the Customers data-table) is used.
  6. The discount that has been pulled through from step 4 or 5 is used to compute the value of the discount.
  7. The amount the customer is charged (the TotalValue) is computed as SalePrice - Discount.
  8. If the user does not want to use the Default Discount, they can pick any other discount level from the list of available DiscountIDs.

Customer Discounts and Products in EESys

Adding and managing Discounts, and promotions.
As customers are offered higher special discounts from time-to-time, EESys includes the ability to give multiple levels of discount to each product, and pick higher or lower discounts in such cases.

The “CustomerProducts” table 

For each product a customer buys a record must be added to the CustomerProducts table. This limits the list of products shown when an invoice is created, ensuring staff select the right products for each customer. The discount given to a customer for each product is set by the “Discount” value in the “CustomerProducts” record with a DiscountTypeID = "Default Discount".

To enable selling items to a customer at higher levels of discount, add extra CustomerProducts records with different levels of discount. Ensure they do not have DiscountTypeID = "Default Discount."

Viewing and Editing CustomerProducts  

CustomerProducts and discounts

  1. Viewing "Greencity" customer
  2. CustomerProducts data added for "Organic Dark Chocolate"
  3. Discount of 25% given
  4. Marked as "Current" (untick this box to stop using this discount).
  5. DiscountType set to "Default".

How Discounts on sales invoices are computed by EESys 

When a new Sales Invoice is created, a new record is inserted into the database for the SalesInvoices data-table, and it is linked to one customer. Values are then entered for fields such as “DateWanted”, the date that the customer has requested to receive the goods.

Once this basic data is added, one or more line-items can be added to list the individual product sales on this Sales Invoice. These are added as records in the SalesInvoiceItems data-table. A Product is selected, with an Order Quantity. 

The EESys then looks up the current price for the product, and the default discount for this customer. The EESys finds the CustomerProduct record and stores it in the “DiscountsID” field of the SalesInvoiceItems data-table, so you know which discount was picked. The "DiscountPercent" is pulled through, and the Discount is computed as "SalesPrice" * "DiscountPercent".

If the customer has more than one entry in the "DiscountsID" drop down list, the user can pick any one, and the discount will update to the newly chosen value.

EESys: SalesInvoices, SalesInvoiceItems  

Sales Invoice Items

  1. Sales Invoices linked to Greencity
  2. Product "Medium Roast Coffee" Selected
  3. Default discount pulled through automatically. The value of this discount is passed to the "DiscountPercent" field, and used to compute the Discount.

Picking a different Discount

EESys Discount, changing chosen discount level  

Pick a new value from the "DiscountsID" drop down. Note that before the change the discount is still £90.7975

EESys Discount is recomputed  

The discount has been changed and the record posted.

Note (marked 1., in the image) that the Discount has now recomputed.

 

So it is always possible to change the discount for a customer, if a special promotion exists.
Just make sure that the customer already has a "CustomerProducts" record with the new discount level, and it can be chosen as the record is entered.