We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents be446ab + 4fbf704 commit c38c30bCopy full SHA for c38c30b
1 file changed
rmax_custom/public/js/create_customer.js
@@ -151,26 +151,22 @@ function open_create_customer_dialog(frm) {
151
frappe.msgprint("Pincode must be exactly 5 digits.");
152
return;
153
}
154
- if (vat && ["Company", "Branch"].includes(type)) {
155
-
+ if (vat && type !== "Branch") {
156
frappe.db.get_value("Customer", {
157
custom_vat_registration_number: vat
158
}, "name").then(r => {
159
160
if (r.message && r.message.name) {
161
frappe.msgprint(
162
`VAT already exists for Customer: ${r.message.name}`
163
);
164
165
166
167
create_customer();
168
});
169
170
- } else {
171
- create_customer();
+ return;
172
173
+ create_customer();
174
function create_customer() {
175
frappe.call({
176
method: "rmax_custom.api.customer.create_customer_with_address",
0 commit comments