diff --git a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js index 92fd0e000..5bddf1277 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js @@ -75,7 +75,9 @@ frappe.ui.form.on("Purchase Reconciliation Tool", { onload(frm) { if (frm.doc.is_modified) frm.doc.reconciliation_data = null; add_gstr2b_alert(frm); - set_date_range_description(frm); + + frm.trigger("purchase_period"); + frm.trigger("inward_supply_period"); }, async company(frm) { @@ -88,7 +90,12 @@ frappe.ui.form.on("Purchase Reconciliation Tool", { refresh(frm) { // Primary Action frm.disable_save(); - frm.page.set_primary_action(__("Reconcile"), () => frm.save()); + frm.page.set_primary_action(__("Reconcile"), () => { + if (!frm.doc.company && !frm.doc.company_gstin) { + frappe.throw(__('Please provide either a Company name or Company GSTIN.')); + } + frm.save(); + }); // add custom buttons api_enabled diff --git a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.json b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.json index 4acc2f59e..59ca56ed3 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.json +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.json @@ -47,7 +47,8 @@ "fieldname": "purchase_period", "fieldtype": "Select", "label": "Purchase Period", - "options": "\nThis Month\nThis Quarter to Last Month\nThis Quarter\nThis Fiscal Year to Last Month\nThis Fiscal Year\nLast Month\nLast Quarter\nLast Fiscal Year\nCustom" + "options": "\nThis Month\nThis Quarter to Last Month\nThis Quarter\nThis Fiscal Year to Last Month\nThis Fiscal Year\nLast Month\nLast Quarter\nLast Fiscal Year\nCustom", + "reqd": 1 }, { "depends_on": "eval: doc.purchase_period == 'Custom'", @@ -71,7 +72,8 @@ "fieldname": "inward_supply_period", "fieldtype": "Select", "label": "Inward Supply Period", - "options": "\nThis Month\nThis Quarter to Last Month\nThis Quarter\nThis Fiscal Year to Last Month\nThis Fiscal Year\nLast Month\nLast Quarter\nLast Fiscal Year\nCustom" + "options": "\nThis Month\nThis Quarter to Last Month\nThis Quarter\nThis Fiscal Year to Last Month\nThis Fiscal Year\nLast Month\nLast Quarter\nLast Fiscal Year\nCustom", + "reqd": 1 }, { "depends_on": "eval: doc.inward_supply_period == 'Custom'", @@ -150,7 +152,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2024-06-20 13:19:57.316043", + "modified": "2024-08-09 17:57:55.801686", "modified_by": "Administrator", "module": "GST India", "name": "Purchase Reconciliation Tool", diff --git a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/test_purchase_reconciliation_tool.py b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/test_purchase_reconciliation_tool.py index 87252dcfc..ab037f98f 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/test_purchase_reconciliation_tool.py +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/test_purchase_reconciliation_tool.py @@ -82,8 +82,10 @@ def test_purchase_reconciliation_tool(self): { "company": "_Test Indian Registered Company", "company_gstin": "All", + "purchase_period": "Custom", "purchase_from_date": "2023-11-01", "purchase_to_date": "2023-12-31", + "inward_supply_period": "Custom", "inward_supply_from_date": "2023-11-01", "inward_supply_to_date": "2023-12-31", "gst_return": "GSTR 2B",