feat: implement invoice number sequence field and enhance tax provider status handling across components
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<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" />
|
||||
<catalog-tax-provider-status-tag [status]="invoice.status.value" [translate]="invoice.status.translate" />
|
||||
</app-key-value>
|
||||
<div class="col-span-3">
|
||||
<app-key-value label="توضیحات" [value]="invoice.notes" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Maybe } from '@/core';
|
||||
import { NativeBridgeService } from '@/core/services';
|
||||
import { CatalogTaxProviderStatusTagComponent } from '@/shared/catalog';
|
||||
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
|
||||
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
|
||||
import {
|
||||
@@ -9,8 +10,15 @@ import {
|
||||
import { PriceMaskDirective } from '@/shared/directives';
|
||||
import { UikitEmptyStateComponent } from '@/uikit';
|
||||
import { getGoodUnitTypeProperties } from '@/utils';
|
||||
import { Component, EventEmitter, inject, Input, Output, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { Badge } from 'primeng/badge';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
inject,
|
||||
Input,
|
||||
Output,
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { ButtonDirective } from 'primeng/button';
|
||||
import { Divider } from 'primeng/divider';
|
||||
import { TableModule } from 'primeng/table';
|
||||
@@ -24,7 +32,6 @@ export type TConsumerSaleInvoice = 'full' | 'customer' | 'pos';
|
||||
imports: [
|
||||
AppCardComponent,
|
||||
KeyValueComponent,
|
||||
Badge,
|
||||
Divider,
|
||||
ButtonDirective,
|
||||
PageDataListComponent,
|
||||
@@ -32,6 +39,7 @@ export type TConsumerSaleInvoice = 'full' | 'customer' | 'pos';
|
||||
PageLoadingComponent,
|
||||
UikitEmptyStateComponent,
|
||||
PriceMaskDirective,
|
||||
CatalogTaxProviderStatusTagComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerSaleInvoiceSharedComponent {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import ISummary from '@/core/models/summary';
|
||||
import { TspProviderResponseStatus } from '@/shared/catalog';
|
||||
import { IEnumTranslate } from '@/shared/models/enum_translate.type';
|
||||
|
||||
export interface ISaleInvoiceFullRawResponse {
|
||||
id: string;
|
||||
@@ -13,6 +15,7 @@ export interface ISaleInvoiceFullRawResponse {
|
||||
notes?: string;
|
||||
customer?: Customer;
|
||||
unknown_customer?: UnknownCustomer;
|
||||
status: IEnumTranslate<TspProviderResponseStatus>;
|
||||
}
|
||||
|
||||
export interface ISaleInvoiceFullResponse extends ISaleInvoiceFullRawResponse {}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<field-economic-code [control]="form.controls.economic_code" />
|
||||
<field-fiscal-code [control]="form.controls.fiscal_id" />
|
||||
<field-partner-token [control]="form.controls.partner_token" />
|
||||
<field-invoice-number-sequence [control]="form.controls.invoice_number_sequence" [min]="1" />
|
||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||
</form>
|
||||
</shared-dialog>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
PartnerTokenComponent,
|
||||
} from '@/shared/components';
|
||||
import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
|
||||
import { InvoiceNumberSequenceComponent } from '@/shared/components/fields/invoice_number_sequence.component';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { fieldControl } from '@/shared/constants/fields';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
@@ -22,8 +23,9 @@ import { BusinessActivitiesService } from '../services/main.service';
|
||||
FormFooterActionsComponent,
|
||||
NameComponent,
|
||||
EconomicCodeComponent,
|
||||
FiscalIdComponent,
|
||||
PartnerTokenComponent,
|
||||
InvoiceNumberSequenceComponent,
|
||||
FiscalIdComponent,
|
||||
],
|
||||
})
|
||||
export class ConsumerBusinessActivityFormComponent extends AbstractFormDialog<
|
||||
@@ -38,6 +40,9 @@ export class ConsumerBusinessActivityFormComponent extends AbstractFormDialog<
|
||||
economic_code: fieldControl.economic_code(this.initialValues?.economic_code || ''),
|
||||
fiscal_id: fieldControl.fiscal_id(this.initialValues?.fiscal_id || ''),
|
||||
partner_token: fieldControl.partner_token(this.initialValues?.partner_token || ''),
|
||||
invoice_number_sequence: fieldControl.invoice_number_sequence(
|
||||
this.initialValues?.invoice_number_sequence || 1,
|
||||
),
|
||||
});
|
||||
|
||||
override submitForm(payload: IBusinessActivityRequest) {
|
||||
|
||||
@@ -10,10 +10,13 @@
|
||||
(onRefresh)="refresh()"
|
||||
>
|
||||
</app-page-data-list>
|
||||
<consumer-businessActivity-form
|
||||
[(visible)]="visibleForm"
|
||||
[editMode]="editMode()"
|
||||
[businessId]="selectedItemForEdit()?.id || ''"
|
||||
[initialValues]="selectedItemForEdit() || undefined"
|
||||
(onSubmit)="refresh()"
|
||||
/>
|
||||
|
||||
@if (visibleForm()) {
|
||||
<consumer-businessActivity-form
|
||||
[(visible)]="visibleForm"
|
||||
[editMode]="editMode()"
|
||||
[businessId]="selectedItemForEdit()?.id || ''"
|
||||
[initialValues]="selectedItemForEdit() || undefined"
|
||||
(onSubmit)="refresh()"
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface IBusinessActivityRawResponse {
|
||||
partner_token: string;
|
||||
guild: ISummary;
|
||||
created_at: string;
|
||||
invoice_number_sequence: number;
|
||||
license_info: LicenseInfo;
|
||||
}
|
||||
export interface IBusinessActivityResponse extends IBusinessActivityRawResponse {}
|
||||
@@ -17,6 +18,7 @@ export interface IBusinessActivityRequest {
|
||||
fiscal_id: string;
|
||||
partner_token: string;
|
||||
name: string;
|
||||
invoice_number_sequence: number;
|
||||
}
|
||||
|
||||
interface LicenseInfo {
|
||||
|
||||
Reference in New Issue
Block a user