Use quantity set on the line to compute unit price from Shopify order
The quantity of the line item may be different if part of the line item has been refunded or cancelled. Closes #14103
This commit is contained in:
@@ -373,9 +373,9 @@ class Line(IdentifierMixin, metaclass=PoolMeta):
|
||||
total_discount = sum(
|
||||
Decimal(d.amount) for d in line_item.discount_allocations)
|
||||
unit_price = ((
|
||||
(Decimal(line_item.price) * line_item.quantity)
|
||||
(Decimal(line_item.price) * (quantity or 1))
|
||||
- Decimal(total_discount))
|
||||
/ line_item.quantity)
|
||||
/ (quantity or 1))
|
||||
unit_price = round_price(Tax.reverse_compute(
|
||||
unit_price, line.taxes, sale.sale_date))
|
||||
if line.product:
|
||||
|
||||
Reference in New Issue
Block a user