From 4f5f3156c21e383831f4940eed7a642c438beed0 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sun, 20 Apr 2025 13:24:02 +0330 Subject: [PATCH] fixed bug --- .../Form/CreateFactor/CreateFactorContent.jsx | 34 +++++++++---------- .../DamageItemDialog/DamageItemContent.jsx | 12 +++++-- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx b/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx index 961f59c..9ee0999 100644 --- a/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx +++ b/src/components/dashboard/damages/operator/Form/CreateFactor/CreateFactorContent.jsx @@ -79,6 +79,22 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog }) <> + + + } + label={ + + مبلغ کل خسارت برآورد شده + + } + /> + + + + {(row.original?.sum / 1).toLocaleString() || "0"} ریال + + - - - } - label={ - - مبلغ کل خسارت برآورد شده - - } - /> - - - - {(row.original?.sum / 1).toLocaleString() || "0"} ریال - - - {(row.original?.sum / 1).toLocaleString() || "0"} ریال + {(row.original?.sum - (row.original?.deposit_insurance_amount + row.original?.deposit_daghi_amount)).toLocaleString() || "0"} ریال {!factorCreated && ( diff --git a/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx b/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx index e9a76e5..5a37619 100644 --- a/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx +++ b/src/components/dashboard/damages/operator/RowActions/DamageItemDialog/DamageItemContent.jsx @@ -23,7 +23,7 @@ const DamageItemContent = ({ rowId }) => { try { setLoading(true); const response = await request(`${GET_DAMAGE_ITEM_DETAILS}/${rowId}`); - setData(response.data.data.damages); + setData(response.data.data); } catch (error) { } finally { setLoading(false); @@ -38,7 +38,7 @@ const DamageItemContent = ({ rowId }) => { {loading ? ( - ) : data ? ( + ) : data.damages ? ( @@ -49,7 +49,7 @@ const DamageItemContent = ({ rowId }) => { - {data.map((item) => { + {data.damages.map((item) => { return ( { ); })} + + اجرت نصب + {(data.ojrate_nasb / 1).toLocaleString()} +