Chore: Reformatted everthing
Fix: Product ledger was not totalling. This is because for some reason, pydantic was sending the data as string when the field was nullable
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
autocomplete="off"
|
||||
/>
|
||||
<mat-hint *ngIf="accBal">
|
||||
Balance as on Date: <strong>{{ accBal.date | currency: 'INR' | accounting }}</strong> /
|
||||
Final balance: <strong>{{ accBal.total | currency: 'INR' | accounting }}</strong>
|
||||
Balance as on Date: <strong>{{ accBal.date | currency: 'INR' | accounting }}</strong> / Final balance:
|
||||
<strong>{{ accBal.total | currency: 'INR' | accounting }}</strong>
|
||||
</mat-hint>
|
||||
<mat-autocomplete
|
||||
#autoA="matAutocomplete"
|
||||
@@ -48,9 +48,7 @@
|
||||
[displayWith]="displayFn"
|
||||
(optionSelected)="accountSelected($event)"
|
||||
>
|
||||
<mat-option *ngFor="let account of accounts | async" [value]="account">{{
|
||||
account.name
|
||||
}}</mat-option>
|
||||
<mat-option *ngFor="let account of accounts | async" [value]="account">{{ account.name }}</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-auto basis-1/5">
|
||||
@@ -60,10 +58,7 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div
|
||||
formGroupName="addRow"
|
||||
class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col"
|
||||
>
|
||||
<div formGroupName="addRow" class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
|
||||
<mat-form-field class="flex-auto basis-1/2 mr-5">
|
||||
<mat-label>Product</mat-label>
|
||||
<input
|
||||
@@ -80,9 +75,7 @@
|
||||
[displayWith]="displayFn"
|
||||
(optionSelected)="productSelected($event)"
|
||||
>
|
||||
<mat-option *ngFor="let product of products | async" [value]="product">{{
|
||||
product.name
|
||||
}}</mat-option>
|
||||
<mat-option *ngFor="let product of products | async" [value]="product">{{ product.name }}</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-auto basis-1/10 mr-5">
|
||||
@@ -102,9 +95,7 @@
|
||||
<input type="text" matInput formControlName="discount" autocomplete="off" />
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-raised-button color="primary" (click)="addRow()" class="flex-auto basis-1/10">
|
||||
Add
|
||||
</button>
|
||||
<button mat-raised-button color="primary" (click)="addRow()" class="flex-auto basis-1/10">Add</button>
|
||||
</div>
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
<!-- Product Column -->
|
||||
@@ -116,9 +107,7 @@
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="quantity">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Quantity</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{
|
||||
row.quantity | number: '1.2-2'
|
||||
}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.quantity | number: '1.2-2' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Rate Column -->
|
||||
@@ -136,17 +125,13 @@
|
||||
<!-- Discount Column -->
|
||||
<ng-container matColumnDef="discount">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Discount</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{
|
||||
row.discount | percent: '1.2-2'
|
||||
}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.discount | percent: '1.2-2' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Amount Column -->
|
||||
<ng-container matColumnDef="amount">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Amount</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{
|
||||
row.amount | currency: 'INR'
|
||||
}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.amount | currency: 'INR' }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Action Column -->
|
||||
@@ -170,11 +155,7 @@
|
||||
<textarea matInput matAutosizeMinRows="5" formControlName="narration"></textarea>
|
||||
</mat-form-field>
|
||||
<div class="flex flex-row justify-center items-stretch mr-5">
|
||||
<div
|
||||
class="img-container"
|
||||
class="flex-auto mr-5 basis-1/5"
|
||||
*ngFor="let item of voucher.files"
|
||||
>
|
||||
<div class="img-container" class="flex-auto mr-5 basis-1/5" *ngFor="let item of voucher.files">
|
||||
<img [src]="item.thumbnail" (click)="zoomImage(item)" />
|
||||
<button mat-icon-button class="overlay" (click)="deleteImage(item)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
@@ -211,13 +192,7 @@
|
||||
>
|
||||
{{ voucher.posted ? 'Posted' : 'Post' }}
|
||||
</button>
|
||||
<button
|
||||
mat-raised-button
|
||||
color="warn"
|
||||
(click)="confirmDelete()"
|
||||
*ngIf="voucher.id"
|
||||
[disabled]="!canSave()"
|
||||
>
|
||||
<button mat-raised-button color="warn" (click)="confirmDelete()" *ngIf="voucher.id" [disabled]="!canSave()">
|
||||
Delete
|
||||
</button>
|
||||
<span class="fill-remaining-space"></span>
|
||||
|
||||
Reference in New Issue
Block a user