feat: rename 'fee' to 'unitPrice' across purchase components and models
- Updated form component to use 'unitPrice' instead of 'fee'. - Adjusted product charge row form fields and templates to reflect the new naming. - Modified receipt template and related components to utilize 'unitPrice'. - Changed models and interfaces to replace 'fee' with 'unitPrice'. - Updated supplier invoice and statistics components to align with the new naming convention. - Added new API routes for dashboard and statistics modules.
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
</td>
|
||||
<td class="text-center!">
|
||||
@if (item.type === "IN") {
|
||||
<span [appPriceMask]="item.fee"></span>
|
||||
<span [appPriceMask]="item.unitPrice"></span>
|
||||
} @else {
|
||||
0
|
||||
}
|
||||
@@ -54,13 +54,13 @@
|
||||
</td>
|
||||
<td class="text-center!">
|
||||
@if (item.type === "OUT") {
|
||||
<span [appPriceMask]="item.fee"></span>
|
||||
<span [appPriceMask]="item.unitPrice"></span>
|
||||
} @else {
|
||||
0
|
||||
}
|
||||
</td>
|
||||
<td class="text-center!">{{ item.remainedInStock }}</td>
|
||||
<!-- <td class="text-center!"><span [appPriceMask]="item.fee"></span></td>
|
||||
<!-- <td class="text-center!"><span [appPriceMask]="item.unitPrice"></span></td>
|
||||
<td class="text-center!"><span [appPriceMask]="item.totalCost"></span></td> -->
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
[required]="isRequired"
|
||||
[invalid]="control.invalid && (control.touched || control.dirty)"
|
||||
(input)="onInput($event)"
|
||||
(onBlur)="blur.emit()"
|
||||
/>
|
||||
<p-inputgroup-addon>ریال</p-inputgroup-addon>
|
||||
</p-inputgroup>
|
||||
@@ -34,6 +35,7 @@
|
||||
[required]="isRequired"
|
||||
[invalid]="control.invalid && (control.touched || control.dirty)"
|
||||
(input)="onInput($event)"
|
||||
(onBlur)="blur.emit()"
|
||||
/>
|
||||
}
|
||||
@if (hint) {
|
||||
|
||||
@@ -45,6 +45,7 @@ export class InputComponent {
|
||||
@Input() showErrors = false;
|
||||
@Input() hint?: string;
|
||||
@Output() valueChange = new EventEmitter<string | number>();
|
||||
@Output() blur = new EventEmitter<void>();
|
||||
|
||||
onInput(ev: Event) {
|
||||
const v = (ev.target as HTMLInputElement).value;
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
[supplierId]="purchaseReceipt.supplierId.toString()"
|
||||
[inventoryId]="purchaseReceipt.inventoryId.toString()"
|
||||
[invoiceId]="purchaseReceipt.id.toString()"
|
||||
(onSubmit)="submitted()"
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ToastService } from '@/core/services/toast.service';
|
||||
import { SupplierInvoicePayFormComponent } from '@/modules/suppliers/components/invoices/pay-form.component';
|
||||
import { Component, Input, signal } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output, signal } from '@angular/core';
|
||||
import { IPurchaseReceiptResponse } from '../../../modules/purchases/models';
|
||||
import { ConfirmationDialogService } from '../confirmationDialog/confirmation-dialog.service';
|
||||
|
||||
@@ -12,6 +12,8 @@ import { ConfirmationDialogService } from '../confirmationDialog/confirmation-di
|
||||
export class PurchaseReceiptPaymentWrapperComponent {
|
||||
@Input() purchaseReceipt!: IPurchaseReceiptResponse;
|
||||
|
||||
@Output() onSubmit = new EventEmitter<void>();
|
||||
|
||||
showPaymentForm = signal(false);
|
||||
constructor(
|
||||
private confirmService: ConfirmationDialogService,
|
||||
@@ -40,7 +42,12 @@ export class PurchaseReceiptPaymentWrapperComponent {
|
||||
});
|
||||
}
|
||||
|
||||
submit() {}
|
||||
submitted() {
|
||||
console.log('submitted');
|
||||
|
||||
this.showPaymentForm.set(false);
|
||||
this.onSubmit.emit();
|
||||
}
|
||||
|
||||
toPaymentForm() {
|
||||
this.showPaymentForm.set(true);
|
||||
|
||||
Reference in New Issue
Block a user