Skip to main content

Conditional Discount Calculation

This window calculates the conditional discounts of the contract offers and posts them in a journal entry. You run the calculation for each month, then for the whole year. For the steps, see Calculate conditional discounts.

Opening the window​

From the ribbon: Materials > Special Offers > Conditional Discounts > Conditional Discount Calculation. The command appears for users who have the permission Conditional Discount Calculation in the Reports list of Users Management. It needs the materials feature in your licence. The command does not need the contract offers feature, but without contract offers there is nothing to calculate.

What the window does​

A contract offer gives a customer a percent of what he bought, if the quantity or the value of his purchases in the contract reaches a limit. See Contract offer page. The window does the calculation in two steps:

  1. Monthly: for a period of one month, the program takes every sales bill and sales return of the customers of each active contract offer, and posts the discount of each matching line in an entry. It does not test the limit yet. The entry is a provisional accrual.
  2. Yearly: for a year whose months were all calculated, the program adds the purchases of the whole year for each customer and condition. It keeps the discount only for the customers who reached the limit. It rebuilds the entry of every month with those customers only, and closes the months.

The report Conditional Discounts Calculation shows what was calculated, and Realized Conditional Discounts Percentage shows who reached the limit.

Fields​

The group Calculation Options holds the choice of the period.

FieldDescriptionRequiredValues and rules
MonthlyCalculates one month.Yes, one of Monthly and YearlyThe default. Enables Year and Month, or From and To if the option User-Defined is on. See The options page.
YearlyCalculates a whole year, from 1 January to 31 December.Yes, one of the twoEnables Year and disables Month, From and To. It clears Entry No and disables Entry.
YearThe year of the calculation.YesA list of the years from the opening date of the file to its ending date. The first year is selected.
MonthThe month of the calculation.Yes with MonthlyA list of 1 to 12. The first, 1, is selected. The period runs from the first day of the month to its last day.
FromThe first day of the period.Yes with User-DefinedEnabled only in monthly mode when the option User-Defined is on. See Date fields.
ToThe last day of the period.Yes with User-DefinedSame rule as From. It must not be before From.
BranchThe branch to calculate.Yes if the file has branchesIt appears only if branches are on in the file and the licence. Without branches, the program uses the first branch.
Entry NoShows "Entry No:" and the number of the entry that the monthly calculation made.—Read only. It is empty until a monthly calculation makes an entry.

Buttons​

ButtonWhat it does
CalculateRuns the calculation of the chosen mode. See Calculating.
EntryOpens the journal entry that the last monthly calculation made. It is disabled until such an entry exists, and after you choose Yearly.
CloseCloses the window.

Calculating​

Before it starts​

When you click Calculate, the program checks in this order:

  1. If the window shows Branch and it is empty, the message "Branch should be selected" appears.
  2. For Monthly with User-Defined, From must not be after To.
  3. For Monthly, the last day of the period must not be before the lock date of the file. For Yearly, the same rule applies to the end of the first monthly period of the branch, when that period starts on 1 January of the chosen year. The message is "End Date must be after "Lock Date"".
  4. For Monthly, if entries were made before for dates in the same period, the program asks "Generated entries for the same period will be deleted. Are you sure to continue". Click Yes to continue. The old entries are deleted from the journal. Click No to stop.

Monthly calculation​

For the period you chose, the program works in this order.

  1. If an annual calculation already covers part of the period, it stops with "Monthly calculation for the period can't be done! Annual calculation is already done covering this period".
  2. It deletes the entries and the period records that a monthly calculation made earlier for the same period.
  3. It collects the lines of the bills that match: the sales bills and the sales return bills of the period, dated inside the offer dates, of a bill type of the offer, for a customer who matches the offer (by account or by Customers Terms), and a cost center that matches (the cost center of the offer and its sub centers; an offer with no cost center takes every bill; Customer Field of the offer is not read). A line matches a row of the offer if its material is the row material, or is in the row group, or meets the row condition. Lines with a price of 0 and gift lines are left out. A bill with no customer is left out.
  4. If one of those customers has no Conditional account on the Accounts page of his card, it stops with "Calculation can't be completed! There are customers without "Conditional Discount Counter Account". These customers are :" and the names of the customers, one on each line. Add the account to each customer, then calculate again. The entries deleted in step 2 stay deleted.
  5. It makes one entry with the discount of every matching line, as described in The entry.
  6. It shows Entry No and enables Entry, and the message "Operation completed successfully" appears. If no line matched, no entry is made, and the message is "The entry isn't generated! No realized conditions in this period". The period is still recorded as calculated.

