mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
18 lines
367 B
Ruby
18 lines
367 B
Ruby
class Invoice
|
|
class VatRateCalculator
|
|
attr_reader :registry, :registrar
|
|
|
|
def initialize(registry: Registry.current, registrar:)
|
|
@registry = registry
|
|
@registrar = registrar
|
|
end
|
|
|
|
def calculate
|
|
if registrar.vat_liable_locally?(registry)
|
|
registry.vat_rate
|
|
else
|
|
registrar.vat_rate || 0
|
|
end
|
|
end
|
|
end
|
|
end
|