remove unused codes and update

This commit is contained in:
2026-05-10 09:44:30 +03:30
parent a138034c06
commit 048e292bdd
107 changed files with 317 additions and 17930 deletions
@@ -28,7 +28,7 @@ export class PosOrderCustomerDialogComponent extends AbstractDialog {
customerTypes = [
{
label: 'بدون اطلاعات (نوع دوم)',
label: 'نوع دوم',
value: 'UNKNOWN',
},
{
@@ -12,7 +12,7 @@
</div>
<div class="flex gap-2 justify-center">
<button pButton type="button" outlined (click)="printInvoice()">چاپ</button>
<button pButton type="button" outlined (click)="sendToTsp()">ارسال به سامانه مودیان</button>
<button pButton type="button" outlined (click)="sendInvoice()">ارسال به سامانه مودیان</button>
<button pButton type="button" outlined (click)="openOrderDetails()">جزئیات</button>
</div>
</shared-dialog>
@@ -1,10 +1,14 @@
import { NativeBridgeService } from '@/core/services';
import { ToastService } from '@/core/services/toast.service';
import { PosInfoStore } from '@/domains/pos/store';
import { AbstractDialog } from '@/shared/abstractClasses/abstract-dialog';
import { SharedDialogComponent } from '@/shared/components';
import { Component, inject, Input, signal } from '@angular/core';
import { formatJalali } from '@/utils';
import { Component, computed, inject, Input, signal } from '@angular/core';
import { Router } from '@angular/router';
import { ButtonDirective } from 'primeng/button';
import { finalize } from 'rxjs';
import { posSaleInvoicesNamedRoutes } from '../../../saleInvoices/constants';
import { PosSaleInvoicesService } from '../../../saleInvoices/services/main.service';
import { IPosOrderResponse } from '../../models';
@@ -18,12 +22,24 @@ export class PosOrderSubmittedDialogComponent extends AbstractDialog {
private readonly nativeBridgeService = inject(NativeBridgeService);
private readonly service = inject(PosSaleInvoicesService);
private readonly toastService = inject(ToastService);
private readonly posInfoStore = inject(PosInfoStore);
private readonly router = inject(Router);
readonly posName = computed(() => {
if (this.posInfoStore.entity()) {
const { name, businessActivity, complex } = this.posInfoStore.entity()!;
return `${name} (${businessActivity.name} - ${complex.name})`;
}
return '';
});
sendingLoading = signal(false);
sended = signal(false);
openOrderDetails() {
this.close();
this.router.navigateByUrl(
posSaleInvoicesNamedRoutes.saleInvoice.meta.pagePath!(this.invoice.id),
);
}
sendInvoice() {
@@ -39,15 +55,14 @@ export class PosOrderSubmittedDialogComponent extends AbstractDialog {
printInvoice() {
const printResult = this.nativeBridgeService.print({
title: 'رسید پرداخت',
title: `فروشگاه ${this.posName()}`,
items: [
{ label: 'مبلغ کل', value: String(this.invoice.code) },
// { label: 'نقدی', value: String(this.invoice.payment.cash || 0) },
// { label: 'تهاتر', value: String(this.invoice.payment.set_off || 0) },
// {
// label: 'پایانه',
// value: String((this.invoice.payment.terminals || []).reduce((acc, item) => acc + item, 0)),
// },
{
label: 'شماره فاکتور',
value: this.invoice.code,
},
{ label: 'تاریخ', value: formatJalali(this.invoice.invoice_date, 'YYYY/MM/DD') },
{ label: 'مبلغ کل', value: this.invoice.total_amount },
],
});
}
@@ -247,7 +247,7 @@ export class PosPaymentFormDialogComponent extends AbstractFormDialog<IPayment,
(terminal) => terminal.value!,
);
this.selectedPayByTerminalStep.set(terminalPayments.length);
this.selectedPayByTerminalStep.set(terminalPayments.length || 1);
if (terminalPayments.length) {
if (this.nativeBridgeService.isEnabled()) {