Commit Graph

102 Commits

Author SHA1 Message Date
943bc18842 update 2026-08-14 18:19:41 -07:00
95d0537c69 feat(sales-summaries): refresh on a schedule, skipping accepted days
sales-summaries-v2 recomputes every dirty summary, but nothing set the dirty
flag on a schedule: mark-all-dirty was only ever called by hand from the
comment block, and the job was registered in neither server.clj's
INTEGREAT_JOB dispatch nor terraform/deploy.tf, so -main was dead code that
could never run in production. Summaries were only recalculated when someone
remembered to do it in the REPL, and POS data keeps arriving after a business
day closes, so a summary computed once on the day was routinely wrong and
stayed wrong.

Add a daily job that marks the trailing 7 days dirty and recomputes them,
leaving finished work alone. "Finished" is the condition the app already calls
Balanced -- debits equal credits and every line is mapped to an account. Since
that is derived rather than stored, a summary that later falls out of balance
is picked up again on the next run.

Extract the Balanced predicate into auto-ap.datomic.sales-summaries so the
grid's pill and the job share one definition, rather than a background job
requiring an SSR namespace. total-debits/total-credits resolve the ledger side
from either a plain keyword or the {:db/ident ...} map a pull returns, and
accepted? requires every item to declare a side: un-normalized pulled items
otherwise sum to 0.0 on both sides, read as balanced, and get skipped
silently and permanently.

Also fix sales-summaries-v2 destroying user-entered line items. It filtered
for :sales-summary-item/manual? to preserve them, but dirty-sales-summaries'
index-pull selector never fetched :sales-summary/items, so manual-items was
always empty. Because items is a component attribute upserted via
[:reset-rels ...], every recompute deleted the hand-entered lines -- often the
very lines that make a summary balance. Harmless while nothing ran on a
schedule; destructive the moment this does.

Register the job in the admin Background Jobs dropdown too, with a days
field: schedules are prod-only, so the admin page is the only way to run it
on staging.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 15:17:54 -07:00
e25e2bfc46 logging updates, makes invoice voiding trigger refresh of running balances. 2024-09-27 16:59:35 -07:00
4c14e43734 Greatly simplifies keeping bank accounts in check 2024-09-27 15:59:21 -07:00
d86492cd8d shows pending balance 2024-09-25 23:34:16 -07:00
85c0e21daf Fixes minor issue with sorting 2024-09-25 23:08:22 -07:00
cf7e7619dc improves sorting on ledger. 2024-09-25 22:48:38 -07:00
db9e0dc459 makes solr ec2 based and adds resiliency to running balances. 2024-09-25 22:01:12 -07:00
4b36cde7a0 tweaks 2024-05-26 20:17:50 -07:00
f4fc82da05 If search index cant be updated, don't throw exception 2024-05-04 18:34:19 -07:00
f1cb203abc solr updates 2024-05-03 11:08:41 -07:00
Bryce
71b5b9864c Applies all of the feedback for the new page 2024-04-14 22:29:01 -07:00
Bryce
ef452aaba5 Allows staging to use solr 2024-03-21 23:27:54 -07:00
Bryce
c22cd9914c Merge branch 'master' into ssr-invoices 2024-03-21 23:06:25 -07:00
Bryce
bbf205d60c fixes prod terraform 2024-03-21 23:06:13 -07:00
Bryce
59f7636f9c connection 2024-03-21 22:37:22 -07:00
Bryce
87952b79d1 simplifies alpine for syncing props. 2024-03-21 21:09:18 -07:00
df4410ac9d Sets up toast 2023-12-03 20:20:26 -08:00
3211635dce removing old square 2023-11-01 10:02:57 -07:00
0c23ccc811 hopefully makes the insights page show correct 2023-09-01 00:24:23 -07:00
Bryce
486c428917 Pregenerates recommendatios 2023-08-19 13:52:44 -07:00
Bryce
e2b67bde91 Makes usage of https for pdfs 2023-08-04 09:41:22 -07:00
Bryce
c5838e5e3a updated terraform 2023-05-24 13:24:39 -07:00
Bryce
8d4ee2bab8 removing potentially problematic log. 2023-05-23 10:20:24 -07:00
Bryce
4c38393842 changes for prod. 2023-05-22 23:30:36 -07:00
Bryce
bb7ce74224 updated terraform 2023-05-22 23:29:04 -07:00
b200728c6a makes cloud search possible. 2023-05-04 17:07:08 -07:00
721596d6f9 merged 2023-05-01 17:10:34 -07:00
a292ee485c Fixes check width to be wider, fixes 1099 page 2023-05-01 15:48:29 -07:00
aca8f7c92c merged. 2023-04-27 11:33:54 -07:00
0f024f970b Added missing vendor 2023-04-27 09:25:53 -07:00
19d83f655f readiness for ntg automatic invoice importation 2023-04-26 14:26:49 -07:00
8fcfe9e880 merged. 2023-04-04 13:11:25 -07:00
8223485f9c attempt to fix. 2023-03-29 19:54:51 -07:00
b03165ad28 Should make restore backup work properly 2023-03-29 19:30:56 -07:00
392b007920 (cloud) allows for automated restore. 2023-03-29 16:52:10 -07:00
b71095e44b Sets up ability to do backups from production 2023-03-28 12:40:23 -07:00
9260834135 scrubbed all reference to datomic.api 2023-03-24 10:59:06 -07:00
8290138156 Fixes build 2023-03-24 10:57:53 -07:00
45ab9fe0af getting cloud working ok. 2023-03-24 10:57:53 -07:00
328b9db323 minor 2022-12-04 20:09:48 -08:00
de8eb31493 Added the ability to load historcial sales yourself. 2022-12-04 20:04:35 -08:00
632d4bb709 minor tweak to make it go better 2022-12-04 14:43:50 -08:00
3e512a52ac adds register invoice import 2022-12-04 11:09:51 -08:00
58fad1b4f1 Adds the ability to sync ezcater orders every few hours 2022-12-04 10:11:44 -08:00
70391b6b56 Allows a background change for bulk ledger 2022-10-01 07:36:42 -07:00
55e3df7e94 Makes new job for Brian 2022-09-30 23:19:15 -07:00
ae1500be9a Makes a whole separate page for recent jobs. 2022-09-30 16:30:11 -07:00
d58e963c92 fix 2022-09-30 09:40:46 -07:00
8774a3951c adds yodlee2 accounts 2022-09-30 08:34:13 -07:00