Class: GOBL::Bill::Tax

Inherits:
Object show all
Defined in:
lib/generated/gobl/bill/tax.rb

Overview

Tax defines a summary of the taxes which may be applied to an invoice.

Constant Summary collapse

SCHEMA_ID =

The Schema ID of the GOBL Tax structure

'https://gobl.org/draft-0/bill/tax'
ROUNDING_ENUM =

Enumeration of possible values for #rounding with their corresponding descriptions

{
  'precise' => 'The default method of calculating the totals in GOBL, and provides the best results
for most cases as the precision is maintained to the maximum amount possible. The
tradeoff however is that sometimes the totals may not sum exactly based on what is visible.',
  'currency' => 'The alternative method of calculating the totals that will first round all the amounts
to the currencys precision before making the sums. Totals using this approach can always
be recalculated using the amounts presented, but can lead to rounding errors in the case
of pre-payments and when line item prices include tax.s precision before making the sums. Totals using this approach can always
be recalculated using the amounts presented, but can lead to rounding errors in the case
of pre-payments and when line item prices include tax.'
}.freeze

Instance Attribute Summary collapse

Method Summary

Methods inherited from Object

new

Methods inherited from Struct

#as_json, from_data, from_json!, #to_json

Instance Attribute Details

#extGOBL::Tax::Extensions (readonly)

Additional extensions that are applied to the invoice as a whole as opposed to specific sections.



42
# File 'lib/generated/gobl/bill/tax.rb', line 42

property :ext, GOBL::Tax::Extensions

#metaGOBL::CBC::Meta (readonly)

Any additional data that may be required for processing, but should never be relied upon by recipients.

Returns:



47
# File 'lib/generated/gobl/bill/tax.rb', line 47

property :meta, GOBL::CBC::Meta

#prices_includeGOBL::CBC::Code (readonly)

Category of the tax already included in the line item prices, especially useful for B2C retailers with customers who prefer final prices inclusive of tax.

Returns:



18
# File 'lib/generated/gobl/bill/tax.rb', line 18

property :prices_include, GOBL::CBC::Code

#roundingGOBL::CBC::Key (readonly)

Rounding model used to perform tax calculations on the invoice. This will be configured automatically based on the tax regime, or ‘sum-then-round` by default, but you can override here if needed. Use with caution, as some conversion tools may make assumptions about the rounding model used.

Returns:



36
# File 'lib/generated/gobl/bill/tax.rb', line 36

property :rounding, GOBL::CBC::Key