commit 3054599b21c0a465c7c23a06b314648206b97120
parent 908b0b1b5e6c637f1778652d4d5be11758f7dc39
Author: Florian Dold <dold@taler.net>
Date: Thu, 19 Nov 2026 23:22:12 +0100
merchant web UI: offer Sales summary as the scheduled report type
Diffstat:
3 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/packages/taler-merchant-webui/src/screens/ScheduleReportScreen.tsx b/packages/taler-merchant-webui/src/screens/ScheduleReportScreen.tsx
@@ -61,9 +61,6 @@ export function ScheduleReportScreen({
const [, setLocation] = useLocation();
const [reportDesc, setReportDesc] = useState<string>("");
- const [reportSource, setReportSource] = useState<string>(
- "/private/statistics-report/transactions",
- );
const [reportFreq, setReportFreq] = useState<string>("weekly");
const [reportShiftHours, setReportShiftHours] = useState<number>(0);
const [reportTarget, setReportTarget] = useState<string>("");
@@ -120,7 +117,7 @@ export function ScheduleReportScreen({
try {
await onAddReport?.({
description: reportDesc,
- data_source: reportSource,
+ data_source: "/private/statistics-report/transactions",
target_address: reportTarget,
mime_type: reportFormat,
program_section: reportSenderProgram,
@@ -149,7 +146,7 @@ export function ScheduleReportScreen({
onBack={() => setLocation("/reports/scheduled")}
backLabel={t`Reports`}
title={t`Schedule a Report`}
- subtitle={t`Have the server compile a report on a fixed rhythm and send it out, so nobody has to remember to fetch it.`}
+ subtitle={t`Sales summary is currently the only report type. More report types are planned.`}
/>
<form onSubmit={handleSubmit} class="space-y-6 max-w-3xl">
@@ -192,34 +189,6 @@ export function ScheduleReportScreen({
{fieldError("rep_desc_in")}
</div>
- {/* Only the sales summary has a handler on the server. The other
- kinds are offered greyed out rather than silently: choosing one
- used to produce a schedule that failed every time it ran. */}
- <div>
- <label htmlFor="rep_source_select" class={label}>
- {t`What the report covers`}
- </label>
- <select
- id="rep_source_select"
- value={reportSource}
- onChange={(e) =>
- setReportSource((e.target as HTMLSelectElement).value)
- }
- class={`${field} bg-white`}
- >
- <option value="/private/statistics-report/transactions">{t`Sales summary`}</option>
- <option value="/private/statistics-report/money-pots" disabled>
- {t`Money pots summary (not available on this server yet)`}
- </option>
- <option value="/private/statistics-report/sales-funnel" disabled>
- {t`Order funnel (not available on this server yet)`}
- </option>
- <option value="/private/incoming" disabled>
- {t`Payouts received (not available on this server yet)`}
- </option>
- </select>
- <p class="text-2xs text-gray-500 mt-1">{t`Sales summary is currently the only report available on this server.`}</p>
- </div>
</div>
<div class="bg-white p-6 rounded-xl border border-gray-200 shadow-xs space-y-4">
diff --git a/packages/taler-merchant-webui/src/screens/screens.test.tsx b/packages/taler-merchant-webui/src/screens/screens.test.tsx
@@ -8543,7 +8543,7 @@ test("a failed submit keeps what was typed and shows a copyable message", async
document.body.removeChild(container);
});
-test("report schedules use only delivery generators advertised by the server", async () => {
+test("the form schedules the transactions report with the selected delivery generator", async () => {
const container = document.createElement("div");
document.body.appendChild(container);
let submitted: Record<string, unknown> | undefined;
@@ -8561,6 +8561,14 @@ test("report schedules use only delivery generators advertised by the server", a
container,
);
+ assert.match(
+ container.textContent ?? "",
+ /Sales summary is currently the only report type\. More report types are planned\./,
+ );
+ assert.doesNotMatch(
+ container.textContent ?? "",
+ /Money pots summary|Order funnel|Payouts received/,
+ );
const sender = container.querySelector("#rep_sender_in") as HTMLSelectElement;
assert.deepStrictEqual(
Array.from(sender.options).map((option) => [
@@ -8590,6 +8598,10 @@ test("report schedules use only delivery generators advertised by the server", a
assert.strictEqual(submitted?.program_section, "smtp-prod");
assert.strictEqual(submitted?.target_address, "finance@example.test");
+ assert.strictEqual(
+ submitted?.data_source,
+ "/private/statistics-report/transactions",
+ );
render(null, container);
document.body.removeChild(container);
});
diff --git a/packages/taler-merchant-webui/src/tutorial/tutorialData.tsx b/packages/taler-merchant-webui/src/tutorial/tutorialData.tsx
@@ -2017,7 +2017,7 @@ function buildTutorialChapters(t: TranslateFn): TutorialChapter[] {
blocks: [
{
kind: "p",
- text: t`A scheduled report is generated and sent without you asking. Useful for the summary you would otherwise forget to pull at month end, or for sending straight to whoever does your books. Which reports your server can produce is up to your provider; a sales summary is the one every server has.`,
+ text: t`Schedule a sales summary and it will arrive on its own, as a PDF or as data, without you having to remember to fetch it.`,
},
],
activeSidebarItem: "Reports",
@@ -2037,7 +2037,7 @@ function buildTutorialChapters(t: TranslateFn): TutorialChapter[] {
blocks: [
{
kind: "p",
- text: t`Choose what the report covers, how often it should arrive — daily, weekly or monthly — and where it should be sent. Anything greyed out is a report your server cannot produce yet.`,
+ text: t`The server compiles a sales summary on the rhythm you choose and sends it to the address you give.`,
},
],
activeSidebarItem: "Reports",