mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +02:00
19 lines
No EOL
381 B
Ruby
19 lines
No EOL
381 B
Ruby
class Invoice
|
|
class VatRateCalculator
|
|
attr_reader :registry
|
|
attr_reader :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 |