Commit Graph

193 Commits

Author SHA1 Message Date
ba87805d4c Add vendor pre-population for bulk code and individual edit forms
- Add vendor-changed HTMX handlers for both bulk code and individual edit
- Pre-populate default account at 100% when vendor is selected and no accounts exist
- Fix render-accounts-section to render from step-params correctly
- Change bulk code vendor-changed from hx-get to hx-post to include form data
- Add routes for vendor-changed endpoints
- Update e2e tests to cover vendor pre-population
- Run lein cljfmt fix across codebase
2026-05-21 14:45:19 -07:00
535ef4d113 Fix radio-card to pass through HTMX attributes for $/% toggle
The radio-card component was ignoring HTMX attributes (:hx-post, :hx-target,
etc.) passed to it. Modified the component to extract these attributes and
merge them into each radio input element, so the $/% toggle now properly
triggers HTMX requests when changed.
2026-05-20 23:23:19 -07:00
4f32527732 Fix form error display for root-level validation errors
When validation errors occur at the root level (e.g., from :fn validators
in multi schemas), they are returned as a vector directly rather than a
map with :errors key. Update default-step-footer to handle both cases.
2026-05-20 21:27:30 -07:00
021a2f14f7 Merge branch 'master' into staging 2026-05-18 23:18:07 -07:00
2c8985203e improvements 2026-05-18 23:18:02 -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
931a1aa10f merged 2026-03-30 22:40:04 -07:00
Bryce
28a755e9a9 fixes invoice date filtering 2026-03-02 23:20:14 -08:00
b1ce23bfcf minor cleanup 2025-03-12 10:56:16 -07:00
fcb46bf756 msot 2025-03-10 15:04:39 -07:00
7373ef41d1 Removes old login page, more progress on transactions 2025-03-10 14:09:45 -07:00
8429d8516c Switching to radio. 2025-03-10 09:26:29 -07:00
0a797fea3a progress on combinining everything 2025-03-07 11:51:36 -08:00
d19a2988fd Every action kind of works. 2025-03-05 21:02:50 -08:00
7c7fc10a8d transactions page progress. 2025-03-02 20:09:40 -08:00
f1036e257c Allows undoing autopayments 2025-02-03 13:34:19 -08:00
329a1dc0d4 Should make correct tooltip open 2025-02-03 12:11:38 -08:00
ac0dbef961 Makes link dropdown not get cut off 2025-01-31 19:22:24 -08:00
956d233fe1 bulk edit is now possible 2025-01-20 21:18:52 -08:00
747bf66206 Should fix invoice error 2025-01-20 15:49:30 -08:00
ca7a08452c Makes A&J Produce findable. 2025-01-17 20:53:17 -08:00
da2702f9e8 Supports more 2024-12-16 21:55:06 -08:00
b7826ad6ce uses the periods that are actually used. 2024-12-12 09:49:52 -08:00
ef7c127cd5 Makes tooltip, also makes date ranges work the way Ben asked for 2024-12-12 08:20:57 -08:00
aaeafae871 dates work again 2024-12-11 22:51:17 -08:00
98dcdb5a55 cleans stuff up. 2024-11-23 21:13:15 -08:00
39d8e6e71f simplified ui 2024-11-22 10:10:22 -08:00
a4a40fc9c2 applying feedback 2024-11-20 09:48:07 -08:00
a8c7c7eb8e cleans up grids 2024-11-18 19:41:54 -08:00
f634d8fd81 Making investigate improvements. 2024-11-17 22:01:48 -08:00
d119e01857 Adds advanced view 2024-11-13 20:03:04 -08:00
cb4f88f02a adds csv capability 2024-11-11 21:39:36 -08:00
0e5407072e fix 2024-11-10 22:11:07 -08:00
e9c9cd5fb0 fix 2024-11-10 22:10:21 -08:00
df3183f85c progress on reports. 2024-11-10 22:09:14 -08:00
966deb232a tweaks 2024-11-04 21:43:41 -08:00
71d7461eb9 Better experience for adding new journal entry 2024-11-04 13:23:37 -08:00
48d575fe70 create manual ledger experience 2024-10-28 15:18:07 -07:00
f859655aad profit and loss now works. 2024-10-26 19:11:08 -07:00
7ee99b3542 cash flows 2024-10-26 00:20:10 -07:00
864ecec1b2 balance sheet 2024-10-24 22:27:29 -07:00
f9d02e4798 Makes an experience for balance sheet multi choice 2024-10-24 22:21:52 -07:00
3da8bf054f Sets up multi date 2024-10-22 23:55:02 -07:00
4c05452774 makes more changes. 2024-10-18 21:34:29 -07:00
2311acb9a2 Dropdown works well 2024-10-18 21:00:50 -07:00
acaa2a7d1e improve look of search 2024-10-16 15:37:22 -07:00
70e76347e3 Looks good 2024-10-15 21:43:03 -07:00
9d22de1338 new balance sheet 2024-10-15 20:46:18 -07:00
ca27fcdb57 Fixes 2024-10-15 19:22:19 -07:00