summaryrefslogtreecommitdiff
path: root/clients/screens_vouchers.c
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-21 23:09:57 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-21 23:09:57 +0200
commit8350815a8c6987b288551848eda1c678739c8d4a (patch)
tree04ef3c56e10fa8b06768465910d10a57779e8731 /clients/screens_vouchers.c
parentbf9012dad7ef34bbbfb073bc0f37b0161f0496f3 (diff)
downloadbokf-0.1.62.tar.gz
bokf-0.1.62.zip
invoices: text rows, duplicate and payment link (schema v12); smtp address checksv0.1.62
Diffstat (limited to 'clients/screens_vouchers.c')
-rw-r--r--clients/screens_vouchers.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/clients/screens_vouchers.c b/clients/screens_vouchers.c
index 52d29da..4cb6d9d 100644
--- a/clients/screens_vouchers.c
+++ b/clients/screens_vouchers.c
@@ -806,21 +806,33 @@ int64_t vouchers_new_prefill(struct app *a, const struct voucher_prefill *p)
if (p->description && *p->description)
snprintf(vf.desc, sizeof vf.desc, "%s", p->description);
if (p->bank_account && *p->bank_account) {
- snprintf(vf.rows[0].account, sizeof vf.rows[0].account, "%s",
- p->bank_account);
int64_t amt = p->amount_ore < 0 ? -p->amount_ore : p->amount_ore;
char tmp[32];
tui_kr_format(amt, tmp, sizeof tmp);
- if (p->amount_ore > 0)
+ snprintf(vf.rows[0].account, sizeof vf.rows[0].account, "%s",
+ p->bank_account);
+ if (p->counter_account && *p->counter_account &&
+ p->amount_ore > 0) {
snprintf(vf.rows[0].debit, sizeof vf.rows[0].debit, "%s",
tmp);
- else if (p->amount_ore < 0)
+ snprintf(vf.rows[1].account, sizeof vf.rows[1].account, "%s",
+ p->counter_account);
+ snprintf(vf.rows[1].credit, sizeof vf.rows[1].credit, "%s",
+ tmp);
+ } else if (p->amount_ore > 0) {
+ snprintf(vf.rows[0].debit, sizeof vf.rows[0].debit, "%s",
+ tmp);
+ } else if (p->amount_ore < 0) {
snprintf(vf.rows[0].credit, sizeof vf.rows[0].credit, "%s",
tmp);
+ }
}
- if (p->description && *p->description)
+ if (p->description && *p->description) {
snprintf(vf.rows[0].text, sizeof vf.rows[0].text, "%s",
p->description);
+ snprintf(vf.rows[1].text, sizeof vf.rows[1].text, "%s",
+ p->description);
+ }
}
int text_w = COLS - 60;
if (text_w < 8)