Class: EInvoiceAPI::Models::DocumentCreate::Item::Allowance

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/e_invoice_api/models/document_create.rb,
sig/e_invoice_api/models/document_create.rbs

Defined Under Namespace

Modules: Amount, BaseAmount, MultiplierFactor, ReasonCode, TaxCode, TaxRate

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil) ⇒ Object

Some parameter documentations has been truncated, see EInvoiceAPI::Models::DocumentCreate::Item::Allowance for more details.

An allowance is a discount for example for early payment, volume discount, etc.

Parameters:

  • amount (Float, String, nil) (defaults to: nil)

    The allowance amount, without VAT. Must be rounded to maximum 2 decimals

  • base_amount (Float, String, nil) (defaults to: nil)

    The base amount that may be used, in conjunction with the allowance percentage,

  • multiplier_factor (Float, String, nil) (defaults to: nil)

    The percentage that may be used, in conjunction with the allowance base amount,

  • reason (String, nil) (defaults to: nil)

    The reason for the allowance

  • reason_code (Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::ReasonCode, nil) (defaults to: nil)

    Allowance reason codes for invoice discounts and charges

  • tax_code (Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::TaxCode) (defaults to: nil)

    The VAT category code that applies to the allowance

  • tax_rate (Float, String, nil) (defaults to: nil)

    The VAT rate, represented as percentage that applies to the allowance. Must be r



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
# File 'lib/e_invoice_api/models/document_create.rb', line 1088

class Allowance < EInvoiceAPI::Internal::Type::BaseModel
  # @!attribute amount
  #   The allowance amount, without VAT. Must be rounded to maximum 2 decimals
  #
  #   @return [Float, String, nil]
  optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::Amount }, nil?: true

  # @!attribute base_amount
  #   The base amount that may be used, in conjunction with the allowance percentage,
  #   to calculate the allowance amount. Must be rounded to maximum 2 decimals
  #
  #   @return [Float, String, nil]
  optional :base_amount,
           union: -> {
             EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount
           },
           nil?: true

  # @!attribute multiplier_factor
  #   The percentage that may be used, in conjunction with the allowance base amount,
  #   to calculate the allowance amount. To state 20%, use value 20. Must be rounded
  #   to maximum 2 decimals
  #
  #   @return [Float, String, nil]
  optional :multiplier_factor,
           union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor },
           nil?: true

  # @!attribute reason
  #   The reason for the allowance
  #
  #   @return [String, nil]
  optional :reason, String, nil?: true

  # @!attribute reason_code
  #   Allowance reason codes for invoice discounts and charges
  #
  #   @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::ReasonCode, nil]
  optional :reason_code,
           enum: -> {
             EInvoiceAPI::DocumentCreate::Item::Allowance::ReasonCode
           },
           nil?: true

  # @!attribute tax_code
  #   The VAT category code that applies to the allowance
  #
  #   @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::TaxCode, nil]
  optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode }

  # @!attribute tax_rate
  #   The VAT rate, represented as percentage that applies to the allowance. Must be
  #   rounded to maximum 2 decimals
  #
  #   @return [Float, String, nil]
  optional :tax_rate, union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::TaxRate }, nil?: true

  # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
  #   Some parameter documentations has been truncated, see
  #   {EInvoiceAPI::Models::DocumentCreate::Item::Allowance} for more details.
  #
  #   An allowance is a discount for example for early payment, volume discount, etc.
  #
  #   @param amount [Float, String, nil] The allowance amount, without VAT. Must be rounded to maximum 2 decimals
  #
  #   @param base_amount [Float, String, nil] The base amount that may be used, in conjunction with the allowance percentage,
  #
  #   @param multiplier_factor [Float, String, nil] The percentage that may be used, in conjunction with the allowance base amount,
  #
  #   @param reason [String, nil] The reason for the allowance
  #
  #   @param reason_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::ReasonCode, nil] Allowance reason codes for invoice discounts and charges
  #
  #   @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::TaxCode] The VAT category code that applies to the allowance
  #
  #   @param tax_rate [Float, String, nil] The VAT rate, represented as percentage that applies to the allowance. Must be r

  # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#amount
  module Amount
    extend EInvoiceAPI::Internal::Type::Union

    variant Float

    variant String

    # @!method self.variants
    #   @return [Array(Float, String)]
  end

  # The base amount that may be used, in conjunction with the allowance percentage,
  # to calculate the allowance amount. Must be rounded to maximum 2 decimals
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#base_amount
  module BaseAmount
    extend EInvoiceAPI::Internal::Type::Union

    variant Float

    variant String

    # @!method self.variants
    #   @return [Array(Float, String)]
  end

  # The percentage that may be used, in conjunction with the allowance base amount,
  # to calculate the allowance amount. To state 20%, use value 20. Must be rounded
  # to maximum 2 decimals
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#multiplier_factor
  module MultiplierFactor
    extend EInvoiceAPI::Internal::Type::Union

    variant Float

    variant String

    # @!method self.variants
    #   @return [Array(Float, String)]
  end

  # Allowance reason codes for invoice discounts and charges
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#reason_code
  module ReasonCode
    extend EInvoiceAPI::Internal::Type::Enum

    REASON_CODE_41 = :"41"
    REASON_CODE_42 = :"42"
    REASON_CODE_60 = :"60"
    REASON_CODE_62 = :"62"
    REASON_CODE_63 = :"63"
    REASON_CODE_64 = :"64"
    REASON_CODE_65 = :"65"
    REASON_CODE_66 = :"66"
    REASON_CODE_67 = :"67"
    REASON_CODE_68 = :"68"
    REASON_CODE_70 = :"70"
    REASON_CODE_71 = :"71"
    REASON_CODE_88 = :"88"
    REASON_CODE_95 = :"95"
    REASON_CODE_100 = :"100"
    REASON_CODE_102 = :"102"
    REASON_CODE_103 = :"103"
    REASON_CODE_104 = :"104"
    REASON_CODE_105 = :"105"

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The VAT category code that applies to the allowance
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#tax_code
  module TaxCode
    extend EInvoiceAPI::Internal::Type::Enum

    AE = :AE
    E = :E
    S = :S
    Z = :Z
    G = :G
    O = :O
    K = :K
    L = :L
    M = :M
    B = :B

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The VAT rate, represented as percentage that applies to the allowance. Must be
  # rounded to maximum 2 decimals
  #
  # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#tax_rate
  module TaxRate
    extend EInvoiceAPI::Internal::Type::Union

    variant Float

    variant String

    # @!method self.variants
    #   @return [Array(Float, String)]
  end
