minor renaming

This commit is contained in:
2024-12-26 10:45:01 -07:00
parent 26b9c7f0d5
commit e72ee2c919

View File

@@ -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)