Skip to content

Commit c38c30b

Browse files
authored
Merge pull request #18 from EnfonoTech/new_task_stock_8
fix: changed the validation logic in customer
2 parents be446ab + 4fbf704 commit c38c30b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

rmax_custom/public/js/create_customer.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,22 @@ function open_create_customer_dialog(frm) {
151151
frappe.msgprint("Pincode must be exactly 5 digits.");
152152
return;
153153
}
154-
if (vat && ["Company", "Branch"].includes(type)) {
155-
154+
if (vat && type !== "Branch") {
156155
frappe.db.get_value("Customer", {
157156
custom_vat_registration_number: vat
158157
}, "name").then(r => {
159-
160158
if (r.message && r.message.name) {
161159
frappe.msgprint(
162160
`VAT already exists for Customer: ${r.message.name}`
163161
);
164162
return;
165163
}
166-
167164
create_customer();
168165
});
169166

170-
} else {
171-
create_customer();
167+
return;
172168
}
173-
169+
create_customer();
174170
function create_customer() {
175171
frappe.call({
176172
method: "rmax_custom.api.customer.create_customer_with_address",

0 commit comments

Comments
 (0)