def _limit_discount_amount_by_min_price(line, order_source):
 shop_product = line.product.get_shop_instance(order_source.shop)
 if shop_product.minimum_price:
  min_total = (shop_product.minimum_price.value * line.quantity)
  base_price = (line.base_unit_price.value * line.quantity)
  if ((base_price - line.discount_amount.value) < min_total):
   line.discount_amount = order_source.create_price((base_price - min_total))

def _limit_discount_amount_by_min_price ( line , order_source ) : shop_product = line . product . get_shop_instance ( order_source . shop ) if shop_product . minimum_price : min_total = ( shop_product . minimum_price . value * line . quantity ) base_price = ( line . base_unit_price . value * line . quantity ) if ( ( base_price - line . discount_amount . value ) < min_total ) : line . discount_amount = order_source . create_price ( ( base_price - min_total ) )
changes the order line discount amount if the discount amount exceeds the minimium total price set by minimum_price constraint in shopproduct .