-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathcompany.js
More file actions
55 lines (50 loc) · 1.92 KB
/
company.js
File metadata and controls
55 lines (50 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const DOCTYPE = "Company";
validate_pan(DOCTYPE);
validate_gstin(DOCTYPE);
update_gstin_in_other_documents(DOCTYPE);
show_overseas_disabled_warning(DOCTYPE);
set_gstin_options_and_status(DOCTYPE);
set_pan_status(DOCTYPE)
frappe.ui.form.off(DOCTYPE, "make_default_tax_template");
frappe.ui.form.on(DOCTYPE, {
refresh(frm){
frm.fields_dict.bank_details_for_printing.grid.fields_map.print_label.ignore_validation = 1
frm.fields_dict.registration_details_for_printing.grid.fields_map.print_label.ignore_validation = 1
},
setup(frm) {
erpnext.company.set_custom_query(frm, [
"default_customs_expense_account",
{ root_type: "Expense" },
]);
erpnext.company.set_custom_query(frm, [
"default_customs_payable_account",
{ root_type: "Liability" },
]);
erpnext.company.set_custom_query(frm, [
"default_gst_expense_account",
{},
]);
frm.set_query("print_label", "bank_details_for_printing", (_, cdt, cdn) => {
return {
query: "india_compliance.gst_india.overrides.company.get_default_print_options",
params : {for_bank : 1}
}
});
frm.set_query("print_label", "registration_details_for_printing", (_, cdt, cdn) => {
return {
query: "india_compliance.gst_india.overrides.company.get_default_print_options",
params : {for_bank : 0}
}
});
},
make_default_tax_template: function (frm) {
if (frm.doc.country !== "India") return;
frappe.call({
method: "india_compliance.gst_india.overrides.company.make_default_tax_templates",
args: { company: frm.doc.name, gst_rate: frm.doc.default_gst_rate},
callback: function () {
frappe.msgprint(__("Default Tax Templates created"));
},
});
},
});