commit de3df92139da00ff496b22a6a64897ded10dd1a4
parent 6203b05e31ae5e12e40b5d64f3ca32e77f26670e
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 27 Nov 2025 11:27:01 +0100
work on PDF generation and CSV export
Diffstat:
2 files changed, 45 insertions(+), 50 deletions(-)
diff --git a/contrib/typst/vqf_902_1_customer.typ b/contrib/typst/vqf_902_1_customer.typ
@@ -413,9 +413,9 @@
inset: 5pt,
checkbox("" != get("CUSTOMER_ID_AMLA_FILE_REFERENCE_NO")), [Customer identification documents (or: reference#footnote[If the identification document is lists kept in another AMLA-File (in the case of Art. 15 para. 3 SRO Regulations) a reference to the according AMLA-File is sufficient.] to AMLA File No.: #underline([#get("CUSTOMER_ID_AMLA_FILE_REFERENCE_NO")]))],
checkbox("" != get("ESTABLISHER_ID_AMLA_FILE_REFERENCE_NO")), [Identification document of persons establishing the business relationship (or: reference to AMLA File No.: #underline([#get("ESTABLISHER_ID_AMLA_FILE_REFERENCE_NO")]))],
-// checkbox(get("HAVE_VQF_902_9") or get("HAVE_VQF_902_11") or get("HAVE_VQF_902_12") or get("HAVE_VQF_902_13") or get("HAVE_VQF_902_15")), [Establishing of the beneficial owner of the assets/controlling person (VQF Doc No. 902.15, 902.9, 902.11, 902.12 or 902.13)],
-// checkbox(get("HAVE_VQF_902_5")), [Customer profile (VQF doc. No. 902.5; only in the case of permanent business relationship and regular customers)],
-// checkbox(get("HAVE_VQF_902_4")), [Risk profile (VQF doc. No. 902.4)],
+// checkbox(get("HAVE_VQF_902_9") or get("HAVE_vqf_902_11") or get("HAVE_vqf_902_12") or get("HAVE_vqf_902_13") or get("HAVE_vqf_902_15")), [Establishing of the beneficial owner of the assets/controlling person (VQF Doc No. 902.15, 902.9, 902.11, 902.12 or 902.13)],
+// checkbox(get("HAVE_vqf_902_5")), [Customer profile (VQF doc. No. 902.5; only in the case of permanent business relationship and regular customers)],
+// checkbox(get("HAVE_vqf_902_4")), [Risk profile (VQF doc. No. 902.4)],
)
v(1em)
@@ -436,12 +436,12 @@
"CUSTOMER_TYPE": "NATURAL_PERSON",
"FULL_NAME": "John Doe",
"DOMICILE_ADDRESS": "123 Main St, 8001 Zurich",
- "HAVE_VQF_902_9": false,
- "HAVE_VQF_902_11": false,
- "HAVE_VQF_902_12": false,
- "HAVE_VQF_902_13": false,
- "HAVE_VQF_902_15": true,
- "HAVE_VQF_902_4": true,
- "HAVE_VQF_902_5": true,
+ "HAVE_vqf_902_9": false,
+ "HAVE_vqf_902_11": false,
+ "HAVE_vqf_902_12": false,
+ "HAVE_vqf_902_13": false,
+ "HAVE_vqf_902_15": true,
+ "HAVE_vqf_902_4": true,
+ "HAVE_vqf_902_5": true,
// ... other fields
))
diff --git a/src/exchange/taler-exchange-httpd_aml-accounts-get.c b/src/exchange/taler-exchange-httpd_aml-accounts-get.c
@@ -205,6 +205,8 @@ record_cb (
if ( (NULL == comments) &&
(GNUNET_TIME_absolute_is_never (open_time.abs_time)) )
comments = "transacted amounts below limits that trigger account opening";
+ if (NULL == comments)
+ comments = "";
switch (rc->format)
{
case RCF_JSON:
@@ -253,25 +255,27 @@ record_cb (
(unsigned long long) row_id,
payto.full_payto,
NULL == ecomments
- ? ""
- : ecomments,
+ ? ""
+ : ecomments,
high_risk ? "1" : "0",
GNUNET_TIME_absolute_is_never (open_time.
abs_time)
- ? "-"
- : GNUNET_TIME_timestamp2s (open_time),
+ ? "-"
+ : GNUNET_TIME_timestamp2s (open_time),
GNUNET_TIME_absolute_is_never (close_time.
abs_time)
- ? "-"
- : GNUNET_TIME_timestamp2s (close_time));
+ ? "-"
+ : GNUNET_TIME_timestamp2s (close_time));
GNUNET_free (ecomments);
break;
} /* end case RCF_XML */
case RCF_CSV:
{
- char *ecomments = NULL;
+ char *ecomments;
char otbuf[64];
char ctbuf[64];
+ size_t len = strlen (comments);
+ size_t wpos = 0;
GNUNET_snprintf (otbuf,
sizeof (otbuf),
@@ -281,39 +285,30 @@ record_cb (
sizeof (ctbuf),
"%s",
GNUNET_TIME_timestamp2s (close_time));
- if (NULL != comments)
+ /* Escape 'comments' to double '"' as per RFC 4180, 2.7. */
+ ecomments = GNUNET_malloc (2 * len + 1);
+ for (size_t off = 0; off<len; off++)
{
- size_t len = strlen (comments);
- size_t wpos = 0;
-
- /* Escape 'comments' to double '"' as per RFC 4180, 2.7. */
- ecomments = GNUNET_malloc (2 * len + 1);
- for (size_t off = 0; off<len; off++)
- {
- if ('"' == comments[off])
- ecomments[wpos++] = '"';
- ecomments[wpos++] = comments[off++];
- }
-
- GNUNET_buffer_write_fstr (&rc->details.xml,
- "%llu,%s,\"%s\",%s,%s,%s\r\n",
- (unsigned long long) row_id,
- payto.full_payto,
- NULL == ecomments
- ? "-"
- : ecomments,
- high_risk ? "X":" ",
- GNUNET_TIME_absolute_is_never (open_time.
- abs_time)
- ? "-"
- : otbuf,
- GNUNET_TIME_absolute_is_never (close_time.
- abs_time)
- ? "-"
- : ctbuf);
- GNUNET_free (ecomments);
- break;
+ if ('"' == comments[off])
+ ecomments[wpos++] = '"';
+ ecomments[wpos++] = comments[off++];
}
+ GNUNET_buffer_write_fstr (&rc->details.csv,
+ "%llu,%s,\"%s\",%s,%s,%s\r\n",
+ (unsigned long long) row_id,
+ payto.full_payto,
+ ecomments,
+ high_risk ? "X":" ",
+ GNUNET_TIME_absolute_is_never (open_time.
+ abs_time)
+ ? "-"
+ : otbuf,
+ GNUNET_TIME_absolute_is_never (close_time.
+ abs_time)
+ ? "-"
+ : ctbuf);
+ GNUNET_free (ecomments);
+ break;
} /* end case RCF_CSV */
} /* end switch */
}
@@ -489,8 +484,8 @@ TEH_handler_aml_accounts_get (
GNUNET_buffer_write_str (&rctx.details.csv,
CSV_FOOTER);
/* FIXME: add support for compression */
- resp = MHD_create_response_from_buffer (rctx.details.xml.position,
- rctx.details.xml.mem,
+ resp = MHD_create_response_from_buffer (rctx.details.csv.position,
+ rctx.details.csv.mem,
MHD_RESPMEM_MUST_FREE);
TALER_MHD_add_global_headers (resp,
false);