Commit Graph

2644 Commits

Author SHA1 Message Date
76c6eaddb9 improvements 2026-05-21 11:51:29 -07:00
ddf11a7cb3 Adds playwright 2026-05-21 11:50:50 -07:00
adb6ecb1ff stuff 2026-05-21 11:50:32 -07:00
4221d6a0d6 more fixes 2026-05-21 11:46:45 -07:00
918ddd14ff Fix format error in toggle-amount-mode: ensure double values for %f format
The format specifier $%,.2f requires floating-point values but
(reduce + 0 ...) can return a Long when all amounts sum to an integer.
Added explicit (double ...) casts and changed initial value to 0.0
to ensure the format call always receives a double.
2026-05-21 09:14:20 -07:00
acd4184ef0 Fix toggle-amount-mode: avoid cursor context entirely for HTMX re-render
The previous attempts to set up form cursor context in toggle-amount-mode
were failing because the cursor library's dynamic binding model is complex
and requires specific initialization through fc/start-form.

Instead of trying to recreate the cursor context, this fix:
1. Creates transaction-account-row-no-cursor* that renders rows with explicit
   field names and values (no cursor functions)
2. Rewrites toggle-amount-mode to directly construct the data-grid HTML
   using map-indexed over the accounts vector
3. Removes the broken manual cursor binding attempts
4. Removes unused auto-ap.cursor import

