diff --git a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html index 6964ff4..81ba6ae 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html +++ b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html @@ -16,7 +16,7 @@
- @if (['success', 'failure'].includes(saleInvoice.status.value.toLowerCase())) { + @if (['success'].includes(saleInvoice.status.value.toLowerCase())) { } - @if (saleInvoice.status.value.toLowerCase() === 'queued') { + @if (['queued', 'fiscal_queued'].includes(saleInvoice.status.value.toLowerCase())) { } - @if (saleInvoice.status.value.toLowerCase() === 'failure') { + @if (saleInvoice.status.value.toLowerCase() === 'send_failure') { { this.toastService.success({ text: 'ارسال فاکتور با موفقیت انجام شد.' }); this.sended.set(true); + this.close(); }); } diff --git a/src/app/domains/pos/modules/shop/components/payloads/gold/form.component.html b/src/app/domains/pos/modules/shop/components/payloads/gold/form.component.html index 86bdce3..7bd79a8 100644 --- a/src/app/domains/pos/modules/shop/components/payloads/gold/form.component.html +++ b/src/app/domains/pos/modules/shop/components/payloads/gold/form.component.html @@ -13,7 +13,6 @@ name="wages" label="اجرت" /> - {{ initialValues?.payload?.profit }} (0); baseAmountForDiscountCalculation = signal(0); taxAmount = signal(0); + discountAmount = signal(0); totalAmount = signal(0); goldDefaultUnitPrice = signal(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>) { 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'); diff --git a/src/app/domains/pos/modules/shop/components/payloads/standard/form.component.ts b/src/app/domains/pos/modules/shop/components/payloads/standard/form.component.ts index cf343a7..6609023 100644 --- a/src/app/domains/pos/modules/shop/components/payloads/standard/form.component.ts +++ b/src/app/domains/pos/modules/shop/components/payloads/standard/form.component.ts @@ -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)]], }); diff --git a/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html b/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html index 46ab0c1..e92f1d7 100644 --- a/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html +++ b/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html @@ -24,7 +24,6 @@ optionValue="value" />
} - v { 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 { payload: T; base_total_amount: number; - discount: number; - tax_amount: number; } export interface IPosInOrderGood extends Omit { diff --git a/src/app/domains/pos/modules/shop/store/main.store.ts b/src/app/domains/pos/modules/shop/store/main.store.ts index d9122de..7a6ecc7 100644 --- a/src/app/domains/pos/modules/shop/store/main.store.ts +++ b/src/app/domains/pos/modules/shop/store/main.store.ts @@ -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({ diff --git a/src/app/shared/catalog/taxProviderStatus/tax-provider-status-tag.component.ts b/src/app/shared/catalog/taxProviderStatus/tax-provider-status-tag.component.ts index dd0f335..79e8c8f 100644 --- a/src/app/shared/catalog/taxProviderStatus/tax-provider-status-tag.component.ts +++ b/src/app/shared/catalog/taxProviderStatus/tax-provider-status-tag.component.ts @@ -16,10 +16,12 @@ export class CatalogTaxProviderStatusTagComponent { case 'SUCCESS': return 'success'; case 'FAILURE': + case 'SEND_FAILURE': return 'danger'; case 'NOT_SEND': return 'warn'; case 'QUEUED': + case 'FISCAL_QUEUED': return 'info'; default: return 'secondary'; @@ -35,7 +37,11 @@ export class CatalogTaxProviderStatusTagComponent { case 'NOT_SEND': return 'ارسال نشده'; case 'QUEUED': - return 'در صف ارسال'; + return 'در صف ارسال به معتمد'; + case 'FISCAL_QUEUED': + return 'در صف ارسال به مالیات'; + case 'SEND_FAILURE': + return 'خطا در ارسال'; default: return 'نامشخص'; } diff --git a/src/app/shared/catalog/taxProviderStatus/type.ts b/src/app/shared/catalog/taxProviderStatus/type.ts index 29e177b..da08ec1 100644 --- a/src/app/shared/catalog/taxProviderStatus/type.ts +++ b/src/app/shared/catalog/taxProviderStatus/type.ts @@ -3,6 +3,8 @@ export const TspProviderResponseStatus = { FAILURE: 'FAILURE', NOT_SEND: 'NOT_SEND', QUEUED: 'QUEUED', + FISCAL_QUEUED: 'FISCAL_QUEUED', + SEND_FAILURE: 'SEND_FAILURE', } as const; export type TspProviderResponseStatus = diff --git a/src/app/shared/components/dialog/light-bottomsheet.component.ts b/src/app/shared/components/dialog/light-bottomsheet.component.ts index 91ac5ec..38e2396 100644 --- a/src/app/shared/components/dialog/light-bottomsheet.component.ts +++ b/src/app/shared/components/dialog/light-bottomsheet.component.ts @@ -132,7 +132,6 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha this.syncZIndex(); } if (changes['visible']) { - console.log('changed', this.visible); this.toggleBodyScrollLock(this.visible); } @@ -140,8 +139,6 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha ngOnDestroy() { this.toggleBodyScrollLock(false); - console.log('destroyed'); - this.removeDrawer(); } @@ -171,8 +168,6 @@ export class SharedLightBottomsheetComponent implements OnInit, OnDestroy, OnCha } private toggleBodyScrollLock(locked: boolean) { - console.log('locked', locked); - const body = this.document.body; if (!body) return; diff --git a/src/app/shared/components/invoices/sale-invoice-full-response.model.ts b/src/app/shared/components/invoices/sale-invoice-full-response.model.ts index b233319..01590cf 100644 --- a/src/app/shared/components/invoices/sale-invoice-full-response.model.ts +++ b/src/app/shared/components/invoices/sale-invoice-full-response.model.ts @@ -7,6 +7,8 @@ export interface ISaleInvoiceFullRawResponse { id: string; code: string; total_amount: string; + discount_amount: string; + tax_amount: string; invoice_date: string; consumer_account: ConsumerAccount; pos: Pos; diff --git a/src/app/shared/components/invoices/sale-invoice-single-view.component.html b/src/app/shared/components/invoices/sale-invoice-single-view.component.html index 8109cd4..6a208f7 100644 --- a/src/app/shared/components/invoices/sale-invoice-single-view.component.html +++ b/src/app/shared/components/invoices/sale-invoice-single-view.component.html @@ -33,6 +33,8 @@ اطلاعات پرداخت
+ + @for (payment of invoice.payments; track $index) { { - console.log('dateStr', jalaliToGregorian(dateStr)); - this.valueChange.emit(dateStr); if (this.control) this.control.setValue(dayjs(dateStr).toISOString()); }, diff --git a/src/environments/environment.tis.ts b/src/environments/environment.tis.ts index 8873f90..914a195 100644 --- a/src/environments/environment.tis.ts +++ b/src/environments/environment.tis.ts @@ -2,7 +2,8 @@ export const environment = { production: true, // apiBaseUrl: 'https://psp-api.shift-am.ir', - apiBaseUrl: 'http://192.168.128.73:5002', + // apiBaseUrl: 'http://192.168.128.73:5002', + apiBaseUrl: 'http://localhost:5002', host: 'localhost', port: 5000, enableLogging: false,