Class: GOBL::Bill::Discount
- Defined in:
- lib/generated/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/discount'
- KEY_ENUM =
Enumeration of possible values for #key with their corresponding descriptions
{ 'early-completion' => 'Bonus for works ahead of schedule', 'military' => 'Military Discount', 'work-accident' => 'Work Accident Discount', 'special-agreement' => 'Special Agreement Discount', 'production-error' => 'Production Error Discount', 'new-outlet' => 'New Outlet Discount', 'sample' => 'Sample Discount', 'end-of-range' => 'End of Range Discount', 'incoterm' => 'Incoterm Discount', 'pos-threshold' => 'Point of Sale Threshold Discount', 'special-rebate' => 'Special Rebate', 'temporary' => 'Temporary', 'standard' => 'Standard', 'yearly-turnover' => 'Yearly Turnover' }.freeze
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 instead of the invoice’s sum of lines.
-
#code ⇒ GOBL::CBC::Code
readonly
Code to used to refer to the this discount by the issuer.
-
#ext ⇒ GOBL::Tax::Extensions
readonly
Extension codes that apply to the discount.
-
#i ⇒ Integer
readonly
Line number inside the list of discounts (calculated).
-
#key ⇒ GOBL::CBC::Key
readonly
Key for identifying the type of discount being applied.
-
#meta ⇒ GOBL::CBC::Meta
readonly
Additional semi-structured information.
-
#percent ⇒ GOBL::Num::Percentage
readonly
Percentage to apply to the base or invoice’s sum.
-
#reason ⇒ String
readonly
Text description as to why the discount was applied.
-
#taxes ⇒ GOBL::Tax::Set
readonly
List of taxes to apply to the discount.
-
#uuid ⇒ String
readonly
Universally Unique Identifier.
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).
71 |
# File 'lib/generated/gobl/bill/discount.rb', line 71 property :amount, GOBL::Num::Amount |
#base ⇒ GOBL::Num::Amount (readonly)
Base represents the value used as a base for percent calculations instead of the invoice’s sum of lines.
61 |
# File 'lib/generated/gobl/bill/discount.rb', line 61 property :base, GOBL::Num::Amount |
#code ⇒ GOBL::CBC::Code (readonly)
Code to used to refer to the this discount by the issuer
51 |
# File 'lib/generated/gobl/bill/discount.rb', line 51 property :code, GOBL::CBC::Code |
#ext ⇒ GOBL::Tax::Extensions (readonly)
Extension codes that apply to the discount
81 |
# File 'lib/generated/gobl/bill/discount.rb', line 81 property :ext, GOBL::Tax::Extensions |
#i ⇒ Integer (readonly)
Line number inside the list of discounts (calculated)
23 |
# File 'lib/generated/gobl/bill/discount.rb', line 23 property :i, Integer |
#key ⇒ GOBL::CBC::Key (readonly)
Key for identifying the type of discount being applied.
46 |
# File 'lib/generated/gobl/bill/discount.rb', line 46 property :key, GOBL::CBC::Key |
#meta ⇒ GOBL::CBC::Meta (readonly)
Additional semi-structured information.
86 |
# File 'lib/generated/gobl/bill/discount.rb', line 86 property :meta, GOBL::CBC::Meta |
#percent ⇒ GOBL::Num::Percentage (readonly)
Percentage to apply to the base or invoice’s sum.
66 |
# File 'lib/generated/gobl/bill/discount.rb', line 66 property :percent, GOBL::Num::Percentage |
#reason ⇒ String (readonly)
Text description as to why the discount was applied
56 |
# File 'lib/generated/gobl/bill/discount.rb', line 56 property :reason, String |
#taxes ⇒ GOBL::Tax::Set (readonly)
List of taxes to apply to the discount
76 |
# File 'lib/generated/gobl/bill/discount.rb', line 76 property :taxes, GOBL::Tax::Set |
#uuid ⇒ String (readonly)
Universally Unique Identifier.
18 |
# File 'lib/generated/gobl/bill/discount.rb', line 18 property :uuid, String |