From e72ee2c9191ae79d63b81bf120d2a576954ba150 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 26 Dec 2024 10:45:01 -0700 Subject: [PATCH] minor renaming --- hifo/index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hifo/index.js b/hifo/index.js index 947644f..881eb49 100644 --- a/hifo/index.js +++ b/hifo/index.js @@ -6,6 +6,7 @@ const { PDFDocument } = require('pdf-lib') const year = 2024 const txs = csvToJson.fieldDelimiter(',').getJsonFromCsv(`../Ledger.csv`) + let lots = [] let dispositions = [] @@ -72,20 +73,20 @@ const consumeLots = (tx) => { Remaining: tx.Remaining, } } else if (!stLot) { - lot = lots.find(u => u.Id === ltLot.Id) + lot = lots.find(l => l.Id === ltLot.Id) st = false } else if (!ltLot) { - lot = lots.find(u => u.Id === stLot.Id) + lot = lots.find(l => l.Id === stLot.Id) st = true } else { const { Tax: stTax } = getProvisional(tx, stLot, true) const { Tax: ltTax } = getProvisional(tx, ltLot, false) if (new BN(stTax).lt(ltTax)) { - lot = lots.find(u => u.Id === stLot.Id) + lot = lots.find(l => l.Id === stLot.Id) st = true } else { - lot = lots.find(u => u.Id === ltLot.Id) + lot = lots.find(l => l.Id === ltLot.Id) st = false } } @@ -127,9 +128,9 @@ let balances = lots.reduce((prev, curr) => { return prev }, {}) -lots = lots.map(u => ({ - ...u, - Remaining: u.Remaining.toFixed(8), +lots = lots.map(l => ({ + ...l, + Remaining: l.Remaining.toFixed(8), })) balances = Object.keys(balances)