Show is_open in EditAccount
This commit is contained in:
		@@ -3,12 +3,14 @@ import { computed, ref } from 'vue';
 | 
			
		||||
import Modal from '../components/Modal.vue';
 | 
			
		||||
import { useAccountStore } from '../stores/budget-account';
 | 
			
		||||
import Input from '../components/Input.vue';
 | 
			
		||||
import Checkbox from '../components/Checkbox.vue';
 | 
			
		||||
 | 
			
		||||
const accountStore = useAccountStore();
 | 
			
		||||
const CurrentAccount = computed(() => accountStore.CurrentAccount);
 | 
			
		||||
 | 
			
		||||
const accountName = ref("");
 | 
			
		||||
const accountOnBudget = ref(true);
 | 
			
		||||
const accountOpen = ref(true);
 | 
			
		||||
 | 
			
		||||
function editAccount(e : any) {
 | 
			
		||||
    accountStore.EditAccount(CurrentAccount.value?.ID ?? "", accountName.value, accountOnBudget.value);
 | 
			
		||||
@@ -17,6 +19,7 @@ function editAccount(e : any) {
 | 
			
		||||
function openEditAccount(e : any) {
 | 
			
		||||
    accountName.value = CurrentAccount.value?.Name ?? "";
 | 
			
		||||
    accountOnBudget.value = CurrentAccount.value?.OnBudget ?? true;
 | 
			
		||||
    accountOpen.value = CurrentAccount.value?.IsOpen ?? true;
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@@ -33,13 +36,20 @@ function openEditAccount(e : any) {
 | 
			
		||||
            />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="mt-2 px-7 py-3">
 | 
			
		||||
            <Input
 | 
			
		||||
            <Checkbox
 | 
			
		||||
                class="border-2"
 | 
			
		||||
                type="checkbox"
 | 
			
		||||
                v-model="accountOnBudget"
 | 
			
		||||
                required
 | 
			
		||||
            />
 | 
			
		||||
            <label>On Budget</label>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="mt-2 px-7 py-3">
 | 
			
		||||
            <Checkbox
 | 
			
		||||
                class="border-2"
 | 
			
		||||
                v-model="accountOpen"
 | 
			
		||||
                required
 | 
			
		||||
            />
 | 
			
		||||
            <label>Open</label>
 | 
			
		||||
        </div>
 | 
			
		||||
    </Modal>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -16,6 +16,7 @@ export interface Account {
 | 
			
		||||
    ID: string
 | 
			
		||||
    Name: string
 | 
			
		||||
    OnBudget: boolean
 | 
			
		||||
    IsOpen: boolean
 | 
			
		||||
    ClearedBalance: number
 | 
			
		||||
    WorkingBalance: number
 | 
			
		||||
    ReconciledBalance: number
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user