7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/models/workarea/pricing/calculators/customizations_calculator.rb', line 7
def adjust
order.items.each do |item|
next unless item.customizations['pricing_sku'].present?
price = pricing.for_sku(
item.customizations['pricing_sku'],
quantity: item.quantity
)
unit = price.sell
if unit > 0
item.adjust_pricing(
price: 'item',
amount: unit * item.quantity,
quantity: item.quantity,
calculator: self.class.name,
description: 'Customizations',
data: { 'tax_code' => price.tax_code }
)
end
end
end
|