Commit Graph

2423 Commits

Author SHA1 Message Date
3441ae63b4 fix: normalize account ref map to db/id in simple mode rendering
When a transaction is pre-coded, the snapshot stores :transaction-account/account
as a Datomic ref map {:db/id N} rather than a bare integer. simple-mode-fields*
and the simpleAccountId Alpine initializer both need the integer id, not the map,
to correctly populate the account typeahead value and the x-hx-val binding.
2026-05-28 00:10:15 -07:00
79ddda624a fix: change toggle-mode links from hx-get to hx-post so form data is submitted 2026-05-27 23:53:43 -07:00
cbb9bc750d fix: prefer step-params over snapshot for row-count and existing-row 2026-05-27 23:49:59 -07:00
9997d60de1 fix: handle absent :transaction/accounts in simple-mode-fields* (ValCursor crash) 2026-05-27 23:07:52 -07:00
06fb0ea067 feat: update edit-vendor-changed-handler to support simple/advanced mode 2026-05-27 22:03:13 -07:00
9a7d0b8b18 feat: add edit-wizard-toggle-mode-handler 2026-05-27 21:59:33 -07:00
70a3db9a64 fix: repair vendor-changed swap target and remove unused declare 2026-05-27 21:57:11 -07:00
4e22fb1d82 feat: extract manual-coding-section* with simple/advanced mode selection 2026-05-27 21:52:09 -07:00
a88dcf4122 fix: safe cursor indexing in simple-mode-fields* 2026-05-27 21:44:54 -07:00
00b5303c28 feat: add simple-mode-fields* for transaction edit modal 2026-05-27 21:40:04 -07:00
ab1a2c3368 feat: add edit-wizard-toggle-mode route 2026-05-27 21:35:21 -07:00
17eebe5628 Add http-port override, login UI improvements, and dev tooling 2026-05-27 14:13:43 -07:00
e5a2d0bbba Simplify sysco line item allocation: use actual amounts, default unmatched to food cost (50000) 2026-05-27 13:22:29 -07:00
7db1e07512 new glimpse test. 2026-05-27 10:14:54 -07:00
de933699aa Merge branch 'integreat-assorted' into staging 2026-05-26 23:20:45 -07:00
4fca49bff0 fixes a number of issues 2026-05-26 23:20:31 -07:00
2f9da3cdd9 general improvements 2026-05-26 22:25:47 -07:00
78bd1d92e0 Merge branch 'integreat-invoices-for-ntg' into staging 2026-05-26 22:04:37 -07:00
99dd88329e uses percent 2026-05-26 22:04:21 -07:00
de73233a08 transaction dialog now uses sidebar. 2026-05-26 21:58:24 -07:00
11cc887671 unique locations 2026-05-26 21:56:58 -07:00
a4d7ac5982 Allows upload of CSV of sysco with line item parsing 2026-05-26 21:53:04 -07:00
f42d937691 fix: replace broken hx-vals JS with hx-include for transaction nav links
The hx-vals attribute with a JavaScript IIFE was causing a SyntaxError
when navigating to the transactions page from any other page. Replaced
with hx-include="#transaction-filters" which correctly preserves
filter state across transaction sub-pages.
2026-05-26 21:16:37 -07:00
200056098f feat: add memo filter and enhance description filter with regex matching
- Add new memo filter to transaction page (searches :transaction/memo)
- Enhance existing description filter to use case-insensitive regex
- Both filters support wildcard matching via .* pattern
- Add e2e tests for filter functionality
- Update test data with memo fields
2026-05-26 16:34:56 -07:00
712b2c0cb8 fix: use cleansed-query for Solr client name search
Fixes substring search in company dropdown. The search query was
using raw user input instead of the cleansed version that adds a
wildcard suffix (e.g. 'dough' -> 'dough*'). Without the wildcard,
Solr performs exact token matching, so searching 'dough' would not
match 'Doughballs'.
2026-05-26 13:21:53 -07:00
85652a7ce7 horizontal 2026-05-26 11:57:59 -07:00
ae0788e6dd improvements 2026-05-26 11:18:52 -07:00
f239b114c3 Merge branch 'integreat-fix-errors' into staging 2026-05-24 21:54:54 -07:00
8e3aa13f4d fixes 2026-05-24 21:54:37 -07:00
5b2aba561c feat: support exact client code match in dropdown search
When typing in the company dropdown search, check for an exact match
on client code via Datomic before falling back to Solr name search.
This allows users to quickly find clients by typing their code (e.g. NGRV).
2026-05-23 13:24:40 -07:00
3715910029 adds invoices dates 2026-05-23 12:28:21 -07:00
03bfca35cb Fix bulk code vendor pre-population for single vs multi-client contexts
- vendor-default-account now uses raw vendor default account (not client-specific override)
- Account name is clientized via d-accounts/clientize only for single-client contexts
- Added single-client-id helper that returns client ID only when user has exactly one client
- Added multi-client e2e test verifying no pre-population across multiple clients
- Updated test server to support multi-client mode switching via /test-set-client-mode
- Test server now seeds a second client for multi-client scenarios
2026-05-23 11:21:22 -07:00
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
8bd0cee1b1 Add e2e tests for bulk coding transactions and fix SSR location validation
- Create requirements document based on master cljs implementation
- Add Playwright e2e tests covering happy path, validation, and distribution
- Fix hiccup id syntax in SSR bulk code form (div#id.class order)
- Add missing account location validation to SSR bulk code submit
- Enhance test server with multiple transactions and fixed-location account
2026-05-21 13:21:22 -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
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