sysmocom_value_calculator: UPS Standard pricing (lower cost)

This commit is contained in:
Harald Welte 2022-02-01 12:03:55 +01:00
parent 52de319def
commit 97335a298e
1 changed files with 5 additions and 17 deletions

View File

@ -126,32 +126,20 @@ module Spree
# maximum insured value 5000 EUR # maximum insured value 5000 EUR
end end
def insurance_cost_DE(value) # we choose pricing between 2kg and 5kg; UPS Standard via shipcloud
if value <= 500
return 0
elsif value <= 2500
return 6
elsif value <= 25000
return 18
else
return 99999
end
end
# we choose pricing between 2kg and 5kg
def price_germany(value, weight) def price_germany(value, weight)
if weight < 2000 if weight < 2000
price = 5.50 price = 5.50
elsif weight < 5000 elsif weight < 5000
price = 5.99 price = 6.50
elsif weight < 10000 elsif weight < 10000
price = 8.49 price = 7.50
elsif weight < 31500 elsif weight < 31500
price = 16.49 price = 8.50
else else
price = 99999 price = 99999
end end
return price + insurance_cost_DE(value) return price
end end
# We assume a 5kg package in all zones below # We assume a 5kg package in all zones below