Class: GOBL::Bill::LineCharge
- 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
-
#amount ⇒ GOBL::Num::Amount
readonly
Fixed or resulting charge amount to apply (calculated if percent present).
-
#base ⇒ GOBL::Num::Amount
readonly
Base for percent calculations instead of the line’s sum.
-
#code ⇒ GOBL::CBC::Code
readonly
Reference or ID for this charge defined by the issuer.
-
#ext ⇒ GOBL::Tax::Extensions
readonly
Extension codes that apply to the charge.
-
#key ⇒ GOBL::CBC::Key
readonly
Key for grouping or identifying charges for tax purposes.
-
#percent ⇒ GOBL::Num::Percentage
readonly
Percentage of base or parent line’s sum.
-
#quantity ⇒ GOBL::Num::Amount
readonly
Quantity of units to apply the charge to when using the rate instead of the line’s quantity.
-
#rate ⇒ GOBL::Num::Amount
readonly
Rate defines a price per unit to use instead of the percentage.
-
#reason ⇒ String
readonly
Text description as to why the charge was applied.
-
#unit ⇒ GOBL::Org::Unit
readonly
Unit to associate with the quantity when using the rate.
Method Summary
Methods inherited from Object
Methods inherited from Struct
#as_json, from_data, from_json!, #to_json
Instance Attribute Details
#amount ⇒ GOBL::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 |
#base ⇒ GOBL::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 |
#code ⇒ GOBL::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 |
#ext ⇒ GOBL::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 |
#key ⇒ GOBL::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 |
#percent ⇒ GOBL::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 |
#quantity ⇒ GOBL::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 |
#rate ⇒ GOBL::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 |
#reason ⇒ String (readonly)
Text description as to why the charge was applied
43 |
# File 'lib/generated/gobl/bill/line_charge.rb', line 43 property :reason, String |
#unit ⇒ GOBL::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 |