diff --git a/public/favicon.ico b/public/favicon.ico index 04bc49e..2c7668f 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png index 107a390..4643ac1 100644 Binary files a/public/favicon/apple-touch-icon.png and b/public/favicon/apple-touch-icon.png differ diff --git a/public/favicon/favicon-96x96.png b/public/favicon/favicon-96x96.png index 9cc83f1..e7a5c10 100644 Binary files a/public/favicon/favicon-96x96.png and b/public/favicon/favicon-96x96.png differ diff --git a/public/favicon/favicon.ico b/public/favicon/favicon.ico index 04bc49e..2c7668f 100644 Binary files a/public/favicon/favicon.ico and b/public/favicon/favicon.ico differ diff --git a/public/favicon/favicon.svg b/public/favicon/favicon.svg index 9d8298e..6a2ff69 100644 --- a/public/favicon/favicon.svg +++ b/public/favicon/favicon.svg @@ -1,3 +1 @@ - \ No newline at end of file +RealFaviconGeneratorhttps://realfavicongenerator.net \ No newline at end of file diff --git a/public/favicon/site.webmanifest b/public/favicon/site.webmanifest index ef3c29a..bb1f7f2 100644 --- a/public/favicon/site.webmanifest +++ b/public/favicon/site.webmanifest @@ -5,20 +5,20 @@ { "purpose": "maskable", "sizes": "192x192", - "src": "/favicon/web-app-manifest-192x192.png", + "src": "/web-app-manifest-192x192.png", "type": "image/png" }, { "purpose": "maskable", "sizes": "512x512", - "src": "/favicon/web-app-manifest-512x512.png", + "src": "/web-app-manifest-512x512.png", "type": "image/png" } ], "id": "/", - "name": "مدیریت صورت‌حساب‌های مالیاتی", + "name": "نرم افزار صورت‌حساب‌های مالیاتی پاژن", "scope": "/", - "short_name": "مدیریت صورت‌حساب‌های مالیاتی", + "short_name": "پاژن", "start_url": "/", "theme_color": "#ffffff" } diff --git a/public/favicon/web-app-manifest-192x192.png b/public/favicon/web-app-manifest-192x192.png index 56bb138..ad1364f 100644 Binary files a/public/favicon/web-app-manifest-192x192.png and b/public/favicon/web-app-manifest-192x192.png differ diff --git a/public/favicon/web-app-manifest-512x512.png b/public/favicon/web-app-manifest-512x512.png index f82b4c3..c2d28ce 100644 Binary files a/public/favicon/web-app-manifest-512x512.png and b/public/favicon/web-app-manifest-512x512.png differ diff --git a/src/app/core/services/form-errors.service.ts b/src/app/core/services/form-errors.service.ts index f849132..4c1444d 100644 --- a/src/app/core/services/form-errors.service.ts +++ b/src/app/core/services/form-errors.service.ts @@ -64,6 +64,10 @@ export class FormErrorsService { if (errors['invalidMobile']) { out.push({ key: 'invalidMobile', message: `${label} معتبر نیست.` }); } + if (errors['invalidUsername']) { + const info = errors['invalidUsername']; + out.push({ key: 'invalidUsername', message: info.message ?? `${label} معتبر نیست.` }); + } // fallback: include any other error keys Object.keys(errors).forEach((k) => { if ( diff --git a/src/app/core/services/native-bridge.service.ts b/src/app/core/services/native-bridge.service.ts index ce66162..a5bbc37 100644 --- a/src/app/core/services/native-bridge.service.ts +++ b/src/app/core/services/native-bridge.service.ts @@ -1,5 +1,4 @@ import { inject, Injectable } from '@angular/core'; -import { environment } from 'src/environments/environment'; import { Maybe } from '../models'; import { ToastService } from './toast.service'; @@ -42,17 +41,22 @@ export class NativeBridgeService { } isEnabled(): boolean { - if (!this.host) return false; - const hostEnabled = this.host?.isEnabled; - if (typeof hostEnabled === 'function') { - try { - return !!hostEnabled(); - } catch { - return false; - } - } + // @ts-ignore + return !!window.NativeBridge; + // if (window.NativeBridge) { - return !!environment.enableNativeBridge && !!this.host; + // } + // if (!this.host) return false; + // const hostEnabled = this.host?.isEnabled; + // if (typeof hostEnabled === 'function') { + // try { + // return !!hostEnabled(); + // } catch { + // return false; + // } + // } + + // return !!environment.enableNativeBridge && !!this.host; } canPay(): boolean { @@ -64,22 +68,40 @@ export class NativeBridgeService { } pay(request: INativePayRequest): any { - this.toastService.info({ text: 'در حال پردازش پرداخت...', life: 3000 }); - const fn = this.host?.pay; - if (typeof fn !== 'function') { - this.toastService.error({ text: 'متاسفانه پرداخت امکان‌پذیر نیست.', life: 3000 }); - return { success: false, error: 'متاسفانه پرداخت امکان‌پذیر نیست.' }; + if (request.amount <= 10_000) { + const errorMessage = 'برای مقادیر زیر ۱۰۰ هزار ریال، پرداخت ممکن نیست.'; + this.toastService.error({ text: errorMessage, life: 3000 }); + return { + success: false, + error: errorMessage, + }; } - + this.toastService.info({ text: 'در حال پردازش پرداخت...', life: 3000 }); try { - fn(request.amount, request.id); - + // @ts-ignore + window.NativeBridge.pay(request.amount, request.id || ''); return { success: true }; - - // return { success: true, data: parsed ?? raw }; } catch (error) { + this.toastService.info({ text: (error as Error).message, life: 30000 }); return { success: false, error: (error as Error).message }; } + // const fn = window.NativeBridge.pay(123, 'test'); + // if (typeof fn !== 'function') { + // this.toastService.error({ text: 'متاسفانه پرداخت امکان‌پذیر نیست.', life: 3000 }); + // return { success: false, error: 'متاسفانه پرداخت امکان‌پذیر نیست.' }; + // } + + // try { + // fn(123, 'test'); + // // fn(request.amount, request.id || ''); + + // return { success: true }; + + // // return { success: true, data: parsed ?? raw }; + // } catch (error) { + // this.toastService.info({ text: (error as Error).message, life: 30000 }); + // return { success: false, error: (error as Error).message }; + // } } print(request: INativePrintRequest): INativeBridgeResult { @@ -87,17 +109,13 @@ export class NativeBridgeService { } private invokePrint(payload: INativePrintRequest): INativeBridgeResult { - const fn = this.host?.print; - if (typeof fn !== 'function') { - return { success: false, error: 'متاسفانه چاپ امکان‌پذیر نیست.' }; - } - try { - fn(payload); - + // @ts-ignore + window.NativeBridge.print(JSON.stringify([payload])); return { success: true }; } catch (error) { - return { success: false, error: 'متاسفانه چاپ امکان‌پذیر نیست.' }; + this.toastService.info({ text: (error as Error).message, life: 30000 }); + return { success: false, error: (error as Error).message }; } } diff --git a/src/app/core/validators/index.ts b/src/app/core/validators/index.ts index fc9a5c2..a484f07 100644 --- a/src/app/core/validators/index.ts +++ b/src/app/core/validators/index.ts @@ -5,3 +5,4 @@ export * from './mobile.validator'; export * from './must-match.validator'; export * from './password.validator'; export * from './postal-code.validator'; +export * from './username.validator'; diff --git a/src/app/core/validators/username.validator.ts b/src/app/core/validators/username.validator.ts new file mode 100644 index 0000000..b6f74eb --- /dev/null +++ b/src/app/core/validators/username.validator.ts @@ -0,0 +1,31 @@ +import { ValidatorFn } from '@angular/forms'; + +export function usernameValidator(): ValidatorFn { + return (control) => { + if (control.value === null || control.value === undefined || control.value === '') { + return null; + } + + if (control.value.length < 6) { + return { + minlength: { + requiredLength: 6, + actualLength: control.value.length, + }, + }; + } + + const pattern = /^[a-zA-Z0-9_-]*$/; + + if (!pattern.test(control.value)) { + return { + invalidUsername: { + value: control.value, + message: + 'نام کاربری فقط می‌تواند شامل حروف انگلیسی، اعداد، خط تیره (-) و زیر‌خط (_) باشد', + }, + }; + } + return null; + }; +} diff --git a/src/app/domains/consumer/components/invoices/shared-saleInvoice.component.ts b/src/app/domains/consumer/components/invoices/shared-saleInvoice.component.ts index e776c3a..f26f73e 100644 --- a/src/app/domains/consumer/components/invoices/shared-saleInvoice.component.ts +++ b/src/app/domains/consumer/components/invoices/shared-saleInvoice.component.ts @@ -1,3 +1,4 @@ +import { Maybe } from '@/core'; import { NativeBridgeService } from '@/core/services'; import { CatalogTaxProviderStatusTagComponent } from '@/shared/catalog'; import { AppCardComponent, KeyValueComponent } from '@/shared/components'; @@ -46,7 +47,7 @@ export class ConsumerSaleInvoiceSharedComponent { private readonly nativeBridge = inject(NativeBridgeService); @Input({ required: true }) loading!: boolean; - @Input({ required: true }) invoice!: ISaleInvoiceFullResponse; + @Input() invoice!: Maybe; @Input() variant: TConsumerSaleInvoice = 'full'; @Input() backRoute?: UrlTree | string | any[]; @@ -55,7 +56,7 @@ export class ConsumerSaleInvoiceSharedComponent { @ViewChild('totalAmount', { static: false }) totalAmount!: TemplateRef; printInvoice = () => { - if (this.nativeBridge.isEnabled()) { + if (this.nativeBridge.isEnabled() && this.invoice) { const result = this.nativeBridge.print({ title: 'salam', items: [ diff --git a/src/app/domains/partner/modules/consumers/components/businessActivities/create-wrapper/create-wrapper.component.html b/src/app/domains/partner/modules/consumers/components/businessActivities/create-wrapper/create-wrapper.component.html index 5379070..fc81016 100644 --- a/src/app/domains/partner/modules/consumers/components/businessActivities/create-wrapper/create-wrapper.component.html +++ b/src/app/domains/partner/modules/consumers/components/businessActivities/create-wrapper/create-wrapper.component.html @@ -19,7 +19,6 @@ @case (1) { diff --git a/src/app/domains/partner/modules/consumers/components/businessActivities/form-dialog.component.html b/src/app/domains/partner/modules/consumers/components/businessActivities/form-dialog.component.html index 35728d7..e5edd4e 100644 --- a/src/app/domains/partner/modules/consumers/components/businessActivities/form-dialog.component.html +++ b/src/app/domains/partner/modules/consumers/components/businessActivities/form-dialog.component.html @@ -11,7 +11,6 @@ [businessActivityId]="businessActivityId" [initialValues]="initialValues" [editMode]="editMode" - [visible]="visible" (onSubmit)="onFormSubmit($event)" (onClose)="close()" /> diff --git a/src/app/domains/partner/modules/consumers/components/businessActivities/form.component.ts b/src/app/domains/partner/modules/consumers/components/businessActivities/form.component.ts index 28bc90d..03b6dba 100644 --- a/src/app/domains/partner/modules/consumers/components/businessActivities/form.component.ts +++ b/src/app/domains/partner/modules/consumers/components/businessActivities/form.component.ts @@ -38,7 +38,6 @@ export class ConsumerBusinessActivitiesFormComponent extends AbstractForm< @Input({ required: true }) consumerId!: string; @Input() businessActivityId!: string; - @Input({ required: true }) visible!: boolean; initForm = () => { const form = this.fb.group({ diff --git a/src/app/domains/partner/modules/consumers/components/poses/form.component.ts b/src/app/domains/partner/modules/consumers/components/poses/form.component.ts index 511fb87..b675f52 100644 --- a/src/app/domains/partner/modules/consumers/components/poses/form.component.ts +++ b/src/app/domains/partner/modules/consumers/components/poses/form.component.ts @@ -1,5 +1,5 @@ // import { CatalogRolesComponent } from '@/shared/catalog/roles'; -import { MustMatch } from '@/core/validators'; +import { MustMatch, usernameValidator } from '@/core/validators'; import { AbstractForm } from '@/shared/abstractClasses'; import { DeviceIdComponent, @@ -49,9 +49,9 @@ export class ConsumerPosFormContentComponent extends AbstractForm { @@ -89,30 +89,8 @@ export class ConsumerPosFormContentComponent extends AbstractForm('', { - nonNullable: true, - validators: fieldControl.username('')[1], - }), - ); - // @ts-ignore - form.addControl( - 'password', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); - // @ts-ignore - form.addControl( - 'confirmPassword', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); + form.controls.username.setValidators([Validators.required, usernameValidator()]); + form.controls.username.updateValueAndValidity({ emitEvent: false }); form.addValidators([MustMatch('password', 'confirmPassword')]); } diff --git a/src/app/domains/pos/layouts/layout.component.ts b/src/app/domains/pos/layouts/layout.component.ts index 1d6c4e5..981a944 100644 --- a/src/app/domains/pos/layouts/layout.component.ts +++ b/src/app/domains/pos/layouts/layout.component.ts @@ -102,10 +102,21 @@ export class PosLayoutComponent implements AfterViewInit { } doPay() { - this.nativeBridgeService.pay({ - amount: 1000, - id: '1', + // this.nativeBridgeService.pay({ + // amount: 10_000, + // id: '1', + // }); + this.nativeBridgeService.print({ + title: 'salam', + items: [ + { + label: 'مجموع قیمت', + value: '10_000', + }, + ], }); + // @ts-ignore + // window.NativeBridge.pay(12312, 'test'); } ngOnInit() { diff --git a/src/app/domains/pos/modules/landing/components/customers/individual/form.component.html b/src/app/domains/pos/modules/landing/components/customers/individual/form.component.html index c05e775..5b4723b 100644 --- a/src/app/domains/pos/modules/landing/components/customers/individual/form.component.html +++ b/src/app/domains/pos/modules/landing/components/customers/individual/form.component.html @@ -4,6 +4,7 @@ + diff --git a/src/app/domains/pos/modules/landing/components/customers/individual/form.component.ts b/src/app/domains/pos/modules/landing/components/customers/individual/form.component.ts index e932965..64cefbe 100644 --- a/src/app/domains/pos/modules/landing/components/customers/individual/form.component.ts +++ b/src/app/domains/pos/modules/landing/components/customers/individual/form.component.ts @@ -5,6 +5,7 @@ import { LastNameComponent, MobileNumberComponent, NationalIdComponent, + PostalCodeComponent, } from '@/shared/components'; import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component'; import { fieldControl } from '@/shared/constants'; @@ -26,6 +27,7 @@ import { PosLandingStore } from '../../../store/main.store'; NationalIdComponent, EconomicCodeComponent, MobileNumberComponent, + PostalCodeComponent, ], }) export class CustomerIndividualFormComponent extends AbstractForm< diff --git a/src/app/domains/pos/modules/landing/components/payloads/form-dialog-amount-card-template.component.html b/src/app/domains/pos/modules/landing/components/payloads/form-dialog-amount-card-template.component.html index 81428da..7ca7602 100644 --- a/src/app/domains/pos/modules/landing/components/payloads/form-dialog-amount-card-template.component.html +++ b/src/app/domains/pos/modules/landing/components/payloads/form-dialog-amount-card-template.component.html @@ -12,7 +12,7 @@ }
- مالیات (۱۰٪) + ارزش افزوده

