Skip to content

Pricing, discounts and margin

When you add or reprice a line, Sales resolves a suggested unit price from the customer, item, quantity, and any matching pricing schedules. Margin starts as an estimate and can become actual after delivery consumes real stock.

lowest matching unit price winsmanual overrides are trackedestimated then actual margin

Pricing evaluates the customer category, item scope, and ordered quantity:

  1. The item’s base selling price becomes listUnitPrice.
  2. The pricing lookup gathers every schedule that can apply to the customer and item.
  3. Each candidate schedule contributes a matching quantity break when the quantity falls inside that break.
  4. The engine calculates each candidate unit price as base price * (1 - discount percent / 100).
  5. The lowest resulting unit price wins.

This means an all-customer schedule and a category-scoped schedule can both be candidates. The category-scoped schedule does not automatically beat the all-customer schedule; the lowest resulting unit price wins.

If no schedule break matches, the suggested unit price is the base selling price and the source is base_price.

Schedule-based pricing is part of the wholesale pricing add-on; without it, new lines price at base.

FieldMeaning
pricingSourceTypeschedule_break or base_price.
pricingScheduleNameSnapshot of the winning schedule name.
pricingBreakLabelSnapshot of the winning break range.
suggestedUnitPriceWhat pricing resolution suggested.
unitPriceWhat the order will charge.
isPriceOverriddenTrue when the user changed the suggested price.

The discount cell tooltip shows the schedule and break, Manual price override, or Base price.

Discount is derived from list price versus unit price. Editing the discount column reprices the unit price down from the base price.

AmountFormula
Line subtotalquantity * unitPrice
Line taxlineSubtotal * taxRatePercent
Line totallineSubtotal + lineTaxAmount
Order totalLine totals plus shipping fee and shipping tax.

Tax rate name and percent are snapshotted to the line so later tax setup changes do not rewrite order history.

The order detail data carries estimated and actual margin fields, but the visible order card currently keeps the main totals strip focused on revenue, discount, shipping fee, tax, and total.

Before delivery, line margin can use estimated unit cost:

Estimated fieldMeaning
estimatedUnitCostCurrent estimated cost for the item.
estimatedCogsEstimated cost of goods for the line.
estimatedGrossProfitEstimated line profit.
estimatedMarginPercentEstimated margin percentage.

After delivery consumes real inventory lots, actual cost fields can be populated:

Actual fieldMeaning
actualUnitCostCost from consumed stock.
actualCogsActual cost of goods for shipped quantity.
actualGrossProfitActual line profit.
actualMarginPercentActual margin percentage.

The order-level margin summary tracks product revenue, freight recovery, product COGS, fulfillment costs, contribution margin, margin percent, and whether the cost side is estimated, actual, mixed, or unknown.