From 102007216e61746702261f9ef0406ca86fea37b1 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Wed, 27 Nov 2024 07:51:13 +0200 Subject: [PATCH] Add bulk epense route page --- src/routes/expense/bulk/+page.svelte | 386 +++++++++++++++++++++++++++ 1 file changed, 386 insertions(+) create mode 100644 src/routes/expense/bulk/+page.svelte diff --git a/src/routes/expense/bulk/+page.svelte b/src/routes/expense/bulk/+page.svelte new file mode 100644 index 0000000..3f77772 --- /dev/null +++ b/src/routes/expense/bulk/+page.svelte @@ -0,0 +1,386 @@ + + +{#if error} +

{error}

+{/if} + +
+
+ +

Manage Expenses in Bulk

+
+ +
+

Add New Root Expense

+
+ { + currentExpense.propagate_card_id = !currentExpense.propagate_card_id; + currentExpense.card_id = 0; + }} + title={"Set parent card_id"} + /> + {#if currentExpense.propagate_card_id} + + {/if} + + { + currentExpense.propagate_type_id = !currentExpense.propagate_type_id; + currentExpense.type_id = 0; + }} + title={"Set parent type_id"} + /> + {#if currentExpense.propagate_type_id} + + {/if} + + { + currentExpense.propagate_value = !currentExpense.propagate_value; + currentExpense.value = 0; + }} + title={"Set parent value"} + /> + {#if currentExpense.propagate_value} + + {getBalanceOfSelectedCardAfterExpense()} + {/if} + + { + currentExpense.propagate_comment = !currentExpense.propagate_comment; + currentExpense.comment = ""; + }} + title={"Set parent comment"} + /> + {#if currentExpense.propagate_comment} + + {/if} + + { + currentExpense.propagate_date = !currentExpense.propagate_date; + currentExpense.date = ""; + }} + title={"Set parent date"} + /> + {#if currentExpense.propagate_date} +
+ + + +
+ {/if} + + + {#each (currentExpense.children as Partial[]) as child, index} +
+

Expense {index + 1}

+ + {#if !currentExpense.propagate_card_id} + + {/if} + + {#if !currentExpense.propagate_type_id} + + {/if} + + {#if !currentExpense.propagate_value} + + {/if} + + {#if !currentExpense.propagate_comment} + + {/if} + + {#if !currentExpense.propagate_date} +
+ + + +
+ {/if} +
+ {/each} + +
+ +
+ +
+