diff --git a/src/app/domains/pos/modules/landing/components/payloads/gold/form.component.ts b/src/app/domains/pos/modules/landing/components/payloads/gold/form.component.ts index 344fa42..8f36792 100644 --- a/src/app/domains/pos/modules/landing/components/payloads/gold/form.component.ts +++ b/src/app/domains/pos/modules/landing/components/payloads/gold/form.component.ts @@ -132,9 +132,14 @@ export class PosGoldPayloadFormComponent extends AbstractForm< const totalAmountBeforeProfit = unitWithQuantity + wageAmount + commissionAmount; const baseTotalAmount = totalAmountBeforeProfit + profitAmount; const baseAmountForDiscountCalculation = - this.discountType() === 1 ? profitAmount : baseTotalAmount; + this.discountType() === 1 ? profitAmount : unitWithQuantity; - const taxAmount = (profitAmount + commissionAmount + wageAmount - discountAmount) * 0.1; + const taxAmount = + (profitAmount + + commissionAmount + + wageAmount - + (this.discountType() === 1 ? discountAmount : 0)) * + 0.1; const totalAmount = baseTotalAmount - discountAmount + taxAmount; this.unitWithQuantity.set(unitWithQuantity); diff --git a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html index b6bf435..f18a17a 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html +++ b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html @@ -23,7 +23,7 @@ /> -
+
diff --git a/src/app/domains/pos/modules/saleInvoices/components/list.component.ts b/src/app/domains/pos/modules/saleInvoices/components/list.component.ts index 607e718..225c6f3 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/list.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/components/list.component.ts @@ -3,7 +3,6 @@ import { Component, computed, inject, signal } from '@angular/core'; import { Router } from '@angular/router'; import { Button, ButtonDirective } from 'primeng/button'; import { Chip } from 'primeng/chip'; -import { Paginator } from 'primeng/paginator'; import { Skeleton } from 'primeng/skeleton'; import { finalize } from 'rxjs'; import { posSaleInvoicesNamedRoutes } from '../constants/routes'; @@ -27,7 +26,6 @@ import { SaleInvoiceCardComponent } from './sale-invoice-card.component'; Button, Chip, SaleInvoiceCardComponent, - Paginator, ], }) export class PosSaleInvoiceListComponent { diff --git a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts index f66c1df..a4d1db4 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts @@ -51,7 +51,7 @@ export class SaleInvoiceCardComponent { if (customer) { const { legal, individual } = customer; - let text = 'الکترونیکی نوع اول - '; + let text = 'نوع اول - '; console.log(customer); if (legal) { text += `حقوقی (${legal.company_name})`; @@ -61,7 +61,7 @@ export class SaleInvoiceCardComponent { } return text; } - return 'الکترونیکی نوع دوم (بدون اطلاعات خریدار)'; + return 'نوع دوم (بدون اطلاعات خریدار)'; }); sendInvoice() { diff --git a/src/app/domains/superAdmin/modules/consumers/components/accounts/list.component.html b/src/app/domains/superAdmin/modules/consumers/components/accounts/list.component.html index 736de9f..68ad031 100644 --- a/src/app/domains/superAdmin/modules/consumers/components/accounts/list.component.html +++ b/src/app/domains/superAdmin/modules/consumers/components/accounts/list.component.html @@ -4,7 +4,7 @@ emptyPlaceholderTitle="حساب کاربری‌ای یافت نشد." [items]="items()" [loading]="loading()" - [showDetails]="true" + [showIndex]="false" (onRefresh)="refresh()" > diff --git a/src/app/domains/superAdmin/modules/guilds/components/categories/list.component.html b/src/app/domains/superAdmin/modules/guilds/components/categories/list.component.html index 1860a2e..07fd084 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/categories/list.component.html +++ b/src/app/domains/superAdmin/modules/guilds/components/categories/list.component.html @@ -2,7 +2,6 @@ [pageTitle]="'مدیریت دسته‌بندی‌های کالا'" [addNewCtaLabel]="'افزودن دسته‌بندی'" [columns]="columns" - [showAdd]="true" emptyPlaceholderTitle="دسته‌بندی یافت نشد" emptyPlaceholderDescription="برای افزودن دسته‌بندی، روی دکمهٔ بالا کلیک کنید." [items]="items()" diff --git a/src/app/domains/superAdmin/modules/guilds/components/form.component.html b/src/app/domains/superAdmin/modules/guilds/components/form.component.html index 540c1fe..53ca756 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/form.component.html +++ b/src/app/domains/superAdmin/modules/guilds/components/form.component.html @@ -1,7 +1,8 @@
- - + + + diff --git a/src/app/domains/superAdmin/modules/guilds/components/form.component.ts b/src/app/domains/superAdmin/modules/guilds/components/form.component.ts index 109b391..632d8cc 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/form.component.ts +++ b/src/app/domains/superAdmin/modules/guilds/components/form.component.ts @@ -1,11 +1,12 @@ import { AbstractFormDialog } from '@/shared/abstractClasses'; -import { InputComponent } from '@/shared/components'; +import { CodeComponent, FieldInvoiceTemplatesComponent, NameComponent } from '@/shared/components'; +import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component'; +import { fieldControl } from '@/shared/constants'; import { Component, inject, Input } from '@angular/core'; -import { ReactiveFormsModule, Validators } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; import { IGuildRequest, IGuildResponse } from '../models'; import { GuildsService } from '../services/main.service'; -import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; interface T { name: string; @@ -15,21 +16,23 @@ interface T { @Component({ selector: 'admin-guild-form', templateUrl: './form.component.html', - imports: [ReactiveFormsModule, SharedDialogComponent, InputComponent, FormFooterActionsComponent], + imports: [ + ReactiveFormsModule, + SharedDialogComponent, + FormFooterActionsComponent, + NameComponent, + CodeComponent, + FieldInvoiceTemplatesComponent, + ], }) export class GuildFormComponent extends AbstractFormDialog { @Input() guildId?: string; private service = inject(GuildsService); form = this.fb.group({ - name: [ - { value: this.initialValues?.name, disabled: this.submitLoading() }, - Validators.required, - ], - code: [ - { value: this.initialValues?.code, disabled: this.submitLoading() }, - Validators.required, - ], + name: fieldControl.name(this.initialValues?.name, true), + code: fieldControl.code(this.initialValues?.code, true), + invoice_template: fieldControl.invoice_template(this.initialValues?.invoice_template.id, true), }); override ngOnChanges() { diff --git a/src/app/domains/superAdmin/modules/guilds/components/goods/list.component.html b/src/app/domains/superAdmin/modules/guilds/components/goods/list.component.html index 4c2b653..04fdedb 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/goods/list.component.html +++ b/src/app/domains/superAdmin/modules/guilds/components/goods/list.component.html @@ -1,6 +1,6 @@ diff --git a/src/app/domains/superAdmin/modules/partners/components/form.component.html b/src/app/domains/superAdmin/modules/partners/components/form.component.html index 4855179..5cd6204 100644 --- a/src/app/domains/superAdmin/modules/partners/components/form.component.html +++ b/src/app/domains/superAdmin/modules/partners/components/form.component.html @@ -8,12 +8,11 @@ >
- - + + @if (!editMode) { اطلاعات ورود - - + { @@ -32,35 +40,16 @@ export class GuildFormComponent extends AbstractFormDialog('', { - nonNullable: true, - validators: [Validators.required], - }), - ); - form.addControl( - 'password', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); - form.addControl( - 'confirmPassword', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); + form.controls.username.setValidators([Validators.required, usernameValidator()]); + form.controls.username.updateValueAndValidity({ emitEvent: false }); form.addValidators([MustMatch('password', 'confirmPassword')]); } else { // @ts-ignore diff --git a/src/app/domains/superAdmin/modules/partners/views/list.component.html b/src/app/domains/superAdmin/modules/partners/views/list.component.html index b4094ff..7dd0852 100644 --- a/src/app/domains/superAdmin/modules/partners/views/list.component.html +++ b/src/app/domains/superAdmin/modules/partners/views/list.component.html @@ -20,7 +20,7 @@ diff --git a/src/app/domains/superAdmin/modules/providers/components/form.component.ts b/src/app/domains/superAdmin/modules/providers/components/form.component.ts index 21008f8..05d9a72 100644 --- a/src/app/domains/superAdmin/modules/providers/components/form.component.ts +++ b/src/app/domains/superAdmin/modules/providers/components/form.component.ts @@ -1,8 +1,9 @@ -import { MustMatch } from '@/core/validators'; +import { MustMatch, usernameValidator } from '@/core/validators'; import { AbstractFormDialog } from '@/shared/abstractClasses'; import { InputComponent, SharedPasswordInputComponent } from '@/shared/components'; import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component'; +import { fieldControl } from '@/shared/constants'; import { Component, computed, inject, Input } from '@angular/core'; import { ReactiveFormsModule, Validators } from '@angular/forms'; import { Divider } from 'primeng/divider'; @@ -27,35 +28,16 @@ export class ProviderFormComponent extends AbstractFormDialog('', { - nonNullable: true, - validators: [Validators.required], - }), - ); - form.addControl( - 'password', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); - form.addControl( - 'confirmPassword', - this.fb.control('', { - nonNullable: true, - validators: [Validators.required], - }), - ); + form.controls.username.setValidators([Validators.required, usernameValidator()]); + form.controls.username.updateValueAndValidity({ emitEvent: false }); form.addValidators([MustMatch('password', 'confirmPassword')]); } else { // @ts-ignore diff --git a/src/app/domains/superAdmin/modules/users/components/accounts/list.component.html b/src/app/domains/superAdmin/modules/users/components/accounts/list.component.html index 438ea7b..37a37fa 100644 --- a/src/app/domains/superAdmin/modules/users/components/accounts/list.component.html +++ b/src/app/domains/superAdmin/modules/users/components/accounts/list.component.html @@ -2,13 +2,13 @@ pageTitle="مدیریت حساب‌های کاربری" [addNewCtaLabel]="'افزودن حساب کاربری'" [columns]="columns" - [showAdd]="true" emptyPlaceholderTitle="حساب کاربری‌ای یافت نشد." emptyPlaceholderDescription="برای افزودن حساب کاربری، روی دکمهٔ بالا کلیک کنید." [items]="items()" [loading]="loading()" [showDetails]="true" [showAdd]="true" + [showIndex]="false" (onAdd)="openAddForm()" (onRefresh)="refresh()" > diff --git a/src/app/layout/default/app.sidebar.component.html b/src/app/layout/default/app.sidebar.component.html index 1021575..5b5d42e 100644 --- a/src/app/layout/default/app.sidebar.component.html +++ b/src/app/layout/default/app.sidebar.component.html @@ -3,8 +3,12 @@
-
- ارایه شده توسط (برند نرم‌افزار) + +
+
+ Logo +
+ مدیریت صورت‌حساب‌های مالیاتی پاژن
diff --git a/src/app/layout/default/app.sidebar.component.ts b/src/app/layout/default/app.sidebar.component.ts index 56fca6f..6078e17 100644 --- a/src/app/layout/default/app.sidebar.component.ts +++ b/src/app/layout/default/app.sidebar.component.ts @@ -1,12 +1,16 @@ import { Component, ElementRef } from '@angular/core'; +import { Divider } from 'primeng/divider'; +import images from 'src/assets/images'; import { AppMenu } from './app.menu.component'; @Component({ selector: 'app-sidebar', standalone: true, - imports: [AppMenu], + imports: [AppMenu, Divider], templateUrl: './app.sidebar.component.html', }) export class AppSidebar { constructor(public el: ElementRef) {} + + logo = images.logo; } diff --git a/src/app/modules/auth/pages/auth.component.html b/src/app/modules/auth/pages/auth.component.html index 060c8e6..17fd577 100644 --- a/src/app/modules/auth/pages/auth.component.html +++ b/src/app/modules/auth/pages/auth.component.html @@ -8,7 +8,7 @@ >
مدیریت صورت‌حساب‌های مالیاتی - به پنل مدیریت صورت‌حساب‌های مالیاتی خوش آمدید. + به پنل مدیریت صورت‌حساب‌های مالیاتی پاژن خوش آمدید.
diff --git a/src/app/modules/auth/pages/auth.component.ts b/src/app/modules/auth/pages/auth.component.ts index 36f13d3..0284402 100644 --- a/src/app/modules/auth/pages/auth.component.ts +++ b/src/app/modules/auth/pages/auth.component.ts @@ -1,15 +1,7 @@ import { IAuthResponse, TRoles } from '@/core'; import { ToastService } from '@/core/services/toast.service'; -import { - Component, - EventEmitter, - Input, - Output, - signal, - inject, -} from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output, signal } from '@angular/core'; import { Router } from '@angular/router'; -import { ButtonDirective } from 'primeng/button'; import images from 'src/assets/images'; import { LoginComponent } from './login/login.component'; @@ -18,7 +10,7 @@ type TSteps = 'login' | 'otp' | 'modifyLoginInfo' | 'signup'; @Component({ selector: 'app-auth', templateUrl: './auth.component.html', - imports: [LoginComponent, ButtonDirective], + imports: [LoginComponent], }) export class AuthComponent { @Input() redirectUrl!: string; @@ -91,5 +83,4 @@ export class AuthComponent { } this.router.navigateByUrl(redirectUrl); } - } diff --git a/src/app/modules/pos/components/order/price-info-card.component.html b/src/app/modules/pos/components/order/price-info-card.component.html index 7c60e0a..ffad995 100644 --- a/src/app/modules/pos/components/order/price-info-card.component.html +++ b/src/app/modules/pos/components/order/price-info-card.component.html @@ -12,7 +12,7 @@ }
- مالیات (۱۰٪) + ارزش افزوده

