Class: GOBL::Bill::LineDiscount
- Defined in:
- lib/generated/gobl/bill/line_discount.rb
Overview
LineDiscount represents an amount deducted from the line, and will be applied before taxes.
Constant Summary collapse
- SCHEMA_ID =
The Schema ID of the GOBL LineDiscount structure
'https://gobl.org/draft-0/bill/line#/$defs/LineDiscount'- 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
Fixed discount 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
Code or reference for this discount defined by the issuer.
-
#ext ⇒ GOBL::Tax::Extensions
readonly
Extension codes that apply to the discount.
-
#key ⇒ GOBL::CBC::Key
readonly
Key for identifying the type of discount being applied.
-
#percent ⇒ GOBL::Num::Percentage
readonly
Percentage to apply to the base or line sum to calculate the discount amount.
-
#reason ⇒ String
readonly
Text description as to why the discount was applied.
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 discount amount to apply (calculated if percent present)
61 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 61 property :amount, GOBL::Num::Amount |
#base ⇒ GOBL::Num::Amount (readonly)
Base for percent calculations instead of the line’s sum.
51 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 51 property :base, GOBL::Num::Amount |
#code ⇒ GOBL::CBC::Code (readonly)
Code or reference for this discount defined by the issuer
41 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 41 property :code, GOBL::CBC::Code |
#ext ⇒ GOBL::Tax::Extensions (readonly)
Extension codes that apply to the discount
66 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 66 property :ext, GOBL::Tax::Extensions |
#key ⇒ GOBL::CBC::Key (readonly)
Key for identifying the type of discount being applied.
36 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 36 property :key, GOBL::CBC::Key |
#percent ⇒ GOBL::Num::Percentage (readonly)
Percentage to apply to the base or line sum to calculate the discount amount
56 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 56 property :percent, GOBL::Num::Percentage |
#reason ⇒ String (readonly)
Text description as to why the discount was applied
46 |
# File 'lib/generated/gobl/bill/line_discount.rb', line 46 property :reason, String |