feat(purchases): implement purchase receipt functionality with form and receipt template

- Added `ProductPurchaseComponent` to handle product purchases.
- Created `PurchaseReceiptTemplateComponent` for displaying purchase receipt details.
- Developed `PurchaseFormComponent` for managing purchase form inputs and submission.
- Introduced `ProductChargeRowFormComponent` and `ProductChargeRowFormFieldsComponent` for handling product charge rows in the form.
- Implemented `PurchaseReceiptProductRowComponent` for displaying individual product rows in the receipt.
- Established API routes for purchase operations in `apiRoutes`.
- Integrated suppliers and inventories selection components.
- Added utility functions for converting prices to Persian alphabet.
- Created a utility for generating full names from name parts.
- Enhanced form validation and submission handling in the purchase form.
- Updated styles and templates for improved UI/UX.
This commit is contained in:
2025-12-09 20:17:00 +03:30
parent abf53bac03
commit 50bc9a4632
77 changed files with 1807 additions and 18834 deletions
@@ -0,0 +1,22 @@
<div class="flex items-stretch gap-2">
<div class="shrink-0 flex items-center">
@if (editMode()) {
<ng-container [ngTemplateOutlet]="field"></ng-container>
} @else {
<ng-container [ngTemplateOutlet]="data"></ng-container>
}
</div>
<div class="relative shrink-0">
<div class="static end-0 top-0">
<button
pButton
size="small"
type="button"
[icon]="'pi ' + (editMode() ? 'pi-times' : 'pi-pencil')"
text
severity="secondary"
(click)="toggleEditMode()"
></button>
</div>
</div>
</div>
@@ -0,0 +1,20 @@
import { CommonModule } from '@angular/common';
import { Component, ContentChild, signal, TemplateRef } from '@angular/core';
import { ButtonDirective } from 'primeng/button';
@Component({
selector: 'shared-inline-edit',
templateUrl: './inline-edit.component.html',
imports: [CommonModule, ButtonDirective],
})
export class InlineEditComponent {
constructor() {}
editMode = signal<boolean>(false);
@ContentChild('data', { static: true }) data?: TemplateRef<any>;
@ContentChild('field', { static: true }) field?: TemplateRef<any>;
toggleEditMode() {
this.editMode.set(!this.editMode());
}
}