Feature: Adding recipe templates to print recipes.

Feautre: Recipe export to xlsx
Chore: Python 11 style type annotations
Chore: Moved to sqlalchemy 2.0
Chore: Minimum python is 3.11
Fix: Fix nullability of a lot of fields in the database.
This commit is contained in:
2023-07-23 08:12:21 +05:30
parent d2d26ab1ae
commit 22cac61761
344 changed files with 3247 additions and 2370 deletions
@@ -5,12 +5,22 @@
<mat-card-content>
<form [formGroup]="form" class="flex flex-col">
<div class="flex flex-row justify-around content-start items-start">
<mat-form-field class="flex-auto mr-5">
<mat-label>Date</mat-label>
<input
matInput
[matDatepicker]="date"
formControlName="date"
autocomplete="off"
#dateElement
(focus)="dateElement.select()"
/>
<mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle>
<mat-datepicker #date></mat-datepicker>
</mat-form-field>
<mat-form-field class="flex-auto">
<mat-select formControlName="period">
<mat-option *ngFor="let p of periods" [value]="p">
{{ p.validFrom }} to {{ p.validTill }}
</mat-option>
</mat-select>
<mat-label>Source</mat-label>
<input type="text" matInput formControlName="source" autocomplete="off" />
</mat-form-field>
</div>
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
@@ -39,27 +49,12 @@
<mat-label>Yield</mat-label>
<input type="text" matInput formControlName="recipeYield" autocomplete="off" />
</mat-form-field>
<mat-form-field class="flex-auto basis-1/10 mr-5">
<mat-label>Sale Price</mat-label>
<input type="text" matInput formControlName="salePrice" autocomplete="off" />
<span matTextPrefix>&nbsp;</span>
</mat-form-field>
<mat-form-field class="flex-auto basis-1/10 mr-5">
<mat-label>Cost Price</mat-label>
<input type="text" matInput formControlName="costPrice" autocomplete="off" />
<span matTextPrefix>&nbsp;</span>
</mat-form-field>
<mat-form-field class="flex-auto basis-1/10">
<mat-label>Cost Percentage</mat-label>
<input type="text" matInput formControlName="costPercentage" autocomplete="off" />
<span matSuffix>%</span>
</mat-form-field>
</div>
<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-form-field class="flex-auto basis-2/5 mr-5">
<mat-label>Ingredient</mat-label>
<input
type="text"
@@ -85,6 +80,10 @@
<input type="text" matInput formControlName="quantity" autocomplete="off" />
</mat-form-field>
<mat-form-field class="flex-auto basis-1/5 mr-5">
<mat-label>Description</mat-label>
<input type="text" matInput formControlName="description" autocomplete="off" />
</mat-form-field>
<mat-form-field class="flex-auto basis-1/10 mr-5">
<mat-label>Rate</mat-label>
<input type="text" matInput formControlName="rate" autocomplete="off" />
<span matTextPrefix>&nbsp;</span>
@@ -98,7 +97,7 @@
<!-- Ingredient Column -->
<ng-container matColumnDef="product">
<mat-header-cell *matHeaderCellDef>Product</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.product.name }}</mat-cell>
<mat-cell *matCellDef="let row">{{ row.product.name }} {{ row.description }}</mat-cell>
</ng-container>
<!-- Quantity Column -->
@@ -109,22 +108,6 @@
>
</ng-container>
<!-- Rate Column -->
<ng-container matColumnDef="rate">
<mat-header-cell *matHeaderCellDef class="right">Rate</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{
row.price | currency : 'INR'
}}</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.quantity * row.price | currency : 'INR'
}}</mat-cell>
</ng-container>
<!-- Action Column -->
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef class="center">Action</mat-header-cell>
@@ -138,6 +121,18 @@
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
<mat-form-field class="flex-auto">
<mat-label>Instructions</mat-label>
<textarea matInput matAutosizeMinRows="5" formControlName="instructions"></textarea>
</mat-form-field>
<mat-form-field class="flex-auto">
<mat-label>Garnishing</mat-label>
<textarea matInput matAutosizeMinRows="5" formControlName="garnishing"></textarea>
</mat-form-field>
<mat-form-field class="flex-auto">
<mat-label>Plating</mat-label>
<textarea matInput matAutosizeMinRows="5" formControlName="plating"></textarea>
</mat-form-field>
</form>
</mat-card-content>
<mat-card-actions>