uob-payroll 1.0.5 → 1.0.6
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/txt_file.rb +9 -1
- data/lib/uob/payroll/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32983839740c020f77497bd36935fe222e0a4e08
|
4
|
+
data.tar.gz: 38d9c170b7c86606d13fe18c3e8c489f4780baa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e42067c89bc9b913c80470bf129a2e8f503d6ec6c67d077d767e2d5ee1d55359954c4a37bc455133319611e228d780a9a7148fa22c02e66acf441c42c8fa1b26
|
7
|
+
data.tar.gz: 0305338ff2552081bd518550811e8c174b39cfc0af78206cc9a951b40dc8b71cac8289919f79c6075407b2421d134ffad45f88b40640da744de99202f84ee702
|
data/lib/uob/payroll/txt_file.rb
CHANGED
@@ -20,7 +20,7 @@ module UOB
|
|
20
20
|
value_date: payable_date
|
21
21
|
)
|
22
22
|
@rows = transactions.map { |transaction| Row.new transaction }
|
23
|
-
@footer = Footer.new total_amount: rows
|
23
|
+
@footer = Footer.new total_amount: total_amount(rows), header: header, rows: rows
|
24
24
|
end
|
25
25
|
|
26
26
|
def content
|
@@ -33,6 +33,14 @@ module UOB
|
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
+
# We need to round each amount first before summing them up so that it matches
|
37
|
+
# the amounts in the details
|
38
|
+
def total_amount(rows)
|
39
|
+
rows.each.map { |row|
|
40
|
+
row.amount.round(2)
|
41
|
+
}.reduce(0, :+)
|
42
|
+
end
|
43
|
+
|
36
44
|
attr_accessor :header, :rows, :footer
|
37
45
|
end
|
38
46
|
end
|
data/lib/uob/payroll/version.rb
CHANGED