transactions.html omits non-payee currency and value table cells
All checks were successful
cicd / ci (push) Successful in 1m3s
All checks were successful
cicd / ci (push) Successful in 1m3s
This commit is contained in:
@@ -45,6 +45,11 @@ func (transaction Transaction) Payee() string {
|
||||
candidates := []string{}
|
||||
|
||||
for name, balance := range balances {
|
||||
deltas := Deltas(transaction).Like(LikeName(`^` + name + `$`))
|
||||
if len(deltas) != 1 {
|
||||
continue
|
||||
}
|
||||
|
||||
everyoneElse := balances.NotLike(`^` + name + `$`).Group(`^`)[""]
|
||||
matches := true
|
||||
for currency, value := range balance {
|
||||
@@ -192,7 +197,18 @@ func readTransaction(name string, r *bufio.Reader) (transaction, error) {
|
||||
sumPerRecipient[recipient.name] += recipient.value
|
||||
}
|
||||
slices.Sort(recipients)
|
||||
|
||||
for _, k := range recipients {
|
||||
n := 0
|
||||
for i := range result.recipients {
|
||||
if result.recipients[i].name == k {
|
||||
n += 1
|
||||
}
|
||||
}
|
||||
if n != 1 {
|
||||
continue
|
||||
}
|
||||
|
||||
v := sumPerRecipient[k]
|
||||
everyoneElse := 0.0
|
||||
for j := range sumPerRecipient {
|
||||
|
||||
Reference in New Issue
Block a user