summaryrefslogtreecommitdiff
path: root/clients/bokftui.c
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-23 09:13:17 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-23 09:13:17 +0200
commit53071bb69f5d21b35b8a61c2b1dd18832ce781d4 (patch)
treefa76c13cef78925d1b9650e92f64d5115dcdb6e7 /clients/bokftui.c
parent2ca284619125af0d5c12e9210ff1bfc8f9122739 (diff)
downloadbokf-53071bb69f5d21b35b8a61c2b1dd18832ce781d4.tar.gz
bokf-53071bb69f5d21b35b8a61c2b1dd18832ce781d4.zip
tui: aligned voucher detail, up/down between vouchers, list sorting
The detail pads every column by display width, blanks zero amounts and shows row texts and a Summa line. Up/Down step to the previous/next voucher in the list order; 's' cycles the list sort (number or date, ascending or descending, saved in tui.conf). The list fetches all pages of voucher.list instead of stopping at 200. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'clients/bokftui.c')
-rw-r--r--clients/bokftui.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clients/bokftui.c b/clients/bokftui.c
index 69d6690..867e63e 100644
--- a/clients/bokftui.c
+++ b/clients/bokftui.c
@@ -20,6 +20,7 @@
#include "version.h"
#include "yyjson.h"
#include "ui.h"
+#include "vlist.h"
/* Screen names for ^R restoration and --screen. Only the top-level
views; sub-screens unwind to their parent. */
@@ -149,6 +150,8 @@ static void config_load(struct app *a)
else if (strcmp(line, "attachment_dir") == 0 &&
!a->attachment_dir[0])
snprintf(a->attachment_dir, sizeof a->attachment_dir, "%s", val);
+ else if (strcmp(line, "voucher_sort") == 0)
+ a->voucher_sort = vlist_sort_parse(val);
}
fclose(f);
}
@@ -166,6 +169,8 @@ void config_save(struct app *a)
fprintf(f, "user=%s\n", a->username);
if (a->attachment_dir[0])
fprintf(f, "attachment_dir=%s\n", a->attachment_dir);
+ if (a->voucher_sort != VSORT_NUMBER)
+ fprintf(f, "voucher_sort=%s\n", vlist_sort_name(a->voucher_sort));
fclose(f);
chmod(path, 0600);
}