Class: GOBL::Bill::LineDiscount

Inherits:
Object show all
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

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 discount amount to apply (calculated if percent present)



61
# File 'lib/generated/gobl/bill/line_discount.rb', line 61

property :amount, GOBL::Num::Amount

#baseGOBL::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

#codeGOBL::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

#extGOBL::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

#keyGOBL::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

#percentGOBL::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

#reasonString (readonly)

Text description as to why the discount was applied



46
# File 'lib/generated/gobl/bill/line_discount.rb', line 46

property :reason, String