Commit Graph

2367 Commits

Author SHA1 Message Date
64506705e7 fixes 2026-05-18 18:30:16 -07:00
66b0b611e4 stuff 2026-05-18 18:29:44 -07:00
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
aeb7891efa Merge branch 'master' of codecommit://integreat 2026-05-16 00:25:37 -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
931a1aa10f merged 2026-03-30 22:40:04 -07:00
297464c188 Merge branch 'master' of codecommit://integreat 2026-03-30 22:38:34 -07:00
6e3a024f66 adds stuff for dough burger 2026-03-30 22:36:12 -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
53625e4583 Makes invoices use the closed_at date. 2026-02-21 22:53:05 -08:00
d2b5a08519 Merge branch 'master' into clauding 2026-02-08 07:57:52 -08:00
8a0395dc4a Add Bonanza Produce multi-invoice statement template
- Added multi-invoice template for Bonanza Produce with :multi and :multi-match? flags
- Template uses keywords for statement header to identify multi-invoice format
- Extracts invoice-number, date, customer-identifier (from RETURN line), and total
- Parses 4 invoices from statement PDF 13595522.pdf
- All tests pass (29 assertions, 0 failures, 0 errors)

- Added test: parse-bonanza-produce-statement-13595522
- Updated invoice-template-creator skill: emphasized test-first approach
2026-02-08 07:56:14 -08:00
98a3e0dda6 Extract customer name and address for Bonanza Produce
- customer-identifier field: customer name (e.g., 'NICK THE GREEK')
- account-number field: street address (e.g., '600 VISTA WAY')
- Combined they provide full customer identification with address
- Updated test to verify both fields and their concatenation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-08 07:55:26 -08:00
f4366fe98e Add location extraction for Bonanza Produce invoices
- Extract city/state/zip in location field
- Customer address now split across 3 fields:
  - customer-identifier: customer name
  - account-number: street address
  - location: city, state zip
- All components verified in test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-08 07:55:12 -08:00
d95e24a1d7 Improve Bonanza Produce customer identifier extraction
- Extract customer name in customer-identifier field
- Extract street address in account-number field
- Use non-greedy regex with lookahead to capture clean values
- Update test to verify both name and address extraction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-08 07:50:55 -08:00
37351e5f92 Add Bonanza Produce invoice template
- Add new PDF template for Bonanza Produce vendor
- Template uses phone number 530-544-4136 as unique identifier
- Extracts invoice number, date, customer identifier, and total
- Includes passing test for invoice 03881260

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-08 07:50:42 -08:00
35f5ed025f Merge branch 'master' into get-transactions2-page-working 2026-01-27 16:26:50 -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
795189ddd3 csv for worldwide produce 2026-01-07 11:32:49 -08:00
4ef2190570 template for sushi. 2026-01-07 11:26:20 -08:00
b1273835d5 2025 1099s 2026-01-07 10:45:35 -08:00
d008ec71c3 merged 2026-01-05 21:37:30 -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
ff8e7b3063 fixes reel produce 2025-11-05 21:34:17 -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
c528795b1e fixed the only first four issue. 2025-10-07 21:08:19 -07:00
45012e85cc fixes bugs. 2025-09-23 22:53:29 -07:00
4c2369c16c pecific ids and filters are exclusive. 2025-09-17 19:02:09 -07:00
3647934be6 temporarily loading 30 days of data 2025-09-16 09:15:19 -07:00
b646544ebc Improvements to templates 2025-09-11 23:00:42 -07:00
96934b12fd Sample ledger show 2025-05-23 17:25:18 -07:00
495d290a46 look for any order that's updated in the time range. 2025-04-10 21:46:35 -07:00
5a05c144ea progress on bulk activities 2025-03-31 10:55:47 -07:00
7f12b31fdf shows as locked 2025-03-29 19:36:52 -07:00