diff --git a/cmd/clitest/index.html b/cmd/clitest/index.html index c61a0ca..c815032 100644 --- a/cmd/clitest/index.html +++ b/cmd/clitest/index.html @@ -73,6 +73,11 @@ + + + + + diff --git a/cmd/clitest/main.go b/cmd/clitest/main.go index 614e92e..6e62906 100644 --- a/cmd/clitest/main.go +++ b/cmd/clitest/main.go @@ -93,11 +93,31 @@ func main() { foolike = like } - register := deltas.Like(foolike...).Register() + deltas := deltas.Like(foolike...) + + // MODIFIERS + for i, whatIf := range r.URL.Query()["whatIf"] { + fields := strings.Fields(whatIf) + date := "2001-01" + name := fields[0] + currency := ledger.Currency(fields[1]) + value, err := strconv.ParseFloat(fields[2], 64) + if err != nil { + panic(err) + } + deltas = append(deltas, ledger.Delta{ + Date: date, + Name: name, + Value: value, + Currency: currency, + Description: fmt.Sprintf("?whatIf[%d]", i), + }) + } + + register := deltas.Register() predicted := make(ledger.Register) bpis := maps.Clone(bpis) - // MODIFIERS if predictionMonths, err := strconv.ParseInt(r.URL.Query().Get("predictionMonths"), 10, 16); err == nil && predictionMonths > 0 { window := time.Hour * 24.0 * 365.0 / 12.0 * time.Duration(predictionMonths) // TODO whatif diff --git a/todo.yaml b/todo.yaml index 5558154..d1d0eef 100755 --- a/todo.yaml +++ b/todo.yaml @@ -1,6 +1,4 @@ todo: -- predictWhatIf=2023-10=AssetAccount:Cash=$=-7000 changes too much when removing 7k - from prinicple - html version can accept new transactions for moolah scheduled: [] done: @@ -64,3 +62,6 @@ done: ts: Fri Oct 27 19:53:44 MDT 2023 - todo: ana/predictor for bpi or de-legacy ts: Fri Oct 27 19:53:44 MDT 2023 +- todo: predictWhatIf=2023-10=AssetAccount:Cash=$=-7000 changes too much when removing + 7k from prinicple + ts: Fri Oct 27 20:37:12 MDT 2023