diff --git a/src/app/shared/apiEnum/constants/apiRoutes.ts b/src/app/shared/apiEnum/constants/apiRoutes.ts index 02676e3..eb8c4d7 100644 --- a/src/app/shared/apiEnum/constants/apiRoutes.ts +++ b/src/app/shared/apiEnum/constants/apiRoutes.ts @@ -20,4 +20,5 @@ export const ENUMS_API_ROUTES = { goodPricingModel: `${baseUrl}/good_pricing_model`, consumerRole: `${baseUrl}/consumer_role`, fiscalResponseStatus: `${baseUrl}/tsp_provider_response_status`, + invoice_template_type: `${baseUrl}/invoice_templates`, }; diff --git a/src/app/shared/components/fields/abstractField.component.ts b/src/app/shared/components/fields/abstractField.component.ts new file mode 100644 index 0000000..e4c8484 --- /dev/null +++ b/src/app/shared/components/fields/abstractField.component.ts @@ -0,0 +1,13 @@ +import { Component, Input } from '@angular/core'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; + +@Component({ + selector: 'abstract-field', + template: '', + imports: [ReactiveFormsModule], +}) +export abstract class AbstractFieldComponent { + @Input({ required: true }) control!: FormControl; + @Input({ required: true }) name!: string; + @Input({ required: true }) label!: string; +} diff --git a/src/app/shared/components/fields/index.ts b/src/app/shared/components/fields/index.ts index 77596d7..8b44f74 100644 --- a/src/app/shared/components/fields/index.ts +++ b/src/app/shared/components/fields/index.ts @@ -10,6 +10,7 @@ export * from './email.component'; export * from './first_name.component'; export * from './fiscal_id.component'; export * from './guild_id.component'; +export * from './invoice_templates.component'; export * from './last_name.component'; export * from './legal_name.component'; export * from './license_starts_at.component'; diff --git a/src/app/shared/components/fields/invoice_templates.component.ts b/src/app/shared/components/fields/invoice_templates.component.ts new file mode 100644 index 0000000..b47ddc5 --- /dev/null +++ b/src/app/shared/components/fields/invoice_templates.component.ts @@ -0,0 +1,19 @@ +import { EnumSelectComponent } from '@/shared/apiEnum/select.component'; +import { Component, Input } from '@angular/core'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; + +@Component({ + selector: 'field-invoice-templates', + template: ``, + imports: [ReactiveFormsModule, EnumSelectComponent], +}) +export class FieldInvoiceTemplatesComponent { + @Input({ required: true }) control = new FormControl(''); + @Input() name = 'invoice-template'; + @Input() label = 'قالب فاکتور'; +} diff --git a/src/app/shared/constants/fields/index.ts b/src/app/shared/constants/fields/index.ts index 613f0eb..864d763 100644 --- a/src/app/shared/constants/fields/index.ts +++ b/src/app/shared/constants/fields/index.ts @@ -1,4 +1,10 @@ -import { fiscalCodeValidator, mobileValidator, postalCodeValidator } from '@/core/validators'; +import { + fiscalCodeValidator, + mobileValidator, + password, + postalCodeValidator, + usernameValidator, +} from '@/core/validators'; import { nationalIdValidator } from '@/core/validators/national-id.validator'; import { ValidatorFn, Validators } from '@angular/forms'; @@ -7,6 +13,10 @@ type ControlConfig = [any, ValidatorFn[]]; export const fieldControl = { name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []], + invoice_template: (value = '', isRequired = true): ControlConfig => [ + value, + isRequired ? required() : [], + ], code: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []], description: (value = '', isRequired = false): ControlConfig => [ value, @@ -61,11 +71,14 @@ export const fieldControl = { value, isRequired ? [Validators.required, nationalIdValidator()] : [nationalIdValidator()], ], - postal_code: (value = '', isRequired = true): ControlConfig => [ + postal_code: (value = '', isRequired = false): ControlConfig => [ value, isRequired ? [Validators.required, postalCodeValidator()] : [postalCodeValidator()], ], - username: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []], + username: (value = '', isRequired = true): ControlConfig => [ + value, + isRequired ? [...required(), usernameValidator()] : [usernameValidator()], + ], economic_code: (value = '', isRequired = true): ControlConfig => [ value, isRequired ? required() : [], @@ -174,4 +187,13 @@ export const fieldControl = { value, isRequired ? required() : [], ], + + password: (value = '', isRequired = true): ControlConfig => [ + value, + isRequired ? [...required(), password()] : [password()], + ], + confirmPassword: (value = '', isRequired = true): ControlConfig => [ + value, + isRequired ? required() : [], + ], }; diff --git a/src/assets/images/index.ts b/src/assets/images/index.ts index 3547e95..e17923d 100644 --- a/src/assets/images/index.ts +++ b/src/assets/images/index.ts @@ -1,7 +1,7 @@ // Export the public URL for static assets so bundlers don't need a loader for binary imports. // The Angular CLI / build serves files in `src/assets` at `/assets`. import errors from './errors'; -import login from './login.webp'; +import login from './login.jpg'; import logo from './logo.png'; import { placeholders } from './placeholders'; diff --git a/src/assets/images/login.jpg b/src/assets/images/login.jpg new file mode 100644 index 0000000..ecfc21f Binary files /dev/null and b/src/assets/images/login.jpg differ diff --git a/src/assets/images/login.png b/src/assets/images/login.png deleted file mode 100644 index 71ce1d5..0000000 Binary files a/src/assets/images/login.png and /dev/null differ diff --git a/src/assets/images/login.webp b/src/assets/images/login.webp deleted file mode 100644 index 6e0ecb5..0000000 Binary files a/src/assets/images/login.webp and /dev/null differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png index f82b4c3..b038004 100644 Binary files a/src/assets/images/logo.png and b/src/assets/images/logo.png differ diff --git a/src/index.html b/src/index.html index aed0bf8..d941bb3 100644 --- a/src/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - پنل مدیریت صورت‌حساب‌های مالیاتی + مدیریت صورت‌حساب‌های مالیاتی پاژن