From 97335a298e1fd7fa80ee51e7fe44c5fd25db3686 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 1 Feb 2022 12:03:55 +0100 Subject: [PATCH] sysmocom_value_calculator: UPS Standard pricing (lower cost) --- .../calculator/sysmocom_value_calculator.rb | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/app/models/spree/calculator/sysmocom_value_calculator.rb b/app/models/spree/calculator/sysmocom_value_calculator.rb index ef1344b..5496200 100644 --- a/app/models/spree/calculator/sysmocom_value_calculator.rb +++ b/app/models/spree/calculator/sysmocom_value_calculator.rb @@ -126,32 +126,20 @@ module Spree # maximum insured value 5000 EUR end - def insurance_cost_DE(value) - 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 + # we choose pricing between 2kg and 5kg; UPS Standard via shipcloud def price_germany(value, weight) if weight < 2000 price = 5.50 elsif weight < 5000 - price = 5.99 + price = 6.50 elsif weight < 10000 - price = 8.49 + price = 7.50 elsif weight < 31500 - price = 16.49 + price = 8.50 else price = 99999 end - return price + insurance_cost_DE(value) + return price end # We assume a 5kg package in all zones below