From 00578ba6329c3f4681b40cb12801bf085d8c2b45 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 13 Jun 2019 13:30:39 +0530 Subject: [PATCH 01/13] fix: Show product page even if cart is not enabled --- erpnext/shopping_cart/product_info.py | 5 ++++- erpnext/templates/generators/item/item_details.html | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py index f9a45ce578..d69b5e3a21 100644 --- a/erpnext/shopping_cart/product_info.py +++ b/erpnext/shopping_cart/product_info.py @@ -13,8 +13,11 @@ from erpnext.utilities.product import get_price, get_qty_in_stock def get_product_info_for_website(item_code): """get product price / stock info for website""" - cart_quotation = _get_cart_quotation() cart_settings = get_shopping_cart_settings() + if not cart_settings.enabled: + return frappe._dict() + + cart_quotation = _get_cart_quotation() price = get_price( item_code, diff --git a/erpnext/templates/generators/item/item_details.html b/erpnext/templates/generators/item/item_details.html index 4f8f8c21a5..8e560333ae 100644 --- a/erpnext/templates/generators/item/item_details.html +++ b/erpnext/templates/generators/item/item_details.html @@ -9,7 +9,13 @@

- {{ doc.web_long_description or doc.description or _("No description given") | safe }} +{% if frappe.utils.strip_html(doc.web_long_description) %} + {{ doc.web_long_description | safe }} +{% elif frappe.utils.strip_html(doc.description) %} + {{ doc.description | safe }} +{% else %} + {{ _("No description given") }} +{% endif %}
{% if has_variants %} From 4c1639305f2c39da83a2bbc50634543464f7f674 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 12:11:23 +0530 Subject: [PATCH 02/13] feat: creating stock entry against purchase receipt --- erpnext/controllers/queries.py | 3 --- .../doctype/work_order/work_order.js | 7 +++--- .../purchase_receipt/purchase_receipt.js | 9 +++++++ .../purchase_receipt/purchase_receipt.py | 22 ++++++++++++++++ .../stock_entry_detail.json | 25 ++++++++++++++----- .../report/stock_balance/stock_balance.js | 3 --- 6 files changed, 54 insertions(+), 15 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 0dcf077c47..ccd334ffba 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -152,9 +152,6 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False): conditions = [] - if not filters["item_group"]: - filters.pop("item_group", None) - description_cond = '' if frappe.db.count('Item', cache=True) < 50000: # scan description only if items are less than 50000 diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index 580243fce8..22613cc8a4 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -72,9 +72,10 @@ frappe.ui.form.on("Work Order", { frm.set_query("production_item", function() { return { query: "erpnext.controllers.queries.item_query", - filters:{ - 'is_stock_item': 1, - } + filters:[ + ['is_stock_item', '=',1], + ['default_bom', '!=', ''] + ] } }); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 21513640ed..e82aa2c63e 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -107,6 +107,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend cur_frm.add_custom_button(__('Return'), this.make_purchase_return, __('Create')); + cur_frm.add_custom_button(__('Make Stock Entry'), cur_frm.cscript['Make Stock Entry'], __('Create')); + if(flt(this.frm.doc.per_billed) < 100) { cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice, __('Create')); } @@ -249,6 +251,13 @@ frappe.ui.form.on('Purchase Receipt Item', { }, }); +cur_frm.cscript['Make Stock Entry'] = function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_stock_entry", + frm: cur_frm, + }) +} + var validate_sample_quantity = function(frm, cdt, cdn) { var d = locals[cdt][cdn]; if (d.sample_quantity) { diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 1a469c5218..cdca44d60b 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -12,6 +12,7 @@ from frappe.utils import getdate from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.utils import get_account_currency from frappe.desk.notifications import clear_doctype_notifications +from frappe.model.mapper import get_mapped_doc from erpnext.buying.utils import check_on_hold_or_closed_status from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_disabled from six import iteritems @@ -530,3 +531,24 @@ def make_purchase_return(source_name, target_doc=None): def update_purchase_receipt_status(docname, status): pr = frappe.get_doc("Purchase Receipt", docname) pr.update_status(status) + +@frappe.whitelist() +def make_stock_entry(source_name,target_doc=None): + def set_missing_values(source, target): + target.stock_entry_type = "Material Transfer" + target.purpose = "Material Transfer" + + doclist = get_mapped_doc("Purchase Receipt", source_name,{ + "Purchase Receipt": { + "doctype": "Stock Entry", + }, + "Purchase Receipt Item": { + "doctype": "Stock Entry Detail", + "field_map": { + "warehouse": "s_warehouse", + "parent": "reference_purchase_receipt" + }, + }, + }, target_doc, set_missing_values) + + return doclist diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json index 8834035776..5933700457 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json @@ -13,6 +13,7 @@ "t_warehouse", "sec_break1", "item_code", + "item_group", "col_break2", "item_name", "section_break_8", @@ -59,7 +60,8 @@ "against_stock_entry", "ste_detail", "column_break_51", - "transferred_qty" + "transferred_qty", + "reference_purchase_receipt" ], "fields": [ { @@ -72,7 +74,6 @@ "fieldtype": "Section Break" }, { - "columns": 2, "fieldname": "s_warehouse", "fieldtype": "Link", "in_list_view": 1, @@ -86,7 +87,6 @@ "fieldtype": "Column Break" }, { - "columns": 2, "fieldname": "t_warehouse", "fieldtype": "Link", "in_list_view": 1, @@ -101,7 +101,6 @@ }, { "bold": 1, - "columns": 3, "fieldname": "item_code", "fieldtype": "Link", "in_global_search": 1, @@ -164,7 +163,6 @@ }, { "bold": 1, - "columns": 3, "fieldname": "qty", "fieldtype": "Float", "in_list_view": 1, @@ -460,15 +458,30 @@ { "fieldname": "dimension_col_break", "fieldtype": "Column Break" + }, + { + "fetch_from": "item_code.item_group", + "fieldname": "item_group", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Group" + }, + { + "fieldname": "reference_purchase_receipt", + "fieldtype": "Link", + "label": "Reference Purchase Receipt", + "options": "Purchase Receipt", + "read_only": 1 } ], "idx": 1, "istable": 1, - "modified": "2019-05-25 22:51:00.802226", + "modified": "2019-06-14 11:58:41.958144", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail", "owner": "Administrator", "permissions": [], + "sort_field": "modified", "sort_order": "ASC" } \ No newline at end of file diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js index 120f879f20..3829d6a5b4 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.js +++ b/erpnext/stock/report/stock_balance/stock_balance.js @@ -41,9 +41,6 @@ frappe.query_reports["Stock Balance"] = { "get_query": function() { return { query: "erpnext.controllers.queries.item_query", - filters: { - "item_group": frappe.query_report.get_filter_value("item_group") - } } } }, From 8f04f6c631e3abc921ff48bc7200db0822d80a90 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 14 Jun 2019 13:08:09 +0530 Subject: [PATCH 03/13] fix: GSTR-3b Report fixes --- .../doctype/gstr_3b_report/gstr_3b_report.py | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 01da810d76..946650bd4e 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -138,14 +138,15 @@ class GSTR3BReport(Document): outward_supply_tax_amounts = self.get_tax_amounts("Sales Invoice") inward_supply_tax_amounts = self.get_tax_amounts("Purchase Invoice", reverse_charge="Y") itc_details = self.get_itc_details() - inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state")) - inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state")) self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_det", ["Registered Regular"]) self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_zero", ["SEZ", "Deemed Export", "Overseas"]) self.prepare_data("Purchase Invoice", inward_supply_tax_amounts, "sup_details", "isup_rev", ["Registered Regular"], reverse_charge="Y") self.report_dict["sup_details"]["osup_nil_exmp"]["txval"] = flt(self.get_nil_rated_supply_value(), 2) self.set_itc_details(itc_details) + + inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state_number")) + inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state")) self.set_inter_state_supply(inter_state_supplies) self.set_inward_nil_exempt(inward_nil_exempt) @@ -221,7 +222,7 @@ class GSTR3BReport(Document): for k, v in iteritems(account_map): txval -= self.report_dict.get(supply_type, {}).get(supply_category, {}).get(v, 0) - self.report_dict[supply_type][supply_category]["txval"] = flt(txval, 2) + self.report_dict[supply_type][supply_category]["txval"] += flt(txval, 2) def set_inter_state_supply(self, inter_state_supply): @@ -283,15 +284,13 @@ class GSTR3BReport(Document): and s.company = %s and s.company_gstin = %s""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1)[0].total - def get_inter_state_supplies(self, state): + def get_inter_state_supplies(self, state_number): - inter_state_supply = frappe.db.sql(""" select sum(s.grand_total) as total, t.tax_amount, a.gst_state, s.gst_category - from `tabSales Invoice` s, `tabSales Taxes and Charges` t, `tabAddress` a - where t.parent = s.name and s.customer_address = a.name and - s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s and - a.gst_state <> %s and s.company = %s and s.company_gstin = %s and - s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') - group by s.gst_category, a.state""", (self.month_no, self.year, state, self.company, self.gst_details.get("gstin")), as_dict=1) + inter_state_supply = frappe.db.sql(""" select sum(s.net_total) as total, sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category + from `tabSales Invoice` s, `tabSales Taxes and Charges` t + where t.parent = s.name and s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s + and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1, debug=1) inter_state_supply_details = {} @@ -300,11 +299,16 @@ class GSTR3BReport(Document): d.gst_category, [] ) - inter_state_supply_details[d.gst_category].append({ - "pos": get_state_code(d.gst_state), - "txval": d.total - d.tax_amount, - "iamt": d.tax_amount - }) + if state_number != d.place_of_supply.split("-")[0]: + inter_state_supply_details[d.gst_category].append({ + "pos": d.place_of_supply, + "txval": d.total, + "iamt": d.tax_amount + }) + else: + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total/2, 2) + self.report_dict["sup_details"]["osup_det"]["camt"] += flt(d.tax_amount/2, 2) + self.report_dict["sup_details"]["osup_det"]["samt"] += flt(d.tax_amount/2, 2) return inter_state_supply_details From e6dd55d9f2e612d8bf09f4bc9890da5ec69f8d90 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 3 Jun 2019 17:48:39 +0530 Subject: [PATCH 04/13] feat: dashboards for HR module --- .../appraisal_template_dashboard.py | 12 ++++++++ .../hr/doctype/employee/employee_dashboard.py | 22 +++++++++----- .../employee_onboarding_template_dashboard.py | 12 ++++++++ .../employee_separation_template_dashboard.py | 12 ++++++++ .../holiday_list/holiday_list_dashboard.py | 3 ++ .../job_applicant/job_applicant_dashboard.py | 16 ++++++++++ .../job_opening/job_opening_dashboard.py | 12 ++++++++ .../leave_allocation_dashboard.py | 15 ++++++++++ .../loan_application_dashboard.py | 12 ++++++++ .../doctype/loan_type/loan_type_dashboard.py | 12 ++++++++ .../payroll_period_dashboard.py | 13 ++++++++ .../salary_structure_dashboard.py | 10 +++++-- .../shift_request/shift_request_dashboard.py | 12 ++++++++ .../shift_type/shift_type_dashboard.py | 12 ++++++++ .../staffing_plan/staffing_plan_dashboard.py | 12 ++++++++ .../training_event_dashboard.py | 13 ++++++++ .../hr/doctype/vehicle/vehicle_dashboard.py | 30 ++++++++++++------- 17 files changed, 210 insertions(+), 20 deletions(-) create mode 100644 erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py create mode 100644 erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py create mode 100644 erpnext/hr/doctype/job_opening/job_opening_dashboard.py create mode 100644 erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py create mode 100644 erpnext/hr/doctype/loan_application/loan_application_dashboard.py create mode 100644 erpnext/hr/doctype/loan_type/loan_type_dashboard.py create mode 100644 erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py create mode 100644 erpnext/hr/doctype/shift_request/shift_request_dashboard.py create mode 100644 erpnext/hr/doctype/shift_type/shift_type_dashboard.py create mode 100644 erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py create mode 100644 erpnext/hr/doctype/training_event/training_event_dashboard.py diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py new file mode 100644 index 0000000000..309427e30c --- /dev/null +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'kra_template', + 'transactions': [ + { + 'items': ['Appraisal'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 46461da1a5..14fa466845 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -13,23 +13,31 @@ def get_data(): }, { 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Timesheet'] + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + }, + { + 'label': _('Shift'), + 'items': ['Shift Request', 'Shift Assignment'] }, { 'label': _('Expense'), - 'items': ['Expense Claim'] + 'items': ['Expense Claim', 'Travel Request'] }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, - { - 'label': _('Training'), - 'items': ['Training Event', 'Training Result'] - }, { 'label': _('Lifecycle'), 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - } + }, + { + 'label': _('Benefit'), + 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + }, + { + 'label': _('Training'), + 'items': ['Training Event', 'Training Result', 'Training Feedback', 'Employee Skill Map'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py new file mode 100644 index 0000000000..837da53016 --- /dev/null +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_onboarding_template', + 'transactions': [ + { + 'items': ['Employee Onboarding'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py new file mode 100644 index 0000000000..39345f0766 --- /dev/null +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_separation_template', + 'transactions': [ + { + 'items': ['Employee Separation'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py index d1599a4f47..22e1de0c34 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py @@ -13,6 +13,9 @@ def get_data(): }, { 'items': ['Leave Period', 'Shift Type'] + }, + { + 'items': ['Service Level', 'Service Level Agreement'] } ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py new file mode 100644 index 0000000000..2478a6395a --- /dev/null +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_applicant', + 'transactions': [ + { + 'label': _('Employee'), + 'items': ['Employee', 'Employee Onboarding'] + }, + { + 'items': ['Job Offer'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py new file mode 100644 index 0000000000..c0890b4f57 --- /dev/null +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_title', + 'transactions': [ + { + 'items': ['Job Applicant'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py new file mode 100644 index 0000000000..72a1b7c194 --- /dev/null +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'leave_allocation', + 'transactions': [ + { + 'items': ['Compensatory Leave Request'] + }, + { + 'items': ['Leave Encashment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_application/loan_application_dashboard.py b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py new file mode 100644 index 0000000000..232c6e3c5b --- /dev/null +++ b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_application', + 'transactions': [ + { + 'items': ['Loan'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_type/loan_type_dashboard.py b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py new file mode 100644 index 0000000000..07b11fe627 --- /dev/null +++ b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_type', + 'transactions': [ + { + 'items': ['Loan Application'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py new file mode 100644 index 0000000000..d524861e4b --- /dev/null +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'payroll_period', + 'transactions': [ + { + 'label': _('Employee Tax Exemption'), + 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py index 3803c1d3ea..547f2b81be 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py @@ -4,9 +4,15 @@ from frappe import _ def get_data(): return { 'fieldname': 'salary_structure', + 'non_standard_fieldnames': { + 'Employee Grade': 'default_salary_structure' + }, 'transactions': [ { - 'items': ['Salary Structure Assignment'] - } + 'items': ['Salary Structure Assignment', 'Salary Slip'] + }, + { + 'items': ['Employee Grade'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py new file mode 100644 index 0000000000..e3bf5df949 --- /dev/null +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_request', + 'transactions': [ + { + 'items': ['Shift Assignment'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py new file mode 100644 index 0000000000..91dfbad7b1 --- /dev/null +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_type', + 'transactions': [ + { + 'items': ['Shift Request', 'Shift Assignment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py new file mode 100644 index 0000000000..35a303f0fb --- /dev/null +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'staffing_plan', + 'transactions': [ + { + 'items': ['Job Opening'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py new file mode 100644 index 0000000000..663832d45f --- /dev/null +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'training_event', + 'transactions': [ + { + 'label': _('Result And Feedback'), + 'items': ['Training Result', 'Training Feedback'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index d27c7ac009..00f1baf859 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -1,14 +1,22 @@ from __future__ import unicode_literals from frappe import _ -data = { - 'heatmap': True, - 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), - 'fieldname': 'license_plate', - 'transactions': [ - { - 'label': _('Logs'), - 'items': ['Vehicle Log'] - } - ] -} \ No newline at end of file +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), + 'fieldname': 'license_plate', + 'non_standard_fieldnames':{ + 'Delivery Trip': 'vehicle' + }, + 'transactions': [ + { + 'label': _('Logs'), + 'items': ['Vehicle Log'] + }, + { + 'label': _('Trip'), + 'items': ['Delivery Trip'] + } + ] + } \ No newline at end of file From 0ae6cbdd01dd155b8d5fefef9dd7ad9e17309ca5 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 13 Jun 2019 19:47:11 +0530 Subject: [PATCH 05/13] fix: requested Changes --- erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py | 1 - erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py | 1 - erpnext/hr/doctype/training_event/training_event_dashboard.py | 1 - erpnext/hr/doctype/vehicle/vehicle_dashboard.py | 2 -- 4 files changed, 5 deletions(-) diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index 2478a6395a..7f131151e1 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'job_applicant', 'transactions': [ { - 'label': _('Employee'), 'items': ['Employee', 'Employee Onboarding'] }, { diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py index d524861e4b..4e9c7c9e7c 100644 --- a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'payroll_period', 'transactions': [ { - 'label': _('Employee Tax Exemption'), 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] }, ], diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index 663832d45f..1c1645c766 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'training_event', 'transactions': [ { - 'label': _('Result And Feedback'), 'items': ['Training Result', 'Training Feedback'] }, ], diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index 00f1baf859..761c70182b 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -11,11 +11,9 @@ def get_data(): }, 'transactions': [ { - 'label': _('Logs'), 'items': ['Vehicle Log'] }, { - 'label': _('Trip'), 'items': ['Delivery Trip'] } ] From e87ebcaf046f9c70c5285f53b39e7b1aabea1ac4 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 14:10:38 +0530 Subject: [PATCH 06/13] fix: upadated employee dashboard --- .../hr/doctype/employee/employee_dashboard.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 14fa466845..e3cc33d142 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -12,8 +12,8 @@ def get_data(): 'items': ['Attendance', 'Attendance Request', 'Leave Application', 'Leave Allocation'] }, { - 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + 'label': _('Lifecycle'), + 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] }, { 'label': _('Shift'), @@ -23,17 +23,17 @@ def get_data(): 'label': _('Expense'), 'items': ['Expense Claim', 'Travel Request'] }, + { + 'label': _('Benefit'), + 'items': ['Employee Benefit Application', 'Employee Benefit Claim'] + }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, { - 'label': _('Lifecycle'), - 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - }, - { - 'label': _('Benefit'), - 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + 'label': _('Payroll'), + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus'] }, { 'label': _('Training'), From 37a717aa98950b5a3733bca444f7400ed94e77b4 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 14 Jun 2019 14:30:36 +0530 Subject: [PATCH 07/13] fix: Seperate queries for Taxable value and tax amounts --- .../doctype/gstr_3b_report/gstr_3b_report.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 946650bd4e..6569833659 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -286,15 +286,24 @@ class GSTR3BReport(Document): def get_inter_state_supplies(self, state_number): - inter_state_supply = frappe.db.sql(""" select sum(s.net_total) as total, sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category + inter_state_supply_taxable_value = frappe.db.sql(""" select sum(s.net_total) as total, s.place_of_supply, s.gst_category + from `tabSales Invoice` s where s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s + and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1) + + inter_state_supply_tax = frappe.db.sql(""" select sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category from `tabSales Invoice` s, `tabSales Taxes and Charges` t where t.parent = s.name and s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') - group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1, debug=1) + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1) + inter_state_supply_tax_mapping={} inter_state_supply_details = {} - for d in inter_state_supply: + for d in inter_state_supply_tax: + inter_state_supply_tax_mapping.setdefault(d.place_of_supply, d.tax_amount) + + for d in inter_state_supply_taxable_value: inter_state_supply_details.setdefault( d.gst_category, [] ) @@ -302,13 +311,13 @@ class GSTR3BReport(Document): if state_number != d.place_of_supply.split("-")[0]: inter_state_supply_details[d.gst_category].append({ "pos": d.place_of_supply, - "txval": d.total, - "iamt": d.tax_amount + "txval": flt(d.total, 2), + "iamt": flt(inter_state_supply_tax_mapping.get(d.place_of_supply), 2) }) else: - self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total/2, 2) - self.report_dict["sup_details"]["osup_det"]["camt"] += flt(d.tax_amount/2, 2) - self.report_dict["sup_details"]["osup_det"]["samt"] += flt(d.tax_amount/2, 2) + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total, 2) + self.report_dict["sup_details"]["osup_det"]["camt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2) + self.report_dict["sup_details"]["osup_det"]["samt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2) return inter_state_supply_details From f472a49cf69990581599e79984f559fcd6d1b882 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 16:32:21 +0530 Subject: [PATCH 08/13] fix: Remove Specifications label --- erpnext/templates/generators/item/item_specifications.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/erpnext/templates/generators/item/item_specifications.html b/erpnext/templates/generators/item/item_specifications.html index a12a074fa9..469a45fd7d 100644 --- a/erpnext/templates/generators/item/item_specifications.html +++ b/erpnext/templates/generators/item/item_specifications.html @@ -1,8 +1,6 @@ {% if doc.website_specifications -%}
-
{{ _("Specifications") }}
- {% for d in doc.website_specifications -%} From 1ecc78266c793a0c0b405485d80039da54c8efa0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 14 Jun 2019 17:29:26 +0530 Subject: [PATCH 09/13] fix: added promotional scheme in selling and buying module page --- erpnext/config/buying.py | 7 ++++++- erpnext/config/selling.py | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py index 264f88f9c1..d1b0d91728 100644 --- a/erpnext/config/buying.py +++ b/erpnext/config/buying.py @@ -70,11 +70,16 @@ def get_data(): "link": "Tree/Item Group", "description": _("Tree of Item Groups."), }, + { + "type": "doctype", + "name": "Promotional Scheme", + "description": _("Rules for applying different promotional schemes.") + }, { "type": "doctype", "name": "Pricing Rule", "description": _("Rules for applying pricing and discount.") - }, + } ] }, { diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index 9209ca96aa..b31eb02cf7 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -111,6 +111,11 @@ def get_data(): "description": _("Bundle items at time of sale."), "dependencies": ["Item"], }, + { + "type": "doctype", + "name": "Promotional Scheme", + "description": _("Rules for applying different promotional schemes.") + }, { "type": "doctype", "name": "Pricing Rule", From 22642a5f45a4fa92a33d973bcfb9014dd273d15d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 18:15:40 +0530 Subject: [PATCH 10/13] fix: Homepage products styling (#17912) --- erpnext/templates/pages/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html index b67a4651db..2ef9c10534 100644 --- a/erpnext/templates/pages/home.html +++ b/erpnext/templates/pages/home.html @@ -33,7 +33,7 @@ {% for item in homepage.products %}
-
+
{{ item.item_name }}
{{ _('More details') }} From b2ab1031e35acfee35816dcf4cc68d4d441707e4 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 18:16:14 +0530 Subject: [PATCH 11/13] fix: Show Clear filters when attribute filters are set --- erpnext/www/all-products/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/www/all-products/index.html b/erpnext/www/all-products/index.html index ade72a25ce..f09021412b 100644 --- a/erpnext/www/all-products/index.html +++ b/erpnext/www/all-products/index.html @@ -42,7 +42,7 @@
- {% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.search %} + {% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.attribute_filters or frappe.form_dict.search %} {{ _('Clear filters') }} {% endif %} From 8e99aaf6050afdf258343397c5e70109e89b56ea Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 20:06:54 +0530 Subject: [PATCH 12/13] fix: Add erpnext website theme import --- erpnext/public/js/website_theme.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/erpnext/public/js/website_theme.js b/erpnext/public/js/website_theme.js index 6c7edfa655..84de2f5b51 100644 --- a/erpnext/public/js/website_theme.js +++ b/erpnext/public/js/website_theme.js @@ -2,16 +2,13 @@ // MIT License. See license.txt frappe.ui.form.on('Website Theme', { - apply_custom_theme(frm) { - let custom_theme = frm.doc.custom_theme; - custom_theme = custom_theme.split('\n'); - if ( - frm.doc.apply_custom_theme - && custom_theme.length === 2 - && custom_theme[1].includes('frappe/public/scss/website') + validate(frm) { + let theme_scss = frm.doc.theme_scss; + if (theme_scss.includes('frappe/public/scss/website') + && !theme_scss.includes('erpnext/public/scss/website') ) { - frm.set_value('custom_theme', - `$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`); + frm.set_value('theme_scss', + `${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`); } } }); From b821af44b6af3d9d1bfd12a2ae371711873f6801 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 07:40:21 +0530 Subject: [PATCH 13/13] fix: revert group by voucher general ledger changes --- erpnext/accounts/report/general_ledger/general_ledger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 307b72d4e8..d9f395b895 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -128,7 +128,8 @@ def get_gl_entries(filters): order_by_statement = "order by posting_date, voucher_type, voucher_no" if filters.get("group_by") == _("Group by Voucher (Consolidated)"): - group_by_statement = "group by voucher_type, voucher_no, account, cost_center, against_voucher" + group_by_statement = "group by voucher_type, voucher_no, account, cost_center" + select_fields = """, sum(debit) as debit, sum(credit) as credit, sum(debit_in_account_currency) as debit_in_account_currency, sum(credit_in_account_currency) as credit_in_account_currency"""