class UOB::Payroll::TXTFile::Header

Attributes

account_number[R]
branch_code[R]
company_name[R]
creation_date[R]
value_date[R]

Public Class Methods

new(company_name:, account_number:, branch_code:, creation_date:, value_date:) click to toggle source

@param [String] company_name @param [String] account_number The originating 10 digit UOB bank account number @param [String] branch_code The originating UOB branch code @param [Date] creation_date Date when the bank file was created @param [Date] value_date Date when the amounts will be credited to the receiving party

# File lib/uob/payroll/txt_file/header.rb, line 34
def initialize(company_name:, account_number:, branch_code:, creation_date:, value_date:)
  @company_name = company_name
  @account_number = account_number
  @branch_code = branch_code
  @creation_date = creation_date
  @value_date = value_date

  raise Errors::Invalid, errors.full_messages.to_sentence unless valid?
end

Public Instance Methods

bulk_customer_reference() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 68
def bulk_customer_reference
  "PAYROLL#{creation_date.strftime('%d%m')}"
end
filename() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 44
def filename
  "UGBI#{creation_date.strftime('%d%m')}01"
end
formatted_creation_date() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 60
def formatted_creation_date
  creation_date.strftime '%Y%m%d'
end
formatted_value_date() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 64
def formatted_value_date
  value_date.strftime '%Y%m%d'
end
originating_account_name() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 56
def originating_account_name
  String(company_name).upcase.ljust 140
end
originating_account_number() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 52
def originating_account_number
  account_number
end
originating_bic_code() click to toggle source
# File lib/uob/payroll/txt_file/header.rb, line 48
def originating_bic_code
  "UOVBSGSG#{branch_code}"
end