From dde20635421fa1b62241419d5961e01a8c2a0ff9 Mon Sep 17 00:00:00 2001 From: pofider Date: Mon, 23 Dec 2024 17:36:20 +0100 Subject: [PATCH] fix fees calc --- dist/lib/payments/taxes/taxes.js | 3 ++- dist/lib/payments/taxes/taxes.js.map | 2 +- src/lib/payments/taxes/taxes.ts | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/lib/payments/taxes/taxes.js b/dist/lib/payments/taxes/taxes.js index b0caf8a..49b875a 100644 --- a/dist/lib/payments/taxes/taxes.js +++ b/dist/lib/payments/taxes/taxes.js @@ -46,7 +46,8 @@ async function calculateFees(stripeSales, gumroadInvoices) { incomes += stripeSale.accountingData.price; } for (const gumroadInvoice of gumroadInvoices) { - incomes += (await quotation_1.default(moment_1.default(gumroadInvoice.date).format('DD.MM.YYYY'), 'USD')) / gumroadInvoice.amount; + const q = await quotation_1.default(moment_1.default(gumroadInvoice.date).format('DD.MM.YYYY'), 'USD'); + incomes += gumroadInvoice.amount / q; } return utils_1.round(incomes * 0.23); } diff --git a/dist/lib/payments/taxes/taxes.js.map b/dist/lib/payments/taxes/taxes.js.map index af2079c..7c3424f 100644 --- a/dist/lib/payments/taxes/taxes.js.map +++ b/dist/lib/payments/taxes/taxes.js.map @@ -1 +1 @@ -{"version":3,"file":"taxes.js","sourceRoot":"","sources":["../../../../src/lib/payments/taxes/taxes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAA+B;AAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC3D,+CAAgC;AAChC,uCAAwB;AACxB,2CAA4B;AAC5B,uCAAwB;AACxB,oDAA2B;AAE3B,4DAAmC;AACnC,6CAAyC;AACzC,4DAA8B;AAC9B,4DAAmC;AAanC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAA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QAClC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAC3B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC3B,OAAO,CAAC,QAAQ,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;AAC/D,CAAC,CAAA;AAjCY,QAAA,WAAW,eAiCvB"} \ No newline at end of file diff --git a/src/lib/payments/taxes/taxes.ts b/src/lib/payments/taxes/taxes.ts index 023e2ba..cf7c8dd 100644 --- a/src/lib/payments/taxes/taxes.ts +++ b/src/lib/payments/taxes/taxes.ts @@ -37,8 +37,9 @@ async function calculateFees(stripeSales: Array, gumroadInvoices: Array