mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Consistency in tax calculations, remove some unneeded local vars
This commit is contained in:
@@ -199,11 +199,11 @@ Spree::Order.class_eval do
|
||||
end
|
||||
|
||||
def shipping_tax
|
||||
adjustments(:reload).shipping.first.andand.included_tax || 0
|
||||
adjustments(:reload).shipping.sum &:included_tax
|
||||
end
|
||||
|
||||
def enterprise_fee_tax
|
||||
adjustments(:reload).enterprise_fee.sum(&:included_tax)
|
||||
adjustments(:reload).enterprise_fee.sum &:included_tax
|
||||
end
|
||||
|
||||
def total_tax
|
||||
|
||||
@@ -16,12 +16,9 @@ module OpenFoodNetwork
|
||||
@orders.map do |order|
|
||||
totals = totals_of order.line_items
|
||||
shipping_cost = shipping_cost_for order
|
||||
shipping_tax = order.shipping_tax
|
||||
enterprise_fee_tax = order.enterprise_fee_tax
|
||||
total_tax = order.total_tax
|
||||
|
||||
[order.number, order.created_at, totals[:items], totals[:items_total],
|
||||
totals[:taxable_total], totals[:sales_tax], shipping_cost, shipping_tax, enterprise_fee_tax, total_tax,
|
||||
totals[:taxable_total], totals[:sales_tax], shipping_cost, order.shipping_tax, order.enterprise_fee_tax, order.total_tax,
|
||||
order.bill_address.full_name, order.distributor.andand.name]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user