refactor: accounting module (#1202)

See: #1196
This commit is contained in:
Karan Takalkar
2020-08-14 14:46:06 +05:30
committed by GitHub
parent 572a07bf45
commit 8208f6bb01
23 changed files with 49 additions and 42 deletions
@@ -7,13 +7,12 @@
<fa-icon icon="sitemap"></fa-icon>
</mat-button-toggle>
</mat-button-toggle-group>
<button mat-raised-button color="primary" [routerLink]="['gl-accounts/create']">
<button mat-raised-button color="primary" [routerLink]="['gl-accounts/create']" *mifosxHasPermission="'CREATE_GLACCOUNT'">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Add Account
</button>
</div>
<!-- List View -->
<div class="container" [hidden]="viewGroup.value !== 'listView'">
@@ -83,7 +83,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="[cancelRoute]">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!glAccountForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!glAccountForm.valid" *mifosxHasPermission="'CREATE_GLACCOUNT'">Submit</button>
</mat-card-actions>
</form>
@@ -83,7 +83,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="glAccountForm.pristine">Submit</button>
<button mat-raised-button color="primary" [disabled]="glAccountForm.pristine" *mifosxHasPermission="'UPDATE_GLACCOUNT'">Submit</button>
</mat-card-actions>
</form>
@@ -1,21 +1,29 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" *ngIf="glAccount.usage.value === 'HEADER'" [routerLink]="['/accounting/chart-of-accounts/gl-accounts/create']" [queryParams]="{ parent: glAccount.id, accountType: glAccount.type.id }">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Subledger Account
</button>
<button mat-raised-button color="primary" [routerLink]="['edit']">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
<button mat-raised-button color="warn" *ngIf="!glAccount.disabled" (click)="changeGlAccountState()">
<fa-icon icon="lock"></fa-icon>&nbsp;&nbsp;
Disable
</button>
<button mat-raised-button color="accent" *ngIf="glAccount.disabled" (click)="changeGlAccountState()">
<fa-icon icon="lock-open"></fa-icon>&nbsp;&nbsp;
Enable
</button>
<button mat-raised-button color="warn" (click)="deleteGlAccount()">
<span *mifosxHasPermission="'CREATE_GLACCOUNT'">
<button mat-raised-button color="primary" *ngIf="glAccount.usage.value === 'HEADER'" [routerLink]="['/accounting/chart-of-accounts/gl-accounts/create']" [queryParams]="{ parent: glAccount.id, accountType: glAccount.type.id }">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Subledger Account
</button>
</span>
<span *mifosxHasPermission="'UPDATE_GLACCOUNT'">
<button mat-raised-button color="primary" [routerLink]="['edit']">
<fa-icon icon="edit"></fa-icon>&nbsp;&nbsp;
Edit
</button>
</span>
<span *mifosxHasPermission="'UPDATE_GLACCOUNT'">
<button mat-raised-button color="warn" *ngIf="!glAccount.disabled" (click)="changeGlAccountState()">
<fa-icon icon="lock"></fa-icon>&nbsp;&nbsp;
Disable
</button>
</span>
<span *mifosxHasPermission="'UPDATE_GLACCOUNT'">
<button mat-raised-button color="accent" *ngIf="glAccount.disabled" (click)="changeGlAccountState()">
<fa-icon icon="lock-open"></fa-icon>&nbsp;&nbsp;
Enable
</button>
</span>
<button mat-raised-button color="warn" (click)="deleteGlAccount()" *mifosxHasPermission="'DELETE_GLACCOUNT'">
<fa-icon icon="trash"></fa-icon>&nbsp;&nbsp;
Delete
</button>