From 678d288a933f80459abc890ffcbdc9c689eea4b9 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 9 Oct 2023 16:34:07 +0530 Subject: [PATCH] Improved: condition to check atp type(#240) --- src/views/catalog-product-details.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/catalog-product-details.vue b/src/views/catalog-product-details.vue index ccaba575..0497b0ea 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -733,7 +733,7 @@ export default defineComponent({ if (hasError(resp[1]) && resp[1]?.data?.error !== "No record found") showToast(this.$t("Something went wrong, could not fetch", { data: 'online ATP' })) else this.atpCalcDetails.onlineAtp = resp[1].data?.onlineAtp - if (typeof this.atpCalcDetails.totalQOH === 'number' && typeof this.atpCalcDetails.onlineAtp === 'number') { + if (typeof resp[0].data?.availableToPromiseTotal === 'number' && typeof this.atpCalcDetails.onlineAtp === 'number') { this.atpCalcDetails.excludedAtp = resp[0].data?.availableToPromiseTotal - resp[1].data?.onlineAtp } } catch (error) {