end

Instance Attribute Details

#amountFloat, ...

The allowance amount, without VAT. Must be rounded to maximum 2 decimals

Parameters:

  • value (EInvoiceAPI::Models::DocumentCreate::Item::Allowance::amount, nil)

Returns:

  • (Float, String, nil)


1093
# File 'lib/e_invoice_api/models/document_create.rb', line 1093

optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::Amount }, nil?: true

#base_amountFloat, ...

The base amount that may be used, in conjunction with the allowance percentage, to calculate the allowance amount. Must be rounded to maximum 2 decimals

Parameters:

  • value (EInvoiceAPI::Models::DocumentCreate::Item::Allowance::base_amount, nil)

Returns:

  • (Float, String, nil)


1100
1101
1102
1103
1104
# File 'lib/e_invoice_api/models/document_create.rb', line 1100

optional :base_amount,
union: -> {
  EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount
},
nil?: true

#multiplier_factorFloat, ...

The percentage that may be used, in conjunction with the allowance base amount, to calculate the allowance amount. To state 20%, use value 20. Must be rounded to maximum 2 decimals

Parameters:

  • value (EInvoiceAPI::Models::DocumentCreate::Item::Allowance::multiplier_factor, nil)

Returns:

  • (Float, String, nil)


1112
1113
1114
# File 'lib/e_invoice_api/models/document_create.rb', line 1112

optional :multiplier_factor,
union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor },
nil?: true

#reasonString?

The reason for the allowance

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


1120
# File 'lib/e_invoice_api/models/document_create.rb', line 1120

optional :reason, String, nil?: true

#reason_codeSymbol, ...

Allowance reason codes for invoice discounts and charges

Parameters:

  • value (EInvoiceAPI::Models::DocumentCreate::Item::Allowance::reason_code, nil)

Returns:



1126
1127
1128
1129
1130
# File 'lib/e_invoice_api/models/document_create.rb', line 1126

optional :reason_code,
enum: -> {
  EInvoiceAPI::DocumentCreate::Item::Allowance::ReasonCode
},
nil?: true

#tax_codeSymbol, ...

The VAT category code that applies to the allowance



1136
# File 'lib/e_invoice_api/models/document_create.rb', line 1136

optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode }

#tax_rateFloat, ...

The VAT rate, represented as percentage that applies to the allowance. Must be rounded to maximum 2 decimals

Parameters:

  • value (EInvoiceAPI::Models::DocumentCreate::Item::Allowance::tax_rate, nil)

Returns:

  • (Float, String, nil)


1143
# File 'lib/e_invoice_api/models/document_create.rb', line 1143

optional :tax_rate, union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::TaxRate }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/e_invoice_api/models/document_create.rb', line 1236

.variantsArray(Float, String)

Returns:

  • (Array(Float, String))


# File 'lib/e_invoice_api/models/document_create.rb', line 1175

Instance Method Details

#to_hash{

Returns:

  • ({)


1022
# File 'sig/e_invoice_api/models/document_create.rbs', line 1022

def to_hash: -> {