This ensures the toggle handler works independently of the wizard's cursor
context while still producing identical HTML output.
2026-05-21 07:44:43 -07:00
857a1536ef Fix toggle-amount-mode: set up form cursor context for grid re-render
The toggle-amount-mode handler was failing because account-grid-body*
uses fc/cursor-map which requires the form cursor context to be set up.
Added manual cursor binding in toggle-amount-mode to create a cursor
pointing to the transaction/accounts vector and bind it to fc/*current*
before rendering the grid.
2026-05-21 07:33:15 -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
351659f8eb Fix toggle-amount-mode: properly update request state with converted accounts and new mode
The assoc-in call had too many arguments, so the request state wasn't being
updated with the new mode or converted accounts. Using -> threading with
separate assoc-in calls ensures both the accounts and mode are properly set
before re-rendering the grid.
2026-05-20 23:18:35 -07:00
4739769297 Fix $/% toggle: handle nil amounts and make toggle horizontal
- Fix Math/abs nil error when adding new accounts by using (or value 0.0)
- Fix Math/abs nil in account-grid-body* and save-handler for safety
- Make $/% radio toggle display side-by-side using :orientation :horizontal
- Apply fixes to edit-wizard-new-account render, account-grid-body*, and save-handler
2026-05-20 23:15:05 -07:00
567db50a66 Add $/% toggle for transaction account amounts in manual edit
When editing a transaction manually, users can now toggle between viewing
account amounts as dollar values or percentages. The toggle appears in the
table header as a radio button group ($ / %).

Key features:
- Global toggle switches all accounts simultaneously
- $→%: amounts are converted to percentages of the transaction total
- %→$: uses percentages->dollars with spread-cents for accurate cent distribution
- Form state preserves vendor, memo, approval status when toggling
- Save handler converts % back to $ before persisting to Datomic
- Uses HTMX to re-render only the account grid body on toggle

New route: /toggle-amount-mode
New functions: ->percentage, percentages->dollars, convert-accounts-mode,
              account-grid-body*, toggle-amount-mode
2026-05-20 23:07:11 -07:00
dbfa04c766 Add design spec for transaction account $/% toggle 2026-05-20 22:34:01 -07:00
0692089e39 Flash transaction row after editing through modal
When a transaction is saved via the edit modal, return the updated row
HTML with {:flash? true} instead of an empty div. This makes the row
flash with the live-added animation, matching the behavior of other
pages like invoices and accounts.

Uses hx-retarget to swap the specific row in the table while also
triggering modalclose to close the modal.
2026-05-20 21:39:30 -07:00
8189a7648b Fix Datomic conflict when spreading shared location across accounts
When a transaction account had 'Shared' location, spread-account was
creating multiple accounts with the same :db/id but different locations,
causing a datoms-conflict error in Datomic.

Now generates unique tempids for all spread accounts beyond the first,
preventing entity ID collisions while preserving the original account's
tempid for the first location.

Fixes: Two datoms in the same transaction conflict on :transaction-account/location
2026-05-20 21:33:44 -07:00
dd4d1a6d4f Add error message to require-approval validator
Ensure the validation error message shows up properly when users try
to approve a manual transaction without assigning financial accounts.
2026-05-20 21:29:03 -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
0811771ae6 Fix manual transaction validation: require accounts when approving
- Add require-approval schema validation for :manual action
- Fix keyword comparison to use :transaction-approval-status/approved
- Move require-approval function before schema definition
- Also fix save handler validation to use correct keyword
2026-05-20 21:23:20 -07:00
c6b55ce567 Show potential-duplicates filter only when a bank account is selected 2026-05-20 21:14:21 -07:00
1f9a7080e1 Fix linked-to filter to handle empty string as nil 2026-05-20 21:02:23 -07:00
6f7f1c7815 Add linking, location, import-batch, and potential-duplicates filters to SSR transactions 2026-05-20 20:59:43 -07:00
065d1182d7 Add unresolved-only and financial account filters to SSR transaction listing 2026-05-20 20:51:22 -07:00
b42e2a6a44 adds unresolved only 2026-05-20 20:45:39 -07:00
e8979738ab Merge branch 'master' into staging 2026-05-19 20:55:27 -07:00
08b948c24b fixes 2026-05-19 20:55:21 -07:00
aae1d2168b Merge branch 'master' into staging 2026-05-19 09:22:23 -07:00
83a739ac5b Adds clojure agent 2026-05-19 09:21:28 -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
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
4997a40c00 fixes build 2026-05-18 15:50:09 -07:00
bc89a7d586 fixes 2026-05-18 15:39:31 -07:00
a156ac99fe tries sales changes 2026-05-18 15:38:07 -07:00
7eda6849d1 improved 2026-05-18 11:31:54 -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
3512ad858d merged 2026-05-16 07:21:13 -07:00
Bryce
455cec7828 Merge branch 'master' of gitea.story-basking.ts.net:notid/integreat 2026-05-16 07:14:01 -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
bd82f555c2 Merge branch 'master' of gitea.story-basking.ts.net:notid/integreat 2026-05-15 19:48:34 -07:00
a78c818270 Merge pull request 'docs: comprehensive test behavior documentation for all pages' (#6) from test-plan-docs into master
Reviewed-on: #6
2026-05-04 13:55:03 -07:00
d627e3c5d0 refactor(all): rewrite all behavior docs in table format with checkboxes
Rewrite all 11 remaining behavior documents to match the streamlined
invoice.md format:

- dashboard.md: 250 lines, 62 behaviors
- payment.md: 260 lines, behaviors for list, void, check printing, ACH
- transaction.md: 310 lines, list, import, admin insights
- ledger.md: 519 lines, entries, P&L, balance sheet, cash flows
- company.md: 320 lines, profile, 1099s, Plaid/Yodlee, reports
- admin.md: 494 lines, clients, accounts, vendors, rules, jobs, history
- pos.md: 405 lines, sales, deposits, tenders, refunds, shifts
- search-indicators.md: 167 lines, search modal, indicators
- auth.md: 184 lines, login, logout, impersonation, sessions
- outgoing-invoice.md: 192 lines, create, line items, PDF
- legacy-spa.md: 340 lines, all legacy pages (docs only)

All documents now use:
- Testing Patterns section with reusable abstractions
- Numbered tables: # | Behavior | Test Strategy | Status
- It should... behavior descriptions
- Checkboxes [ ]/[x] for tracking implementation
- Cross-Cutting Behaviors for permissions, lock dates, etc.
- Test Data Requirements tables
- Existing Tests to Preserve sections

Total: 3,844 lines of behavior documentation across 12 subsystem docs.
2026-05-04 13:48:51 -07:00
e14a23ff54 refactor(invoice): rewrite in table format with test strategies and checkboxes
- Add testing patterns section (Grid Page, Wizard, Permission Gates)
- Convert all behaviors to numbered tables with checkboxes
- Specify test strategy per behavior (Unit/Integration/UI)
- Group by feature area: Display, Filter, Sort, Pay Wizard, etc.
- Add cross-cutting Permissions and Lock Date tables
- Reduce from 496 to 403 lines while being more comprehensive
2026-05-04 13:31:02 -07:00