accounting-engine 0.1.4 → 0.1.6
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/package.json
CHANGED
@@ -147,7 +147,13 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
|
|
147
147
|
type: 'taxable',
|
148
148
|
code: item.code,
|
149
149
|
percent: item.percent,
|
150
|
-
amount:
|
150
|
+
amount:
|
151
|
+
// eslint-disable-next-line no-nested-ternary
|
152
|
+
item.code === '0015'
|
153
|
+
? Number(item.amount) === 0
|
154
|
+
? item.taxable
|
155
|
+
: Number(item.amount) / (Number(item.percent) / 100).toFixed(2)
|
156
|
+
: item.taxable,
|
151
157
|
withholding,
|
152
158
|
});
|
153
159
|
}
|
@@ -182,7 +188,13 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
|
|
182
188
|
type: 'taxable',
|
183
189
|
code: item.code,
|
184
190
|
percent: item.percent,
|
185
|
-
amount:
|
191
|
+
amount:
|
192
|
+
// eslint-disable-next-line no-nested-ternary
|
193
|
+
item.code === '0015'
|
194
|
+
? Number(item.amount) === 0
|
195
|
+
? item.taxable
|
196
|
+
: Number(item.amount) / (Number(item.percent) / 100).toFixed(2)
|
197
|
+
: item.taxable,
|
186
198
|
withholding: {
|
187
199
|
type: null,
|
188
200
|
code: null,
|