fix(reconcile): prevent split/tag double-counting on reconciled transactions

Move splits, tags and overrides from manual to statement side on reconcile
(delete from manual after copying) instead of just copying. Add read-time
filter to exclude reconciled manual transactions from balance and shared
transaction queries. Also adds participant filter to shared expenses page.
This commit is contained in:
2026-05-11 19:15:41 +10:00
parent ce67e38d77
commit b8cd1b0f89
5 changed files with 41 additions and 10 deletions
+7 -4
View File
@@ -210,12 +210,15 @@ export function useParticipantBalances(tagIds?: string[]) {
});
}
export function useSharedTransactions(tagIds?: string[]) {
export function useSharedTransactions(tagIds?: string[], participantId?: number) {
return useQuery({
queryKey: ["shared-transactions", tagIds],
queryKey: ["shared-transactions", tagIds, participantId],
queryFn: async () => {
const params = tagIds?.length ? `?tag_ids=${tagIds.join(",")}` : "";
const res = await fetch(`/api/shared-transactions${params}`);
const sp = new URLSearchParams();
if (tagIds?.length) sp.set("tag_ids", tagIds.join(","));
if (participantId) sp.set("participant_id", String(participantId));
const query = sp.toString() ? `?${sp.toString()}` : "";
const res = await fetch(`/api/shared-transactions${query}`);
return res.json();
},
});