Class: FactPulse::InvoiceTypeCode

Inherits:
Object
  • Object
show all
Defined in:
lib/factpulse/models/invoice_type_code.rb

Constant Summary collapse

INVOICE =
"380".freeze
SELF_BILLED_INVOICE =
"389".freeze
FACTORED_INVOICE =
"393".freeze
SELF_BILLED_FACTORED_INVOICE =
"501".freeze
PREPAYMENT_INVOICE =
"386".freeze
SELF_BILLED_PREPAYMENT_INVOICE =
"500".freeze
CORRECTIVE_INVOICE =
"384".freeze
SELF_BILLED_CORRECTIVE_INVOICE =
"471".freeze
FACTORED_CORRECTIVE_INVOICE =
"472".freeze
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE =
"473".freeze
CREDIT_NOTE =
"381".freeze
SELF_BILLED_CREDIT_NOTE =
"261".freeze
GLOBAL_ALLOWANCE_CREDIT_NOTE =
"262".freeze
FACTORED_CREDIT_NOTE =
"396".freeze
SELF_BILLED_FACTORED_CREDIT_NOTE =
"502".freeze
PREPAYMENT_CREDIT_NOTE =
"503".freeze
N3802 =
"380".freeze
N3892 =
"389".freeze
N3932 =
"393".freeze
N5012 =
"501".freeze
N3862 =
"386".freeze
N5002 =
"500".freeze
N3842 =
"384".freeze
N4712 =
"471".freeze
N4722 =
"472".freeze
N4732 =
"473".freeze
N3812 =
"381".freeze
N2612 =
"261".freeze
N2622 =
"262".freeze
N3962 =
"396".freeze
N5022 =
"502".freeze
N5032 =
"503".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_vars ⇒ Object



51
52
53
# File 'lib/factpulse/models/invoice_type_code.rb', line 51

def self.all_vars
  @all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE, N3802, N3892, N3932, N5012, N3862, N5002, N3842, N4712, N4722, N4732, N3812, N2612, N2622, N3962, N5022, N5032].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String) —

    enum value in the form of the string

Returns:

  • (String) —

    The enum value



58
59
60
# File 'lib/factpulse/models/invoice_type_code.rb', line 58

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String) —

    enum value in the form of the string

Returns:

  • (String) —

    The enum value



65
66
67
68
# File 'lib/factpulse/models/invoice_type_code.rb', line 65

def build_from_hash(value)
  return value if InvoiceTypeCode.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #InvoiceTypeCode"
end