Class: GOBL::Bill::Discount
- Defined in:
- lib/gobl/bill/discount.rb
Overview
Discount represents an allowance applied to the complete document independent from the individual lines.
Constant Summary collapse
- SCHEMA_ID =
The Schema ID of the GOBL Discount structure
'https://gobl.org/draft-0/bill/invoice#/$defs/Discount'
Constants included from Hashme
Instance Attribute Summary collapse
-
#amount ⇒ GOBL::Num::Amount
readonly
Amount to apply (calculated if percent present).
-
#base ⇒ GOBL::Num::Amount
readonly
Base represents the value used as a base for percent calculations.
-
#code ⇒ String
readonly
Code for the reason this discount applied.
-
#i ⇒ Integer
readonly
Line number inside the list of discounts (calculated).
-
#meta ⇒ GOBL::CBC::Meta
readonly
Additional semi-structured information.
-
#percent ⇒ GOBL::Num::Percentage
readonly
Percentage to apply to the invoice’s Sum.
-
#reason ⇒ String
readonly
Text description as to why the discount was applied.
-
#ref ⇒ String
readonly
Reference or ID for this Discount.
-
#taxes ⇒ GOBL::Tax::Set
readonly
List of taxes to apply to the discount.
-
#uuid ⇒ GOBL::UUID::UUID
readonly
Unique identifying for the discount entry.
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)
Amount to apply (calculated if percent present).
44 |
# File 'lib/gobl/bill/discount.rb', line 44 property :amount, GOBL::Num::Amount |
#base ⇒ GOBL::Num::Amount (readonly)
Base represents the value used as a base for percent calculations. If not already provided, we’ll take the invoices sum.
34 |
# File 'lib/gobl/bill/discount.rb', line 34 property :base, GOBL::Num::Amount |
#code ⇒ String (readonly)
Code for the reason this discount applied
54 |
# File 'lib/gobl/bill/discount.rb', line 54 property :code, String |
#i ⇒ Integer (readonly)
Line number inside the list of discounts (calculated)
24 |
# File 'lib/gobl/bill/discount.rb', line 24 property :i, Integer |
#meta ⇒ GOBL::CBC::Meta (readonly)
Additional semi-structured information.
64 |
# File 'lib/gobl/bill/discount.rb', line 64 property :meta, GOBL::CBC::Meta |
#percent ⇒ GOBL::Num::Percentage (readonly)
Percentage to apply to the invoice’s Sum.
39 |
# File 'lib/gobl/bill/discount.rb', line 39 property :percent, GOBL::Num::Percentage |
#reason ⇒ String (readonly)
Text description as to why the discount was applied
59 |
# File 'lib/gobl/bill/discount.rb', line 59 property :reason, String |
#ref ⇒ String (readonly)
Reference or ID for this Discount
29 |
# File 'lib/gobl/bill/discount.rb', line 29 property :ref, String |
#taxes ⇒ GOBL::Tax::Set (readonly)
List of taxes to apply to the discount
49 |
# File 'lib/gobl/bill/discount.rb', line 49 property :taxes, GOBL::Tax::Set |
#uuid ⇒ GOBL::UUID::UUID (readonly)
Unique identifying for the discount entry
19 |
# File 'lib/gobl/bill/discount.rb', line 19 property :uuid, GOBL::UUID::UUID |