@fuzzle/opencode-accountant 0.13.11 → 0.13.12-next.1
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/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17015,8 +17015,9 @@ function moveCsvToDone(csvFile, pendingDir, doneDir) {
|
|
|
17015
17015
|
const destPath = path2.join(doneDir, relativePath);
|
|
17016
17016
|
ensureDirectory(path2.dirname(destPath));
|
|
17017
17017
|
fs3.renameSync(csvFile, destPath);
|
|
17018
|
-
|
|
17019
|
-
|
|
17018
|
+
const suffix = csvFile.endsWith("-filtered.csv") ? "-filtered.csv" : csvFile.endsWith("-simple.csv") ? "-simple.csv" : null;
|
|
17019
|
+
if (suffix) {
|
|
17020
|
+
const originalCsv = csvFile.replace(new RegExp(`${suffix.replace(".", "\\.")}$`), ".csv");
|
|
17020
17021
|
if (fs3.existsSync(originalCsv)) {
|
|
17021
17022
|
const originalRelative = path2.relative(pendingDir, originalCsv);
|
|
17022
17023
|
const originalDest = path2.join(doneDir, originalRelative);
|
|
@@ -24730,7 +24731,10 @@ function formatJournalEntry(match2) {
|
|
|
24730
24731
|
if (hasFees) {
|
|
24731
24732
|
const feeAmount = formatAmount(btcRow.fees.amount);
|
|
24732
24733
|
const feeCurrency = btcRow.fees.currency;
|
|
24733
|
-
postings.push({
|
|
24734
|
+
postings.push({
|
|
24735
|
+
account: `expenses:fees:revolut:${feeCurrency.toLowerCase()}`,
|
|
24736
|
+
amount: `${feeAmount} ${feeCurrency}`
|
|
24737
|
+
});
|
|
24734
24738
|
}
|
|
24735
24739
|
postings.push({ account: equityFiat, amount: `${netFiat} ${fiatCurrency}` }, { account: equityBtc, amount: `-${btcQuantity} BTC` }, { account: "assets:bank:revolut:btc", amount: `${btcQuantity} BTC${costAnnotation}` });
|
|
24736
24740
|
return `${date5} Bitcoin purchase
|
|
@@ -24797,7 +24801,7 @@ function generateBtcPurchaseJournal(fiatCsvPaths, btcCsvPath, yearJournalPath, l
|
|
|
24797
24801
|
accountsUsed.add(`equity:conversion:${pair}:btc`);
|
|
24798
24802
|
accountsUsed.add("assets:bank:revolut:btc");
|
|
24799
24803
|
if (match2.btcRow.fees.amount > 0) {
|
|
24800
|
-
accountsUsed.add(
|
|
24804
|
+
accountsUsed.add(`expenses:fees:revolut:${match2.btcRow.fees.currency.toLowerCase()}`);
|
|
24801
24805
|
}
|
|
24802
24806
|
if (isDuplicate(match2, journalContent)) {
|
|
24803
24807
|
skippedDuplicates++;
|
package/package.json
CHANGED