module Vatcalc
A Base Element Object inherits from GNV
@see Vatcalc::GNV
A BaseElement always needs an VAT percentage and an amount if no VAT Percentage is given it takes the default VAT Percentage
A GNV Object consists basically of a 2D Vector First value is gross, second is net. Vat is calculated by gross - net GNV is an abstract Object and should only used for internal calculations in this library.
@example
GNV.new(10.00,9.00) You can add or subtract two GNVs GNV.new(10.00,9.00) + GNV.new(9.00,0.00)
Constants
- VERSION
Public Class Methods
acts_as_bill_element?()
click to toggle source
# File lib/vatcalc/acts_as_bill_element.rb, line 4 def self.acts_as_bill_element? @acts_as_bill_element ||= ->(obj) { obj.class.respond_to?(:acts_as_bill_element) && obj.respond_to?(:as_vatcalc_bill_element) } end
gross_of(v,**args)
click to toggle source
# File lib/vatcalc.rb, line 41 def gross_of(v,**args) BaseElement.new(v,**args).gross end
net_of(v,**args)
click to toggle source
# File lib/vatcalc.rb, line 37 def net_of(v,**args) BaseElement.new(v,**args).net end
vat_of(v,**args)
click to toggle source
# File lib/vatcalc.rb, line 33 def vat_of(v,**args) BaseElement.new(v,**args).vat end
vat_percentage()
click to toggle source
# File lib/vatcalc.rb, line 21 def vat_percentage @vat_percentage end
Also aliased as: percentage
vat_percentage=(v)
click to toggle source
# File lib/vatcalc.rb, line 25 def vat_percentage=(v) @vat_percentage = VATPercentage.new(v) end
Also aliased as: percentage=