Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chadhutchins/6112305 to your computer and use it in GitHub Desktop.
Save chadhutchins/6112305 to your computer and use it in GitHub Desktop.
SugarLogic Calculated Field script to calculate the subtotal, with respect to quantity and provided discount (dollar amount or percentage), for product line items on SugarCRM Quotes.
ifElse(
$discount_select,
multiply(
subtract(
$discount_price,
multiply(
$discount_price,
divide(
$discount_amount,
100
)
)
),
$quantity
),
multiply(
subtract(
$discount_price,
$discount_amount
),
$quantity
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment