exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b3b45bdb3675034afc7d6e66b7f32354ed99dbd2
parent 09ad1c3068872a5bd935cb3078ad7fdb3893ce09
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 30 Jan 2026 14:01:13 +0100

fix #10948

Diffstat:
Msrc/exchange/taler-exchange-httpd_aml-accounts-get.c | 98++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 62 insertions(+), 36 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_aml-accounts-get.c b/src/exchange/taler-exchange-httpd_aml-accounts-get.c @@ -43,19 +43,23 @@ #define CSV_FOOTER "\r\n" #define XML_HEADER "<?xml version=\"1.0\"?>" \ - "<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"" \ - "xmlns:o=\"urn:schemas-microsoft-com:office:office\"" \ - "xmlns:x=\"urn:schemas-microsoft-com:office:excel\"" \ - "xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\">" \ - "<Worksheet ss:Name=\"Sheet1\">" \ - "<Table>" \ - "<Row>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">File number</Data></Cell>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Customer</Data></Cell>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Comments</Data></Cell>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Increased risk business relationship</Data></Cell>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Acquisition date</Data></Cell>" \ - "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Exit date</Data></Cell>" \ + "<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"" \ + " xmlns:c=\"urn:schemas-microsoft-com:office:component:spreadsheet\"" \ + " xmlns:html=\"http://www.w3.org/TR/REC-html40\"" \ + " xmlns:x2=\"http://schemas.microsoft.com/office/excel/2003/xml\"" \ + " xmlns:o=\"urn:schemas-microsoft-com:office:office\"" \ + " xmlns:x=\"urn:schemas-microsoft-com:office:excel\"" \ + " xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\">" \ + "<Styles><Style ss:ID=\"DateFormat\"><NumberFormat ss:Format=\"yyyy-mm-dd\"/></Style></Styles>\n" \ + "<Worksheet ss:Name=\"Sheet1\">\n" \ + "<Table>\n" \ + "<Row>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">File number</Data></Cell>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Customer</Data></Cell>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Comments</Data></Cell>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Increased risk business relationship</Data></Cell>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Acquisition date</Data></Cell>\n" \ + "<Cell ss:StyleID=\"Header\"><Data ss:Type=\"String\">Exit date</Data></Cell>\n" \ "</Row>\n" #define XML_FOOTER "</Table></Worksheet></Workbook>" @@ -237,35 +241,57 @@ record_cb ( case RCF_XML: { char *ecomments = NULL; + char opentime_s[128]; + char closetime_s[128]; + const struct tm *tm; + time_t tt; if ( (NULL == comments) && (GNUNET_TIME_absolute_is_never (open_time.abs_time)) ) comments = "transacted amounts below limits that trigger account opening"; ecomments = escape_xml (comments); - GNUNET_buffer_write_fstr (&rc->details.xml, - "<Row>" - "<Cell><Data ss:Type=\"Number\">%llu</Data></Cell>" - "<Cell><Data ss:Type=\"String\">%s</Data></Cell>" - "<Cell><Data ss:Type=\"String\">%s</Data></Cell>" - "<Cell><Data ss:Type=\"Boolean\">%s</Data></Cell>" - "<Cell><Data ss:Type=\"DateTime\">%s</Data></Cell>" - "<Cell><Data ss:Type=\"DateTime\">%s</Data></Cell>" - "</Row>\n", - (unsigned long long) row_id, - payto.full_payto, - NULL == ecomments - ? "" - : ecomments, - high_risk ? "1" : "0", - GNUNET_TIME_absolute_is_never (open_time. - abs_time) - ? "" - : GNUNET_TIME_timestamp2s (open_time), - GNUNET_TIME_absolute_is_never (close_time. - abs_time) - ? "" - : GNUNET_TIME_timestamp2s (close_time)); + tt = (time_t) GNUNET_TIME_timestamp_to_s (open_time); + tm = gmtime (&tt); + strftime (opentime_s, + sizeof (opentime_s), + "%Y-%m-%dT%H:%M:%S", + tm); + tt = (time_t) GNUNET_TIME_timestamp_to_s (close_time); + tm = gmtime (&tt); + strftime (closetime_s, + sizeof (closetime_s), + "%Y-%m-%dT%H:%M:%S", + tm); + GNUNET_buffer_write_fstr ( + &rc->details.xml, + "<Row>" + "<Cell><Data ss:Type=\"Number\">%llu</Data></Cell>" + "<Cell><Data ss:Type=\"String\">%s</Data></Cell>" + "<Cell><Data ss:Type=\"String\">%s</Data></Cell>" + "<Cell ss:Formula=\"=%s()\"><Data ss:Type=\"Boolean\">%s</Data></Cell>" + "<Cell ss:StyleID=\"DateFormat\"><Data ss:Type=\"%s\">%s</Data></Cell>" + "<Cell ss:StyleID=\"DateFormat\"><Data ss:Type=\"%s\">%s</Data></Cell>" + "</Row>\n", + (unsigned long long) row_id, + payto.full_payto, + NULL == ecomments + ? "" + : ecomments, + high_risk ? "TRUE" : "FALSE", + high_risk ? "1" : "0", + GNUNET_TIME_absolute_is_never (open_time.abs_time) + ? "String" + : "DateTime", + GNUNET_TIME_absolute_is_never (open_time.abs_time) + ? "never" + : opentime_s, + GNUNET_TIME_absolute_is_never (close_time.abs_time) + ? "String" + : "DateTime", + GNUNET_TIME_absolute_is_never (close_time.abs_time) + ? "never" + : closetime_s); GNUNET_free (ecomments); break; } /* end case RCF_XML */