Skip to content

Commit

Permalink
Merge pull request #526 from resilient-tech/version-14-hotfix
Browse files Browse the repository at this point in the history
chore: release v14
  • Loading branch information
sagarvora authored Mar 24, 2023
2 parents 70a1fb0 + 7d4f348 commit b279440
Show file tree
Hide file tree
Showing 30 changed files with 1,784 additions and 59 deletions.
18 changes: 14 additions & 4 deletions india_compliance/gst_india/client_scripts/company.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ set_gstin_query(DOCTYPE);

frappe.ui.form.off(DOCTYPE, "make_default_tax_template");
frappe.ui.form.on(DOCTYPE, {
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" },
]);
},

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,
country: frm.doc.country,
},
args: { company: frm.doc.name },
callback: function () {
frappe.msgprint(__("Default Tax Templates created"));
},
Expand Down
21 changes: 21 additions & 0 deletions india_compliance/gst_india/client_scripts/purchase_invoice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
frappe.ui.form.on("Purchase Invoice", {
refresh(frm) {
if (
frm.doc.docstatus !== 1 ||
frm.doc.gst_category !== "Overseas" ||
frm.doc.__onload?.bill_of_entry_exists
)
return;

frm.add_custom_button(
__("Bill of Entry"),
() => {
frappe.model.open_mapped_doc({
method: "india_compliance.gst_india.doctype.bill_of_entry.bill_of_entry.make_bill_of_entry",
frm: frm,
});
},
__("Create")
);
},
});
27 changes: 21 additions & 6 deletions india_compliance/gst_india/constants/custom_fields.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from copy import deepcopy

import frappe

from india_compliance.gst_india.constants import GST_CATEGORIES, STATE_NUMBERS
Expand Down Expand Up @@ -50,11 +48,28 @@ def get_place_of_supply_options():
},
]

company_fields = deepcopy(party_fields)
company_fields[0]["insert_after"] = "parent_company"

CUSTOM_FIELDS = {
"Company": company_fields,
"Company": [
{
**party_fields[0],
"insert_after": "parent_company",
},
*party_fields[1:],
{
"fieldname": "default_customs_expense_account",
"label": "Default Customs Duty Expense Account",
"fieldtype": "Link",
"options": "Account",
"insert_after": "unrealized_profit_loss_account",
},
{
"fieldname": "default_customs_payable_account",
"label": "Default Customs Duty Payable Account",
"fieldtype": "Link",
"options": "Account",
"insert_after": "default_finance_book",
},
],
("Customer", "Supplier"): party_fields,
# Purchase Fields
("Purchase Order", "Purchase Receipt", "Purchase Invoice"): [
Expand Down
Empty file.
Loading

0 comments on commit b279440

Please sign in to comment.