update sale invoices models and some ui fix

This commit is contained in:
2026-05-26 12:06:43 +03:30
parent eb671d5949
commit 9fdd5e451c
20 changed files with 147 additions and 77 deletions
@@ -1,4 +1,11 @@
<div class="flex justify-end gap-2">
<p-button [label]="cancelLabel" severity="secondary" (click)="cancel()" />
<p-button [label]="submitLabel" type="submit" [disabled]="disabled" [loading]="loading" (onClick)="submit()" />
<button pButton [label]="cancelLabel" severity="secondary" (click)="cancel()"></button>
<button
pButton
[label]="submitLabel"
type="submit"
class="min-w-28"
[disabled]="disabled"
[loading]="loading"
(onClick)="submit()"></button>
</div>
@@ -1,10 +1,10 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Button } from 'primeng/button';
import { ButtonDirective } from 'primeng/button';
@Component({
selector: 'app-form-footer-actions',
templateUrl: './form-footer-actions.component.html',
imports: [Button],
imports: [ButtonDirective],
})
export class FormFooterActionsComponent {
@Input() submitLabel = 'تایید';
@@ -1,5 +1,6 @@
import { Maybe } from '@/core';
import ISummary from '@/core/models/summary';
import { TspProviderResponseStatus } from '@/shared/catalog';
import { InvoiceTypes, TspProviderResponseStatus } from '@/shared/catalog';
import { IEnumTranslate } from '@/shared/models/enum_translate.type';
export interface ISaleInvoiceFullRawResponse {
@@ -11,11 +12,16 @@ export interface ISaleInvoiceFullRawResponse {
pos: Pos;
payments: Payment[];
items: Item[];
invoice_number: number;
type: IEnumTranslate<InvoiceTypes>;
created_at: string;
notes?: string;
customer?: Customer;
unknown_customer?: UnknownCustomer;
status: IEnumTranslate<TspProviderResponseStatus>;
main_id: Maybe<string>;
tax_id: Maybe<string>;
reference_invoice: Maybe<string>;
notes: Maybe<string>;
}
export interface ISaleInvoiceFullResponse extends ISaleInvoiceFullRawResponse {}
@@ -17,14 +17,17 @@
</ng-template>
<div class="flex flex-col gap-4">
<div class="listKeyValue">
<app-key-value label="کد رهگیری" [value]="invoice.code" />
<app-key-value label="شماره صورت‌حساب" [value]="invoice.invoice_number" />
<app-key-value label="تاریخ فاکتور" [value]="invoice.invoice_date" type="dateTime" />
<app-key-value label="تاریخ ایجاد فاکتور" [value]="invoice.created_at" type="dateTime" />
<app-key-value label="نوع صورت‌حساب">
<catalog-invoice-type-tag [status]="invoice.type.value" />
</app-key-value>
<app-key-value label="وضعیت صدور به سامانه‌ی مودیان">
<catalog-tax-provider-status-tag [status]="invoice.status.value" [translate]="invoice.status.translate" />
</app-key-value>
<div class="col-span-full">
<app-key-value label="توضیحات" [value]="invoice.notes" />
<app-key-value label="توضیحات" [value]="invoice.notes || '----'" />
</div>
</div>
<p-divider align="center"> اطلاعات پرداخت </p-divider>
@@ -3,7 +3,10 @@ import { NativeBridgeService } from '@/core/services';
import { ToastService } from '@/core/services/toast.service';
import { PosConfigPrintService } from '@/domains/pos/modules/configs/components/print/services/main.service';
import { PosInfoStore } from '@/domains/pos/store';
import { CatalogTaxProviderStatusTagComponent } from '@/shared/catalog';
import {
CatalogInvoiceTypeTagComponent,
CatalogTaxProviderStatusTagComponent,
} from '@/shared/catalog';
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
import { ISaleInvoiceFullResponse } from '@/shared/components/invoices/sale-invoice-full-response.model';
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
@@ -45,6 +48,7 @@ export type TSaleInvoiceSingleViewVariant = 'full' | 'customer' | 'pos';
UikitEmptyStateComponent,
PriceMaskDirective,
CatalogTaxProviderStatusTagComponent,
CatalogInvoiceTypeTagComponent,
],
})
export class SharedSaleInvoiceSingleViewComponent {
@@ -88,12 +88,12 @@ export class KeyValueComponent {
}
switch (this.type) {
case 'simple':
return this.value || '-';
return this.value || '-----';
}
return value;
}
valueType = computed(() =>
this.variant || ['boolean', 'has', 'active'].includes(this.type) ? 'tag' : 'text',
this.variant || ['boolean', 'has', 'active'].includes(this.type) ? 'tag' : 'text'
);
}