Intranet · Sales & audit-log CSV download
Downloads sales data for a date range as CSV — both the sales themselves (date, concept, amount, tickets, store, Yardi code) and the change log (who changed what and when).
| Area | Intranet |
| Routes | intranet.sales · intranet.sales.index |
| Centre modules | intranet |
| Staff levels | root · admin · manager · scmanager · sales |
| Models | intranet-sale · intranet-sales-detail |
| UI label | intranet.sales.download.date-error |
| Coverage | 3 use cases · 1 happy · 3 failure |
How it works
Date-range validation is done locally before any request (_validateDownloadCsvRange → validDownloadCsvDates) with three distinct messages, including one that caps the end date at today. The log columns (log.creator-email, log.created-at, log.concept, log.amount) make this the audit trail for sales figures. exportIntranetSalesDetailsCsv covers the detail rows.
Use cases
Why someone opens this (3)
- Pulling a quarter of sales for the centre’s own reporting.
- Producing an audit trail of who modified a disputed figure.
- Reconciling declared sales against the Yardi export.
Path map
flowchart LR F(["Sales and audit-log CSV download"]):::feat F --> H1["Range exported"]:::ok F -.-> X1["Start after end"]:::bad F -.-> X2["End date in the future"]:::bad F -.-> X3["Dates missing"]:::bad classDef feat fill:#26688f,stroke:#26688f,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Range exported
- User picks a start and end date within the allowed window.
_validateDownloadCsvRangepasses.downloadCSVbuilds the file with the sales or log columns and the browser downloads it.
Failure paths
Start after end
Cause — Dates reversed.
What happens —
intranet.sales.download.start-date-error/intranet.sales.download.date-error(‘Date from must be less than date to’).
End date in the future
Cause — End date after today.
What happens —
intranet.sales.download.end-date-error(‘The end date cannot be later than today’).
Dates missing
Cause — Either bound blank.
What happens —
intranet.sales.download.start-date-missing/intranet.sales.download.end-date-missing;validDownloadCsvDatesreturns false and no request is made.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Range exported
- ⛔ Start after end
- ⛔ End date in the future
- ⛔ Dates missing
Implementation
Translation keys (10)
Key English intranet.sales.download.date-errorDate from must be less than date to intranet.sales.download.start-date-errorThe start date must be earlier than the end date intranet.sales.download.end-date-errorThe end date cannot be later than today intranet.sales.download.start-date-missingPlease, select a valid start date intranet.sales.download.end-date-missingPlease, select a valid end date log.creator-emailUser log.created-atUpload date log.conceptConcept log.amountSales amount commerce.yardi-codeYardi Code
Related
- Same area — Store sales declaration & month closing · Sales status overview & Yardi export · Annual sales statement · Intranet communications (threads, confirmations, authorisations) · Communication subtypes · Files management · Footfall (flows) & Yardi upload · SAFT-E - IntelliSales import · Utility consumptions
Generated from doc/feature-inventory.json · id intranet-sales-export · commit 276788ca6