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:
+7
-4
@@ -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();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user