Commit Graph

471 Commits

Author SHA1 Message Date
08b948c24b fixes 2026-05-19 20:55:21 -07:00
2c8985203e improvements 2026-05-18 23:18:02 -07:00
66b0b611e4 stuff 2026-05-18 18:29:44 -07:00
baef2afc63 fixes 2026-05-18 16:21:07 -07:00
a156ac99fe tries sales changes 2026-05-18 15:38:07 -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
31179278e4 Adds a more actionable view 2026-05-17 08:16:11 -07:00
Bryce
1b2e2e4da7 Merge branch 'master' of gitea.story-basking.ts.net:notid/integreat 2026-05-16 00:17:01 -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
Bryce
04bc7cae78 total column 2026-04-09 14:32:39 -07:00
Bryce
28a755e9a9 fixes invoice date filtering 2026-03-02 23:20:14 -08:00
Bryce
01347ff3f5 fixes balance sheet 2026-03-02 22:53:53 -08:00
7fae3717f7 expense account fix 2026-01-16 16:24:43 -08:00
a2e31d6966 1099 expens account 2026-01-16 15:50:36 -08:00
b1273835d5 2025 1099s 2026-01-07 10:45:35 -08:00
68444d6311 allows importing only the invoices that were successful. 2026-01-05 21:34:24 -08:00
8511d30715 pnl changes 2026-01-03 22:44:58 -08:00
269fa45923 improvements 2025-12-04 11:18:36 -08:00
af7f9355e8 Fixes issues 2025-11-19 23:53:30 -08:00
bd8cb34a0f Adds pedantic flag 2025-11-05 20:57:54 -08:00
a462c56595 fixes bugs, makes checks printable for different dates. 2025-10-07 21:52:46 -07:00
45012e85cc fixes bugs. 2025-09-23 22:53:29 -07:00
96934b12fd Sample ledger show 2025-05-23 17:25:18 -07:00
01329bbdf5 Disallows chatgpt for emailed invoices. 2025-03-25 21:26:40 -07:00
581033001b Adds the ability to filter down to unbalanced 2025-03-11 21:07:51 -07:00
38ed981cba Recalculates running balance as report is run 2025-02-08 22:14:24 -08:00
d078fb8a15 Makes better warning/errors 2025-02-03 21:06:28 -08:00
473b2c34c8 fixes adding new ledger 2025-02-03 19:43:56 -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
c863d36836 undid mistake 2025-01-31 19:35:32 -08:00
ac0dbef961 Makes link dropdown not get cut off 2025-01-31 19:22:24 -08:00
2826fd5099 also update client 2025-01-30 13:43:28 -08:00
c57775eddd correct 2025-01-30 12:42:28 -08:00
8bfe4ff1ae date too. 2025-01-30 12:36:37 -08:00
e1d86ffa24 makes client ids on manual 2025-01-30 12:11:52 -08:00
ebf155d0cd change company 1099 dates 2025-01-29 06:38:52 -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
084df59149 Allows paying from credit 2025-01-17 23:10:42 -08:00
ca7a08452c Makes A&J Produce findable. 2025-01-17 20:53:17 -08:00
ce3cdf836a maybe fixes 2025-01-12 20:52:42 -08:00
ce759acab4 Adds memo field 2024-12-29 21:52:53 -08:00
a0bfeb51a7 dates should be inclusive. 2024-12-16 22:30:18 -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
40fee3ad74 Prevents bad bank account 2024-12-11 16:47:46 -08:00
717e89c799 Unpay autopays 2024-12-11 15:00:58 -08:00