In the Excel export, Delivery Order rows were writing `group.DeliveryDate`
(the actual delivery date) to column B ("Tanggal"), while the web UI always
shows `so_date` for every row. This caused a visible mismatch — e.g. DO-01954
displayed "31 Mei 2026" on the web but "01-06-2026" in the exported file.
Changes:
- Remove the `doDate` variable from the DO branch; both the empty-deliveries
fallback row and each per-delivery row now write `soDate` to column B,
consistent with what the web shows
- Fix a pre-existing nil pointer dereference: `prod.ProductWarehouse.Warehouse`
was accessed without a nil guard in the SO branch
- Update the export test to match the current 17-column layout (headers and
row assertions were stale), and add a regression case that explicitly
asserts a DO row with soDate=2026-05-31 / deliveryDate=2026-06-01 produces
"31-05-2026" in column B
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added start_date, end_date, and filter_by query parameters to the
GET /api/marketing/ endpoint. Users can now filter marketing records
by a date range using either so_date (Sales Order date, default) or
created_at as the target column.
Changes:
- validation: added StartDate, EndDate (YYYY-MM-DD format), and
FilterBy (oneof: so_date, created_at) to DeliveryOrderQuery struct
- controller: parse the three new query params in GetAll handler
- service: apply >=start / <end+1day date range filter in the query
modifier using the existing utils.ParseDateRangeForQuery helper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ?export=excel support to GetBalanceMonitoring. Creates a new
repport.balance_monitoring.export.go with a 2-row merged header layout
matching the UI (Penjualan Ayam and Penjualan Telur grouped columns),
a totals row, red styling for negative Saldo Akhir, and frozen panes
below the header rows. Exported data reflects all active query filters.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>