ThreadCount Community edition

Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from a113353 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount
2026-09-15 22:54:09 +10:00
commit a6f1059ddf
424 changed files with 53535 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/* Filters on the Stock tabs live in the address, so a link or the help mark lands on the same view.
replaceState keeps typing out of the history and Next keeps useSearchParams in step with it. */
export function setQuery(updates: Record<string, string | null | undefined>) {
if (typeof window === "undefined") return;
const u = new URL(window.location.href);
for (const [k, v] of Object.entries(updates)) {
if (v === null || v === undefined || v === "") u.searchParams.delete(k);
else u.searchParams.set(k, v);
}
window.history.replaceState(null, "", u.pathname + u.search + u.hash);
}
/** Whole dollars for the stock table and totals: $1,008. */
export const wholeMoney = (n: number) => (n < 0 ? "" : "") + "$" + Math.round(Math.abs(n || 0)).toLocaleString("en-AU");