uob-payroll 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uob/payroll/hash_calculator.rb +18 -5
- data/lib/uob/payroll/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ecd32fd61d7f53f77bf7261411aea6cf01b231
|
4
|
+
data.tar.gz: 6bb40fd043452f949ad7e4b536c52a6921d4ea92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc27e12c24c32ecc9ee9a39722b0ff3123445b974655d8b7445970e36d229348ad29713b8047da84b22e7544d5d7bace035df0df49ec9aa9d9300d3299c4d9f
|
7
|
+
data.tar.gz: eda4045e762e5d3a030df8423f9def14a832fc4261533e823cc9a310e7989ac504224af74013823ffda818432e12b0f3d9ac7ab95b0ae15b36f49d5fb6e28380
|
@@ -20,8 +20,7 @@ module UOB
|
|
20
20
|
|
21
21
|
def calculate
|
22
22
|
sum_header +
|
23
|
-
sum_rows
|
24
|
-
22 # Payment Type is always 'R' for Payroll and Hash Code will always be 1. See p16.
|
23
|
+
sum_rows
|
25
24
|
end
|
26
25
|
|
27
26
|
attr_reader :header, :rows
|
@@ -33,19 +32,33 @@ module UOB
|
|
33
32
|
end
|
34
33
|
|
35
34
|
def sum_rows
|
36
|
-
|
37
|
-
|
35
|
+
index = 1
|
36
|
+
sum = 0
|
37
|
+
|
38
|
+
rows.each.map do |row|
|
39
|
+
index = 1 if index == 9
|
40
|
+
|
41
|
+
sum += calculate_string(row.receiving_bic_code) +
|
38
42
|
index * calculate_padded_string(string: row.receiving_account_number, size: 34) +
|
39
43
|
index * calculate_padded_string(string: row.receiving_account_name, size: 140) +
|
40
44
|
calculate_payment_type(index) +
|
41
45
|
calculate_string('SGD') +
|
42
46
|
calculate_padded_string(string: row.formatted_amount, size: 18, pad: '0', just: :right) +
|
43
47
|
calculate_string('SALA')
|
44
|
-
|
48
|
+
|
49
|
+
index += 1
|
50
|
+
end
|
51
|
+
|
52
|
+
sum
|
45
53
|
end
|
46
54
|
|
47
55
|
private
|
48
56
|
|
57
|
+
def calculate_index(index)
|
58
|
+
index = 0 if index == 9
|
59
|
+
index += 1
|
60
|
+
end
|
61
|
+
|
49
62
|
# Payment Type is always 'R', so Payment Code = 22
|
50
63
|
def calculate_payment_type(index)
|
51
64
|
22 * (index)
|
data/lib/uob/payroll/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uob-payroll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Paca
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|