feat: enhance inner pages header with back button functionality and emit event on back click
fix: update total price info handling in correction form and ensure accurate calculations refactor: streamline sale invoice single view component by extracting info card into a separate component style: adjust button sizes in payment forms for better UI consistency feat: implement season picker navigation controls to prevent out-of-bounds selection fix: improve price formatting utility to handle undefined values gracefully chore: update environment configuration for API base URL feat: add navigation service to manage routing history and back navigation
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
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',
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user