095ae31249
fix: Update single component to correctly bind invoice data feat: Enhance partner info model with detailed license status refactor: Simplify account list component by removing unnecessary details fix: Correctly reference username in consumer account form feat: Add POS related fields to consumer account list chore: Update models to include charge account details for partners feat: Implement charge account dialog for partner consumers feat: Create API routes for accounts charge functionality feat: Add charge account service for handling requests feat: Introduce license info template component for dashboard refactor: Update dashboard view to display license information fix: Improve layout component to handle POS information more effectively chore: Clean up unused imports and components in various files feat: Add loading state handling in landing views feat: Implement charge account form dialog for partner consumers
100 lines
5.2 KiB
HTML
100 lines
5.2 KiB
HTML
@if (loading) {
|
|
<shared-page-loading />
|
|
} @else if (!invoice) {
|
|
<uikit-empty-state> </uikit-empty-state>
|
|
} @else {
|
|
<div class="flex flex-col gap-6">
|
|
<app-card-data cardTitle="اطلاعات فاکتور" [editable]="false">
|
|
<ng-template #moreActions>
|
|
<button pButton type="button" label="چاپ" icon="pi pi-print" outlined (click)="printInvoice()"></button>
|
|
</ng-template>
|
|
<div class="flex flex-col gap-4">
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
<app-key-value label="کد رهگیری" [value]="invoice.code" />
|
|
<app-key-value label="تاریخ فاکتور" [value]="invoice.invoice_date" type="dateTime" />
|
|
<app-key-value label="تاریخ ایجاد فاکتور" [value]="invoice.created_at" type="dateTime" />
|
|
<app-key-value label="وضعیت صدور به سامانهی مودیان">
|
|
<p-badge value="ارسال نشده" severity="danger" />
|
|
</app-key-value>
|
|
<div class="col-span-3">
|
|
<app-key-value label="توضیحات" [value]="invoice.notes" />
|
|
</div>
|
|
</div>
|
|
<p-divider align="center"> اطلاعات پرداخت </p-divider>
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
<app-key-value label="مجموع قابل پرداخت" [value]="invoice.total_amount" type="price" />
|
|
@for (payment of invoice.payments; track $index) {
|
|
<app-key-value
|
|
[label]="`${payment.payment_method === 'SET_OF' ? 'تهاتر' : payment.payment_method === 'TERMINAL' ? 'پایانه' : 'نقدی'}`"
|
|
[value]="payment.amount"
|
|
type="price"
|
|
/>
|
|
}
|
|
</div>
|
|
|
|
<p-divider align="center"> اطلاعات صادر کننده </p-divider>
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
<app-key-value label="کسب و کار" [value]="invoice.pos!.complex.business_activity.name" />
|
|
<app-key-value label="مجموعه" [value]="invoice.pos!.complex.name" />
|
|
<app-key-value label="پایانهی فروش" [value]="invoice.pos!.name" />
|
|
<app-key-value label="ایجاد کننده" [value]="invoice.consumer_account.account.username" />
|
|
</div>
|
|
|
|
@if (variant !== "customer") {
|
|
<p-divider align="center"> اطلاعات مشتری </p-divider>
|
|
@if (invoice.customer) {
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
@if (invoice.customer.type === "INDIVIDUAL") {
|
|
<app-key-value label="نوع مشتری" value="حقیقی" />
|
|
<app-key-value label="نام" [value]="invoice.customer.customer_individual?.first_name" />
|
|
<app-key-value label="نام خانوادگی" [value]="invoice.customer.customer_individual?.last_name" />
|
|
<app-key-value label="کد اقتصادی" [value]="invoice.customer.customer_individual?.economic_code" />
|
|
<app-key-value label="کد ملی" [value]="invoice.customer.customer_individual?.national_id" />
|
|
<app-key-value label="کد پستی" [value]="invoice.customer.customer_individual?.postal_code" />
|
|
} @else {
|
|
<app-key-value label="نوع مشتری" value="حقوقی" />
|
|
<app-key-value label="نام شرکت" [value]="invoice.customer.customer_legal?.company_name" />
|
|
<app-key-value label="کد اقتصادی" [value]="invoice.customer.customer_legal?.economic_code" />
|
|
<app-key-value label="کد ثبتی" [value]="invoice.customer.customer_legal?.registration_number" />
|
|
<app-key-value label="کد پستی" [value]="invoice.customer.customer_legal?.postal_code" />
|
|
}
|
|
</div>
|
|
} @else if (invoice.unknown_customer) {
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
<app-key-value label="نوع مشتری" value="نوع دوم" />
|
|
<app-key-value label="عنوان" [value]="invoice.unknown_customer.name" />
|
|
<app-key-value label="کد ثبتی" [value]="invoice.unknown_customer.national_code" />
|
|
</div>
|
|
} @else {
|
|
<p class="text-center text-text-color pt-3 pb-5">اطلاعات مشتری ثبت نشده است.</p>
|
|
}
|
|
}
|
|
</div>
|
|
</app-card-data>
|
|
<app-card-data cardTitle="کالاهای خریداری شده" [editable]="false">
|
|
<app-page-data-list
|
|
[columns]="columns"
|
|
[expandColumns]="expandableColumns"
|
|
[expandable]="true"
|
|
expandableItemKey="payload"
|
|
[items]="invoice.items"
|
|
[loading]="loading"
|
|
pageTitle=""
|
|
[showRefresh]="false"
|
|
>
|
|
<ng-template #totalAmount let-item>
|
|
aaa
|
|
@if (!item.discount_amount) {
|
|
<span [appPriceMask]="item.total_amount"></span>
|
|
} @else {
|
|
<!-- <div class="flex flex-col items-end">
|
|
<span class="line-through text-muted-color text-xs" [appPriceMask]="item.total_amount"></span>
|
|
<span [appPriceMask]="item.total_amount - item.discount_amount"></span>
|
|
</div> -->
|
|
}
|
|
</ng-template>
|
|
</app-page-data-list>
|
|
</app-card-data>
|
|
</div>
|
|
}
|