From 4fbf7045ca81f1246831ce53c84bad7dc9534cd8 Mon Sep 17 00:00:00 2001 From: Neha Fathima Date: Fri, 17 Apr 2026 17:14:06 +0530 Subject: [PATCH] fix: changed the validation logic in customer --- rmax_custom/public/js/create_customer.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rmax_custom/public/js/create_customer.js b/rmax_custom/public/js/create_customer.js index 32c559b..a0d34ad 100644 --- a/rmax_custom/public/js/create_customer.js +++ b/rmax_custom/public/js/create_customer.js @@ -151,26 +151,22 @@ function open_create_customer_dialog(frm) { frappe.msgprint("Pincode must be exactly 5 digits."); return; } - if (vat && ["Company", "Branch"].includes(type)) { - + if (vat && type !== "Branch") { frappe.db.get_value("Customer", { custom_vat_registration_number: vat }, "name").then(r => { - if (r.message && r.message.name) { frappe.msgprint( `VAT already exists for Customer: ${r.message.name}` ); return; } - create_customer(); }); - } else { - create_customer(); + return; } - + create_customer(); function create_customer() { frappe.call({ method: "rmax_custom.api.customer.create_customer_with_address",