update sale invoice and payload forms of pos
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<hr />
|
||||
<div class="flex items-center justify-center gap-4">
|
||||
@if (['success', 'failure'].includes(saleInvoice.status.value.toLowerCase())) {
|
||||
@if (['success'].includes(saleInvoice.status.value.toLowerCase())) {
|
||||
<p-button
|
||||
label="ابطال"
|
||||
type="button"
|
||||
@@ -33,7 +33,7 @@
|
||||
[loading]="sendingLoading()"
|
||||
[disabled]="onAction()"></p-button>
|
||||
}
|
||||
@if (saleInvoice.status.value.toLowerCase() === 'queued') {
|
||||
@if (['queued', 'fiscal_queued'].includes(saleInvoice.status.value.toLowerCase())) {
|
||||
<p-button
|
||||
label="استعلام وضعیت ارسال"
|
||||
type="button"
|
||||
@@ -42,7 +42,7 @@
|
||||
[loading]="gettingStatusLoading()"
|
||||
[disabled]="onAction()"></p-button>
|
||||
}
|
||||
@if (saleInvoice.status.value.toLowerCase() === 'failure') {
|
||||
@if (saleInvoice.status.value.toLowerCase() === 'send_failure') {
|
||||
<p-button
|
||||
label="ارسال مجدد"
|
||||
type="button"
|
||||
|
||||
@@ -55,6 +55,7 @@ export class PosOrderSubmittedDialogComponent extends AbstractDialog {
|
||||
.subscribe(() => {
|
||||
this.toastService.success({ text: 'ارسال فاکتور با موفقیت انجام شد.' });
|
||||
this.sended.set(true);
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
name="wages"
|
||||
label="اجرت" />
|
||||
|
||||
{{ initialValues?.payload?.profit }}
|
||||
<app-amount-percentage-input
|
||||
[percentageControl]="form.controls.payload.controls.commission_percentage"
|
||||
[amountControl]="form.controls.payload.controls.commission"
|
||||
|
||||
@@ -68,6 +68,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
||||
baseTotalAmount = signal<number>(0);
|
||||
baseAmountForDiscountCalculation = signal<number>(0);
|
||||
taxAmount = signal<number>(0);
|
||||
discountAmount = signal<number>(0);
|
||||
totalAmount = signal<number>(0);
|
||||
|
||||
goldDefaultUnitPrice = signal<number>(0);
|
||||
@@ -87,7 +88,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
||||
[Validators.required, greaterThanValidator(0)],
|
||||
],
|
||||
quantity: [this.initialValues?.quantity || 0, [Validators.required, greaterThanValidator(0)]],
|
||||
discount: [this.initialValues?.discount || 0],
|
||||
discount: [this.initialValues?.discount_amount || 0],
|
||||
discount_percentage: [0, [Validators.max(100), Validators.min(0)]],
|
||||
payload: this.fb.group({
|
||||
commission: [this.initialValues?.payload?.commission || 0, [Validators.required]],
|
||||
@@ -126,6 +127,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
||||
total_amount: this.totalAmount(),
|
||||
base_total_amount: this.baseTotalAmount(),
|
||||
tax_amount: this.taxAmount(),
|
||||
discount_amount: this.form.value.discount || 0,
|
||||
payload: {
|
||||
commission: this.form.controls.payload.controls.commission.value || 0,
|
||||
karat: this.form.controls.payload.controls.karat.value as TGoldKarat,
|
||||
@@ -138,7 +140,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
||||
updateCalculateAmount(payload: Partial<IPosOrderItem<any>>) {
|
||||
const commissionAmount = Number(payload.payload?.commission ?? '0');
|
||||
const wageAmount = Number(payload.payload?.wages ?? '0');
|
||||
const discountAmount = Number(payload.discount ?? '0');
|
||||
const discountAmount = Number(payload.discount_amount ?? '0');
|
||||
const profitAmount = Number(payload.payload?.profit ?? '0');
|
||||
const unitPrice = Number(payload.unit_price ?? '0');
|
||||
const quantity = Number(payload.quantity ?? '0');
|
||||
|
||||
@@ -38,7 +38,7 @@ export class PosStandardPayloadFormComponent extends AbstractForm<
|
||||
[Validators.required, greaterThanValidator(0)],
|
||||
],
|
||||
quantity: [this.initialValues?.quantity || 0, [Validators.required, greaterThanValidator(0)]],
|
||||
discount_amount: [this.initialValues?.discount || 0, [Validators.min(0)]],
|
||||
discount_amount: [this.initialValues?.discount_amount || 0, [Validators.min(0)]],
|
||||
discount_percentage: [0, [Validators.min(0), Validators.max(100)]],
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
optionValue="value" />
|
||||
</div>
|
||||
}
|
||||
v
|
||||
<uikit-field label="تعداد مراحل پرداخت با پوز" name="pay_by_terminal_steps">
|
||||
<p-select
|
||||
[options]="payByTerminalSteps()"
|
||||
|
||||
+5
-1
@@ -7,6 +7,8 @@ import { IPosOrderItem } from './types';
|
||||
|
||||
export interface IPosOrderRequest {
|
||||
total_amount: number;
|
||||
discount_amount: number;
|
||||
tax_amount: number;
|
||||
invoice_date: string;
|
||||
settlement_type: 'CASH' | 'CREDIT' | 'MIXED';
|
||||
payments: IPayment;
|
||||
@@ -23,7 +25,9 @@ export interface IPosOrderRawResponse {
|
||||
invoice_number: number;
|
||||
invoice_date: string;
|
||||
created_at: string;
|
||||
total_amount: string;
|
||||
total_amount: strung;
|
||||
discount_amount: strung;
|
||||
tax_amount: strung;
|
||||
customer: ICustomer;
|
||||
unknown_customer: IUnknownCustomer;
|
||||
status: IEnumTranslate;
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface IPosOrderItem<T = TPosOrderGoodPayload> {
|
||||
quantity: number;
|
||||
total_amount: number;
|
||||
discount_amount: number;
|
||||
tax_amount: number;
|
||||
measure_unit: ISummary;
|
||||
good_id?: string;
|
||||
service_id?: string;
|
||||
@@ -15,8 +16,6 @@ export interface IPosOrderItem<T = TPosOrderGoodPayload> {
|
||||
payload: T;
|
||||
|
||||
base_total_amount: number;
|
||||
discount: number;
|
||||
tax_amount: number;
|
||||
}
|
||||
|
||||
export interface IPosInOrderGood extends Omit<IPosOrderItem, 'good_id' | 'service_id' | 'notes'> {
|
||||
|
||||
@@ -272,6 +272,8 @@ export class PosLandingStore {
|
||||
payments: this.payments(),
|
||||
settlement_type: this.state$().settlement_type,
|
||||
total_amount: this.orderPricingInfo().totalAmount,
|
||||
discount_amount: this.orderPricingInfo().discountAmount,
|
||||
tax_amount: this.orderPricingInfo().taxAmount,
|
||||
};
|
||||
|
||||
// this.toastServices.info({
|
||||
|
||||
Reference in New Issue
Block a user