Compare commits
No commits in common. "b8decb3ec8c0baa6dd725aecf50c811cc764a6cc" and "05a867cc551b4068580047654b7403ca2133d7b3" have entirely different histories.
b8decb3ec8
...
05a867cc55
|
@ -152,7 +152,7 @@ class SCDeliveryCarrier(models.Model):
|
|||
return res
|
||||
|
||||
def build_sc_customs_decl(self, picking, explanation, currency='EUR'):
|
||||
items = [self.build_sc_customs_item(x) for x in picking.move_lines if picking.state == 'assigned']
|
||||
items = [self.build_sc_customs_item(x) for x in picking.move_lines]
|
||||
total = 0.0
|
||||
for i in items:
|
||||
total += i['value_amount']
|
||||
|
@ -204,18 +204,7 @@ class SCDeliveryCarrier(models.Model):
|
|||
except shipcloud.ApiError as err:
|
||||
raise Warning(str(err))
|
||||
# { "shipment_quote": { "price": 42.12 } }
|
||||
shipping_cost = result['shipment_quote']['price']
|
||||
# determine net value in EUR of order
|
||||
if order.currency_id != order.company_id.currency_id:
|
||||
eur_amount = order.currency_id.compute(order.amount_untaxed, order.company_id.currency_id)
|
||||
_logger.info("Converted %5.2f %s -> %5.2f %s" % (order.amount_untaxed, order.currency_id.name, eur_amount, order.company_id.currency_id.name))
|
||||
else:
|
||||
eur_amount = order.amount_untaxed
|
||||
# compute 0.35% of net value for transport insurance
|
||||
insurance_cost = eur_amount * 0.0035
|
||||
_logger.info("Order %s, Shipping Service %s, cost=%5.2f, insurance=%5.2f", order.name, carrier_service.name, shipping_cost, insurance_cost)
|
||||
# return sum of shipcloud shipping cost + insurance cost
|
||||
return shipping_cost + insurance_cost
|
||||
return result['shipment_quote']['price']
|
||||
|
||||
def _is_outside_eu(self, country):
|
||||
if country.code == 'DE':
|
||||
|
|
Loading…
Reference in New Issue