Updates default chart of accounts
Expands the default chart of accounts with a more detailed hierarchical structure. This includes new accounts for fixed assets, livestock, equity contributions, and detailed expense categories. The migration script only adds accounts that don't already exist, ensuring a smooth update process.
This commit is contained in:
parent
6f62c52c68
commit
88aaf0e28e
3 changed files with 89 additions and 29 deletions
|
|
@ -1,3 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
{% extends "base.html" %}
|
||||
{% from "macros.jinja" import window_vars with context %}
|
||||
|
||||
|
|
@ -41,21 +42,21 @@
|
|||
|
||||
<!-- Tabs for different views -->
|
||||
<q-tabs v-model="activeTab" class="text-primary" dense>
|
||||
<q-tab name="by-user" icon="people" label="By User" />
|
||||
<q-tab name="by-account" icon="account_balance" label="By Account" />
|
||||
<q-tab name="by-user" icon="people" label="By User"></q-tab>
|
||||
<q-tab name="by-account" icon="account_balance" label="By Account"></q-tab>
|
||||
</q-tabs>
|
||||
|
||||
<q-separator />
|
||||
<q-separator></q-separator>
|
||||
|
||||
<q-tab-panels v-model="activeTab" animated>
|
||||
<!-- By User View -->
|
||||
<q-tab-panel name="by-user">
|
||||
<div v-if="loading" class="row justify-center q-pa-md">
|
||||
<q-spinner color="primary" size="3em" />
|
||||
<q-spinner color="primary" size="3em"></q-spinner>
|
||||
</div>
|
||||
|
||||
<div v-else-if="permissionsByUser.size === 0" class="text-center q-pa-md">
|
||||
<q-icon name="info" size="3em" color="grey-5" />
|
||||
<q-icon name="info" size="3em" color="grey-5"></q-icon>
|
||||
<p class="text-grey-6">No permissions granted yet</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -63,14 +64,14 @@
|
|||
<q-card v-for="[userId, userPerms] in permissionsByUser" :key="userId" flat bordered>
|
||||
<q-card-section>
|
||||
<div class="text-h6 q-mb-sm">
|
||||
<q-icon name="person" class="q-mr-sm" />
|
||||
<q-icon name="person" class="q-mr-sm"></q-icon>
|
||||
User: {% raw %}{{ userId }}{% endraw %}
|
||||
</div>
|
||||
<q-list separator>
|
||||
<q-item v-for="perm in userPerms" :key="perm.id">
|
||||
<q-item-section avatar>
|
||||
<q-avatar :color="getPermissionColor(perm.permission_type)" text-color="white" size="sm">
|
||||
<q-icon :name="getPermissionIcon(perm.permission_type)" />
|
||||
<q-icon :name="getPermissionIcon(perm.permission_type)"></q-icon>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
|
|
@ -112,11 +113,11 @@
|
|||
<!-- By Account View -->
|
||||
<q-tab-panel name="by-account">
|
||||
<div v-if="loading" class="row justify-center q-pa-md">
|
||||
<q-spinner color="primary" size="3em" />
|
||||
<q-spinner color="primary" size="3em"></q-spinner>
|
||||
</div>
|
||||
|
||||
<div v-else-if="permissionsByAccount.size === 0" class="text-center q-pa-md">
|
||||
<q-icon name="info" size="3em" color="grey-5" />
|
||||
<q-icon name="info" size="3em" color="grey-5"></q-icon>
|
||||
<p class="text-grey-6">No permissions granted yet</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -124,14 +125,14 @@
|
|||
<q-card v-for="[accountId, accountPerms] in permissionsByAccount" :key="accountId" flat bordered>
|
||||
<q-card-section>
|
||||
<div class="text-h6 q-mb-sm">
|
||||
<q-icon name="account_balance" class="q-mr-sm" />
|
||||
<q-icon name="account_balance" class="q-mr-sm"></q-icon>
|
||||
{% raw %}{{ getAccountName(accountId) }}{% endraw %}
|
||||
</div>
|
||||
<q-list separator>
|
||||
<q-item v-for="perm in accountPerms" :key="perm.id">
|
||||
<q-item-section avatar>
|
||||
<q-avatar :color="getPermissionColor(perm.permission_type)" text-color="white" size="sm">
|
||||
<q-icon :name="getPermissionIcon(perm.permission_type)" />
|
||||
<q-icon :name="getPermissionIcon(perm.permission_type)"></q-icon>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
|
|
@ -196,7 +197,7 @@
|
|||
:rules="[val => !!val || 'User ID is required']"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="person" />
|
||||
<q-icon name="person"></q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -215,7 +216,7 @@
|
|||
:rules="[val => !!val || 'Account is required']"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="account_balance" />
|
||||
<q-icon name="account_balance"></q-icon>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
|
|
@ -234,7 +235,7 @@
|
|||
:rules="[val => !!val || 'Permission type is required']"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="security" />
|
||||
<q-icon name="security"></q-icon>
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
|
|
@ -256,7 +257,7 @@
|
|||
dense
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" />
|
||||
<q-icon name="event"></q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -271,13 +272,13 @@
|
|||
rows="3"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="note" />
|
||||
<q-icon name="note"></q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn flat label="Cancel" color="grey" v-close-popup />
|
||||
<q-btn flat label="Cancel" color="grey" v-close-popup></q-btn>
|
||||
<q-btn
|
||||
unelevated
|
||||
label="Grant Permission"
|
||||
|
|
@ -285,7 +286,7 @@
|
|||
@click="grantPermission"
|
||||
:loading="granting"
|
||||
:disable="!isGrantFormValid"
|
||||
/>
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
@ -322,14 +323,14 @@
|
|||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn flat label="Cancel" color="grey" v-close-popup />
|
||||
<q-btn flat label="Cancel" color="grey" v-close-popup></q-btn>
|
||||
<q-btn
|
||||
unelevated
|
||||
label="Revoke"
|
||||
color="negative"
|
||||
@click="revokePermission"
|
||||
:loading="revoking"
|
||||
/>
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue