From 406043be1eefaeefa203b6c5934b851dcf5012c5 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sun, 4 May 2025 09:57:14 +0330 Subject: [PATCH] invoice create --- src/pages/customer/types/CustomerTypes.ts | 38 +++++++++++++++++++++++ src/pages/receipts/Create.tsx | 18 +++++------ 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/src/pages/customer/types/CustomerTypes.ts b/src/pages/customer/types/CustomerTypes.ts index 3ce947a..047d20e 100644 --- a/src/pages/customer/types/CustomerTypes.ts +++ b/src/pages/customer/types/CustomerTypes.ts @@ -14,7 +14,27 @@ export type CustomerItemType = { // Add other properties of role if needed }; legalUser: { + id: string; + economicCode: string; + nationalIdentity: string; + registrationCode: string; registrationName: string; + phone: string; + address: { + id: string; + createdAt: string; + updatedAt: string; + fullAddress: string; + postalCode: string; + city: { + id: number; + name: string; + province: { + id: number; + name: string; + }; + }; + }; }; subscriptions: unknown[]; tickets: unknown[]; @@ -23,6 +43,24 @@ export type CustomerItemType = { subscriptionsCount: string; ticketsCount: string; invoicesCount: string; + realUser: { + phone: string; + address: { + id: string; + createdAt: string; + updatedAt: string; + fullAddress: string; + postalCode: string; + city: { + id: number; + name: string; + province: { + id: number; + name: string; + }; + }; + }; + }; }; export type CreateCustomerType = { diff --git a/src/pages/receipts/Create.tsx b/src/pages/receipts/Create.tsx index 064c5c9..1de4f30 100644 --- a/src/pages/receipts/Create.tsx +++ b/src/pages/receipts/Create.tsx @@ -140,7 +140,7 @@ const CreateReceipt: FC = () => {
{t('receip.type_person')}
-
حقوقی
+
{customer.legalUser ? 'حقوقی' : 'حقیقی'}
{t('receip.representativeـname')}
@@ -148,39 +148,39 @@ const CreateReceipt: FC = () => {
{t('receip.company_name')}
-
راوک
+
{customer?.legalUser?.registrationName}
{t('receip.registration_number')}
-
۱۲۳۴
+
{customer?.legalUser?.registrationCode}
{t('receip.tel_company')}
-
۰۸۶۹۱۰۰۹۱۰۰۱
+
{customer?.realUser?.phone || customer?.legalUser?.phone}
{t('receip.national_code')}
-
۰۰۱۲۳۴۵۶۷۸
+
{customer.nationalCode}
{t('receip.postal_code')}
-
۰۰۱۲۳۴۵۶۷۸
+
{customer?.realUser?.address?.postalCode || customer?.legalUser?.address?.postalCode}
{t('receip.state')}
-
مرکزی
+
{customer?.realUser?.address?.city?.province?.name || customer?.legalUser?.address?.city?.province?.name}
{t('receip.city')}
-
اراک
+
{customer?.realUser?.address?.city?.name || customer?.legalUser?.address?.city?.name}
{t('receip.address')}
-
اراک -خیابان شریعتی-خیابان جنت
+
{customer?.realUser?.address?.fullAddress || customer?.legalUser?.address?.fullAddress}