lib/onix/apa_product.rb
def proprietry_discount_code_for_rrp=(code)
      price    = price_get(2)
      if price.nil?
        self.rrp_inc_sales_tax = 0
        price    = price_get(2)
      end

      discount = price.discounts_coded.find { |disc| disc.discount_code_type == 2 }

      if discount.nil?
        discount = ONIX::DiscountCoded.new
        discount.discount_code_type = 2
        price.discounts_coded << discount
      end
      discount.discount_code = code
    end
def proprietry_discount_code_for_rrp=(code)
      price    = price_get(2)
      if price.nil?
        self.rrp_inc_sales_tax = 0
        price    = price_get(2)
      end

      discount = price.discounts_coded.find { |disc| disc.discount_code_type == 2 }

      if discount.nil?
        discount = ONIX::DiscountCoded.new
        discount.discount_code_type = 2
        price.discounts_coded << discount
      end
      discount.discount_code = code
    end
def proprietry_discount_code_for_rrp = ( code ) price = price_get ( 2 ) if price . nil? self . rrp_inc_sales_tax = 0 price = price_get ( 2 ) end discount = price . discounts_coded . find { | disc | disc . discount_code_type == 2 } if discount . nil? discount = ONIX :: DiscountCoded . new discount . discount_code_type = 2 price . discounts_coded << discount end discount . discount_code = code end
set the discount code that describes the rrp in this file
set the discount code that describes the rrp in this file