Compare commits
3 Commits
96c31d2cc7
...
3ac7cbdf5d
Author | SHA1 | Date | |
---|---|---|---|
3ac7cbdf5d | |||
3ad03226ae | |||
02c1444203 |
|
@ -28,6 +28,7 @@ export interface Category {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
parent_id: number;
|
parent_id: number;
|
||||||
|
name_with_parent: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Expense {
|
export interface Expense {
|
||||||
|
|
|
@ -264,23 +264,6 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="mb-4 px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600"
|
|
||||||
onclick={() => {
|
|
||||||
currentExpense.children?.push({
|
|
||||||
id: 0,
|
|
||||||
card_id: 0,
|
|
||||||
type_id: 0,
|
|
||||||
value: 0,
|
|
||||||
comment: "",
|
|
||||||
date: "",
|
|
||||||
show_value: "",
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
+ Add Item
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{#each (currentExpense.children as Partial<Expense>[]) as child, index}
|
{#each (currentExpense.children as Partial<Expense>[]) as child, index}
|
||||||
<div class="p-4 bg-white mb-4 rounded-lg shadow-md">
|
<div class="p-4 bg-white mb-4 rounded-lg shadow-md">
|
||||||
|
@ -373,6 +356,24 @@
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="mb-4 px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600"
|
||||||
|
onclick={() => {
|
||||||
|
currentExpense.children?.push({
|
||||||
|
id: 0,
|
||||||
|
card_id: 0,
|
||||||
|
type_id: 0,
|
||||||
|
value: 0,
|
||||||
|
comment: "",
|
||||||
|
date: "",
|
||||||
|
show_value: "",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
+ Add Item
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring focus:ring-indigo-200 focus:border-indigo-500"
|
class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring focus:ring-indigo-200 focus:border-indigo-500"
|
||||||
>
|
>
|
||||||
{#each cards as card}
|
{#each cards as card}
|
||||||
<option value={card.id}>{card.name}</option>
|
<option value={card.id}>{card.display_name}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
@ -221,7 +221,7 @@
|
||||||
class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring focus:ring-indigo-200 focus:border-indigo-500"
|
class="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-md focus:ring focus:ring-indigo-200 focus:border-indigo-500"
|
||||||
>
|
>
|
||||||
{#each categories as category}
|
{#each categories as category}
|
||||||
<option value={category.id}>{category.name}</option>
|
<option value={category.id}>{category.name_with_parent}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user