5ee03cf761
Production CI / validate-and-build (push) Failing after 1m1s
- Updated return form instructions for clarity. - Refined labels in sale invoice info card for consistency. - Enhanced sale invoice view with a correction payment dialog for increased user interaction. - Improved invoice print preparation utility for better data handling. - Adjusted paginator component for first and last page navigation. - Modified layout styles for better responsiveness and user experience. - Updated environment configurations for different setups.
105 lines
2.6 KiB
TypeScript
105 lines
2.6 KiB
TypeScript
import { Maybe } from '@/core';
|
|
import {
|
|
CatalogInvoiceTypeTagComponent,
|
|
CatalogTaxProviderStatusTagComponent,
|
|
} from '@/shared/catalog';
|
|
import { CatalogInvoiceSettlementTypeTagComponent } from '@/shared/catalog/invoiceSettlementType';
|
|
import { PriceMaskDirective } from '@/shared/directives';
|
|
import { Component, Input } from '@angular/core';
|
|
import { Card } from 'primeng/card';
|
|
import { Divider } from 'primeng/divider';
|
|
import { KeyValueComponent } from '../key-value.component/key-value.component';
|
|
import { IColumn, PageDataListComponent } from '../pageDataList/page-data-list.component';
|
|
import { ISaleInvoiceFullResponse } from './sale-invoice-full-response.model';
|
|
|
|
export type TSaleInvoiceSingleViewVariant = 'full' | 'customer' | 'pos';
|
|
|
|
@Component({
|
|
selector: 'shared-sale-invoice-single-info-card',
|
|
templateUrl: './sale-invoice-single-info-card.component.html',
|
|
imports: [
|
|
Card,
|
|
KeyValueComponent,
|
|
CatalogInvoiceTypeTagComponent,
|
|
CatalogTaxProviderStatusTagComponent,
|
|
Divider,
|
|
CatalogInvoiceSettlementTypeTagComponent,
|
|
PageDataListComponent,
|
|
PriceMaskDirective,
|
|
],
|
|
})
|
|
export class SaleInvoiceSingleInfoCardComponent {
|
|
@Input({ required: true }) loading!: boolean;
|
|
@Input() invoice!: Maybe<ISaleInvoiceFullResponse>;
|
|
@Input() variant: TSaleInvoiceSingleViewVariant = 'full';
|
|
|
|
columns: IColumn[] = [
|
|
{
|
|
field: 'name',
|
|
header: 'عنوان',
|
|
type: 'nested',
|
|
nestedOption: {
|
|
path: 'good_snapshot.name',
|
|
},
|
|
},
|
|
{
|
|
field: 'sku_code',
|
|
header: 'شناسه کالا',
|
|
},
|
|
{
|
|
field: 'unit_price',
|
|
header: 'قیمت واحد',
|
|
type: 'price',
|
|
},
|
|
{
|
|
field: 'quantity',
|
|
header: 'مقدار',
|
|
customDataModel(item) {
|
|
return `${item.quantity} ${item.measure_unit_text}`;
|
|
},
|
|
},
|
|
{
|
|
field: 'commission',
|
|
header: 'کارمزد',
|
|
type: 'nested',
|
|
nestedOption: {
|
|
path: 'payload.commission',
|
|
type: 'price',
|
|
},
|
|
},
|
|
{
|
|
field: 'wages',
|
|
header: 'اجرت',
|
|
type: 'nested',
|
|
nestedOption: {
|
|
path: 'payload.wages',
|
|
type: 'price',
|
|
},
|
|
},
|
|
{
|
|
field: 'profit',
|
|
header: 'سود',
|
|
type: 'nested',
|
|
nestedOption: {
|
|
path: 'payload.profit',
|
|
type: 'price',
|
|
},
|
|
},
|
|
{
|
|
field: 'discount_amount',
|
|
header: 'تخفیف',
|
|
type: 'price',
|
|
},
|
|
{
|
|
field: 'tax_amount',
|
|
header: 'مالیات',
|
|
type: 'price',
|
|
},
|
|
{
|
|
field: 'total_amount',
|
|
header: 'قابل پرداخت',
|
|
type: 'price',
|
|
},
|
|
];
|
|
}
|