Class: GOBL::Bill::Charge

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

Overview

Charge represents a surchange applied to the complete document independent from the individual lines.

Constant Summary collapse

SCHEMA_ID =

The Schema ID of the GOBL Charge structure

'https://gobl.org/draft-0/bill/invoice#/$defs/Charge'

Constants included from Hashme

Hashme::Boolean

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

#amountGOBL::Num::Amount (readonly)

Amount to apply (calculated if percent present)

Returns:



44
# File 'lib/gobl/bill/charge.rb', line 44

property :amount, GOBL::Num::Amount

#baseGOBL::Num::Amount (readonly)

Base represents the value used as a base for percent calculations. If not already provided, we’ll take the invoices sum before discounts.

Returns:



34
# File 'lib/gobl/bill/charge.rb', line 34

property :base, GOBL::Num::Amount

#codeString (readonly)

Code for why was this charge applied?

Returns:

  • (String)


54
# File 'lib/gobl/bill/charge.rb', line 54

property :code, String

#iInteger (readonly)

Line number inside the list of discounts (calculated).

Returns:

  • (Integer)


24
# File 'lib/gobl/bill/charge.rb', line 24

property :i, Integer

#metaGOBL::CBC::Meta (readonly)

Additional semi-structured information.

Returns:



64
# File 'lib/gobl/bill/charge.rb', line 64

property :meta, GOBL::CBC::Meta

#percentGOBL::Num::Percentage (readonly)

Percentage to apply to the invoice’s Sum



39
# File 'lib/gobl/bill/charge.rb', line 39

property :percent, GOBL::Num::Percentage

#reasonString (readonly)

Text description as to why the charge was applied

Returns:

  • (String)


59
# File 'lib/gobl/bill/charge.rb', line 59

property :reason, String

#refString (readonly)

Code to used to refer to the this charge

Returns:

  • (String)


29
# File 'lib/gobl/bill/charge.rb', line 29

property :ref, String

#taxesGOBL::Tax::Set (readonly)

List of taxes to apply to the charge

Returns:



49
# File 'lib/gobl/bill/charge.rb', line 49

property :taxes, GOBL::Tax::Set

#uuidGOBL::UUID::UUID (readonly)

Unique identifying for the discount entry

Returns:



19
# File 'lib/gobl/bill/charge.rb', line 19

property :uuid, GOBL::UUID::UUID