The value of a line is its net value: price times quantity in the unit of the line, minus the discount of the line, plus its extras, plus its share of the extras of the bill, minus its share of the discounts of the bill. The share is in proportion to the gross value of the line over the total of the bill.

Yearly calculation​

The program works for the year you chose, from 1 January to 31 December.

  1. It looks at the months that a monthly calculation recorded for this branch in the year. If a part of the year has no monthly calculation, it stops with "Can't continue annual calculation! There are periods without monthly calculation:" and one line for each missing part, "From … To …".
  2. It adds up, for each customer and each condition, the purchases of the whole year: the sales bills add, the sales returns subtract. A condition on Material Quantity is tested on the quantity in the unit of the condition. A condition on Sales Value is tested on the net value.
  3. It drops the customers whose total is less than Condition Value.
  4. For each monthly period it deletes the entry, and makes a new entry with the lines of that period for the customers who stayed. A period with no such lines has no entry any more.
  5. It marks the months as calculated by the year. The message "Operation completed successfully" appears. Entry No stays empty.

After the yearly calculation, you cannot calculate those months again by month. The message in step 1 of the monthly calculation appears.

The entry​

Each calculation makes a general journal entry with these values:

ValueWhat the program puts
DateThe last day of the period.
NumberThe next number after the last entry.
NotesThe text "Entry generated from the monthly conditional discount calculation for the period from", then the first and last day, such as 1-1-2026 : 31-1-2026. In the entries that the yearly calculation rebuilds, the first day follows the text with no space.
CurrencyThe default currency of the file, with its rate. If none is set, the first currency.
BranchThe branch of the window.
StatePosted.
Cost centerNone on the lines.

The lines are:

  • One line for each discount account, counter account and condition: the debit is the discount of the sales lines, less the discount of the sales return lines. If the result is negative, the line is a credit.
  • One counter line for each counter account, with the opposite side and the same total.

The program picks the discount account of a line in this order: the Material discount account of the offer, then the discount account of the material for the bill type, then that of its group for the bill type, then the default discount account of the bill type. The counter account is the Conditional account of the customer. The program drops a line whose accounts are empty.

Worked example. A contract offer for the customer Alnakheel: the group Beverages, Condition Type Sales Value, Condition Value 50,000, Discount 2. The discount account is Discounts allowed. The Conditional account of the customer is Conditional discount reserve.

  • January: a sales bill of Beverages with a net value of 20,000.00. The monthly entry for 1-1-2026 to 31-1-2026: debit Discounts allowed 400.00 (20,000 × 2%), credit Conditional discount reserve 400.00.
  • February: a sales bill of 40,000.00 and a sales return of 2,000.00. The monthly entry: debit Discounts allowed 760.00 (40,000 × 2% = 800, less 2,000 × 2% = 40), credit Conditional discount reserve 760.00.
  • After all the months are calculated, the yearly calculation adds 20,000 + 38,000 = 58,000. This is not less than 50,000, so the customer stays and the entries of January and February are rebuilt with the same amounts, 400.00 and 760.00. If the total were 45,000, the program would delete both entries and make none.

Messages​

MessageWhy it appearsWhat to do
Branch should be selectedThe file has branches and Branch is empty.Choose the branch.
Start Date must be before "End Date"In monthly mode with User-Defined, From is after To.Correct the dates.
End Date must be after "Lock Date"The end of the period is before the lock date of the file.Choose a later period, or change the lock date in the file options.
Generated entries for the same period will be deleted. Are you sure to continueYou calculate a month for which an entry exists.Yes deletes the old entries and calculates. No stops.
Monthly calculation for the period can't be done! Annual calculation is already done covering this periodA yearly calculation covers the month.You cannot calculate this month again by month.
Calculation can't be completed! There are customers without "Conditional Discount Counter Account". These customers are : …Customers with matching bills have no Conditional account. The customers are listed.Set the account in each customer card, then calculate again.
The entry isn't generated! No realized conditions in this periodNo bill line matched the offers in the period.Check the offers, the dates and the bill types.
Can't continue annual calculation! There are periods without monthly calculation: …Part of the year has no monthly calculation. The missing parts are listed.Calculate the months that are listed, then calculate the year again.
Operation completed successfullyThe calculation ended.For a monthly calculation, click Entry to see the entry.

This page applies to alameen ERP 10, version 10.1.79.764.