Method: ChargeLine#calculate_tax

Defined in:
app/models/charge_line.rb

#calculate_tax(ctx = {}) ⇒ Object

calculates tax and save to sales_tax



32
33
34
35
36
37
38
39
# File 'app/models/charge_line.rb', line 32

def calculate_tax(ctx={})
  taxation = ErpOrders::Taxation.new

  self.sales_tax = taxation.calculate_tax(self,
                                          ctx.merge({
                                                        amount: money.amount
                                                    }))
end