{% if(data[i].posting_date) { %}
| {%= frappe.datetime.str_to_user(data[i].posting_date) %} |
From 2898c94f0820734b396bd570f414cfca5a0647f0 Mon Sep 17 00:00:00 2001
From: Aditya Hase
Date: Wed, 5 Jun 2019 23:29:45 +0530
Subject: [PATCH 3/6] fix(error-report): Do not send error reports to
support@erpnext.com
---
erpnext/hooks.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index fb24aa93892..9b18e5e1f3a 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -13,8 +13,6 @@ source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop'
-error_report_email = "support@erpnext.com"
-
app_include_js = "assets/js/erpnext.min.js"
app_include_css = "assets/css/erpnext.css"
web_include_js = "assets/js/erpnext-web.min.js"
From e0333c0756712bb95bed9b421555922627aa8b99 Mon Sep 17 00:00:00 2001
From: Prasann Shah
Date: Thu, 6 Jun 2019 11:22:06 +0530
Subject: [PATCH 4/6] [Add] GSTIN filter in HSN summary report (#17836)
* [Add] GSTIN filter in HSN summary report
* [Add] Same filter in GST Itemised Sales Register
---
.../item_wise_sales_register.py | 4 ++-
erpnext/regional/india/utils.py | 14 ++++++++++
.../gst_itemised_sales_register.js | 28 ++++++++++++++++++-
.../hsn_wise_summary_of_outward_supplies.js | 20 +++++++++++--
.../hsn_wise_summary_of_outward_supplies.py | 5 ++--
.../india_gst_common/india_gst_common.js | 21 ++++++++++++++
6 files changed, 85 insertions(+), 7 deletions(-)
create mode 100644 erpnext/regional/report/india_gst_common/india_gst_common.js
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
index e8b19b40249..5d3253a552d 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
@@ -102,7 +102,9 @@ def get_conditions(filters):
("customer", " and `tabSales Invoice`.customer = %(customer)s"),
("item_code", " and `tabSales Invoice Item`.item_code = %(item_code)s"),
("from_date", " and `tabSales Invoice`.posting_date>=%(from_date)s"),
- ("to_date", " and `tabSales Invoice`.posting_date<=%(to_date)s")):
+ ("to_date", " and `tabSales Invoice`.posting_date<=%(to_date)s"),
+ ("company_gstin", " and `tabSales Invoice`.company_gstin = %(company_gstin)s"),
+ ("invoice_type", " and `tabSales Invoice`.invoice_type = %(invoice_type)s")):
if filters.get(opts[0]):
conditions += opts[1]
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 9077b79b78c..015aefb8b35 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -367,6 +367,20 @@ def generate_ewb_json(dt, dn):
frappe.local.response.filename = '{0}_e-WayBill_Data_{1}.json'.format(doc_name, frappe.utils.random_string(5))
+@frappe.whitelist()
+def get_gstins_for_company(company):
+ company_gstins =[]
+ if company:
+ company_gstins = frappe.db.sql("""select
+ distinct `tabAddress`.gstin
+ from
+ `tabAddress`, `tabDynamic Link`
+ where
+ `tabDynamic Link`.parent = `tabAddress`.name and
+ `tabDynamic Link`.parenttype = 'Address' and
+ `tabDynamic Link`.link_doctype = 'Company' and
+ `tabDynamic Link`.link_name = '{0}'""".format(company))
+ return company_gstins
def get_address_details(data, doc, company_address, billing_address):
data.fromPincode = validate_pincode(company_address.pincode, 'Company Address')
diff --git a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.js b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.js
index 1ece14b713b..3a0f0c966d6 100644
--- a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.js
+++ b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.js
@@ -3,5 +3,31 @@
/* eslint-disable */
{% include "erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js" %}
+{% include "erpnext/regional/report/india_gst_common/india_gst_common.js" %}
-frappe.query_reports["GST Itemised Sales Register"] = frappe.query_reports["Item-wise Sales Register"]
\ No newline at end of file
+let filters = frappe.query_reports["Item-wise Sales Register"]["filters"];
+
+// Add GSTIN filter
+filters = filters.concat({
+ "fieldname":"company_gstin",
+ "label": __("Company GSTIN"),
+ "fieldtype": "Select",
+ "placeholder":"Company GSTIN",
+ "options": [""],
+ "width": "80"
+}, {
+ "fieldname":"invoice_type",
+ "label": __("Invoice Type"),
+ "fieldtype": "Select",
+ "placeholder":"Invoice Type",
+ "options": ["", "Regular", "SEZ", "Export", "Deemed Export"]
+});
+
+// Handle company on change
+for (var i = 0; i < filters.length; ++i) {
+ if (filters[i].fieldname === 'company') {
+ filters[i].on_change = fetch_gstins;
+ }
+}
+
+frappe.query_reports["GST Itemised Sales Register"] = { "filters": filters, "onload": fetch_gstins };
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js
index df0ef253158..dcb81cb087e 100644
--- a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js
@@ -2,6 +2,8 @@
// For license information, please see license.txt
/* eslint-disable */
+{% include "erpnext/regional/report/india_gst_common/india_gst_common.js" %}
+
frappe.query_reports["HSN-wise-summary of outward supplies"] = {
"filters": [
{
@@ -10,7 +12,8 @@ frappe.query_reports["HSN-wise-summary of outward supplies"] = {
"fieldtype": "Link",
"options": "Company",
"reqd": 1,
- "default": frappe.defaults.get_user_default("Company")
+ "default": frappe.defaults.get_user_default("Company"),
+ "on_change": fetch_gstins
},
{
"fieldname":"gst_hsn_code",
@@ -18,6 +21,17 @@ frappe.query_reports["HSN-wise-summary of outward supplies"] = {
"fieldtype": "Link",
"options": "GST HSN Code",
"width": "80"
+ },
+ {
+ "fieldname":"company_gstin",
+ "label": __("Company GSTIN"),
+ "fieldtype": "Select",
+ "placeholder":"Company GSTIN",
+ "options": [""],
+ "width": "80"
}
- ]
-}
+ ],
+ onload: (report) => {
+ fetch_gstins(report);
+ }
+};
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
index 165458c4d5a..e938e29c440 100644
--- a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
@@ -87,7 +87,8 @@ def get_conditions(filters):
conditions = ""
for opts in (("company", " and company=%(company)s"),
- ("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s")):
+ ("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s"),
+ ("company_gstin", " and company_gstin=%(company_gstin)s")):
if filters.get(opts[0]):
conditions += opts[1]
@@ -193,7 +194,7 @@ def get_merged_data(columns, data):
add_column_index.append(i)
for row in data:
- if merged_hsn_dict.has_key(row[0]):
+ if row[0] in merged_hsn_dict:
to_add_row = merged_hsn_dict.get(row[0])
# add columns from the add_column_index table
diff --git a/erpnext/regional/report/india_gst_common/india_gst_common.js b/erpnext/regional/report/india_gst_common/india_gst_common.js
new file mode 100644
index 00000000000..49606013946
--- /dev/null
+++ b/erpnext/regional/report/india_gst_common/india_gst_common.js
@@ -0,0 +1,21 @@
+function fetch_gstins(report) {
+ var company_gstins = report.get_filter('company_gstin');
+ var company = report.get_filter_value('company');
+ if (company) {
+ frappe.call({
+ method:'erpnext.regional.india.utils.get_gstins_for_company',
+ async: false,
+ args: {
+ company: company
+ },
+ callback: function(r) {
+ r.message.unshift("");
+ company_gstins.df.options = r.message;
+ company_gstins.refresh();
+ }
+ });
+ } else {
+ company_gstins.df.options = [""];
+ company_gstins.refresh();
+ }
+}
\ No newline at end of file
From 4c23c2ddec0b4873999f7f628592a5c805d01062 Mon Sep 17 00:00:00 2001
From: Sagar Vora
Date: Fri, 7 Jun 2019 10:36:58 +0530
Subject: [PATCH 5/6] fix (regional): remove "Generate" from button text as
button now under "Make" heading
---
erpnext/accounts/doctype/sales_invoice/regional/india.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erpnext/accounts/doctype/sales_invoice/regional/india.js b/erpnext/accounts/doctype/sales_invoice/regional/india.js
index 5fec3ba6d32..c8305e325f6 100644
--- a/erpnext/accounts/doctype/sales_invoice/regional/india.js
+++ b/erpnext/accounts/doctype/sales_invoice/regional/india.js
@@ -21,7 +21,7 @@ frappe.ui.form.on("Sales Invoice", {
if(frm.doc.docstatus == 1 && !frm.is_dirty()
&& !frm.doc.is_return && !frm.doc.ewaybill) {
- frm.add_custom_button('Generate e-Way Bill JSON', () => {
+ frm.add_custom_button('e-Way Bill JSON', () => {
var w = window.open(
frappe.urllib.get_full_url(
"/api/method/erpnext.regional.india.utils.generate_ewb_json?"
From d72f4d79595a32509448ad5a0c88fe06decd1091 Mon Sep 17 00:00:00 2001
From: Rohit Waghchaure
Date: Fri, 7 Jun 2019 11:44:51 +0530
Subject: [PATCH 6/6] fix: Not able to save salary slip
---
erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index dd4c77d1452..ffd786836a5 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -443,7 +443,7 @@ class SalarySlip(TransactionBase):
else:
component_row.additional_amount = amount
- if not overwrite:
+ if not overwrite and component_row.default_amount:
amount += component_row.default_amount
component_row.amount = amount