@furkot/export-expense-report 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/expense-report.js +19 -1
- package/package.json +1 -1
package/lib/expense-report.js
CHANGED
|
@@ -78,10 +78,12 @@ function* expenseReport(options) {
|
|
|
78
78
|
arrival_time,
|
|
79
79
|
cost,
|
|
80
80
|
costRoute,
|
|
81
|
+
day,
|
|
81
82
|
distance,
|
|
82
83
|
name,
|
|
83
84
|
nights,
|
|
84
85
|
notes,
|
|
86
|
+
per_diem,
|
|
85
87
|
tags
|
|
86
88
|
} = steps[i];
|
|
87
89
|
const to = name || address;
|
|
@@ -118,7 +120,11 @@ function* expenseReport(options) {
|
|
|
118
120
|
const line = [];
|
|
119
121
|
|
|
120
122
|
line.push(format.description(name || address, tags,
|
|
121
|
-
nights > 1 &&
|
|
123
|
+
nights > 1 &&
|
|
124
|
+
[
|
|
125
|
+
format.amount(cost / 100, 2, currency),
|
|
126
|
+
`${day + 1}/${nights}`
|
|
127
|
+
]));
|
|
122
128
|
line.push(date);
|
|
123
129
|
line.push(format.amount(cost / (nights || 1) / 100, 2));
|
|
124
130
|
line.push(currency);
|
|
@@ -127,6 +133,18 @@ function* expenseReport(options) {
|
|
|
127
133
|
|
|
128
134
|
lines.push(prepare(line));
|
|
129
135
|
}
|
|
136
|
+
if (per_diem) {
|
|
137
|
+
const line = [];
|
|
138
|
+
|
|
139
|
+
line.push(format.description(address || name, tags));
|
|
140
|
+
line.push(date);
|
|
141
|
+
line.push(format.amount(per_diem / 100, 2));
|
|
142
|
+
line.push(currency);
|
|
143
|
+
line.push('per diem');
|
|
144
|
+
line.push(notes);
|
|
145
|
+
|
|
146
|
+
lines.push(prepare(line));
|
|
147
|
+
}
|
|
130
148
|
|
|
131
149
|
from = to;
|
|
132
150
|
return lines;
|