Commit Graph

33 Commits

Author SHA1 Message Date
6a7c529c24 Merge branch 'master' into staging 2026-05-18 16:21:14 -07:00
baef2afc63 fixes 2026-05-18 16:21:07 -07:00
bc89a7d586 fixes 2026-05-18 15:39:31 -07:00
a156ac99fe tries sales changes 2026-05-18 15:38:07 -07:00
6487cccf2d Merge branch 'master' into staging 2026-05-18 11:28:45 -07:00
de1c154706 Polish sales summary grid and edit dialog
Aligns debit/credit amounts to a right column with tabular-nums;
replaces the in-cell delta and balanced text with chip-style status
indicators; shortens the edit dialog and clarifies its totals/unbalanced
footer rows; gives manual line items a subtle accent so they're
distinguishable from auto-generated rows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:13:32 -07:00
df85e30bf6 merged 2026-05-17 08:17:51 -07:00
31179278e4 Adds a more actionable view 2026-05-17 08:16:11 -07:00
8367036f85 merged 2026-05-16 00:36:16 -07:00
cc31d8849b Feat/Complete Sales Summaries (#5)
## Summary

Completes the automatic sales summary pipeline end-to-end: the `sales-summaries-v2` job now calculates aggregate totals, preserves manual adjustments, and automatically posts balanced journal entries to the ledger.

## What Changed

**New Datomic transaction function** (`upsert-sales-summary-ledger`)
- Transforms detailed `sales-summary-item`s into aggregated `journal-entry` lines grouped by account and ledger side
- Handles the full upsert: posts a new journal entry for summaries with mapped accounts, or retracts the orphaned entry if items no longer qualify

**Enhanced `sales-summaries-v2` job**
- Calculates and stores 13 aggregate total attributes (card/cash/food-app/gift-card payments, refunds, fees, discounts, tax, tip, returns, unknown, net)
- Preserves manual items (`manual? true`) during recalculation — only auto-calculated items are replaced

**Ledger reconciliation**
- `reconcile-ledger` now queries for sales summaries missing journal entries and repairs them via `:upsert-sales-summary-ledger`, alongside existing invoice and transaction repairs

**Schema**
- Added 13 `total-*` attributes on `sales-summary` (all `db.type/double`, no history)
- Registered the new transaction function in `tx.clj` and `datomic.clj`

**Admin UI cleanup**
- Resolved "clientize" and HTMX `client-id` TODOs in the sales summaries admin page
- `new-summary-item` now correctly passes `client-id` via `hx-vals`
- Removed stale TODO comments and placeholder code

## Files Changed (8)

| File | Purpose |
|------|---------|
| `iol_ion/.../upsert_sales_summary_ledger.clj` | New Datomic tx function |
| `iol_ion/.../tx.clj` | Register new tx function |
| `resources/schema.edn` | 13 new `total-*` attributes |
| `src/.../datomic.clj` | Load new tx namespace |
| `src/.../jobs/sales_summaries.clj` | Aggregate totals + manual item preservation |
| `src/.../ledger.clj` | Sales summary repair in `reconcile-ledger` |
| `src/.../ssr/admin/sales_summaries.clj` | UI TODO cleanup |
| `docs/plans/...plan.md` | Implementation plan document |

Co-authored-by: Bryce <bryce@integreatconsult.com>
Reviewed-on: #5
Co-authored-by: Bryce <bryce@brycecovertoperations.com>
Co-committed-by: Bryce <bryce@brycecovertoperations.com>
2026-05-16 00:16:44 -07:00
fcb46bf756 msot 2025-03-10 15:04:39 -07:00
a8c7c7eb8e cleans up grids 2024-11-18 19:41:54 -08:00
554d0af35e Fixes the sidebar's jank 2024-03-25 22:02:11 -07:00
Bryce
8af5713ba2 Makes navigation a little bit better. 2024-03-20 14:48:44 -07:00
5b9c4b7aef progress on invoices. 2024-03-14 07:16:59 -07:00
8063a8fcbd Builds client SSR approach, sunsets old cljs. 2024-02-07 21:22:56 -08:00
d3477c3fce Adds the ability to export sales data 2023-11-16 22:27:17 -08:00
25b397325a Adds new default admin page 2023-10-31 13:59:03 -07:00
7796e34834 Another admin page 2023-10-31 12:44:10 -07:00
7f7458d54a Makes testing of transaction rules work 2023-10-26 21:23:52 -07:00
5ed23f26be fixes 2023-10-26 15:54:41 -07:00
d9fec54062 Migrates user page to SSR 2023-10-12 21:55:37 -07:00
8c3756f1c1 Sets up impersonate for ssr pages too 2023-09-28 23:22:25 -07:00
99accc067c progress on migrating all grids. 2023-09-28 22:22:25 -07:00
d1798f6b5c further cleans up POS 2023-09-28 20:41:00 -07:00
c73c7619d8 cleanup 2023-09-28 08:05:14 -07:00
fddd3d9007 makes all sales orders use new grid helper 2023-09-27 23:52:57 -07:00
c5c752417b Maybe using new datepicker 2023-09-27 09:03:16 -07:00
160c289f03 progress towards sales. 2023-09-26 14:30:21 -07:00
94ef7ebf03 progress for sales 2023-09-25 23:44:35 -07:00
d5565f7cf8 Revisions on grid page to make parameters easier to grok 2023-09-25 16:26:42 -07:00
e23cc6e8fd progress on ssr sales. 2023-09-23 07:13:32 -07:00
85597fd9eb ssr sales 2023-09-14 22:45:05 -07:00