diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 9e6707a262..afa61319c9 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.11' +__version__ = '8.0.12' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index a96446f306..0dcae82d82 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -1426,7 +1426,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "is_sample_item", + "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, @@ -1435,7 +1435,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Is Sample Item", + "label": "Allow Zero Valuation Rate", "length": 0, "no_copy": 1, "permlevel": 0, diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index 721785e82c..205b61e882 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -1552,7 +1552,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "is_sample_item", + "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, @@ -1561,7 +1561,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Is Sample Item", + "label": "Allow Zero Valuation Rate", "length": 0, "no_copy": 1, "permlevel": 0, @@ -2094,7 +2094,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-03-30 16:26:36.507924", + "modified": "2017-04-05 23:28:13.520429", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 3697174e87..670a577c4e 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1356,7 +1356,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ discount_percentage: d.discount_percentage || 0.0, actual_qty: me.actual_qty_dict[d.item_code] || 0.0, projected_qty: d.projected_qty, - rate: format_number(d.rate, me.frm.doc.currency), + rate: format_currency(d.rate, me.frm.doc.currency), enabled: me.pos_profile_data["allow_user_to_edit_rate"] ? true : false, amount: format_currency(d.amount, me.frm.doc.currency), selected_class: (me.item_code == d.item_code) ? "active" : "" diff --git a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json index f7d5f630a3..6b603c80e2 100644 --- a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json +++ b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json @@ -7,10 +7,10 @@ "docstatus": 0, "doctype": "Print Format", "font": "Default", - "html": "\n\n

\n\t{{ company }}
\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}
\n

\n

