Class: GOBL::Bill::Discount

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

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)

Amount to apply (calculated if percent present).

Returns:



71
# File 'lib/generated/gobl/bill/discount.rb', line 71

property :amount, GOBL::Num::Amount

#baseGOBL::Num::Amount (readonly)

Base represents the value used as a base for percent calculations instead of the invoice’s sum of lines.

Returns:



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

property :base, GOBL::Num::Amount

#codeGOBL::CBC::Code (readonly)

Code to used to refer to the this discount by the issuer

Returns:



51
# File 'lib/generated/gobl/bill/discount.rb', line 51

property :code, GOBL::CBC::Code

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

#iInteger (readonly)

Line number inside the list of discounts (calculated)

Returns:

  • (Integer)


23
# File 'lib/generated/gobl/bill/discount.rb', line 23

property :i, Integer

#keyGOBL::CBC::Key (readonly)

Key for identifying the type of discount being applied.

Returns:



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

property :key, GOBL::CBC::Key

#metaGOBL::CBC::Meta (readonly)

Additional semi-structured information.

Returns:



86
# File 'lib/generated/gobl/bill/discount.rb', line 86

property :meta, GOBL::CBC::Meta

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

#reasonString (readonly)

Text description as to why the discount was applied

Returns:

  • (String)


56
# File 'lib/generated/gobl/bill/discount.rb', line 56

property :reason, String

#taxesGOBL::Tax::Set (readonly)

List of taxes to apply to the discount

Returns:



76
# File 'lib/generated/gobl/bill/discount.rb', line 76

property :taxes, GOBL::Tax::Set

#uuidString (readonly)

Universally Unique Identifier.

Returns:

  • (String)


18
# File 'lib/generated/gobl/bill/discount.rb', line 18

property :uuid, String