@fuzzle/opencode-accountant 0.10.2-next.1 → 0.10.3-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 +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24805,6 +24805,11 @@ Got:
|
|
|
24805
24805
|
import * as fs18 from "fs";
|
|
24806
24806
|
import * as path13 from "path";
|
|
24807
24807
|
|
|
24808
|
+
// src/utils/symbolNormalizer.ts
|
|
24809
|
+
function normalizeSymbol(symbol2) {
|
|
24810
|
+
return symbol2.toLowerCase().replace(/\./g, "-");
|
|
24811
|
+
}
|
|
24812
|
+
|
|
24808
24813
|
// src/utils/swissquoteLotTracker.ts
|
|
24809
24814
|
import * as fs17 from "fs";
|
|
24810
24815
|
import * as path12 from "path";
|
|
@@ -25329,7 +25334,7 @@ var MERGER_LIKE_TYPES = new Set([
|
|
|
25329
25334
|
]);
|
|
25330
25335
|
function processCorporateActions(actions, inventory, lotInventoryPath, projectDir, logger) {
|
|
25331
25336
|
const entries = [];
|
|
25332
|
-
actions.sort((a, b) => a.date.localeCompare(b.date));
|
|
25337
|
+
actions.sort((a, b) => formatDate(a.date).localeCompare(formatDate(b.date)));
|
|
25333
25338
|
const mergerActions = [];
|
|
25334
25339
|
const otherActions = [];
|
|
25335
25340
|
for (const action of actions) {
|
|
@@ -25579,6 +25584,9 @@ async function preprocessSwissquote(csvPath, projectDir, currency, year, lotInve
|
|
|
25579
25584
|
if (hasSymbolMap && txn.symbol) {
|
|
25580
25585
|
txn.symbol = symbolMap[txn.symbol] ?? txn.symbol;
|
|
25581
25586
|
}
|
|
25587
|
+
if (txn.symbol) {
|
|
25588
|
+
txn.symbol = normalizeSymbol(txn.symbol);
|
|
25589
|
+
}
|
|
25582
25590
|
transactions.push(txn);
|
|
25583
25591
|
}
|
|
25584
25592
|
}
|
|
@@ -25634,7 +25642,7 @@ async function preprocessSwissquote(csvPath, projectDir, currency, year, lotInve
|
|
|
25634
25642
|
const journalEntries = [];
|
|
25635
25643
|
if (trades.length > 0) {
|
|
25636
25644
|
logger?.startSection("Trade Processing", 2);
|
|
25637
|
-
trades.sort((a, b) => a.date.localeCompare(b.date));
|
|
25645
|
+
trades.sort((a, b) => formatDate(a.date).localeCompare(formatDate(b.date)));
|
|
25638
25646
|
for (const trade of trades) {
|
|
25639
25647
|
try {
|
|
25640
25648
|
if (trade.type === "Buy") {
|
package/package.json
CHANGED