\n\t{{ __(\"Date\") }}: {{ dateutil.global_date_format(posting_date) }}
\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{% for item in items %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endfor %}\n\t\n
{{ __(\"Item\") }}{{ __(\"Qty\") }}{{ __(\"Amount\") }}
\n\t\t\t\t{{ item.item_name }}\n\t\t\t{{ format_number(item.qty, precision(\"difference\")) }}
@ {{ format_currency(item.rate, currency) }}
{{ format_currency(item.amount, currency) }}
\n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Paid Amount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t
\n\n\n
\n

{{ terms }}

\n

{{ __(\"Thank you, please visit again.\") }}

", + "html": "\n\n

\n\t{{ company }}
\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}
\n

\n

\n\t{{ __(\"Date\") }}: {{ dateutil.global_date_format(posting_date) }}
\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{% for item in items %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endfor %}\n\t\n
{{ __(\"Item\") }}{{ __(\"Qty\") }}{{ __(\"Amount\") }}
\n\t\t\t\t{{ item.item_name }}\n\t\t\t{{ format_number(item.qty, null,precision(\"difference\")) }}
@ {{ format_currency(item.rate, currency) }}
{{ format_currency(item.amount, currency) }}
\n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{% endif %}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t
\n\t\t\t\t{{ __(\"Paid Amount\") }}\n\t\t\t\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t
\n\n\n
\n

{{ terms }}

\n

{{ __(\"Thank you, please visit again.\") }}

", "idx": 0, "line_breaks": 0, - "modified": "2017-01-12 14:56:12.571032", + "modified": "2017-04-17 12:12:00.153763", "modified_by": "Administrator", "module": "Accounts", "name": "Point of Sale", diff --git a/erpnext/config/crm.py b/erpnext/config/crm.py index 9935aeffb7..7a55cc606d 100644 --- a/erpnext/config/crm.py +++ b/erpnext/config/crm.py @@ -32,6 +32,12 @@ def get_data(): "label": _("Reports"), "icon": "fa fa-list", "items": [ + { + "type": "report", + "is_query_report": True, + "name": "Lead Details", + "doctype": "Lead" + }, { "type": "page", "name": "sales-funnel", @@ -40,15 +46,15 @@ def get_data(): }, { "type": "report", - "name": "Minutes to First Response for Opportunity", - "doctype": "Opportunity", + "name": "Prospects Engaged But Not Converted", + "doctype": "Lead", "is_query_report": True }, { "type": "report", - "is_query_report": True, - "name": "Lead Details", - "doctype": "Lead" + "name": "Minutes to First Response for Opportunity", + "doctype": "Opportunity", + "is_query_report": True }, { "type": "report", diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py index 7e9760272f..c88a8ccf4b 100644 --- a/erpnext/config/schools.py +++ b/erpnext/config/schools.py @@ -106,7 +106,7 @@ def get_data(): { "type": "doctype", "name": "Course Schedule", - "route": "Calendar/Course Schedule" + "route": "List/Course Schedule/Calendar" }, { "type": "doctype", @@ -205,6 +205,10 @@ def get_data(): { "type": "doctype", "name": "Academic Year" + }, + { + "type": "doctype", + "name": "School Settings" } ] }, diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 9f0534529f..54c181ac1d 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -54,14 +54,14 @@ class StockController(AccountsController): self.check_expense_account(item_row) - # If item is not a sample item + # If the item does not have the allow zero valuation rate flag set # and ( valuation rate not mentioned in an incoming entry # or incoming entry not found while delivering the item), # try to pick valuation rate from previous sle or Item master and update in SLE # Otherwise, throw an exception if not sle.stock_value_difference and self.doctype != "Stock Reconciliation" \ - and not item_row.get("is_sample_item"): + and not item_row.get("allow_zero_valuation_rate"): sle = self.update_stock_ledger_entries(sle) diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/__init__.py b/erpnext/crm/report/prospects_engaged_but_not_converted/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js new file mode 100644 index 0000000000..6f37719f63 --- /dev/null +++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js @@ -0,0 +1,25 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.query_reports["Prospects Engaged But Not Converted"] = { + "filters": [ + { + "fieldname": "lead", + "label": __("Lead"), + "fieldtype": "Link", + "options": "Lead" + }, + { + "fieldname": "no_of_interaction", + "label": __("Number of Interaction"), + "fieldtype": "Int", + "default": 1 + }, + { + "fieldname": "lead_age", + "label": __("Minimum Lead Age (Days)"), + "fieldtype": "Int", + "default": 60 + }, + ] +} diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json new file mode 100644 index 0000000000..9a21e0b56f --- /dev/null +++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json @@ -0,0 +1,29 @@ +{ + "add_total_row": 0, + "apply_user_permissions": 1, + "creation": "2017-04-04 08:25:40.491063", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2017-04-04 10:00:10.253224", + "modified_by": "Administrator", + "module": "CRM", + "name": "Prospects Engaged But Not Converted", + "owner": "Administrator", + "ref_doctype": "Lead", + "report_name": "Prospects Engaged But Not Converted", + "report_type": "Script Report", + "roles": [ + { + "role": "Sales User" + }, + { + "role": "Sales Manager" + }, + { + "role": "System Manager" + } + ] +} \ No newline at end of file diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py new file mode 100644 index 0000000000..36a4ad64ca --- /dev/null +++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py @@ -0,0 +1,74 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe import _ +from frappe.utils import add_days, now + +def execute(filters=None): + columns, data = [], [] + set_defaut_value_for_filters(filters) + columns = get_columns() + data = get_data(filters) + + return columns, data + +def set_defaut_value_for_filters(filters): + if not filters.get('no_of_interaction'): filters["no_of_interaction"] = 1 + if not filters.get('lead_age'): filters["lead_age"] = 60 + +def get_columns(): + return [ + _("Lead") + ":Link/Lead:100", + _("Name") + "::100", + _("Organization") + "::100", + _("Reference Document") + "::150", + _("Reference Name") + ":Dynamic Link/"+_("Reference Document")+":120", + _("Last Communication") + ":Data:200", + _("Last Communication Date") + ":Date:180" + ] + +def get_data(filters): + lead_details = [] + lead_filters = get_lead_filters(filters) + + for lead in frappe.get_all('Lead', fields = ['name', 'lead_name', 'company_name'], filters=lead_filters): + data = frappe.db.sql(""" + select + `tabCommunication`.reference_doctype, `tabCommunication`.reference_name, + `tabCommunication`.content, `tabCommunication`.communication_date + from + ( + (select name, lead from `tabOpportunity` where lead = %(lead)s) + union + (select name, lead from `tabQuotation` where lead = %(lead)s) + union + (select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed') + union + (select %(lead)s, %(lead)s) + ) + as ref_document, `tabCommunication` + where + `tabCommunication`.reference_name = ref_document.name and + `tabCommunication`.sent_or_received = 'Received' + order by + ref_document.lead, `tabCommunication`.creation desc limit %(limit)s""", + {'lead': lead.name, 'limit': filters.get('no_of_interaction')}) + + for lead_info in data: + lead_data = [lead.name, lead.lead_name, lead.company_name] + list(lead_info) + lead_details.append(lead_data) + + return lead_details + +def get_lead_filters(filters): + lead_creation_date = get_creation_date_based_on_lead_age(filters) + lead_filters = [["status", "!=", "Converted"], ["creation", ">", lead_creation_date]] + + if filters.get('lead'): + lead_filters.append(["name", "=", filters.get('lead')]) + return lead_filters + +def get_creation_date_based_on_lead_age(filters): + return add_days(now(), (filters.get('lead_age') * -1)) \ No newline at end of file diff --git a/erpnext/docs/assets/img/crm/report/__init__.py b/erpnext/docs/assets/img/crm/report/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png b/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png new file mode 100644 index 0000000000..3f92edb19c Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png differ diff --git a/erpnext/docs/assets/img/crm/report/inactive_customers.png b/erpnext/docs/assets/img/crm/report/inactive_customers.png new file mode 100644 index 0000000000..75330fd543 Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/inactive_customers.png differ diff --git a/erpnext/docs/assets/img/crm/report/lead.png b/erpnext/docs/assets/img/crm/report/lead.png new file mode 100644 index 0000000000..92a3d70ec4 Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/lead.png differ diff --git a/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png b/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png new file mode 100644 index 0000000000..1831382aa0 Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png differ diff --git a/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png b/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png new file mode 100644 index 0000000000..8406b68901 Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png differ diff --git a/erpnext/docs/assets/img/crm/report/sales_funnel.png b/erpnext/docs/assets/img/crm/report/sales_funnel.png new file mode 100644 index 0000000000..0796441f89 Binary files /dev/null and b/erpnext/docs/assets/img/crm/report/sales_funnel.png differ diff --git a/erpnext/docs/user/manual/en/CRM/crm_reports.md b/erpnext/docs/user/manual/en/CRM/crm_reports.md new file mode 100644 index 0000000000..4ff9aa598d --- /dev/null +++ b/erpnext/docs/user/manual/en/CRM/crm_reports.md @@ -0,0 +1,40 @@ +CRM module's reports helps users to get the information about the prospects. Using Following reports, user can analyze the data about prospect's history with a company and will helps user to build strong relationships with them. + +###Lead Details +It has data about the leads and their contact and address details. +Lead Details + +###Sales Funnel +By using the sales funnel report, and by quantifying the number of prospects at each stage of the process, you can get an idea of your potential customers. + +More than this, by looking at the way these numbers change over time, you can identify problems in the sales pipeline and take any corrective action at the early stage. + +For example, if you notice that very few communications with the prospects has taken place in a month which might indicate a decrease in the sales. From the next month, organization should make sure that more communications has to take place with the prospects. + +Lead Details + +###Prospects Engaged But Not Converted +Using this report, user gets the information about the leads who has shown interest in the business with you but due to some reason they were not converted into the customers. + +Lead Details + +###Minutes to First Response for Opportunity +Immediacy is so important – and so valued +In this internet area, we all expect a quicker response time to any of our query. This report gives you the information about the first response time given to an opportunities or issues. Using this report, the organization can improve their first response time to the prospects which can help to the better sales in the future. + +Lead Details + +###Customer Addresses And Contacts +It has data about the customers and their contact and address details. +Lead Details + +###Inactive Customers +This report shows the list of customers who has not purchased since long time. + +Lead Details diff --git a/erpnext/docs/user/manual/en/CRM/index.txt b/erpnext/docs/user/manual/en/CRM/index.txt index 204123ae69..2fe3f4d6d5 100644 --- a/erpnext/docs/user/manual/en/CRM/index.txt +++ b/erpnext/docs/user/manual/en/CRM/index.txt @@ -3,4 +3,5 @@ customer opportunity contact newsletter +crm_reports setup \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/manufacturing/production-order.md b/erpnext/docs/user/manual/en/manufacturing/production-order.md index 2f0fef34d2..3abf80f6cc 100644 --- a/erpnext/docs/user/manual/en/manufacturing/production-order.md +++ b/erpnext/docs/user/manual/en/manufacturing/production-order.md @@ -1,7 +1,7 @@ Production Order -Production Order (also called as Work Order) is a document that is given to +A Production Order (also known as a Work Order) is a document that is given to the manufacturing shop floor by the Production Planner as a signal to produce -a certain quantity of a certain Item. Production Order also helps to generate +a certain quantity of a certain Item. The Production Order also helps to generate the material requirements (Stock Entry) for the Item to be produced from its **Bill of Materials**. @@ -66,8 +66,8 @@ by: * Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html) * Timesheet's time slots are created against Production Order Operations. -* Drafts of Timesheet is created based on the scheduled operations when an Production Order is Submitted. -* To create more Timesheet against an operation click 'Make Timesheet' button. +* Drafts of Timesheet are created based on the scheduled operations when an Production Order is Submitted. +* To create more Timesheets against an operation click 'Make Timesheet' button. Make timesheet against PO @@ -88,7 +88,7 @@ by: ### Stopping a Production Order * When you stop a Production Order its status is changed to Stop indicating that all production process against that Production Order is to be ceased. -* To stop the Production Order click on the 'stop' Button +* To stop the Production Order click on the 'Stop' Button 1. On Submitting the Production Order, the system will reserve a slot for each of the Production Order Operations serially after the planned start date based on the workstation availability. The Workstation availability depends on the Workstation timings, holiday list and if some other Production Order Operation was scheduled in that slot. You can mention the number of days for the system to try scheduling the operations in the Manufacturing Settings. This is set to 30 Days by default. If the operation requires time exceeding the available slot, system shall ask you to break the operations. Once the scheduling is done system shall create Time Logs and save them. You can Modify them and submit them later. 2. You can also create additional time logs against an Operation. For doing so select the respective operation and click on 'Make Time Log' @@ -98,7 +98,7 @@ by: PO - stop -* You can Also re-start a stopped Production Order. +* You can also re-start a stopped Production Order. > Note : In order to make a Production Order against an Item you must specify 'Yes' to "Allow Production Order" on the Item form. diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 13aa524465..a078ef2033 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -157,7 +157,7 @@ class Employee(Document): delete_events(self.doctype, self.name) def validate_prefered_email(self): - if not self.get(scrub(self.prefered_contact_email)): + if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)): frappe.msgprint(_("Please enter " + self.prefered_contact_email)) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b015e0a227..9c2b1c49ad 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -384,4 +384,5 @@ erpnext.patches.v8_0.repost_reserved_qty_for_multiple_sales_uom erpnext.patches.v8_0.addresses_linked_to_lead execute:frappe.delete_doc('DocType', 'Purchase Common') erpnext.patches.v8_0.update_stock_qty_value_in_purchase_invoice -erpnext.patches.v8_0.update_supplier_address_in_stock_entry \ No newline at end of file +erpnext.patches.v8_0.update_supplier_address_in_stock_entry +erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate \ No newline at end of file diff --git a/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py b/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py new file mode 100644 index 0000000000..744cfed998 --- /dev/null +++ b/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +import frappe +from frappe.model.utils.rename_field import rename_field + +def execute(): + + doc_list = ["Purchase Invoice Item", "Stock Entry Detail", "Delivery Note Item", + "Purchase Receipt Item", "Sales Invoice Item"] + + for doctype in doc_list: + frappe.reload_doctype(doctype) + rename_field(doctype, "is_sample_item", "allow_zero_valuation_rate") \ No newline at end of file diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index 0370dd023b..0245675225 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -26,8 +26,6 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius-top: 4px; - border-radius-right: 4px; } .product-image.missing-image { width: 100%; @@ -36,8 +34,6 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius-top: 4px; - border-radius-right: 4px; position: relative; background-color: #EBEFF2; } @@ -45,9 +41,6 @@ font-size: 32px; color: #d1d8dd; } -.product-text { - padding: 15px 0px; -} .product-search { margin-bottom: 15px; } @@ -246,6 +239,15 @@ padding: 15px; word-wrap: break-word; height: 75px; + display: block; + /* Fallback for non-webkit */ + display: -webkit-box; + max-width: 100%; + margin: 0 auto; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; } .product-image-wrapper { padding-bottom: 40px; diff --git a/erpnext/public/js/payment/pos_payment.html b/erpnext/public/js/payment/pos_payment.html index e94f3a52ae..7700b24374 100644 --- a/erpnext/public/js/payment/pos_payment.html +++ b/erpnext/public/js/payment/pos_payment.html @@ -10,11 +10,11 @@

Outstanding

{%= format_currency(outstanding_amount, currency) %}

-

Change +

Change

-

Write off +

Write off

diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index d132f92f78..19fe2775b3 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -90,7 +90,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field, } }) } else { - frm.set_value(display_field, null); + frm.set_value(display_field, ''); } }; diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index b733dabaf7..79a89a050a 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -36,8 +36,6 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius-top: 4px; - border-radius-right: 4px; } .product-image.missing-image { @@ -51,10 +49,6 @@ color: @border-color; } -.product-text { - padding: 15px 0px; -} - .product-search { margin-bottom: 15px; } @@ -316,6 +310,14 @@ padding: 15px; word-wrap: break-word; height: 75px; + display: block; /* Fallback for non-webkit */ + display: -webkit-box; + max-width: 100%; + margin: 0 auto; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; } .product-image-wrapper { diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/schools/doctype/course/course.js index c667eca2b7..f84c59fcd2 100644 --- a/erpnext/schools/doctype/course/course.js +++ b/erpnext/schools/doctype/course/course.js @@ -1,30 +1,18 @@ frappe.ui.form.on("Course", "refresh", function(frm) { if(!cur_frm.doc.__islocal) { frm.add_custom_button(__("Program"), function() { - frappe.route_options = { - "Program Course.course": frm.doc.name - } frappe.set_route("List", "Program"); }); frm.add_custom_button(__("Student Group"), function() { - frappe.route_options = { - course: frm.doc.name - } frappe.set_route("List", "Student Group"); }); frm.add_custom_button(__("Course Schedule"), function() { - frappe.route_options = { - course: frm.doc.name - } frappe.set_route("List", "Course Schedule"); }); frm.add_custom_button(__("Assessment Plan"), function() { - frappe.route_options = { - course: frm.doc.name - } frappe.set_route("List", "Assessment Plan"); }); } diff --git a/erpnext/schools/doctype/course/course.json b/erpnext/schools/doctype/course/course.json index d1ca26181c..b6eda12e80 100644 --- a/erpnext/schools/doctype/course/course.json +++ b/erpnext/schools/doctype/course/course.json @@ -1,8 +1,9 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, - "autoname": "field:course_name", + "autoname": "field:course_code", "beta": 0, "creation": "2015-09-07 12:39:55.181893", "custom": 0, @@ -24,7 +25,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Course Name", "length": 0, @@ -46,16 +47,46 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "course_code", - "fieldtype": "Data", + "fieldname": "department", + "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": 1, + "label": "Department", + "length": 0, + "no_copy": 0, + "options": "Department", + "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, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "parent_course", + "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": "Course Code", + "label": "Parent Course (Leave blank, if this isn't part of Parent Course)", "length": 0, "no_copy": 0, "permlevel": 0, @@ -103,7 +134,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "course_abbreviation", + "fieldname": "course_code", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, @@ -112,7 +143,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Course Abbreviation", + "label": "Course Code", "length": 0, "no_copy": 0, "permlevel": 0, @@ -122,7 +153,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -132,19 +163,18 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "department", - "fieldtype": "Link", + "fieldname": "course_abbreviation", + "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 1, - "label": "Department", + "in_standard_filter": 0, + "label": "Course Abbreviation", "length": 0, "no_copy": 0, - "options": "Department", "permlevel": 0, "precision": "", "print_hide": 0, @@ -304,18 +334,18 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-02-17 17:22:36.450073", + "modified": "2017-04-12 20:44:42.048564", "modified_by": "Administrator", "module": "Schools", "name": "Course", @@ -366,7 +396,7 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, - "search_fields": "department", + "search_fields": "course_name", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", diff --git a/erpnext/schools/doctype/course_schedule/test_course_schedule.py b/erpnext/schools/doctype/course_schedule/test_course_schedule.py index e9fce4b45f..795486a888 100644 --- a/erpnext/schools/doctype/course_schedule/test_course_schedule.py +++ b/erpnext/schools/doctype/course_schedule/test_course_schedule.py @@ -24,28 +24,28 @@ class TestCourseSchedule(unittest.TestCase): cs1 = make_course_schedule_test_record(simulate= True) cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, - student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1) + student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1) self.assertRaises(OverlapError, cs2.save) def test_room_conflict(self): cs1 = make_course_schedule_test_record(simulate= True) cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, - student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1) + student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1) self.assertRaises(OverlapError, cs2.save) def test_no_conflict(self): cs1 = make_course_schedule_test_record(simulate= True) make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, - student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002") + student_group="TC1-TP2-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002") def make_course_schedule_test_record(**args): args = frappe._dict(args) course_schedule = frappe.new_doc("Course Schedule") - course_schedule.student_group = args.student_group or "TC-TP-2014-2015-2014-2015 (_Test Academic Term)" - course_schedule.course = args.course or "_Test Course" + course_schedule.student_group = args.student_group or "TC-TP1-2014-2015-2014-2015 (_Test Academic Term)" + course_schedule.course = args.course or "TC100" course_schedule.instructor = args.instructor or "_T-Instructor-00001" course_schedule.room = args.room or "RM0001" diff --git a/erpnext/schools/doctype/program/program.js b/erpnext/schools/doctype/program/program.js index 7b9f92042e..cc09d0ef4d 100644 --- a/erpnext/schools/doctype/program/program.js +++ b/erpnext/schools/doctype/program/program.js @@ -1,43 +1,27 @@ // Copyright (c) 2015, Frappe Technologies and contributors // For license information, please see license.txt -cur_frm.add_fetch("course", "course_code", "course_code"); cur_frm.add_fetch('fee_structure', 'total_amount', 'amount'); frappe.ui.form.on("Program", "refresh", function(frm) { if(!frm.doc.__islocal) { frm.add_custom_button(__("Student Applicant"), function() { - frappe.route_options = { - program: frm.doc.name - } frappe.set_route("List", "Student Applicant"); }); frm.add_custom_button(__("Program Enrollment"), function() { - frappe.route_options = { - program: frm.doc.name - } frappe.set_route("List", "Program Enrollment"); }); frm.add_custom_button(__("Student Group"), function() { - frappe.route_options = { - program: frm.doc.name - } frappe.set_route("List", "Student Group"); }); frm.add_custom_button(__("Fee Structure"), function() { - frappe.route_options = { - program: frm.doc.name - } frappe.set_route("List", "Fee Structure"); }); frm.add_custom_button(__("Fees"), function() { - frappe.route_options = { - program: frm.doc.name - } frappe.set_route("List", "Fees"); }); } diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json index cac29649db..9d6ba1ccbb 100644 --- a/erpnext/schools/doctype/program/program.json +++ b/erpnext/schools/doctype/program/program.json @@ -1,8 +1,9 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, - "autoname": "field:program_name", + "autoname": "field:program_code", "beta": 0, "creation": "2015-09-07 12:54:03.609282", "custom": 0, @@ -24,7 +25,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Program Name", "length": 0, @@ -46,47 +47,19 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "program_code", - "fieldtype": "Data", + "fieldname": "department", + "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": "Program Code", - "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, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "program_abbreviation", - "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": "Program Abbreviation", + "in_standard_filter": 1, + "label": "Department", "length": 0, "no_copy": 0, + "options": "Department", "permlevel": 0, "precision": "", "print_hide": 0, @@ -132,19 +105,47 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "department", - "fieldtype": "Link", + "fieldname": "program_code", + "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": "Program Code", + "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": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "program_abbreviation", + "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 1, - "label": "Department", + "in_standard_filter": 0, + "label": "Program Abbreviation", "length": 0, "no_copy": 0, - "options": "Department", "permlevel": 0, "precision": "", "print_hide": 0, @@ -276,18 +277,18 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-02-17 17:22:14.107052", + "modified": "2017-04-12 20:40:53.542488", "modified_by": "Administrator", "module": "Schools", "name": "Program", @@ -318,7 +319,7 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, - "search_fields": "department", + "search_fields": "program_name", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", diff --git a/erpnext/schools/doctype/program/program.py b/erpnext/schools/doctype/program/program.py index 0ece961cba..f626880b2a 100644 --- a/erpnext/schools/doctype/program/program.py +++ b/erpnext/schools/doctype/program/program.py @@ -7,10 +7,4 @@ import frappe from frappe.model.document import Document class Program(Document): - def validate(self): - self.validate_course() - - def validate_course(self): - for d in self.courses: - if not d.course_code: - d.course_code = frappe.db.get_value("Course", d.course, "course_code") + pass \ No newline at end of file diff --git a/erpnext/schools/doctype/program/test_records.json b/erpnext/schools/doctype/program/test_records.json index b2374d6c1f..e5eda70982 100644 --- a/erpnext/schools/doctype/program/test_records.json +++ b/erpnext/schools/doctype/program/test_records.json @@ -1,10 +1,12 @@ [ { "program_name": "_Test Program", - "program_abbreviation": "TP" + "program_code": "_TP1", + "program_abbreviation": "TP1" }, { "program_name": "_Test Program 2", + "program_code": "_TP2", "program_abbreviation": "TP2" } ] diff --git a/erpnext/schools/doctype/program_course/program_course.json b/erpnext/schools/doctype/program_course/program_course.json index c19b61387e..8c82666591 100644 --- a/erpnext/schools/doctype/program_course/program_course.json +++ b/erpnext/schools/doctype/program_course/program_course.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -41,36 +42,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "academic_term", - "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": "Academic Term", - "length": 0, - "no_copy": 0, - "options": "Academic Term", - "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, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -104,7 +75,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "course_code", + "fieldname": "course_name", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, @@ -113,9 +84,10 @@ "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, - "label": "Course Code", + "label": "Course Name", "length": 0, "no_copy": 0, + "options": "course.course_name", "permlevel": 0, "precision": "", "print_hide": 0, @@ -140,7 +112,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Required", "length": 0, @@ -158,18 +130,18 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, "menu_index": 0, - "modified": "2017-02-17 17:16:10.315691", + "modified": "2017-04-07 17:59:12.504949", "modified_by": "Administrator", "module": "Schools", "name": "Program Course", diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.js b/erpnext/schools/doctype/program_enrollment/program_enrollment.js index 96c8f96dc6..f117ee2f49 100644 --- a/erpnext/schools/doctype/program_enrollment/program_enrollment.js +++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.js @@ -3,7 +3,35 @@ cur_frm.add_fetch('fee_structure', 'total_amount', 'amount'); -frappe.ui.form.on("Program Enrollment", { +frappe.ui.form.on("Program Enrollment", { + onload: function(frm, cdt, cdn){ + frm.set_query("academic_term", "fees", function(){ + return{ + "filters":{ + "academic_year": (frm.doc.academic_year) + } + }; + }); + + frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) { + var d = locals[cdt][cdn]; + return { + filters: {'academic_term': d.academic_term} + } + }; + + if (frm.doc.program) { + frm.set_query("course", "courses", function(doc, cdt, cdn) { + return{ + query: "erpnext.schools.doctype.program_enrollment.program_enrollment.get_program_courses", + filters: { + 'program': frm.doc.program + } + } + }); + } + }, + program: function(frm) { if (frm.doc.program) { frappe.call({ @@ -18,28 +46,32 @@ frappe.ui.form.on("Program Enrollment", { } } }); + frm.trigger.onload() } }, student_category: function() { frappe.ui.form.trigger("Program Enrollment", "program"); }, - - onload: function(frm, cdt, cdn){ - cur_frm.set_query("academic_term", "fees", function(){ - return{ - "filters":{ - "academic_year": (frm.doc.academic_year) + + get_courses: function(frm) { + if (frm.doc.program) { + frm.set_value("courses",[]); + frappe.call({ + method: "get_courses", + doc:frm.doc, + callback: function(r) { + if(r.message) { + frm.set_value("courses", r.message); + } + else { + frappe.msgprint(__("There is no mandatory course for the program {0}",[frm.doc.program])); + } } - }; - }); - - cur_frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) { - var d = locals[cdt][cdn]; - return { - filters: {'academic_term': d.academic_term} - } - }; - + }) + } + else { + frappe.throw(__("Select the Program to fetch mandatory courses.")) + } } }); diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.json b/erpnext/schools/doctype/program_enrollment/program_enrollment.json index b1941c7441..988af05091 100644 --- a/erpnext/schools/doctype/program_enrollment/program_enrollment.json +++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.json @@ -78,7 +78,37 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "student_category", + "fieldname": "academic_year", + "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": 1, + "label": "Academic Year", + "length": 0, + "no_copy": 0, + "options": "Academic Year", + "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, + "unique": 0 + }, + { + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "academic_term", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, @@ -87,10 +117,10 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Student Category", + "label": "Academic Term", "length": 0, "no_copy": 0, - "options": "Student Category", + "options": "Academic Term", "permlevel": 0, "precision": "", "print_hide": 0, @@ -108,8 +138,9 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "school_house", - "fieldtype": "Link", + "default": "Today", + "fieldname": "enrollment_date", + "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -117,10 +148,9 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "School House", + "label": "Enrollment Date", "length": 0, "no_copy": 0, - "options": "School House", "permlevel": 0, "precision": "", "print_hide": 0, @@ -128,7 +158,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -192,7 +222,7 @@ "unique": 0 }, { - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "columns": 0, @@ -205,7 +235,7 @@ "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, - "label": "Batch Name", + "label": "Batch", "length": 0, "no_copy": 0, "options": "Student Batch Name", @@ -226,19 +256,19 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "academic_year", + "fieldname": "student_category", "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": 1, - "label": "Academic Year", + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Student Category", "length": 0, "no_copy": 0, - "options": "Academic Year", + "options": "Student Category", "permlevel": 0, "precision": "", "print_hide": 0, @@ -246,7 +276,37 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "school_house", + "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": "School House", + "length": 0, + "no_copy": 0, + "options": "School House", + "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, "unique": 0 @@ -256,9 +316,8 @@ "bold": 0, "collapsible": 0, "columns": 0, - "default": "Today", - "fieldname": "enrollment_date", - "fieldtype": "Date", + "fieldname": "enrolled_courses", + "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -266,7 +325,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Enrollment Date", + "label": "Enrolled courses", "length": 0, "no_copy": 0, "permlevel": 0, @@ -276,7 +335,66 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "get_courses", + "fieldtype": "Button", + "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": "Get Courses", + "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, + "unique": 0 + }, + { + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "courses", + "fieldtype": "Table", + "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": "Courses", + "length": 0, + "no_copy": 0, + "options": "Program Enrollment Course", + "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, "unique": 0 @@ -295,7 +413,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "", + "label": "Fees", "length": 0, "no_copy": 0, "permlevel": 0, @@ -412,7 +530,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-03-29 15:30:03.359985", + "modified": "2017-04-12 12:12:10.148274", "modified_by": "Administrator", "module": "Schools", "name": "Program Enrollment", diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.py b/erpnext/schools/doctype/program_enrollment/program_enrollment.py index 02c6fe71b6..feb4c2f60e 100644 --- a/erpnext/schools/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe from frappe import msgprint, _ from frappe.model.document import Document +from frappe.desk.reportview import get_match_cond, get_filters_cond from frappe.utils import comma_and class ProgramEnrollment(Document): @@ -53,4 +54,26 @@ class ProgramEnrollment(Document): if fee_list: fee_list = ["""%s""" % \ (fee, fee) for fee in fee_list] - msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list))) \ No newline at end of file + msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list))) + + def get_courses(self): + return frappe.db.sql('''select course, course_name from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1) + + +@frappe.whitelist() +def get_program_courses(doctype, txt, searchfield, start, page_len, filters): + if filters.get('program'): + return frappe.db.sql("""select course, course_name from `tabProgram Course` + where parent = %(program)s and course like %(txt)s {match_cond} + order by + if(locate(%(_txt)s, course), locate(%(_txt)s, course), 99999), + idx desc, + `tabProgram Course`.course asc + limit {start}, {page_len}""".format( + match_cond=get_match_cond(doctype), + start=start, + page_len=page_len), { + "txt": "%{0}%".format(txt), + "_txt": txt.replace('%', ''), + "program": filters['program'] + }) diff --git a/erpnext/schools/doctype/program_enrollment_course/__init__.py b/erpnext/schools/doctype/program_enrollment_course/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json new file mode 100644 index 0000000000..5c5e220f26 --- /dev/null +++ b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json @@ -0,0 +1,101 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-04-10 19:28:19.616308", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "course", + "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": "Course", + "length": 0, + "no_copy": 0, + "options": "Course", + "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, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "course_name", + "fieldtype": "Data", + "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": "Course Name", + "length": 0, + "no_copy": 0, + "options": "course.course_name", + "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, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2017-04-12 11:49:50.433280", + "modified_by": "Administrator", + "module": "Schools", + "name": "Program Enrollment Course", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py new file mode 100644 index 0000000000..e1f564eff0 --- /dev/null +++ b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class ProgramEnrollmentCourse(Document): + pass diff --git a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py b/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py index 1747bade4b..d80f2f5c6b 100644 --- a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py +++ b/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py @@ -11,11 +11,11 @@ from erpnext.schools.api import enroll_student class ProgramEnrollmentTool(Document): def get_students(self): if not self.get_students_from: - frappe.throw(_("Mandatory feild - Get Students From")) + frappe.throw(_("Mandatory field - Get Students From")) elif not self.program: - frappe.throw(_("Mandatory feild - Program")) + frappe.throw(_("Mandatory field - Program")) elif not self.academic_year: - frappe.throw(_("Mandatory feild - Academic Year")) + frappe.throw(_("Mandatory field - Academic Year")) else: if self.get_students_from == "Student Applicants": students = frappe.db.sql("select name as student_applicant, title as student_name from \ diff --git a/erpnext/schools/doctype/school_settings/__init__.py b/erpnext/schools/doctype/school_settings/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/schools/doctype/school_settings/school_settings.js b/erpnext/schools/doctype/school_settings/school_settings.js new file mode 100644 index 0000000000..2707c42876 --- /dev/null +++ b/erpnext/schools/doctype/school_settings/school_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('School Settings', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/schools/doctype/school_settings/school_settings.json b/erpnext/schools/doctype/school_settings/school_settings.json new file mode 100644 index 0000000000..5bdb65e1b5 --- /dev/null +++ b/erpnext/schools/doctype/school_settings/school_settings.json @@ -0,0 +1,151 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-04-05 13:33:04.519313", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "current_academic_year", + "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": "Current Academic Year", + "length": 0, + "no_copy": 0, + "options": "Academic Year", + "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, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "current_academic_term", + "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": "Current Academic Term", + "length": 0, + "no_copy": 0, + "options": "Academic Term", + "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, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "attendance_freeze_date", + "fieldtype": "Date", + "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": "Attendance Freeze Date", + "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, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2017-04-05 13:34:57.493516", + "modified_by": "Administrator", + "module": "Schools", + "name": "School Settings", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/schools/doctype/school_settings/school_settings.py b/erpnext/schools/doctype/school_settings/school_settings.py new file mode 100644 index 0000000000..5a1c6fe4a6 --- /dev/null +++ b/erpnext/schools/doctype/school_settings/school_settings.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +import frappe.defaults +from frappe.model.document import Document + +school_keydict = { + # "key in defaults": "key in Global Defaults" + "academic_year": "current_academic_year", + "academic_term": "current_academic_term", +} + +class SchoolSettings(Document): + def on_update(self): + """update defaults""" + for key in school_keydict: + frappe.db.set_default(key, self.get(school_keydict[key], '')) + + # clear cache + frappe.clear_cache() + + def get_defaults(self): + return frappe.defaults.get_defaults() diff --git a/erpnext/schools/doctype/student/test_records.json b/erpnext/schools/doctype/student/test_records.json index e280794ce6..36da06f02d 100644 --- a/erpnext/schools/doctype/student/test_records.json +++ b/erpnext/schools/doctype/student/test_records.json @@ -3,7 +3,7 @@ "first_name": "_Test", "middle_name": "Student", "last_name": "Name", - "program": "_Test Program", + "program": "TC101", "date_of_birth": "2000-01-01", "gender": "Male", "blood_group": "A+" @@ -13,7 +13,7 @@ "first_name": "_Test", "middle_name": "Student", "last_name": "Name 1", - "program": "_Test Program", + "program": "TC101", "date_of_birth": "2000-01-01", "gender": "Male", "blood_group": "A+" @@ -23,7 +23,7 @@ "first_name": "_Test", "middle_name": "Student", "last_name": "Name 2", - "program": "_Test Program", + "program": "TC101", "date_of_birth": "2000-01-01", "gender": "Male", "blood_group": "A+" diff --git a/erpnext/schools/doctype/student_group/test_records.json b/erpnext/schools/doctype/student_group/test_records.json index 27cd181bd1..06cb086c20 100644 --- a/erpnext/schools/doctype/student_group/test_records.json +++ b/erpnext/schools/doctype/student_group/test_records.json @@ -1,13 +1,13 @@ [ { - "program": "_Test Program", - "course": "_Test Course", + "program": "_TP1", + "course": "TC100", "academic_year": "2014-2015", "academic_term": "2014-2015 (_Test Academic Term)" }, { - "program": "_Test Program", - "course": "_Test Course 2", + "program": "_TP2", + "course": "TC101", "academic_year": "2014-2015", "academic_term": "2014-2015 (_Test Academic Term)" } diff --git a/erpnext/schools/utils.py b/erpnext/schools/utils.py index 3adbae4b5e..2ca46d5542 100644 --- a/erpnext/schools/utils.py +++ b/erpnext/schools/utils.py @@ -9,9 +9,9 @@ from frappe import _ class OverlapError(frappe.ValidationError): pass def validate_overlap_for(doc, doctype, fieldname, value=None): - """Checks overlap for specified feild. + """Checks overlap for specified field. - :param fieldname: Checks Overlap for this feild + :param fieldname: Checks Overlap for this field """ existing = get_overlap_for(doc, doctype, fieldname, value) @@ -20,9 +20,9 @@ def validate_overlap_for(doc, doctype, fieldname, value=None): doc.meta.get_label(fieldname) if not value else fieldname , value or doc.get(fieldname)), OverlapError) def get_overlap_for(doc, doctype, fieldname, value=None): - """Returns overlaping document for specified feild. + """Returns overlaping document for specified field. - :param fieldname: Checks Overlap for this feild + :param fieldname: Checks Overlap for this field """ existing = frappe.db.sql("""select name, from_time, to_time from `tab{0}` diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 2bae099aa1..2649c49c08 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -1648,7 +1648,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "is_sample_item", + "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, @@ -1657,7 +1657,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Is Sample Item", + "label": "Allow Zero Valuation Rate", "length": 0, "no_copy": 1, "permlevel": 0, @@ -1894,7 +1894,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-03-30 19:34:42.305637", + "modified": "2017-04-05 23:26:03.390869", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 5159625700..91d1791cc7 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "autoname": "hash", @@ -1633,7 +1634,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "is_sample_item", + "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, @@ -1642,7 +1643,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Is Sample Item", + "label": "Allow Zero Valuation Rate", "length": 0, "no_copy": 1, "permlevel": 0, @@ -1968,17 +1969,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-02-20 13:31:59.778417", + "modified": "2017-04-05 23:27:10.785444", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json index 9b808f0435..6d99dc45c2 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "autoname": "hash", @@ -1043,7 +1044,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "is_sample_item", + "fieldname": "allow_zero_valuation_rate", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, @@ -1052,7 +1053,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Is Sample Item", + "label": "Allow Zero Valuation Rate", "length": 0, "no_copy": 1, "permlevel": 0, @@ -1214,17 +1215,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-02-20 13:31:25.233622", + "modified": "2017-04-05 23:25:26.885642", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail", diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 82f9bf1f8b..d5f64b1298 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -259,10 +259,11 @@ class update_entries_after(object): if not self.valuation_rate and actual_qty > 0: self.valuation_rate = sle.incoming_rate - # Get valuation rate from previous SLE or Item master, if item is not a sample item + # Get valuation rate from previous SLE or Item master, if item does not have the + # allow zero valuration rate flag set if not self.valuation_rate and sle.voucher_detail_no: - is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no) - if not is_sample_item: + allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no) + if not allow_zero_valuation_rate: self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, sle.voucher_type, sle.voucher_no, self.allow_zero_rate, currency=erpnext.get_company_currency(sle.company)) @@ -290,8 +291,8 @@ class update_entries_after(object): while qty_to_pop: if not self.stock_queue: # Get valuation rate from last sle if exists or from valuation rate field in item master - is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no) - if not is_sample_item: + allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no) + if not allow_zero_valuation_rate: _rate = get_valuation_rate(sle.item_code, sle.warehouse, sle.voucher_type, sle.voucher_no, self.allow_zero_rate, currency=erpnext.get_company_currency(sle.company)) @@ -344,9 +345,9 @@ class update_entries_after(object): if not self.stock_queue: self.stock_queue.append([0, sle.incoming_rate or sle.outgoing_rate or self.valuation_rate]) - def check_if_sample_item(self, voucher_type, voucher_detail_no): + def check_if_allow_zero_valuation_rate(self, voucher_type, voucher_detail_no): ref_item_dt = voucher_type + (" Detail" if voucher_type == "Stock Entry" else " Item") - return frappe.db.get_value(ref_item_dt, voucher_detail_no, "is_sample_item") + return frappe.db.get_value(ref_item_dt, voucher_detail_no, "allow_zero_valuation_rate") def get_sle_before_datetime(self): """get previous stock ledger entry before current time-bucket""" diff --git a/erpnext/templates/includes/rfq.js b/erpnext/templates/includes/rfq.js index 46357d4348..3b45cbe506 100644 --- a/erpnext/templates/includes/rfq.js +++ b/erpnext/templates/includes/rfq.js @@ -34,7 +34,7 @@ rfq = Class.extend({ me.qty = parseFloat($(this).val()) || 0; me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val()); me.update_qty_rate(); - $(this).val(format_number(me.qty, 2)); + $(this).val(format_number(me.qty, doc.number_format, 2)); }) }, @@ -45,7 +45,7 @@ rfq = Class.extend({ me.rate = parseFloat($(this).val()) || 0; me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val()); me.update_qty_rate(); - $(this).val(format_number(me.rate, 2)); + $(this).val(format_number(me.rate, doc.number_format, 2)); }) },