Class: GOBL::Bill::LineCharge

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

Overview

LineCharge represents an amount added to the line, and will be applied before taxes.

Constant Summary collapse

SCHEMA_ID =

The Schema ID of the GOBL LineCharge structure

'https://gobl.org/draft-0/bill/line#/$defs/LineCharge'
KEY_ENUM =

Enumeration of possible values for #key with their corresponding descriptions

{
  'stamp-duty' => 'Stamp Duty',
  'outlay' => 'Outlay',
  'tax' => 'Tax',
  'customs' => 'Customs',
  'delivery' => 'Delivery',
  'packing' => 'Packing',
  'handling' => 'Handling',
  'insurance' => 'Insurance',
  'storage' => 'Storage',
  'admin' => 'Administration',
  'cleaning' => 'Cleaning'
}.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

#amountGOBL::Num::Amount (readonly)

Fixed or resulting charge amount to apply (calculated if percent present).



73
# File 'lib/generated/gobl/bill/line_charge.rb', line 73

property :amount, GOBL::Num::Amount

#baseGOBL::Num::Amount (readonly)

Base for percent calculations instead of the line’s sum



48
# File 'lib/generated/gobl/bill/line_charge.rb', line 48

property :base, GOBL::Num::Amount

#codeGOBL::CBC::Code (readonly)

Reference or ID for this charge defined by the issuer



38
# File 'lib/generated/gobl/bill/line_charge.rb', line 38

property :code, GOBL::CBC::Code

#extGOBL::Tax::Extensions (readonly)

Extension codes that apply to the charge



78
# File 'lib/generated/gobl/bill/line_charge.rb', line 78

property :ext, GOBL::Tax::Extensions

#keyGOBL::CBC::Key (readonly)

Key for grouping or identifying charges for tax purposes. A suggested list of keys is provided, but these are for reference only and may be extended by the issuer.



33
# File 'lib/generated/gobl/bill/line_charge.rb', line 33

property :key, GOBL::CBC::Key

#percentGOBL::Num::Percentage (readonly)

Percentage of base or parent line’s sum



53
# File 'lib/generated/gobl/bill/line_charge.rb', line 53

property :percent, GOBL::Num::Percentage

#quantityGOBL::Num::Amount (readonly)

Quantity of units to apply the charge to when using the rate instead of the line’s quantity.



58
# File 'lib/generated/gobl/bill/line_charge.rb', line 58

property :quantity, GOBL::Num::Amount

#rateGOBL::Num::Amount (readonly)

Rate defines a price per unit to use instead of the percentage.



68
# File 'lib/generated/gobl/bill/line_charge.rb', line 68

property :rate, GOBL::Num::Amount

#reasonString (readonly)

Text description as to why the charge was applied



43
# File 'lib/generated/gobl/bill/line_charge.rb', line 43

property :reason, String

#unitGOBL::Org::Unit (readonly)

Unit to associate with the quantity when using the rate.



63
# File 'lib/generated/gobl/bill/line_charge.rb', line 63

property :unit, GOBL::Org::Unit