diff --git a/src/containers/Alerts/Estimates/EstimateDeleteAlert.js b/src/containers/Alerts/Estimates/EstimateDeleteAlert.js index bf11b380a..8929a7503 100644 --- a/src/containers/Alerts/Estimates/EstimateDeleteAlert.js +++ b/src/containers/Alerts/Estimates/EstimateDeleteAlert.js @@ -46,7 +46,24 @@ function EstimateDeleteAlert({ }); closeDrawer('estimate-detail-drawer'); }) - .catch(({ errors }) => {}) + .catch( + ({ + response: { + data: { errors }, + }, + }) => { + if ( + errors.find((e) => e.type === 'SALE_ESTIMATE_CONVERTED_TO_INVOICE') + ) { + AppToaster.show({ + intent: Intent.DANGER, + message: intl.get( + 'estimate.delete.error.estimate_converted_to_invoice', + ), + }); + } + }, + ) .finally(() => { closeAlert(name); }); diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json index 016b4b8d3..74a273c46 100644 --- a/src/lang/ar/index.json +++ b/src/lang/ar/index.json @@ -1109,10 +1109,7 @@ "filter_": "البحث...", "all_rights_reserved": "© {pre}-{current} كل الحقوق محفوظة.", "congrats_your_account_has_been_created_and_invited": "مبروك! تم إنشاء حسابك ودعوتك إلى {organization_name} بنجاح.", - "while_we_set_up_your_account_please_remember_to_verify_your_account": "أثناء قيامنا بإعداد حسابك ، يرجى تذكر التحقق من حسابك بالنقر فوق الارتباط الذي أرسلناه إلى عنوان بريدك الإلكتروني المسجل", - - "blog": "المدونة", "support": "الدعم النفي", "service_status": "حالة الخدمة", @@ -1371,7 +1368,8 @@ "filter.select_option": "اختر خيار", "filter.enter_date": "أدخل تاريخ", "filter.value": "قيمة", - "payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!." + "payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.", + "estimate.delete.error.estimate_converted_to_invoice":"لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع." } diff --git a/src/lang/en/index.json b/src/lang/en/index.json index a3b057077..45df1e03b 100644 --- a/src/lang/en/index.json +++ b/src/lang/en/index.json @@ -1341,5 +1341,6 @@ "filter.select_option": "Select an option", "filter.enter_date": "Enter date", "filter.value": "Value", - "payment_made.empty_status.title": "The organization doesn't pay to vendors, yet!" + "payment_made.empty_status.title": "The organization doesn't pay to vendors, yet!", + "estimate.delete.error.estimate_converted_to_invoice":"Could not delete sale estimate that converted to invoice" }