lib/parseitc/transaction.rb in parseitc-0.1.4 vs lib/parseitc/transaction.rb in parseitc-0.1.5
- old
+ new
@@ -28,10 +28,11 @@
@provider_country = array[1]
@company = array[5]
@product = array[6]
@vendor_identifier = array[2]
@date = Date.parse(array[11])
+ @product_type_id = array[8] # 1 = new, 7 = update
@units = array[9]
@royalty_price = array[10]
@royalty_currency = array[15]
@customer_price = array[20]
@customer_currency = array[13]
@@ -46,10 +47,14 @@
end
def price_tier
@price_tier ||= begin
prices = ApplePricing[@royalty_currency.downcase.to_sym]
- prices.find_index(@royalty_price.to_f)
+ if @customer_price.to_f == 0
+ 0
+ else
+ prices.find_index(@royalty_price.to_f)
+ end
rescue
nil
end
end
\ No newline at end of file