From 4c366eed230ad9b1171ce0c31493d6151f760049 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 15 Nov 2018 11:33:33 +0530 Subject: [PATCH 01/45] Minor issue fixes --- .../projects/doctype/timesheet/timesheet.json | 36 ++----------------- .../stock_projected_qty.js | 3 +- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.json b/erpnext/projects/doctype/timesheet/timesheet.json index e5198dea63..0be147bfb1 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.json +++ b/erpnext/projects/doctype/timesheet/timesheet.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 0, @@ -444,39 +445,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "start_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "User", - "length": 0, - "no_copy": 0, - "options": "User", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -1032,7 +1000,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-08-28 14:44:32.912004", + "modified": "2018-11-15 07:58:42.629845", "modified_by": "Administrator", "module": "Projects", "name": "Timesheet", diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js index 6589688d1a..babc6dc960 100644 --- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js +++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js @@ -7,7 +7,8 @@ frappe.query_reports["Stock Projected Qty"] = { "fieldname":"company", "label": __("Company"), "fieldtype": "Link", - "options": "Company" + "options": "Company", + "default": frappe.defaults.get_user_default("Company") }, { "fieldname":"warehouse", From f4dc71661d1d07e883e83b5a27ba9b4b1bbce7cf Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 15 Nov 2018 17:04:02 +0530 Subject: [PATCH 02/45] [Fix] Address not set from the API --- erpnext/controllers/buying_controller.py | 12 ++++++++++++ erpnext/controllers/selling_controller.py | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index cd3cbe97c9..7ed225fa28 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -10,6 +10,7 @@ from erpnext.accounts.party import get_party_details from erpnext.stock.get_item_details import get_conversion_factor from erpnext.buying.utils import validate_for_items, update_last_purchase_rate from erpnext.stock.stock_ledger import get_valuation_rate +from frappe.contacts.doctype.address.address import get_address_display from erpnext.controllers.stock_controller import StockController @@ -39,6 +40,7 @@ class BuyingController(StockController): self.set_qty_as_per_stock_uom() self.validate_stock_or_nonstock_items() self.validate_warehouse() + self.set_supplier_address() if self.doctype=="Purchase Invoice": self.validate_purchase_receipt_if_update_stock() @@ -96,6 +98,16 @@ class BuyingController(StockController): if not d.cost_center and lc_voucher_data and lc_voucher_data[0][1]: d.db_set('cost_center', lc_voucher_data[0][1]) + def set_supplier_address(self): + address_dict = { + 'supplier_address': 'address_display', + 'shipping_address': 'shipping_address_display' + } + + for address_field, address_display_field in address_dict.items(): + if self.get(address_field): + self.set(address_display_field, get_address_display(self.get(address_field))) + def set_total_in_words(self): from frappe.utils import money_in_words if self.meta.get_field("base_in_words"): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index be5f64ecb1..5c203aff69 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -8,6 +8,7 @@ from frappe import _, throw from erpnext.stock.get_item_details import get_bin_details from erpnext.stock.utils import get_incoming_rate from erpnext.stock.get_item_details import get_conversion_factor +from frappe.contacts.doctype.address.address import get_address_display from erpnext.controllers.stock_controller import StockController @@ -40,6 +41,7 @@ class SellingController(StockController): self.validate_selling_price() self.set_qty_as_per_stock_uom() self.set_po_nos() + self.set_customer_address() check_active_sales_items(self) def set_missing_values(self, for_validate=False): @@ -344,6 +346,17 @@ class SellingController(StockController): po_nos = frappe.get_all('Sales Order', 'po_no', filters = {'name': ('in', sales_orders)}) self.po_no = ', '.join(list(set([d.po_no for d in po_nos if d.po_no]))) + def set_customer_address(self): + address_dict = { + 'customer_address': 'address_display', + 'shipping_address_name': 'shipping_address', + 'company_address': 'company_address_display' + } + + for address_field, address_display_field in address_dict.items(): + if self.get(address_field): + self.set(address_display_field, get_address_display(self.get(address_field))) + def validate_items(self): # validate items to see if they have is_sales_item enabled from erpnext.controllers.buying_controller import validate_item_type From 27a0c3796399fca289a5a7ec9033dd7ad7e71a09 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Thu, 15 Nov 2018 19:21:30 +0000 Subject: [PATCH 03/45] css: build files in v10 --- erpnext/public/css/erpnext.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index 460efbfe9f..c55e422151 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -346,6 +346,11 @@ body[data-route="pos"] .btn-more { body[data-route="pos"] .collapse-btn { cursor: pointer; } +@media (max-width: 767px) { + body[data-route="pos"] .page-actions { + max-width: 110px; + } +} .price-info { position: absolute; left: 0; From b9a95e29b7c3d3243815cba24b97cce841b6c5af Mon Sep 17 00:00:00 2001 From: Jsukrut Date: Fri, 16 Nov 2018 11:28:56 +0530 Subject: [PATCH 04/45] [FIX][#15018][PATIENT Relation should be unique] --- erpnext/healthcare/doctype/patient/patient.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/erpnext/healthcare/doctype/patient/patient.js b/erpnext/healthcare/doctype/patient/patient.js index d0ab94c792..de5bce0aa6 100644 --- a/erpnext/healthcare/doctype/patient/patient.js +++ b/erpnext/healthcare/doctype/patient/patient.js @@ -120,3 +120,16 @@ var btn_invoice_registration = function (frm) { } }); }; + +frappe.ui.form.on('Patient Relation', { + patient_relation_add: function(frm){ + frm.fields_dict['patient_relation'].grid.get_field('patient').get_query = function(frm){ + var patient_list = []; + if(!frm.doc.__islocal) patient_list.push(frm.doc.name); + $.each(frm.doc.patient_relation, function(idx, val){ + if (val.patient) patient_list.push(val.patient); + }); + return { filters: [['Patient', 'name', 'not in', patient_list]] }; + }; + } +}); \ No newline at end of file From 770a13ebc363d2c96e7fd7c6b810e0798b26f0a2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 20 Nov 2018 13:01:52 +0530 Subject: [PATCH 05/45] [Fix] Not able to view general ledger for purchase invoice --- erpnext/accounts/report/general_ledger/general_ledger.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 524f5f70d7..7e50d9be61 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -16,8 +16,6 @@ def execute(filters=None): return [], [] account_details = {} - if not filters.get("group_by"): - filters['group_by'] = _('Group by Voucher (Consolidated)') if filters and filters.get('print_in_account_currency') and \ not filters.get('account'): From f838597b5faec9994155edd191a8d16482cdee63 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Tue, 20 Nov 2018 13:12:13 +0530 Subject: [PATCH 06/45] fix(task): Fix error when trying to convert a task into a group even if no child tasks exist --- erpnext/projects/doctype/task/task.js | 10 +++++----- erpnext/projects/doctype/task/task.py | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js index b8f324a85f..c1a9c448b4 100644 --- a/erpnext/projects/doctype/task/task.js +++ b/erpnext/projects/doctype/task/task.js @@ -80,15 +80,15 @@ frappe.ui.form.on("Task", { } }, - is_group: function(frm) { + is_group: function (frm) { frappe.call({ - method:"erpnext.projects.doctype.task.task.check_if_child_exists", + method: "erpnext.projects.doctype.task.task.check_if_child_exists", args: { name: frm.doc.name }, - callback: function(r){ - if(r.message){ - frappe.msgprint(__('Cannot convert it to non-group. Child Tasks exist.')); + callback: function (r) { + if (r.message.length > 0) { + frappe.msgprint(__(`Cannot convert it to non-group. The following child Tasks exist: ${r.message.join(", ")}.`)); frm.reload_doc(); } } diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 3dc52d4ebe..649d73a63f 100755 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json -from frappe.utils import getdate, date_diff, add_days, cstr +import json + +import frappe from frappe import _, throw +from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate from frappe.utils.nestedset import NestedSet + class CircularReferenceError(frappe.ValidationError): pass class Task(NestedSet): @@ -157,8 +160,10 @@ class Task(NestedSet): @frappe.whitelist() def check_if_child_exists(name): - return frappe.db.sql("""select name from `tabTask` - where parent_task = %s""", name) + child_tasks = frappe.get_all("Task", filters={"parent_task": name}) + child_tasks = [get_link_to_form("Task", task.name) for task in child_tasks] + return child_tasks + def get_project(doctype, txt, searchfield, start, page_len, filters): from erpnext.controllers.queries import get_match_cond @@ -237,4 +242,4 @@ def add_multiple_tasks(data, parent): new_task.insert() def on_doctype_update(): - frappe.db.add_index("Task", ["lft", "rgt"]) \ No newline at end of file + frappe.db.add_index("Task", ["lft", "rgt"]) From 1eb098caf9d9a793d4568686156fffd6eacca9b2 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Wed, 21 Nov 2018 14:36:58 +0530 Subject: [PATCH 07/45] Add additional condition condition to get_pos_profile - If we have any POS Profile related to the user, that profile should be used --- erpnext/stock/get_item_details.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index d90db56e2c..01ee9db1ca 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -594,22 +594,21 @@ def get_pos_profile(company, pos_profile=None, user=None): if not user: user = frappe.session['user'] - pos_profile = frappe.db.sql("""select pf.* - from - `tabPOS Profile` pf, `tabPOS Profile User` pfu - where - pfu.parent = pf.name and pfu.user = %s and pf.company = %s - and pf.disabled = 0 and pfu.default=1""", (user, company), as_dict=1) - - if not pos_profile: - pos_profile = frappe.db.sql("""select pf.* - from - `tabPOS Profile` pf left join `tabPOS Profile User` pfu - on + pos_profile = frappe.db.sql("""SELECT pf.* + FROM + `tabPOS Profile` pf LEFT JOIN `tabPOS Profile User` pfu + ON pf.name = pfu.parent - where - ifnull(pfu.user, '') = '' and pf.company = %s - and pf.disabled = 0""", (company), as_dict=1) + WHERE + ( + (pfu.user = %(user)s AND pf.company = %(company)s AND pfu.default=1) + OR (pfu.user = %(user)s AND pfu.default=1) + OR (ifnull(pfu.user, '') = '' AND pf.company = %(company)s) + ) AND pf.disabled = 0 + """, { + 'user': user, + 'company': company + }, as_dict=1) return pos_profile and pos_profile[0] or None From 23eef11cf5a16f322255347097d40ac3886f9fd3 Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Wed, 21 Nov 2018 15:32:37 +0500 Subject: [PATCH 08/45] Fixed get_buying_amount in Gross Profit report: To handle the case where there may be multiple invoices for a single delivery --- erpnext/accounts/report/gross_profit/gross_profit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 19075d35ae..2ed664c9bf 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -236,7 +236,7 @@ class GrossProfitGenerator(object): previous_stock_value = len(my_sle) > i+1 and \ flt(my_sle[i+1].stock_value) or 0.0 if previous_stock_value: - return previous_stock_value - flt(sle.stock_value) + return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty)) else: return flt(row.qty) * self.get_average_buying_rate(row, item_code) else: From 1879e9114874a8288be1cc90808d7bf3aced32b1 Mon Sep 17 00:00:00 2001 From: Ranjith Date: Wed, 21 Nov 2018 16:04:05 +0530 Subject: [PATCH 09/45] fix: Trial Balance --- .../accounts/report/trial_balance/trial_balance.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 0a3f56ab8e..07dcd4e7a9 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -231,6 +231,13 @@ def get_columns(): "options": "Account", "width": 300 }, + { + "fieldname": "currency", + "label": _("Currency"), + "fieldtype": "Link", + "options": "Currency", + "hidden": 1 + }, { "fieldname": "opening_debit", "label": _("Opening (Dr)"), @@ -272,13 +279,6 @@ def get_columns(): "fieldtype": "Currency", "options": "currency", "width": 120 - }, - { - "fieldname": "currency", - "label": _("Currency"), - "fieldtype": "Link", - "options": "Currency", - "hidden": 1 } ] From 6424f47f3bd5054643edacc1261099ffe0435306 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 21 Nov 2018 23:18:41 +0530 Subject: [PATCH 10/45] [Fix] Incorrect stock value difference because of negative stock --- erpnext/stock/stock_ledger.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 53267d64bc..43140faff6 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -176,7 +176,11 @@ class update_entries_after(object): # rounding as per precision self.stock_value = flt(self.stock_value, self.precision) - stock_value_difference = self.stock_value - self.prev_stock_value + if self.prev_stock_value < 0 and self.stock_value >= 0: + stock_value_difference = sle.actual_qty * self.valuation_rate + else: + stock_value_difference = self.stock_value - self.prev_stock_value + self.prev_stock_value = self.stock_value # update current sle From 2a2f2742ebc7baef15ca893f1051a8837df2d6b2 Mon Sep 17 00:00:00 2001 From: Saif Date: Wed, 21 Nov 2018 23:29:09 +0500 Subject: [PATCH 11/45] Remove "Test" Letter Head --- .../report/address_and_contacts/address_and_contacts.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.json b/erpnext/selling/report/address_and_contacts/address_and_contacts.json index da38babbdc..876c39c0cf 100644 --- a/erpnext/selling/report/address_and_contacts/address_and_contacts.json +++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.json @@ -6,8 +6,7 @@ "docstatus": 0, "doctype": "Report", "idx": 0, - "is_standard": "Yes", - "letter_head": "Test", + "is_standard": "Yes", "modified": "2018-06-01 09:39:39.604944", "modified_by": "Administrator", "module": "Selling", @@ -30,4 +29,4 @@ "role": "Accounts User" } ] -} \ No newline at end of file +} From 037a151ef58a19318ed0e1eb3f14acb05f44db02 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 22 Nov 2018 12:54:51 +0530 Subject: [PATCH 12/45] [Fix] New holiday list form is not working --- erpnext/hr/doctype/holiday_list/holiday_list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.js b/erpnext/hr/doctype/holiday_list/holiday_list.js index b4c56da649..462bd8bb67 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.js +++ b/erpnext/hr/doctype/holiday_list/holiday_list.js @@ -3,7 +3,9 @@ frappe.ui.form.on('Holiday List', { refresh: function(frm) { - frm.set_value('total_holidays', frm.doc.holidays.length); + if (frm.doc.holidays) { + frm.set_value('total_holidays', frm.doc.holidays.length); + } }, from_date: function(frm) { if (frm.doc.from_date && !frm.doc.to_date) { From 5dbb9f5312b42f907fdbac939bc1ea7ecaa06975 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 23 Nov 2018 19:54:08 +0530 Subject: [PATCH 13/45] Accounts receivable summary print fix --- .../accounts_receivable.html | 6 +- .../accounts_receivable_summary.py | 104 +++++++++++++++--- 2 files changed, 89 insertions(+), 21 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 933c6ddf89..b4276a10cd 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -194,7 +194,7 @@ {% if(!filters.show_pdc_in_print) { %} {%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %} - {%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} + {%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} {% } %} {%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %} @@ -220,7 +220,7 @@
{%= data[i][__("Customer Name")] %} {% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
{%= data[i][__("Supplier Name")] %} - {% } %} + {% } %} {% } %}
{%= __("Remarks") %}: {%= data[i][__("Remarks")] %} @@ -230,7 +230,7 @@ {% } %} {%= format_currency(data[i][("total_invoiced_amt")], data[i]["currency"]) %} {%= format_currency(data[i][("total_paid_amt")], data[i]["currency"]) %} - {%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")], data[i]["currency"]) : format_currency(data[i][__("Debit Note Amt")], data[i]["currency"]) %} + {%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("credit_note_amt")], data[i]["currency"]) : format_currency(data[i][__("debit_note_amt")], data[i]["currency"]) %} {%= format_currency(data[i][("total_outstanding_amt")], data[i]["currency"]) %} {% } %} {% } %} diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py index 08b24fb147..fdb7ec82ca 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe import _ +from frappe import _, scrub from frappe.utils import flt from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport @@ -18,25 +18,93 @@ class AccountsReceivableSummary(ReceivablePayableReport): if party_naming_by == "Naming Series": columns += [ args.get("party_type") + " Name::140"] - credit_debit_label = _("Credit Note Amt") if args.get('party_type') == 'Customer' else _("Debit Note Amt") + credit_debit_label = "Credit Note Amt" if args.get('party_type') == 'Customer' else "Debit Note Amt" + + columns += [{ + "label": _("Total Invoiced Amt"), + "fieldname": "total_invoiced_amt", + "fieldtype": "Currency", + "options": "currency", + "width": 100 + }, + { + "label": _("Total Paid Amt"), + "fieldname": "total_paid_amt", + "fieldtype": "Currency", + "options": "currency", + "width": 100 + }] + columns += [ - _("Total Invoiced Amt") + ":Currency/currency:140", - _("Total Paid Amt") + ":Currency/currency:140", - credit_debit_label + ":Currency/currency:140", - _("Total Outstanding Amt") + ":Currency/currency:160", - "0-" + str(self.filters.range1) + ":Currency/currency:100", - str(self.filters.range1) + "-" + str(self.filters.range2) + ":Currency/currency:100", - str(self.filters.range2) + "-" + str(self.filters.range3) + ":Currency/currency:100", - str(self.filters.range3) + _("-Above") + ":Currency/currency:100"] + { + "label": _(credit_debit_label), + "fieldname": scrub(credit_debit_label), + "fieldtype": "Currency", + "options": "currency", + "width": 140 + }, + { + "label": _("Total Outstanding Amt"), + "fieldname": "total_outstanding_amt", + "fieldtype": "Currency", + "options": "currency", + "width": 160 + }, + { + "label": _("0-" + str(self.filters.range1)), + "fieldname": scrub("0-" + str(self.filters.range1)), + "fieldtype": "Currency", + "options": "currency", + "width": 160 + }, + { + "label": _(str(self.filters.range1) + "-" + str(self.filters.range2)), + "fieldname": scrub(str(self.filters.range1) + "-" + str(self.filters.range2)), + "fieldtype": "Currency", + "options": "currency", + "width": 160 + }, + { + "label": _(str(self.filters.range2) + "-" + str(self.filters.range3)), + "fieldname": scrub(str(self.filters.range2) + "-" + str(self.filters.range3)), + "fieldtype": "Currency", + "options": "currency", + "width": 160 + }, + { + "label": _(str(self.filters.range3) + _("-Above")), + "fieldname": scrub(str(self.filters.range3) + _("-Above")), + "fieldtype": "Currency", + "options": "currency", + "width": 160 + } + ] if args.get("party_type") == "Customer": - columns += [ - _("Territory") + ":Link/Territory:80", - _("Customer Group") + ":Link/Customer Group:120" - ] + columns += [{ + "label": _("Territory"), + "fieldname": "territory", + "fieldtype": "Link", + "options": "Territory", + "width": 80 + }, + { + "label": _("Customer Group"), + "fieldname": "customer_group", + "fieldtype": "Link", + "options": "Customer Group", + "width": 80 + }] + if args.get("party_type") == "Supplier": - columns += [_("Supplier Type") + ":Link/Supplier Type:80"] - + columns += [{ + "label": _("Supplier Group"), + "fieldname": "supplier_group", + "fieldtype": "Link", + "options": "Supplier Group", + "width": 80 + }] + columns.append({ "fieldname": "currency", "label": _("Currency"), @@ -67,7 +135,7 @@ class AccountsReceivableSummary(ReceivablePayableReport): row += [self.get_territory(party), self.get_customer_group(party)] if args.get("party_type") == "Supplier": row += [self.get_supplier_type(party)] - + row.append(party_dict.currency) data.append(row) @@ -91,7 +159,7 @@ class AccountsReceivableSummary(ReceivablePayableReport): for k in party_total[d.party].keys(): if k != "currency": party_total[d.party][k] += flt(d.get(k, 0)) - + party_total[d.party].currency = d.currency return party_total From 9cdece4ca241a6a45f44693479a0cbde8be33aef Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 15 Nov 2018 16:24:34 +0530 Subject: [PATCH 14/45] Test case fix and other minor bug fix --- erpnext/patches.txt | 8 +-- .../report/sales_analytics/sales_analytics.js | 11 +--- .../report/sales_analytics/sales_analytics.py | 2 +- .../report/sales_analytics/test_analytics.py | 55 ++++++++++++++----- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f771181f8d..dc4c94c8d1 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -568,10 +568,10 @@ erpnext.patches.v11_0.remove_land_unit_icon erpnext.patches.v11_0.add_default_dispatch_notification_template erpnext.patches.v11_0.add_market_segments erpnext.patches.v11_0.add_sales_stages -execute:frappe.delete_doc("Page", "Sales Analytics") -execute:frappe.delete_doc("Page", "Purchase Analytics") -execute:frappe.delete_doc("Page", "Stock Analytics") -execute:frappe.delete_doc("Page", "Production Analytics") +execute:frappe.delete_doc("Page", "sales-analytics") +execute:frappe.delete_doc("Page", "purchase-analytics") +execute:frappe.delete_doc("Page", "stock-analytics") +execute:frappe.delete_doc("Page", "production-analytics") erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13 erpnext.patches.v11_0.drop_column_max_days_allowed erpnext.patches.v11_0.change_healthcare_desktop_icons diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js index 7c9e3ec35a..718f29c611 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.js +++ b/erpnext/selling/report/sales_analytics/sales_analytics.js @@ -67,23 +67,16 @@ frappe.query_reports["Sales Analytics"] = { reqd: 1 } ], - "formatter": function(value, row, column, data) { - if(!value){ - value = 0 - } - return value; - }, get_datatable_options(options) { return Object.assign(options, { checkboxColumn: true, events: { onCheckRow: function(data) { row_name = data[2].content; - row_values = data.slice(5).map(function (column) { + row_values = data.slice(4).map(function (column) { return column.content; }) - - entry = { + entry = { 'name':row_name, 'values':row_values } diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py index ef9e66656a..2cc2f70401 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.py +++ b/erpnext/selling/report/sales_analytics/sales_analytics.py @@ -275,7 +275,7 @@ class Analytics(object): self.parent_child_map = frappe._dict(frappe.db.sql(""" select name, supplier_group from `tabSupplier`""")) def get_chart_data(self): - labels = [d.get("label") for d in self.columns[3:]] + labels = [d.get("label") for d in self.columns[2:]] self.chart = { "data": { 'labels': labels, diff --git a/erpnext/selling/report/sales_analytics/test_analytics.py b/erpnext/selling/report/sales_analytics/test_analytics.py index c9a00fad15..28c5bac0f1 100644 --- a/erpnext/selling/report/sales_analytics/test_analytics.py +++ b/erpnext/selling/report/sales_analytics/test_analytics.py @@ -9,9 +9,6 @@ from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_orde class TestAnalytics(unittest.TestCase): - def tearDown(self): - frappe.db.sql(""" DELETE FROM `tabSales Order` """) - def test_by_entity(self): create_sales_order() @@ -20,7 +17,7 @@ class TestAnalytics(unittest.TestCase): 'range': 'Monthly', 'to_date': '2018-03-31', 'tree_type': 'Customer', - 'company': '_Test Company', + 'company': '_Test Company 2', 'from_date': '2017-04-01', 'value_quantity': 'Value' } @@ -83,14 +80,13 @@ class TestAnalytics(unittest.TestCase): self.assertEqual(expected_data, report[1]) def test_by_group(self): - create_sales_order() - + filters = { 'doc_type': 'Sales Order', 'range': 'Monthly', 'to_date': '2018-03-31', 'tree_type': 'Customer Group', - 'company': '_Test Company', + 'company': '_Test Company 2', 'from_date': '2017-04-01', 'value_quantity': 'Value' } @@ -170,14 +166,13 @@ class TestAnalytics(unittest.TestCase): self.assertEqual(expected_data, report[1]) def test_by_quantity(self): - create_sales_order() filters = { 'doc_type': 'Sales Order', 'range': 'Monthly', 'to_date': '2018-03-31', 'tree_type': 'Customer', - 'company': '_Test Company', + 'company': '_Test Company 2', 'from_date': '2017-04-01', 'value_quantity': 'Quantity' } @@ -242,9 +237,39 @@ class TestAnalytics(unittest.TestCase): def create_sales_order(): frappe.set_user("Administrator") - make_sales_order(qty=10, customer = "_Test Customer 1", transaction_date='2018-02-10') - make_sales_order(qty=10, customer = "_Test Customer 1", transaction_date='2018-02-15') - make_sales_order(qty=15, customer = "_Test Customer 2", transaction_date='2017-09-23') - make_sales_order(qty=10, customer = "_Test Customer 2", transaction_date='2017-10-10') - make_sales_order(qty=20, customer = "_Test Customer 3", transaction_date='2017-06-15') - make_sales_order(qty=10, customer = "_Test Customer 3", transaction_date='2017-07-10') + make_sales_order(company="_Test Company 2", qty=10, + customer = "_Test Customer 1", + transaction_date = '2018-02-10', + warehouse = 'Finished Goods - _TC2', + currency = 'EUR') + + make_sales_order(company="_Test Company 2", + qty=10, customer = "_Test Customer 1", + transaction_date = '2018-02-15', + warehouse = 'Finished Goods - _TC2', + currency = 'EUR') + + make_sales_order(company = "_Test Company 2", + qty=10, customer = "_Test Customer 2", + transaction_date = '2017-10-10', + warehouse='Finished Goods - _TC2', + currency = 'EUR') + + make_sales_order(company="_Test Company 2", + qty=15, customer = "_Test Customer 2", + transaction_date='2017-09-23', + warehouse='Finished Goods - _TC2', + currency = 'EUR') + + make_sales_order(company="_Test Company 2", + qty=20, customer = "_Test Customer 3", + transaction_date='2017-06-15', + warehouse='Finished Goods - _TC2', + currency = 'EUR') + + make_sales_order(company="_Test Company 2", + qty=10, customer = "_Test Customer 3", + transaction_date='2017-07-10', + warehouse='Finished Goods - _TC2', + currency = 'EUR') + From f77cd54a6cc66ca72c2c315ceb5d602739eafbaa Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 20 Nov 2018 16:46:25 +0530 Subject: [PATCH 15/45] fix(tds): Create tds payable under correct parent --- erpnext/regional/india/setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index d282f5c3fd..5fc06eabb7 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -350,12 +350,17 @@ def set_tax_withholding_category(company): def set_tds_account(docs, company): abbr = frappe.get_value("Company", company, "abbr") - docs.extend([ - { - "doctype": "Account", "account_name": "TDS Payable", "account_type": "Tax", - "parent_account": "Duties and Taxes - {0}".format(abbr), "company": company - } - ]) + parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company}) + if parent_account: + docs.extend([ + { + "doctype": "Account", + "account_name": "TDS Payable", + "account_type": "Tax", + "parent_account": parent_account, + "company": company + } + ]) def get_tds_details(accounts, fiscal_year): # bootstrap default tax withholding sections From 2508d1109730cb1e22f216c2246547986ff64ce0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 23 Nov 2018 14:40:02 +0530 Subject: [PATCH 16/45] fix(test): Test cases fixed --- .../purchase_invoice/purchase_invoice.py | 7 +- .../doctype/bom/test_records.json | 21 +- .../doctype/bom_item/bom_item.json | 1970 +++++++++-------- .../production_plan/test_production_plan.py | 10 +- .../doctype/work_order/test_work_order.py | 1 + erpnext/stock/doctype/item/test_records.json | 12 + 6 files changed, 1022 insertions(+), 999 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 83698f887c..1bb7c97b0d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -226,7 +226,7 @@ class PurchaseInvoice(BuyingController): item.expense_account = warehouse_account[item.warehouse]["account"] else: item.expense_account = stock_not_billed_account - + elif not item.expense_account and for_validate: throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name)) @@ -379,7 +379,7 @@ class PurchaseInvoice(BuyingController): return gl_entries def make_supplier_gl_entry(self, gl_entries): - # Checked both rounding_adjustment and rounded_total + # Checked both rounding_adjustment and rounded_total # because rounded_total had value even before introcution of posting GLE based on rounded total grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total @@ -859,7 +859,8 @@ def make_stock_entry(source_name, target_doc=None): "Purchase Invoice Item": { "doctype": "Stock Entry Detail", "field_map": { - "stock_qty": "transfer_qty" + "stock_qty": "transfer_qty", + "batch_no": "batch_no" }, } }, target_doc) diff --git a/erpnext/manufacturing/doctype/bom/test_records.json b/erpnext/manufacturing/doctype/bom/test_records.json index cc9564276a..1a7e594e87 100644 --- a/erpnext/manufacturing/doctype/bom/test_records.json +++ b/erpnext/manufacturing/doctype/bom/test_records.json @@ -10,7 +10,8 @@ "rate": 5000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 }, { "amount": 2000.0, @@ -21,7 +22,8 @@ "rate": 1000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 } ], "docstatus": 1, @@ -54,7 +56,8 @@ "rate": 5000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 }, { "amount": 2000.0, @@ -65,7 +68,8 @@ "rate": 1000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 } ], "docstatus": 1, @@ -97,7 +101,8 @@ "rate": 5000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 }, { "amount": 3000.0, @@ -109,7 +114,8 @@ "rate": 1000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 } ], "docstatus": 1, @@ -143,7 +149,8 @@ "rate": 3000.0, "uom": "_Test UOM", "stock_uom": "_Test UOM", - "source_warehouse": "_Test Warehouse - _TC" + "source_warehouse": "_Test Warehouse - _TC", + "allow_transfer_for_manufacture": 1 } ], "docstatus": 1, diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json index de079751a7..cc69471eba 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.json +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json @@ -1,1051 +1,1053 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2013-02-22 01:27:49", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Setup", - "editable_grid": 1, + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2013-02-22 01:27:49", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 3, - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 1, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Item Code", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 3, + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Item Code", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 3, - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 3, + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_3", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "bom_no", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 1, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "BOM No", - "length": 0, - "no_copy": 0, - "oldfieldname": "bom_no", - "oldfieldtype": "Link", - "options": "BOM", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bom_no", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "BOM No", + "length": 0, + "no_copy": 0, + "oldfieldname": "bom_no", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "source_warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Source Warehouse", - "length": 0, - "no_copy": 0, - "options": "Warehouse", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "source_warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Source Warehouse", + "length": 0, + "no_copy": 0, + "options": "Warehouse", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "section_break_5", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "description", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Description", - "length": 0, - "no_copy": 0, - "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "250px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "250px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "250px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "col_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "image", - "fieldtype": "Attach", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "image", + "fieldtype": "Attach", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "image_view", - "fieldtype": "Image", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image View", - "length": 0, - "no_copy": 0, - "options": "image", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "options": "image", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Quantity and Rate", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Quantity and Rate", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fieldname": "qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Qty", - "length": 0, - "no_copy": 0, - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Qty", + "length": 0, + "no_copy": 0, + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 1, - "fieldname": "uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "UOM", - "length": 0, - "no_copy": 0, - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 1, + "fieldname": "uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "UOM", + "length": 0, + "no_copy": 0, + "options": "UOM", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "col_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_break2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "stock_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Stock Qty", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "stock_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Stock Qty", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Stock UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Stock UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Conversion Factor", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Conversion Factor", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "rate_amount_section", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rate & Amount", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "rate_amount_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rate & Amount", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "", + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "base_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Basic Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Basic Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_21", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_21", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Amount", - "length": 0, - "no_copy": 0, - "oldfieldname": "amount_as_per_mar", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Amount", + "length": 0, + "no_copy": 0, + "oldfieldname": "amount_as_per_mar", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "base_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_18", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_18", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 1, - "fieldname": "scrap", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scrap %", - "length": 0, - "no_copy": 0, - "oldfieldname": "scrap", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 1, + "fieldname": "scrap", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scrap %", + "length": 0, + "no_copy": 0, + "oldfieldname": "scrap", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "qty_consumed_per_unit", - "fieldtype": "Float", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Qty Consumed Per Unit", - "length": 0, - "no_copy": 0, - "oldfieldname": "qty_consumed_per_unit", - "oldfieldtype": "Float", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "qty_consumed_per_unit", + "fieldtype": "Float", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Qty Consumed Per Unit", + "length": 0, + "no_copy": 0, + "oldfieldname": "qty_consumed_per_unit", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_27", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_27", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_alternative_item", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Alternative Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "allow_alternative_item", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Alternative Item", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_transfer_for_manufacture", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Transfer for Manufacture", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "item_code.allow_transfer_for_manufacture", + "fieldname": "allow_transfer_for_manufacture", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Transfer for Manufacture", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "original_item", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Original Item", - "length": 0, - "no_copy": 0, - "options": "Item", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "original_item", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Original Item", + "length": 0, + "no_copy": 0, + "options": "Item", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "operation", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item operation", - "length": 0, - "no_copy": 0, - "options": "Operation", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "operation", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item operation", + "length": 0, + "no_copy": 0, + "options": "Operation", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2018-09-16 19:59:36.636884", - "modified_by": "clarkejjm@gmail.com", - "module": "Manufacturing", - "name": "BOM Item", - "owner": "Administrator", - "permissions": [], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0, + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 1, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-22 15:04:55.187136", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM Item", + "owner": "Administrator", + "permissions": [], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 0, + "track_seen": 0, "track_views": 0 } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index a33d42b7d0..8eade98ecb 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -48,7 +48,7 @@ class TestProductionPlan(unittest.TestCase): filters = {'production_plan': pln.name}, as_list=1) self.assertTrue(len(work_orders), len(pln.po_items)) - + for name in material_requests: mr = frappe.get_doc('Material Request', name[0]) mr.cancel() @@ -164,7 +164,7 @@ def create_production_plan(**args): mr_items = get_items_for_material_requests(pln.as_dict()) for d in mr_items: pln.append('mr_items', d) - + if not args.do_not_save: pln.insert() if not args.do_not_submit: @@ -182,7 +182,7 @@ def make_bom(**args): 'quantity': args.quantity or 1, 'company': args.company or '_Test Company' }) - + for item in args.raw_materials: item_doc = frappe.get_doc('Item', item) @@ -191,8 +191,8 @@ def make_bom(**args): 'qty': 1, 'uom': item_doc.stock_uom, 'stock_uom': item_doc.stock_uom, - 'rate': item_doc.valuation_rate or args.rate + 'rate': item_doc.valuation_rate or args.rate, }) - + bom.insert(ignore_permissions=True) bom.submit() \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index fb8fd26206..431ad32558 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -292,6 +292,7 @@ class TestWorkOrder(unittest.TestCase): make_bom(item=fg_item, rate=1000, raw_materials = ['_Test FG Item', '_Test FG Non Stock Item']) wo = make_wo_order_test_record(production_item = fg_item) + se = frappe.get_doc(make_stock_entry(wo.name, "Material Transfer for Manufacture", 1)) se.insert() se.submit() diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json index dbb9b59254..18e2910126 100644 --- a/erpnext/stock/doctype/item/test_records.json +++ b/erpnext/stock/doctype/item/test_records.json @@ -57,6 +57,7 @@ "stock_uom": "_Test UOM", "show_in_website": 1, "website_warehouse": "_Test Warehouse - _TC", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -78,6 +79,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Item Home Desktop 100", "valuation_rate": 100, + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -107,6 +109,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Item Home Desktop 200", "stock_uom": "_Test UOM 1", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -128,6 +131,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Product Bundle Item", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -149,6 +153,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test FG Item", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -170,6 +175,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Non Stock Item", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -191,6 +197,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Serialized Item", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -213,6 +220,7 @@ "item_name": "_Test Serialized Item With Series", "serial_no_series": "ABCD.#####", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -234,6 +242,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Item Home Desktop Manufactured", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -255,6 +264,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test FG Item 2", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC", @@ -276,6 +286,7 @@ "item_group": "_Test Item Group Desktops", "item_name": "_Test Variant Item", "stock_uom": "_Test UOM", + "gst_hsn_code": "999800", "has_variants": 1, "item_defaults": [{ "company": "_Test Company", @@ -312,6 +323,7 @@ "item_group": "_Test Item Group", "item_name": "_Test Item Warehouse Group Wise Reorder", "apply_warehouse_wise_reorder_level": 1, + "gst_hsn_code": "999800", "item_defaults": [{ "company": "_Test Company", "default_warehouse": "_Test Warehouse Group-C1 - _TC", From 48e0e19b0308c67a1279eef407ba646da3cf137c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 23 Nov 2018 16:15:32 +0530 Subject: [PATCH 17/45] fix(test): Fixed salary slip and sales analytics test cases --- .../employee_benefit_claim.py | 11 +- erpnext/hr/doctype/job_offer/job_offer.js | 4 +- .../doctype/salary_slip/test_salary_slip.py | 1 + .../report/sales_analytics/test_analytics.py | 187 +++++++----------- 4 files changed, 80 insertions(+), 123 deletions(-) diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py index 75247a4585..9a0c5f77a8 100644 --- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py +++ b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py @@ -36,10 +36,13 @@ class EmployeeBenefitClaim(Document): frappe.throw(_("Maximum benefit amount of employee {0} exceeds {1}").format(self.employee, max_benefits)) def validate_max_benefit_for_component(self, payroll_period): - claimed_amount = self.claimed_amount - claimed_amount += get_previous_claimed_amount(self.employee, payroll_period, component = self.earning_component) - if claimed_amount > self.max_amount_eligible: - frappe.throw(_("Maximum amount eligible for the component {0} exceeds {1}").format(self.earning_component, self.max_amount_eligible)) + if self.max_amount_eligible: + claimed_amount = self.claimed_amount + claimed_amount += get_previous_claimed_amount(self.employee, + payroll_period, component = self.earning_component) + if claimed_amount > self.max_amount_eligible: + frappe.throw(_("Maximum amount eligible for the component {0} exceeds {1}") + .format(self.earning_component, self.max_amount_eligible)) def validate_non_pro_rata_benefit_claim(self, max_benefits, payroll_period): claimed_amount = self.claimed_amount diff --git a/erpnext/hr/doctype/job_offer/job_offer.js b/erpnext/hr/doctype/job_offer/job_offer.js index 367ce38318..4217a782a8 100755 --- a/erpnext/hr/doctype/job_offer/job_offer.js +++ b/erpnext/hr/doctype/job_offer/job_offer.js @@ -14,7 +14,7 @@ frappe.ui.form.on("Job Offer", { refresh: function (frm) { if ((!frm.doc.__islocal) && (frm.doc.status == 'Accepted') - && (frm.doc.docstatus === 1) && (!frm.doc.__onload.employee)) { + && (frm.doc.docstatus === 1) && (!frm.doc.__onload || !frm.doc.__onload.employee)) { frm.add_custom_button(__('Make Employee'), function () { erpnext.job_offer.make_employee(frm); @@ -22,7 +22,7 @@ frappe.ui.form.on("Job Offer", { ); } - if(frm.doc.__onload.employee) { + if(frm.doc.__onload && frm.doc.__onload.employee) { frm.add_custom_button(__('Show Employee'), function () { frappe.set_route("Form", "Employee", frm.doc.__onload.employee); diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index 73ab67dd6f..208a7339fa 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -26,6 +26,7 @@ class TestSalarySlip(unittest.TestCase): self.make_holiday_list() frappe.db.set_value("Company", erpnext.get_default_company(), "default_holiday_list", "Salary Slip Test Holiday List") + frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 0) def tearDown(self): frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 0) diff --git a/erpnext/selling/report/sales_analytics/test_analytics.py b/erpnext/selling/report/sales_analytics/test_analytics.py index 28c5bac0f1..f59fff46f7 100644 --- a/erpnext/selling/report/sales_analytics/test_analytics.py +++ b/erpnext/selling/report/sales_analytics/test_analytics.py @@ -8,10 +8,17 @@ from erpnext.selling.report.sales_analytics.sales_analytics import execute from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order class TestAnalytics(unittest.TestCase): + def test_sales_analytics(self): + frappe.db.sql("delete from `tabSales Order` where company='_Test Company 2'") - def test_by_entity(self): - create_sales_order() + create_sales_orders() + self.compare_result_for_customer() + self.compare_result_for_customer_group() + self.compare_result_for_customer_based_on_quantity() + + + def compare_result_for_customer(self): filters = { 'doc_type': 'Sales Order', 'range': 'Monthly', @@ -42,23 +49,6 @@ class TestAnalytics(unittest.TestCase): "mar": 0.0, "total":2000.0 }, - { - "entity": "_Test Customer 3", - "entity_name": "_Test Customer 3", - "apr": 0.0, - "may": 0.0, - "jun": 2000.0, - "jul": 1000.0, - "aug": 0.0, - "sep": 0.0, - "oct": 0.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 0.0, - "mar": 0.0, - "total": 3000.0 - }, { "entity": "_Test Customer 2", "entity_name": "_Test Customer 2", @@ -75,12 +65,29 @@ class TestAnalytics(unittest.TestCase): "feb": 0.0, "mar": 0.0, "total":2500.0 + }, + { + "entity": "_Test Customer 3", + "entity_name": "_Test Customer 3", + "apr": 0.0, + "may": 0.0, + "jun": 2000.0, + "jul": 1000.0, + "aug": 0.0, + "sep": 0.0, + "oct": 0.0, + "nov": 0.0, + "dec": 0.0, + "jan": 0.0, + "feb": 0.0, + "mar": 0.0, + "total": 3000.0 } ] - self.assertEqual(expected_data, report[1]) + result = sorted(report[1], key=lambda k: k['entity']) + self.assertEqual(expected_data, result) - def test_by_group(self): - + def compare_result_for_customer_group(self): filters = { 'doc_type': 'Sales Order', 'range': 'Monthly', @@ -93,80 +100,26 @@ class TestAnalytics(unittest.TestCase): report = execute(filters) - expected_data = [ - { - "entity": "All Customer Groups", - "indent": 0, - "apr": 0.0, - "may": 0.0, - "jun": 2000.0, - "jul": 1000.0, - "aug": 0.0, - "sep": 1500.0, - "oct": 1000.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 2000.0, - "mar": 0.0, - "total":7500.0 - }, - { - "entity": "Individual", - "indent": 1, - "apr": 0.0, - "may": 0.0, - "jun": 0.0, - "jul": 0.0, - "aug": 0.0, - "sep": 0.0, - "oct": 0.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 0.0, - "mar": 0.0, - "total": 0.0 - }, - { - "entity": "_Test Customer Group", - "indent": 1, - "apr": 0.0, - "may": 0.0, - "jun": 0.0, - "jul": 0.0, - "aug": 0.0, - "sep": 0.0, - "oct": 0.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 0.0, - "mar": 0.0, - "total":0.0 - }, - { - "entity": "_Test Customer Group 1", - "indent": 1, - "apr": 0.0, - "may": 0.0, - "jun": 0.0, - "jul": 0.0, - "aug": 0.0, - "sep": 0.0, - "oct": 0.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 0.0, - "mar": 0.0, - "total":0.0 - } - ] - self.assertEqual(expected_data, report[1]) - - def test_by_quantity(self): + expected_first_row = { + "entity": "All Customer Groups", + "indent": 0, + "apr": 0.0, + "may": 0.0, + "jun": 2000.0, + "jul": 1000.0, + "aug": 0.0, + "sep": 1500.0, + "oct": 1000.0, + "nov": 0.0, + "dec": 0.0, + "jan": 0.0, + "feb": 2000.0, + "mar": 0.0, + "total":7500.0 + } + self.assertEqual(expected_first_row, report[1][0]) + def compare_result_for_customer_based_on_quantity(self): filters = { 'doc_type': 'Sales Order', 'range': 'Monthly', @@ -197,23 +150,6 @@ class TestAnalytics(unittest.TestCase): "mar": 0.0, "total":20.0 }, - { - "entity": "_Test Customer 3", - "entity_name": "_Test Customer 3", - "apr": 0.0, - "may": 0.0, - "jun": 20.0, - "jul": 10.0, - "aug": 0.0, - "sep": 0.0, - "oct": 0.0, - "nov": 0.0, - "dec": 0.0, - "jan": 0.0, - "feb": 0.0, - "mar": 0.0, - "total": 30.0 - }, { "entity": "_Test Customer 2", "entity_name": "_Test Customer 2", @@ -230,11 +166,29 @@ class TestAnalytics(unittest.TestCase): "feb": 0.0, "mar": 0.0, "total":25.0 + }, + { + "entity": "_Test Customer 3", + "entity_name": "_Test Customer 3", + "apr": 0.0, + "may": 0.0, + "jun": 20.0, + "jul": 10.0, + "aug": 0.0, + "sep": 0.0, + "oct": 0.0, + "nov": 0.0, + "dec": 0.0, + "jan": 0.0, + "feb": 0.0, + "mar": 0.0, + "total": 30.0 } ] - self.assertEqual(expected_data, report[1]) + result = sorted(report[1], key=lambda k: k['entity']) + self.assertEqual(expected_data, result) -def create_sales_order(): +def create_sales_orders(): frappe.set_user("Administrator") make_sales_order(company="_Test Company 2", qty=10, @@ -260,16 +214,15 @@ def create_sales_order(): transaction_date='2017-09-23', warehouse='Finished Goods - _TC2', currency = 'EUR') - + make_sales_order(company="_Test Company 2", qty=20, customer = "_Test Customer 3", transaction_date='2017-06-15', warehouse='Finished Goods - _TC2', currency = 'EUR') - + make_sales_order(company="_Test Company 2", qty=10, customer = "_Test Customer 3", transaction_date='2017-07-10', warehouse='Finished Goods - _TC2', currency = 'EUR') - From 2665c37f38fe1423f39abd440f0e499ae62d0db8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 26 Nov 2018 11:05:13 +0530 Subject: [PATCH 18/45] temp(travis): Print statement to fix travis --- erpnext/accounts/doctype/share_transfer/share_transfer.py | 3 ++- .../accounts/doctype/share_transfer/test_share_transfer.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/share_transfer/share_transfer.py b/erpnext/accounts/doctype/share_transfer/share_transfer.py index 50ce9f2bfd..4fe9a6c10a 100644 --- a/erpnext/accounts/doctype/share_transfer/share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/share_transfer.py @@ -189,7 +189,8 @@ class ShareTransfer(Document): if (shareholder == 'from_shareholder') else self.to_folio_no; doc.save() else: - if doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no): + print(doc.name, doc.folio_no, self.from_folio_no, shareholder, self.to_folio_no) + if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no): frappe.throw(_('The folio numbers are not matching')) def autoname_folio(self, shareholder, is_company=False): diff --git a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py index 44ab09999b..3859cc3c6e 100644 --- a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py @@ -79,7 +79,9 @@ class TestShareTransfer(unittest.TestCase): } ] for d in share_transfers: - frappe.get_doc(d).submit() + st = frappe.get_doc(d) + print(st.as_dict()) + st.submit() def test_invalid_share_transfer(self): doc = frappe.get_doc({ From bc4574b59d7f13f6ecb1d797d37fe5aa647751b5 Mon Sep 17 00:00:00 2001 From: Anurag mishra Date: Thu, 22 Nov 2018 18:12:45 +0530 Subject: [PATCH 19/45] Delivery Note fixes --- erpnext/stock/doctype/delivery_note/delivery_note.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ab624d17db..e4cfb474ff 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -119,6 +119,12 @@ class DeliveryNote(SellingController): self.update_current_stock() if not self.installation_status: self.installation_status = 'Not Installed' + + def validate_qty(self): + data = frappe.get_all("Delivery Note Item", filters={"parent" : self.name}, fields=["qty"]) + for quant in data: + if quant.qty == 0: + frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): super(DeliveryNote, self).validate_with_previous_doc({ @@ -202,6 +208,7 @@ class DeliveryNote(SellingController): def on_submit(self): self.validate_packed_qty() + self.validate_qty() # Check for Approving Authority frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) From 66bd5810c5317eb8611ebdb94916770c2c9f3bfc Mon Sep 17 00:00:00 2001 From: Anurag mishra Date: Mon, 26 Nov 2018 11:28:22 +0530 Subject: [PATCH 20/45] fix(validate): Qty is mandatory in delivery note --- erpnext/stock/doctype/delivery_note/delivery_note.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index e4cfb474ff..ea1808b215 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -98,6 +98,7 @@ class DeliveryNote(SellingController): frappe.throw(_("Sales Order required for Item {0}").format(d.item_code)) def validate(self): + self.validate_qty() self.validate_posting_time() super(DeliveryNote, self).validate() self.set_status() @@ -121,9 +122,8 @@ class DeliveryNote(SellingController): if not self.installation_status: self.installation_status = 'Not Installed' def validate_qty(self): - data = frappe.get_all("Delivery Note Item", filters={"parent" : self.name}, fields=["qty"]) - for quant in data: - if quant.qty == 0: + for item in self.items: + if not item.qty: frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): From 3893ba302c8086c3fc63e1214de4b3d7aed88193 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 26 Nov 2018 14:03:23 +0530 Subject: [PATCH 21/45] If is pos and no pos profile use the item's default warehouse for packing materials --- erpnext/stock/doctype/packed_item/packed_item.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 0c55b433a1..e0ad7ac9df 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -49,8 +49,9 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip pi.qty = flt(qty) pi.description = description if not pi.warehouse: - pi.warehouse = (main_item_row.warehouse - if (doc.get('is_pos') or not item.default_warehouse) else item.default_warehouse) + pi.warehouse = (main_item_row.warehouse if ((doc.get('is_pos') + or not item.default_warehouse) and main_item_row.warehouse) else item.default_warehouse) + if not pi.batch_no: pi.batch_no = cstr(main_item_row.get("batch_no")) if not pi.target_warehouse: From 758ca946fa80fee4ce89c9a80b2d037afecb14bd Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Mon, 26 Nov 2018 14:45:54 +0530 Subject: [PATCH 22/45] Update stale.yml --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index 3ad0bff5d7..dabc66eb73 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,7 +1,7 @@ # Configuration for probot-stale - https://github.com/probot/stale # Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 10 +daysUntilStale: 30 # Number of days of inactivity before a stale Issue or Pull Request is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. From 533066eb878e0d8a8a699fd28850a2b1fb48bc99 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 26 Nov 2018 15:04:21 +0530 Subject: [PATCH 23/45] Salary slip bug fix --- erpnext/hr/doctype/salary_slip/salary_slip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index affbb552f7..4fa3f96891 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -178,7 +178,7 @@ var calculate_earning_total = function(doc, dt, dn, reset_amount) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days) / cint(doc.total_working_days)*100)/100; } else if(reset_amount) { - tbl[i].amount = tbl[i].default_amount; + tbl[i].amount = tbl[i].amount; } if(!tbl[i].do_not_include_in_total) { total_earn += flt(tbl[i].amount); @@ -199,7 +199,7 @@ var calculate_ded_total = function(doc, dt, dn, reset_amount) { if(cint(tbl[i].depends_on_lwp) == 1) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days)/cint(doc.total_working_days)*100)/100; } else if(reset_amount) { - tbl[i].amount = tbl[i].default_amount; + tbl[i].amount = tbl[i].amount; } if(!tbl[i].do_not_include_in_total) { total_ded += flt(tbl[i].amount); From 42d3af3bbb1bd876eb2702442c616f359c463090 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 26 Nov 2018 15:19:17 +0530 Subject: [PATCH 24/45] making validation generic for sales order,sales invoice,purchase order etc. --- erpnext/controllers/accounts_controller.py | 7 +++++++ erpnext/selling/doctype/sales_order/sales_order.py | 1 - erpnext/stock/doctype/delivery_note/delivery_note.py | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 51747f67ae..403adb35a4 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -57,6 +57,8 @@ class AccountsController(TransactionBase): _('{0} is blocked so this transaction cannot proceed'.format(supplier_name)), raise_exception=1) def validate(self): + + self.validate_qty_is_not_zero() if self.get("_action") and self._action != "update_after_submit": self.set_missing_values(for_validate=True) @@ -359,6 +361,11 @@ class AccountsController(TransactionBase): return gl_dict + def validate_qty_is_not_zero(self): + for item in self.items: + if not item.qty: + frappe.throw("Item quantity can not be zero") + def validate_account_currency(self, account, account_currency=None): valid_currency = [self.company_currency] if self.get("currency") and self.currency != self.company_currency: diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 5f435ced74..f6ee48ef45 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -32,7 +32,6 @@ class SalesOrder(SellingController): def validate(self): super(SalesOrder, self).validate() - self.validate_order_type() self.validate_delivery_date() self.validate_proj_cust() diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ea1808b215..ab624d17db 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -98,7 +98,6 @@ class DeliveryNote(SellingController): frappe.throw(_("Sales Order required for Item {0}").format(d.item_code)) def validate(self): - self.validate_qty() self.validate_posting_time() super(DeliveryNote, self).validate() self.set_status() @@ -120,11 +119,6 @@ class DeliveryNote(SellingController): self.update_current_stock() if not self.installation_status: self.installation_status = 'Not Installed' - - def validate_qty(self): - for item in self.items: - if not item.qty: - frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): super(DeliveryNote, self).validate_with_previous_doc({ @@ -208,7 +202,6 @@ class DeliveryNote(SellingController): def on_submit(self): self.validate_packed_qty() - self.validate_qty() # Check for Approving Authority frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) From 73ca3cfca6781359940d3d0f14b9e73c0ca0d5ae Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 26 Nov 2018 16:16:42 +0530 Subject: [PATCH 25/45] fix(test): removed test print --- erpnext/accounts/doctype/share_transfer/share_transfer.py | 1 - erpnext/accounts/doctype/share_transfer/test_share_transfer.py | 1 - 2 files changed, 2 deletions(-) diff --git a/erpnext/accounts/doctype/share_transfer/share_transfer.py b/erpnext/accounts/doctype/share_transfer/share_transfer.py index 4fe9a6c10a..1a1f036278 100644 --- a/erpnext/accounts/doctype/share_transfer/share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/share_transfer.py @@ -189,7 +189,6 @@ class ShareTransfer(Document): if (shareholder == 'from_shareholder') else self.to_folio_no; doc.save() else: - print(doc.name, doc.folio_no, self.from_folio_no, shareholder, self.to_folio_no) if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no): frappe.throw(_('The folio numbers are not matching')) diff --git a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py index 3859cc3c6e..f1cf31b820 100644 --- a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py @@ -80,7 +80,6 @@ class TestShareTransfer(unittest.TestCase): ] for d in share_transfers: st = frappe.get_doc(d) - print(st.as_dict()) st.submit() def test_invalid_share_transfer(self): From 7b2c445707e1f716c586cac8c1c49b151d8158c7 Mon Sep 17 00:00:00 2001 From: Anurag mishra Date: Thu, 22 Nov 2018 18:12:45 +0530 Subject: [PATCH 26/45] Delivery Note fixes --- erpnext/stock/doctype/delivery_note/delivery_note.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ab624d17db..e4cfb474ff 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -119,6 +119,12 @@ class DeliveryNote(SellingController): self.update_current_stock() if not self.installation_status: self.installation_status = 'Not Installed' + + def validate_qty(self): + data = frappe.get_all("Delivery Note Item", filters={"parent" : self.name}, fields=["qty"]) + for quant in data: + if quant.qty == 0: + frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): super(DeliveryNote, self).validate_with_previous_doc({ @@ -202,6 +208,7 @@ class DeliveryNote(SellingController): def on_submit(self): self.validate_packed_qty() + self.validate_qty() # Check for Approving Authority frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) From 6ddb15b3dfeb148af8ec36d701bebe3b3a6f18df Mon Sep 17 00:00:00 2001 From: Anurag mishra Date: Mon, 26 Nov 2018 11:28:22 +0530 Subject: [PATCH 27/45] fix(validate): Qty is mandatory in delivery note --- erpnext/stock/doctype/delivery_note/delivery_note.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index e4cfb474ff..ea1808b215 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -98,6 +98,7 @@ class DeliveryNote(SellingController): frappe.throw(_("Sales Order required for Item {0}").format(d.item_code)) def validate(self): + self.validate_qty() self.validate_posting_time() super(DeliveryNote, self).validate() self.set_status() @@ -121,9 +122,8 @@ class DeliveryNote(SellingController): if not self.installation_status: self.installation_status = 'Not Installed' def validate_qty(self): - data = frappe.get_all("Delivery Note Item", filters={"parent" : self.name}, fields=["qty"]) - for quant in data: - if quant.qty == 0: + for item in self.items: + if not item.qty: frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): From e657fe84b87b7af39d9c972469cb6bb46dcf1361 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 26 Nov 2018 15:19:17 +0530 Subject: [PATCH 28/45] making validation generic for sales order,sales invoice,purchase order etc. --- erpnext/controllers/accounts_controller.py | 7 +++++++ erpnext/selling/doctype/sales_order/sales_order.py | 1 - erpnext/stock/doctype/delivery_note/delivery_note.py | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 51747f67ae..403adb35a4 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -57,6 +57,8 @@ class AccountsController(TransactionBase): _('{0} is blocked so this transaction cannot proceed'.format(supplier_name)), raise_exception=1) def validate(self): + + self.validate_qty_is_not_zero() if self.get("_action") and self._action != "update_after_submit": self.set_missing_values(for_validate=True) @@ -359,6 +361,11 @@ class AccountsController(TransactionBase): return gl_dict + def validate_qty_is_not_zero(self): + for item in self.items: + if not item.qty: + frappe.throw("Item quantity can not be zero") + def validate_account_currency(self, account, account_currency=None): valid_currency = [self.company_currency] if self.get("currency") and self.currency != self.company_currency: diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 5f435ced74..f6ee48ef45 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -32,7 +32,6 @@ class SalesOrder(SellingController): def validate(self): super(SalesOrder, self).validate() - self.validate_order_type() self.validate_delivery_date() self.validate_proj_cust() diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ea1808b215..ab624d17db 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -98,7 +98,6 @@ class DeliveryNote(SellingController): frappe.throw(_("Sales Order required for Item {0}").format(d.item_code)) def validate(self): - self.validate_qty() self.validate_posting_time() super(DeliveryNote, self).validate() self.set_status() @@ -120,11 +119,6 @@ class DeliveryNote(SellingController): self.update_current_stock() if not self.installation_status: self.installation_status = 'Not Installed' - - def validate_qty(self): - for item in self.items: - if not item.qty: - frappe.throw("Item quantity can not be zero") def validate_with_previous_doc(self): super(DeliveryNote, self).validate_with_previous_doc({ @@ -208,7 +202,6 @@ class DeliveryNote(SellingController): def on_submit(self): self.validate_packed_qty() - self.validate_qty() # Check for Approving Authority frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) From bd87903b56f6f3b06debf95287fba55a6348e6a3 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 26 Nov 2018 17:13:59 +0530 Subject: [PATCH 29/45] Added condition for default amount --- erpnext/hr/doctype/salary_slip/salary_slip.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index 4fa3f96891..86c50d08ba 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -177,8 +177,8 @@ var calculate_earning_total = function(doc, dt, dn, reset_amount) { if(cint(tbl[i].depends_on_lwp) == 1) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days) / cint(doc.total_working_days)*100)/100; - } else if(reset_amount) { - tbl[i].amount = tbl[i].amount; + } else if(reset_amount && tbl[i].default_amount) { + tbl[i].amount = tbl[i].default_amount; } if(!tbl[i].do_not_include_in_total) { total_earn += flt(tbl[i].amount); @@ -198,8 +198,8 @@ var calculate_ded_total = function(doc, dt, dn, reset_amount) { for(var i = 0; i < tbl.length; i++){ if(cint(tbl[i].depends_on_lwp) == 1) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days)/cint(doc.total_working_days)*100)/100; - } else if(reset_amount) { - tbl[i].amount = tbl[i].amount; + } else if(reset_amount && tbl[i].default_amount) { + tbl[i].amount = tbl[i].default_amount; } if(!tbl[i].do_not_include_in_total) { total_ded += flt(tbl[i].amount); From 5b6dd58b3e8718f752e858a12412b3662113ba1c Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 26 Nov 2018 17:22:50 +0530 Subject: [PATCH 30/45] fixed ZeroDivisionError in sales_order.py --- erpnext/selling/doctype/sales_order/sales_order.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index f6ee48ef45..9a35aedb72 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -341,9 +341,11 @@ class SalesOrder(SellingController): delivered_qty += item.delivered_qty tot_qty += item.qty - - self.db_set("per_delivered", flt(delivered_qty/tot_qty) * 100, - update_modified=False) + + if tot_qty != 0: + self.db_set("per_delivered", flt(delivered_qty/tot_qty) * 100, + update_modified=False) + def set_indicator(self): """Set indicator for portal""" From 15ed7a635158282251469159f58568a9e8fa58c8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 26 Nov 2018 17:31:18 +0530 Subject: [PATCH 31/45] [Fix] No permission for Manufacturing Settings --- .../manufacturing_settings/manufacturing_settings.py | 8 ++++++++ erpnext/stock/doctype/stock_entry/stock_entry.js | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py index b80b0beba3..e88164f917 100644 --- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py +++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py @@ -13,3 +13,11 @@ class ManufacturingSettings(Document): def get_mins_between_operations(): return relativedelta(minutes=cint(frappe.db.get_single_value("Manufacturing Settings", "mins_between_operations")) or 10) + +@frappe.whitelist() +def is_material_consumption_enabled(): + if not hasattr(frappe.local, 'material_consumption'): + frappe.local.material_consumption = cint(frappe.db.get_single_value('Manufacturing Settings', + 'material_consumption')) + + return frappe.local.material_consumption \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index a26992a5ae..ccd5f363a4 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -199,12 +199,15 @@ frappe.ui.form.on('Stock Entry', { }, validate_purpose_consumption: function(frm) { - frappe.model.get_value('Manufacturing Settings', {'name': 'Manufacturing Settings'}, 'material_consumption', function(d) { - if (d.material_consumption==0 && frm.doc.purpose=="Material Consumption for Manufacture") { + frappe.call({ + method: "erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings.is_material_consumption_enabled", + }).then(r => { + if (cint(r.message) == 0 + && frm.doc.purpose=="Material Consumption for Manufacture") { frm.set_value("purpose", 'Manufacture'); frappe.throw(__('Material Consumption is not set in Manufacturing Settings.')); } - }) + }); }, company: function(frm) { From d1a85a3637b3224ff37e49267903a890959ebd4e Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 26 Nov 2018 18:42:29 +0530 Subject: [PATCH 32/45] [Fix] Due date can not be greter than posting date validation should consider supplier invoice date for purchase invoice --- erpnext/accounts/party.py | 2 +- erpnext/controllers/accounts_controller.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index f19aaf833b..8c7f3d881f 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -335,7 +335,7 @@ def get_due_date_from_template(template_name, posting_date, bill_date): def validate_due_date(posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None): if getdate(due_date) < getdate(posting_date): - frappe.throw(_("Due Date cannot be before Posting Date")) + frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date")) else: if not template_name: return diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 51747f67ae..18a769d0f7 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -179,7 +179,7 @@ class AccountsController(TransactionBase): validate_due_date(self.posting_date, self.due_date, "Customer", self.customer, self.company, self.payment_terms_template) elif self.doctype == "Purchase Invoice": - validate_due_date(self.posting_date, self.due_date, + validate_due_date(self.bill_date or self.posting_date, self.due_date, "Supplier", self.supplier, self.company, self.bill_date, self.payment_terms_template) def set_price_list_currency(self, buying_or_selling): From 147fa73d3fd91ed0baf6a7d98234a373353ecf59 Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Mon, 26 Nov 2018 18:14:06 +0500 Subject: [PATCH 33/45] Fixed incorrect use of 'this' causing errors calculating rate --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index a33b87f619..72da3f1e5d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -33,7 +33,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ item.margin_rate_or_amount = 0; item.rate_with_margin = 0; } - item.base_rate_with_margin = item.rate_with_margin * flt(this.frm.doc.conversion_rate); + item.base_rate_with_margin = item.rate_with_margin * flt(frm.doc.conversion_rate); cur_frm.cscript.set_gross_profit(item); cur_frm.cscript.calculate_taxes_and_totals(); From b4a5993eceb0423e2022a2a6f4392d1834769319 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 26 Nov 2018 20:02:01 +0530 Subject: [PATCH 34/45] On uncheck is return field clear the reference field --- erpnext/public/js/controllers/transaction.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index a33b87f619..6cd99df5e4 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -185,6 +185,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } }, + is_return: function() { + if(!this.frm.doc.is_return && this.frm.doc.return_against) { + this.frm.set_value('return_against', ''); + } + }, + setup_quality_inspection: function() { if(!in_list(["Delivery Note", "Sales Invoice", "Purchase Receipt", "Purchase Invoice"], this.frm.doc.doctype)) { return; From 5fdbc68ca34a1c22afcdadf59644eb33ff3b945c Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Mon, 26 Nov 2018 19:32:16 +0500 Subject: [PATCH 35/45] Set Gross Profit on server-side validation of Sales Order --- erpnext/controllers/selling_controller.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 719f4c732a..7739592ced 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -41,6 +41,7 @@ class SellingController(StockController): self.validate_selling_price() self.set_qty_as_per_stock_uom() self.set_po_nos() + self.set_gross_profit() set_default_income_account_for_item(self) def set_missing_values(self, for_validate=False): @@ -348,6 +349,12 @@ class SellingController(StockController): if po_nos and po_nos[0].get('po_no'): self.po_no = ', '.join(list(set([d.po_no for d in po_nos if d.po_no]))) + def set_gross_profit(self): + if self.doctype == "Sales Order": + for item in self.items: + item.gross_profit = flt(((item.base_rate - item.valuation_rate) * item.stock_qty), self.precision("amount", item)) + + def validate_items(self): # validate items to see if they have is_sales_item enabled from erpnext.controllers.buying_controller import validate_item_type From 05c298969859f977be4b6e51224d6feb58c8c0f5 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 26 Nov 2018 16:52:15 +0530 Subject: [PATCH 36/45] removed total from graph --- .../selling/report/sales_analytics/sales_analytics.js | 9 +++++---- .../selling/report/sales_analytics/sales_analytics.py | 9 +++++---- erpnext/stock/report/stock_analytics/stock_analytics.js | 9 ++++----- erpnext/stock/report/stock_analytics/stock_analytics.py | 6 ++---- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js index 718f29c611..7dc7c754bc 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.js +++ b/erpnext/selling/report/sales_analytics/sales_analytics.js @@ -73,7 +73,8 @@ frappe.query_reports["Sales Analytics"] = { events: { onCheckRow: function(data) { row_name = data[2].content; - row_values = data.slice(4).map(function (column) { + length = data.length + row_values = data.slice(4,length-1).map(function (column) { return column.content; }) entry = { @@ -102,12 +103,12 @@ frappe.query_reports["Sales Analytics"] = { labels: raw_data.labels, datasets: new_datasets } - + setTimeout(() => { frappe.query_report.chart.update(new_data) },200) - - + + setTimeout(() => { frappe.query_report.chart.draw(true); }, 800) diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py index 2cc2f70401..8d99a9b789 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.py +++ b/erpnext/selling/report/sales_analytics/sales_analytics.py @@ -166,7 +166,7 @@ class Analytics(object): for entity, period_data in iteritems(self.entity_periodic_data): row = { "entity": entity, - "entity_name": self.entity_names.get(entity) + "entity_name": self.entity_names.get(entity) } total = 0 for dummy, end_date in self.periodic_daterange: @@ -177,7 +177,7 @@ class Analytics(object): row["total"] = total self.data.append(row) - + def get_rows_by_group(self): self.get_periodic_data() out = [] @@ -185,7 +185,7 @@ class Analytics(object): for d in reversed(self.group_entries): row = { "entity": d.name, - "indent": self.depth_map.get(d.name) + "indent": self.depth_map.get(d.name) } total = 0 for dummy, end_date in self.periodic_daterange: @@ -275,7 +275,8 @@ class Analytics(object): self.parent_child_map = frappe._dict(frappe.db.sql(""" select name, supplier_group from `tabSupplier`""")) def get_chart_data(self): - labels = [d.get("label") for d in self.columns[2:]] + length = len(self.columns) + labels = [d.get("label") for d in self.columns[2:length-1]] self.chart = { "data": { 'labels': labels, diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.js b/erpnext/stock/report/stock_analytics/stock_analytics.js index 6010ea9ee2..bebc84e057 100644 --- a/erpnext/stock/report/stock_analytics/stock_analytics.js +++ b/erpnext/stock/report/stock_analytics/stock_analytics.js @@ -88,10 +88,9 @@ frappe.query_reports["Stock Analytics"] = { events: { onCheckRow: function(data) { row_name = data[2].content; - row_values = data.slice(6).map(function (column) { + row_values = data.slice(7).map(function (column) { return column.content; }) - entry = { 'name':row_name, 'values':row_values @@ -118,12 +117,12 @@ frappe.query_reports["Stock Analytics"] = { labels: raw_data.labels, datasets: new_datasets } - + setTimeout(() => { frappe.query_report.chart.update(new_data) },200) - - + + setTimeout(() => { frappe.query_report.chart.draw(true); }, 800) diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.py b/erpnext/stock/report/stock_analytics/stock_analytics.py index 5a8a672b63..dad8be1b8c 100644 --- a/erpnext/stock/report/stock_analytics/stock_analytics.py +++ b/erpnext/stock/report/stock_analytics/stock_analytics.py @@ -167,13 +167,11 @@ def get_data(filters): return data def get_chart_data(columns): - labels = [d.get("label") for d in columns[4:]] + labels = [d.get("label") for d in columns[5:]] chart = { "data": { 'labels': labels, - 'datasets':[ - { "values": ['0' for d in columns[4:]] } - ] + 'datasets':[] } } chart["type"] = "line" From 6a9d9d76eff53a368559c79db416e7522e0ae90f Mon Sep 17 00:00:00 2001 From: Saif Date: Mon, 26 Nov 2018 19:56:13 +0500 Subject: [PATCH 37/45] Company rename abbr to consider more DocTypes --- erpnext/setup/doctype/company/company.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 0c58fb2679..40bbc2c15f 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -363,7 +363,8 @@ def replace_abbr(company, old, new): for d in doc: _rename_record(d) - for dt in ["Warehouse", "Account", "Cost Center"]: + for dt in ["Warehouse", "Account", "Cost Center", "Department", "Location", + "Sales Taxes and Charges Template", "Purchase Taxes and Charges Template"]: _rename_records(dt) frappe.db.commit() From a9525de0da6844ead7fc6fb2b2faf6bbd92b8c7f Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 26 Nov 2018 20:34:32 +0530 Subject: [PATCH 38/45] paid amount fix in fees --- erpnext/education/doctype/fees/fees.py | 5 ++++- erpnext/templates/includes/fee/fee_row.html | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/education/doctype/fees/fees.py b/erpnext/education/doctype/fees/fees.py index bfe6af4bdb..aa616e6206 100644 --- a/erpnext/education/doctype/fees/fees.py +++ b/erpnext/education/doctype/fees/fees.py @@ -112,7 +112,10 @@ def get_fee_list(doctype, txt, filters, limit_start, limit_page_length=20, order user = frappe.session.user student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user) if student: - return frappe. db.sql('''select name, program, due_date, paid_amount, outstanding_amount, grand_total from `tabFees` + return frappe. db.sql(''' + select name, program, due_date, grand_total - outstanding_amount as paid_amount, + outstanding_amount, grand_total, currency + from `tabFees` where student= %s and docstatus=1 order by due_date asc limit {0} , {1}''' .format(limit_start, limit_page_length), student, as_dict = True) diff --git a/erpnext/templates/includes/fee/fee_row.html b/erpnext/templates/includes/fee/fee_row.html index ac2b1006ad..d5fd682236 100644 --- a/erpnext/templates/includes/fee/fee_row.html +++ b/erpnext/templates/includes/fee/fee_row.html @@ -5,13 +5,13 @@ {{ doc.program }}
- {{ doc.get_formatted("total_amount") }} + {{ frappe.utils.fmt_money(doc.grand_total, currency=doc.currency) }}
- {{ doc.get_formatted("paid_amount") }} + {{ frappe.utils.fmt_money(doc.paid_amount, currency=doc.currency) }}
- {{ doc.get_formatted("outstanding_amount") }} + {{ frappe.utils.fmt_money(doc.outstanding_amount, currency=doc.currency) }}
From bc513a88285a407bba5225030d408ac51c4058ed Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 26 Nov 2018 20:43:39 +0530 Subject: [PATCH 39/45] Removed paid amount form Fees doctype --- erpnext/education/doctype/fees/fees.json | 36 ++---------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/erpnext/education/doctype/fees/fees.json b/erpnext/education/doctype/fees/fees.json index ac32717721..2413967442 100644 --- a/erpnext/education/doctype/fees/fees.json +++ b/erpnext/education/doctype/fees/fees.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 0, @@ -991,39 +992,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "paid_amount", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Paid Amount", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -1360,7 +1328,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-08-21 14:44:48.968839", + "modified": "2018-11-26 20:42:14.467284", "modified_by": "Administrator", "module": "Education", "name": "Fees", From 2d0b78810550e4444797478c025de5f3b80e6119 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Tue, 27 Nov 2018 10:37:23 +0530 Subject: [PATCH 40/45] [Minor] Indicators in Leave Application --- .../doctype/leave_application/leave_application_list.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application_list.js b/erpnext/hr/doctype/leave_application/leave_application_list.js index d7588da4dd..f69b182737 100644 --- a/erpnext/hr/doctype/leave_application/leave_application_list.js +++ b/erpnext/hr/doctype/leave_application/leave_application_list.js @@ -1,3 +1,10 @@ frappe.listview_settings['Leave Application'] = { - add_fields: ["leave_type", "employee", "employee_name", "total_leave_days", "from_date", "to_date"] + add_fields: ["leave_type", "employee", "employee_name", "total_leave_days", "from_date", "to_date"], + get_indicator: function (doc) { + if (doc.status === "Approved") { + return [__("Approved"), "green", "status,=,Approved"]; + } else if (doc.status === "Rejected") { + return [__("Rejected"), "red", "status,=,Rejected"]; + } + } }; From 6cc2f52fa4bef717a81574ef07f999b28656ae4b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 27 Nov 2018 12:07:03 +0530 Subject: [PATCH 41/45] [Fix] System allocated grand total amount instead of non zero rounded total for advanced entry in the sales invoice --- erpnext/controllers/accounts_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 51747f67ae..3646d87036 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -405,7 +405,8 @@ class AccountsController(TransactionBase): if d.against_order: allocated_amount = flt(d.amount) else: - allocated_amount = min(self.grand_total - advance_allocated, d.amount) + amount = self.rounded_total or self.grand_total + allocated_amount = min(amount - advance_allocated, d.amount) advance_allocated += flt(allocated_amount) self.append("advances", { From 5281fe8e500c3abfbd049c572fe59be1ea8c0af6 Mon Sep 17 00:00:00 2001 From: "shreyashah115@gmail.com" Date: Tue, 27 Nov 2018 13:11:30 +0530 Subject: [PATCH 42/45] fix: Element selector --- erpnext/public/js/projects/timer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/projects/timer.js b/erpnext/public/js/projects/timer.js index 8b1d1b158b..26be997d48 100644 --- a/erpnext/public/js/projects/timer.js +++ b/erpnext/public/js/projects/timer.js @@ -44,8 +44,8 @@ erpnext.timesheet.timer = function(frm, row, timestamp=0) { }; erpnext.timesheet.control_timer = function(frm, dialog, row, timestamp=0) { - var $btn_start = $(".playpause .btn-start"); - var $btn_complete = $(".playpause .btn-complete"); + var $btn_start = dialog.$wrapper.find(".playpause .btn-start"); + var $btn_complete = dialog.$wrapper.find(".playpause .btn-complete"); var interval = null; var currentIncrement = timestamp; var initialised = row ? true : false; From 10bcd5113cf03e55f1d86ca2f11744a2d8f2eb60 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 27 Nov 2018 16:25:35 +0530 Subject: [PATCH 43/45] [Fix] Accounts receivable summary print is not working --- .../report/accounts_receivable/accounts_receivable.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 933c6ddf89..ae8141e9f0 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -228,10 +228,10 @@ {% } else { %} {%= __("Total") %} {% } %} - {%= format_currency(data[i][("total_invoiced_amt")], data[i]["currency"]) %} - {%= format_currency(data[i][("total_paid_amt")], data[i]["currency"]) %} + {%= format_currency(data[i][__("Total Invoiced Amt")], data[i]["currency"]) %} + {%= format_currency(data[i][__("Total Paid Amt")], data[i]["currency"]) %} {%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")], data[i]["currency"]) : format_currency(data[i][__("Debit Note Amt")], data[i]["currency"]) %} - {%= format_currency(data[i][("total_outstanding_amt")], data[i]["currency"]) %} + {%= format_currency(data[i][__("Total Outstanding Amt")], data[i]["currency"]) %} {% } %} {% } %} From e3136c38e1c1ee10211a7606da4e15f97336347b Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Wed, 28 Nov 2018 07:57:27 +0000 Subject: [PATCH 44/45] bumped to version 10.1.73 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index d6bb2d7aab..97359ede97 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.72' +__version__ = '10.1.73' def get_default_company(user=None): '''Get default company for user''' From 5780e865b7a072c55599fc70df76ed9e877d176e Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Wed, 28 Nov 2018 08:28:36 +0000 Subject: [PATCH 45/45] bumped to version 11.0.3-beta.25 --- erpnext/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 43afa2ae28..cbd3939b7b 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" develop_version = '12.x.x-develop' -staging_version = '11.0.3-beta.24' +staging_version = '11.0.3-beta.25' error_report_email = "support@erpnext.com"