Merge pull request #7791 from nabinhait/pro_order_stock_qty
Build Qty considering quantity for which bom is created
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
index 68ab3fc..9a93423 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json
@@ -341,9 +341,7 @@
"Post Dated Cheques Paid": {
"account_type": "Payable"
},
- "Staff Payable": {
- "account_type": "Payable"
- },
+ "Staff Payable": {},
"Suppliers Price Protection": {
"account_type": "Payable"
},
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
index c7a8045..b3c7891 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json
@@ -136,7 +136,8 @@
"Accounts Payable": {
"Creditors": {
"account_type": "Payable"
- }
+ },
+ "Payroll Payable": {}
},
"Stock Liabilities": {
"Stock Received But Not Billed": {
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json
index b266914..58a89b5 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json
@@ -265,7 +265,8 @@
"Accounts Payable": {
"Creditors": {
"account_type": "Payable"
- }
+ },
+ "Payroll Payable": {}
},
"Duties and Taxes": {
"Deferred Tax Liabilities-Current": {},
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json
index 961912d..15c2468 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json
@@ -142,7 +142,8 @@
"Accounts Payable": {
"Creditors":{
"account_type": "Payable"
- }
+ },
+ "Payroll Payable": {}
},
"Duties and Taxes": {
"account_type": "Tax",
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
index 5824704..c6495c1 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
@@ -137,7 +137,8 @@
_("Accounts Payable"): {
_("Creditors"): {
"account_type": "Payable"
- }
+ },
+ _("Payroll Payable"): {},
},
_("Stock Liabilities"): {
_("Stock Received But Not Billed"): {
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py
index 9caac07..b8d0ec8 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/asset/asset.py
@@ -81,7 +81,10 @@
frappe.throw(_("Number of Depreciations Booked cannot be greater than Total Number of Depreciations"))
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(nowdate()):
- frappe.msgprint(_("Next Depreciation Date is entered as past date"))
+ frappe.msgprint(_("Next Depreciation Date is entered as past date"), title=_('Warning'), indicator='red')
+
+ if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(self.purchase_date):
+ frappe.throw(_("Next Depreciation Date cannot be before Purchase Date"))
if (flt(self.value_after_depreciation) > flt(self.expected_value_after_useful_life)
and not self.next_depreciation_date):
@@ -242,4 +245,4 @@
"asset_category": asset_category
})
- return ret
\ No newline at end of file
+ return ret
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index cc3f277..88600e8 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -5,6 +5,7 @@
import frappe
from frappe.desk.reportview import get_match_cond, get_filters_cond
from frappe.utils import nowdate
+from collections import defaultdict
# searches for active employees
@@ -348,3 +349,46 @@
'company': filters.get("company", ""),
'txt': "%%%s%%" % frappe.db.escape(txt)
})
+
+
+@frappe.whitelist()
+def warehouse_query(doctype, txt, searchfield, start, page_len, filters):
+ # Should be used when item code is passed in filters.
+ conditions, bin_conditions = [], []
+ filter_dict = get_doctype_wise_filters(filters)
+
+ sub_query = """ select round(`tabBin`.actual_qty, 2) from `tabBin`
+ where `tabBin`.warehouse = `tabWarehouse`.name
+ {bin_conditions} """.format(
+ bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"), bin_conditions))
+
+ response = frappe.db.sql("""select `tabWarehouse`.name,
+ CONCAT_WS(" : ", "Actual Qty", ifnull( ({sub_query}), 0) ) as actual_qty
+ from `tabWarehouse`
+ where
+ `tabWarehouse`.`{key}` like %(txt)s
+ {fcond} {mcond}
+ order by
+ `tabWarehouse`.name desc
+ limit
+ %(start)s, %(page_len)s
+ """.format(
+ sub_query=sub_query,
+ key=frappe.db.escape(searchfield),
+ fcond=get_filters_cond(doctype, filter_dict.get("Warehouse"), conditions),
+ mcond=get_match_cond(doctype)
+ ),
+ {
+ "txt": "%%%s%%" % frappe.db.escape(txt),
+ "start": start,
+ "page_len": page_len
+ })
+ return response
+
+
+def get_doctype_wise_filters(filters):
+ # Helper function to seperate filters doctype_wise
+ filter_dict = defaultdict(list)
+ for row in filters:
+ filter_dict[row[0]].append(row)
+ return filter_dict
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 301dc82..786a36c 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -245,3 +245,15 @@
opp = frappe.get_doc("Opportunity", name)
opp.status = status
opp.save()
+
+def auto_close_opportunity():
+ """ auto close the `Replied` Opportunities after 7 days """
+ auto_close_after_days = frappe.db.get_value("Support Settings", "Support Settings", "close_opportunity_after_days") or 15
+
+ opportunities = frappe.db.sql(""" select name from tabOpportunity where status='Replied' and
+ modified<DATE_SUB(CURDATE(), INTERVAL %s DAY) """, (auto_close_after_days), as_dict=True)
+
+ for opportunity in opportunities:
+ doc = frappe.get_doc("Opportunity", opportunity.get("name"))
+ doc.status = "Closed"
+ doc.save(ignore_permissions=True)
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
index 8eefe7f..efbe95f 100644
--- a/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
+++ b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
@@ -89,3 +89,5 @@
There is also a dedicated button "Transfer Asset" inside the Asset form to track the Asset Movement.
<img class="screenshot" alt="Asset" src="{{docs_base_url}}/assets/img/accounts/asset-movement-using-button.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/en/accounts/multi-currency-accounting.md b/erpnext/docs/user/manual/en/accounts/multi-currency-accounting.md
index 92932b5..4e44490 100644
--- a/erpnext/docs/user/manual/en/accounts/multi-currency-accounting.md
+++ b/erpnext/docs/user/manual/en/accounts/multi-currency-accounting.md
@@ -116,3 +116,5 @@
In Accounts Receivable / Payable report, system shows all the amounts in Party / Account Currency.
<img class="screenshot" alt="Accounts Receivable Report" src="{{docs_base_url}}/assets/img/accounts/multi-currency/accounts-receivable.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/en/accounts/payment-request.md b/erpnext/docs/user/manual/en/accounts/payment-request.md
index 67c812d..30f5b1b 100644
--- a/erpnext/docs/user/manual/en/accounts/payment-request.md
+++ b/erpnext/docs/user/manual/en/accounts/payment-request.md
@@ -25,4 +25,4 @@
##### Request Mail
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-email.png">
-
+{next}
diff --git a/erpnext/docs/user/manual/en/accounts/payments.md b/erpnext/docs/user/manual/en/accounts/payments.md
index 881d366..74da054 100644
--- a/erpnext/docs/user/manual/en/accounts/payments.md
+++ b/erpnext/docs/user/manual/en/accounts/payments.md
@@ -46,3 +46,5 @@
<img class="screenshot" alt="Making Payment" src="{{docs_base_url}}/assets/img/accounts/journal-entry.png">
For more details about journal entry [check here.]({{docs_base_url}}/user/manual/en/accounts/journal-entry)
+
+{next}
diff --git a/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md b/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md
index 770e71a..713fb60 100644
--- a/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md
+++ b/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md
@@ -30,4 +30,6 @@
Failure in creation of recurring invoice could be due to multiple reasons like wrong Email Address mentioned in the Email Notification field in Recurring section etc.
-On receipt of notification, if cause of failure is fixed (like correcting Email Address) within 24 hours, then recurring invoice will be generated automatically. If issue is not fixed within the said time, then document should be created for that month/year manually.
\ No newline at end of file
+On receipt of notification, if cause of failure is fixed (like correcting Email Address) within 24 hours, then recurring invoice will be generated automatically. If issue is not fixed within the said time, then document should be created for that month/year manually.
+
+{next}
diff --git a/erpnext/docs/user/manual/en/setting-up/company-setup.md b/erpnext/docs/user/manual/en/setting-up/company-setup.md
index e73aa25..1a07b86 100644
--- a/erpnext/docs/user/manual/en/setting-up/company-setup.md
+++ b/erpnext/docs/user/manual/en/setting-up/company-setup.md
@@ -3,8 +3,8 @@
depending on the nature of your business activity. If you have more than one
companies, create the setup under the Company Setup page.
-After clicking on Setup, go to Masters and click on Company.
+After clicking on Accounts and click on Company.
-> Setup > Masters > Company > New Company
+> Accounts > Company > New Company
{next}
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 14ea74b..a38ebd2 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -44,7 +44,7 @@
fixtures = ["Web Form"]
-website_generators = ["Item Group", "Item", "Sales Partner", "Job Opening", "Student Admission"]
+website_generators = ["Item Group", "Item", "BOM", "Sales Partner", "Job Opening", "Student Admission"]
website_context = {
"favicon": "/assets/erpnext/images/favicon.png",
@@ -96,6 +96,7 @@
},
{"from_route": "/jobs", "to_route": "Job Opening"},
{"from_route": "/admissions", "to_route": "Student Admission"},
+ {"from_route": "/boms", "to_route": "BOM"}
]
portal_menu_items = [
@@ -164,6 +165,7 @@
"erpnext.stock.reorder_item.reorder_item",
"erpnext.setup.doctype.email_digest.email_digest.send",
"erpnext.support.doctype.issue.issue.auto_close_tickets",
+ "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity",
"erpnext.controllers.accounts_controller.update_invoice_status",
"erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
"erpnext.hr.doctype.employee.employee.send_birthday_reminders",
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.js b/erpnext/hr/doctype/employee_loan/employee_loan.js
index a03dbda..cb9216f 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.js
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.js
@@ -12,6 +12,16 @@
}
};
});
+
+ frm.set_query("interest_income_account", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ "root_type": "Income",
+ "is_group": 0
+ }
+ };
+ });
$.each(["payment_account", "employee_loan_account"], function(i, field) {
frm.set_query(field, function() {
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.json b/erpnext/hr/doctype/employee_loan/employee_loan.json
index 22c7dd6..9e884b3 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.json
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.json
@@ -670,6 +670,34 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "interest_income_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Interest Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "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": "section_break_15",
"fieldtype": "Section Break",
"hidden": 0,
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.js b/erpnext/hr/doctype/process_payroll/process_payroll.js
index 128e533..e1bea62 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.js
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.js
@@ -20,6 +20,21 @@
"company": frm.doc.company
}
}
+ }),
+ frm.set_query("cost_center", function() {
+ return {
+ filters: {
+ "is_group": 0,
+ company: frm.doc.company
+ }
+ }
+ }),
+ frm.set_query("project", function() {
+ return {
+ filters: {
+ company: frm.doc.company
+ }
+ }
})
},
@@ -63,7 +78,7 @@
}
})
}
- }
+ },
})
cur_frm.cscript.display_activity_log = function(msg) {
@@ -108,46 +123,18 @@
});
}
-cur_frm.cscript.make_bank_entry = function(doc,cdt,cdn){
+cur_frm.cscript.make_bank_entry = function(doc, cdt, cdn){
if(doc.company && doc.start_date && doc.end_date){
- return cur_frm.cscript.reference_entry(doc,cdt,cdn);
+ return frappe.call({
+ doc: cur_frm.doc,
+ method: "make_payment_entry",
+ callback: function(r) {
+ if (r.message)
+ var doc = frappe.model.sync(r.message)[0];
+ frappe.set_route("Form", doc.doctype, doc.name);
+ }
+ });
} else {
msgprint(__("Company, From Date and To Date is mandatory"));
}
-}
-
-cur_frm.cscript.reference_entry = function(doc,cdt,cdn){
- var dialog = new frappe.ui.Dialog({
- title: __("Bank Transaction Reference"),
- fields: [
- {
- "label": __("Reference Number"),
- "fieldname": "reference_number",
- "fieldtype": "Data",
- "reqd": 1
- },
- {
- "label": __("Reference Date"),
- "fieldname": "reference_date",
- "fieldtype": "Date",
- "reqd": 1,
- "default": get_today()
- }
- ]
- });
- dialog.set_primary_action(__("Make"), function() {
- args = dialog.get_values();
- if(!args) return;
- dialog.hide();
- return frappe.call({
- doc: cur_frm.doc,
- method: "make_journal_entry",
- args: {"reference_number": args.reference_number, "reference_date":args.reference_date},
- callback: function(r) {
- if (r.message)
- cur_frm.cscript.display_activity_log(r.message);
- }
- });
- });
- dialog.show();
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.json b/erpnext/hr/doctype/process_payroll/process_payroll.json
index 7d84910..2b847b3 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.json
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.json
@@ -20,7 +20,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Select Employees",
@@ -47,7 +46,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -75,7 +73,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Company",
@@ -104,7 +101,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Posting Date",
@@ -134,7 +130,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Payroll Frequency",
@@ -163,7 +158,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -190,7 +184,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Branch",
@@ -218,7 +211,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Department",
@@ -246,7 +238,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Designation",
@@ -274,7 +265,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -301,7 +291,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Salary Slip Based on Timesheet",
@@ -329,7 +318,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Select Payroll Period",
@@ -358,7 +346,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Start Date",
@@ -386,7 +373,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -414,7 +400,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "End Date",
@@ -437,12 +422,120 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "section_break_16",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Accounts",
+ "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": "cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "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": "column_break_18",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Project",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Project",
+ "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": "process_payroll",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Process Payroll",
@@ -470,7 +563,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -498,7 +590,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Create Salary Slip",
@@ -525,7 +616,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -553,7 +643,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Submit Salary Slip",
@@ -580,10 +669,9 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Account",
+ "label": "Payment Entry",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -609,7 +697,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Payment Account",
@@ -640,7 +727,6 @@
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Make Bank Entry",
@@ -667,7 +753,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -693,7 +778,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Activity Log",
@@ -722,7 +806,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-12-14 01:48:22.326326",
+ "modified": "2017-02-08 02:34:59.130475",
"modified_by": "Administrator",
"module": "HR",
"name": "Process Payroll",
@@ -738,7 +822,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -755,5 +838,6 @@
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py
index 7bfde1c..561ddfc 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.py
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.py
@@ -140,7 +140,7 @@
Submit all salary slips based on selected criteria
"""
self.check_permission('write')
-
+ jv_name = ""
ss_list = self.get_sal_slip_list(ss_status=0)
submitted_ss = []
not_submitted_ss = []
@@ -158,10 +158,12 @@
submitted_ss.append(ss_dict)
except frappe.ValidationError:
not_submitted_ss.append(ss_dict)
+ if submitted_ss:
+ jv_name = self.make_accural_jv_entry()
- return self.create_submit_log(submitted_ss, not_submitted_ss)
+ return self.create_submit_log(submitted_ss, not_submitted_ss, jv_name)
- def create_submit_log(self, submitted_ss, not_submitted_ss):
+ def create_submit_log(self, submitted_ss, not_submitted_ss, jv_name):
log = ''
if not submitted_ss and not not_submitted_ss:
log = "No salary slip found to submit for the above selected criteria"
@@ -171,9 +173,12 @@
dict(ss_list=submitted_ss,
keys=sorted(submitted_ss[0].keys()),
title=_('Submitted Salary Slips')))
+ if jv_name:
+ log += "<b>" + _("Accural Journal Entry Submitted") + "</b>\
+ %s" % '<br>''<a href="#Form/Journal Entry/{0}">{0}</a>'.format(jv_name)
if not_submitted_ss:
- log += frappe.render_template(self.get_log_template(),
+ log += frappe.render_template("templates/includes/salary_slip_log.html",
dict(ss_list=not_submitted_ss,
keys=sorted(not_submitted_ss[0].keys()),
title=_('Not Submitted Salary Slips')))
@@ -188,17 +193,23 @@
return ['<a href="#Form/Salary Slip/{0}">{0}</a>'.format(salary_slip)]
- def get_total_salary(self):
+ def get_total_salary_and_loan_amounts(self):
"""
- Get total salary amount from submitted salary slip based on selected criteria
+ Get total loan principal, loan interest and salary amount from submitted salary slip based on selected criteria
"""
cond = self.get_filter_condition()
- tot = frappe.db.sql("""
- select sum(rounded_total) from `tabSalary Slip` t1
+ totals = frappe.db.sql("""
+ select sum(principal_amount) as total_principal_amount, sum(interest_amount) as total_interest_amount,
+ sum(total_loan_repayment) as total_loan_repayment, sum(rounded_total) as rounded_total from `tabSalary Slip` t1
where t1.docstatus = 1 and start_date >= %s and end_date <= %s %s
- """ % ('%s', '%s', cond), (self.start_date, self.end_date))
-
- return flt(tot[0][0])
+ """ % ('%s', '%s', cond), (self.start_date, self.end_date), as_dict=True)
+ return totals[0]
+
+ def get_loan_accounts(self):
+ loan_accounts = frappe.get_all("Employee Loan", fields=["employee_loan_account", "interest_income_account"],
+ filters = {"company": self.company, "docstatus":1})
+ if loan_accounts:
+ return loan_accounts[0]
def get_salary_component_account(self, salary_component):
account = frappe.db.get_value("Salary Component Account",
@@ -233,18 +244,31 @@
account = self.get_salary_component_account(s)
account_dict[account] = account_dict.get(account, 0) + a
return account_dict
+
+ def get_default_payroll_payable_account(self):
+ payroll_payable_account = frappe.db.get_value("Company",
+ {"company_name": self.company}, "default_payroll_payable_account")
+
+ if not payroll_payable_account:
+ frappe.throw(_("Please set Default Payroll Payable Account in Company {0}")
+ .format(self.company))
+
+ return payroll_payable_account
- def make_journal_entry(self, reference_number = None, reference_date = None):
+ def make_accural_jv_entry(self):
self.check_permission('write')
earnings = self.get_salary_component_total(component_type = "earnings") or {}
deductions = self.get_salary_component_total(component_type = "deductions") or {}
+ default_payroll_payable_account = self.get_default_payroll_payable_account()
+ loan_amounts = self.get_total_salary_and_loan_amounts()
+ loan_accounts = self.get_loan_accounts()
jv_name = ""
if earnings or deductions:
journal_entry = frappe.new_doc('Journal Entry')
- journal_entry.voucher_type = 'Bank Entry'
- journal_entry.user_remark = _('Payment of salary from {0} to {1}').format(self.start_date,
+ journal_entry.voucher_type = 'Journal Entry'
+ journal_entry.user_remark = _('Accural Journal Entry for salaries from {0} to {1}').format(self.start_date,
self.end_date)
journal_entry.company = self.company
journal_entry.posting_date = nowdate()
@@ -255,22 +279,36 @@
adjustment_amt = adjustment_amt+amt
account_amt_list.append({
"account": acc,
- "debit_in_account_currency": amt
+ "debit_in_account_currency": amt,
+ "cost_center": self.cost_center,
+ "project": self.project
})
for acc, amt in deductions.items():
adjustment_amt = adjustment_amt-amt
account_amt_list.append({
"account": acc,
- "credit_in_account_currency": amt
+ "credit_in_account_currency": amt,
+ "cost_center": self.cost_center,
+ "project": self.project
})
+ #employee loan
account_amt_list.append({
- "account": self.payment_account,
+ "account": loan_accounts.employee_loan_account,
+ "credit_in_account_currency": loan_amounts.total_principal_amount
+ })
+ account_amt_list.append({
+ "account": loan_accounts.interest_income_account,
+ "credit_in_account_currency": loan_amounts.total_interest_amount,
+ "cost_center": self.cost_center,
+ "project": self.project
+ })
+ adjustment_amt = adjustment_amt-(loan_amounts.total_loan_repayment)
+
+ account_amt_list.append({
+ "account": default_payroll_payable_account,
"credit_in_account_currency": adjustment_amt
})
journal_entry.set("accounts", account_amt_list)
- journal_entry.cheque_no = reference_number
- journal_entry.cheque_date = reference_date
- journal_entry.multi_currency = 1
journal_entry.save()
try:
journal_entry.submit()
@@ -278,15 +316,33 @@
self.update_salary_slip_status(jv_name = jv_name)
except Exception, e:
frappe.msgprint(e)
- return self.create_jv_log(jv_name)
+ return jv_name
+ def make_payment_entry(self):
+ self.check_permission('write')
+ total_salary_amount = self.get_total_salary_and_loan_amounts()
+ default_payroll_payable_account = self.get_default_payroll_payable_account()
- def create_jv_log(self, jv_name):
- log = "<p>" + _("No submitted Salary Slip found") + "</p>"
- if jv_name:
- log = "<b>" + _("Journal Entry Submitted") + "</b>\
- %s" % '<br>''<a href="#Form/Journal Entry/{0}">{0}</a>'.format(jv_name)
- return log
+ if total_salary_amount.rounded_total:
+ journal_entry = frappe.new_doc('Journal Entry')
+ journal_entry.voucher_type = 'Bank Entry'
+ journal_entry.user_remark = _('Payment of salary from {0} to {1}').format(self.start_date,
+ self.end_date)
+ journal_entry.company = self.company
+ journal_entry.posting_date = nowdate()
+
+ account_amt_list = []
+
+ account_amt_list.append({
+ "account": self.payment_account,
+ "credit_in_account_currency": total_salary_amount.rounded_total
+ })
+ account_amt_list.append({
+ "account": default_payroll_payable_account,
+ "debit_in_account_currency": total_salary_amount.rounded_total
+ })
+ journal_entry.set("accounts", account_amt_list)
+ return journal_entry.as_dict()
def update_salary_slip_status(self, jv_name = None):
ss_list = self.get_sal_slip_list(ss_status=1)
diff --git a/erpnext/hr/doctype/process_payroll/test_process_payroll.py b/erpnext/hr/doctype/process_payroll/test_process_payroll.py
index 2eb1c6b..6347a2a 100644
--- a/erpnext/hr/doctype/process_payroll/test_process_payroll.py
+++ b/erpnext/hr/doctype/process_payroll/test_process_payroll.py
@@ -29,7 +29,7 @@
process_payroll.create_salary_slips()
process_payroll.submit_salary_slips()
if process_payroll.get_sal_slip_list(ss_status = 1):
- r = process_payroll.make_journal_entry(reference_number=random_string(10),reference_date=nowdate())
+ r = process_payroll.make_payment_entry()
def get_salary_component_account(sal_comp):
diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/hr/doctype/salary_component/salary_component.js
index 3a2492c..86203ab 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.js
+++ b/erpnext/hr/doctype/salary_component/salary_component.js
@@ -5,13 +5,14 @@
setup: function(frm) {
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
+ var root_types = ["Expense", "Liability"];
return {
filters: {
- "root_type": "Expense",
+ "root_type": ["in", root_types],
"is_group": 0,
"company": d.company
}
}
})
}
-});
+});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_component/salary_component.py b/erpnext/hr/doctype/salary_component/salary_component.py
index 8af7311..c02d952 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.py
+++ b/erpnext/hr/doctype/salary_component/salary_component.py
@@ -21,4 +21,4 @@
frappe.throw(_("Abbreviation cannot have more than 5 characters"))
if frappe.db.sql("select salary_component_abbr from `tabSalary Component` where name!=%s and salary_component_abbr=%s", (self.name, self.salary_component_abbr)):
- frappe.throw(_("Abbreviation already used for another salary component"))
\ No newline at end of file
+ frappe.throw(_("Abbreviation {0} already used for another salary component").format(self.salary_component_abbr))
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 0262259..afff67b 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -38,6 +38,7 @@
refresh: function(frm) {
frm.trigger("toggle_fields")
+ frm.trigger("toggle_reqd_fields")
salary_detail_fields = ['formula', 'abbr']
cur_frm.fields_dict['earnings'].grid.set_column_disp(salary_detail_fields,false);
cur_frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false);
@@ -58,9 +59,9 @@
frm.toggle_display(['payment_days', 'total_working_days', 'leave_without_pay'],
frm.doc.payroll_frequency!="");
}
+
})
-
// Get leave details
//---------------------------------------------------------------------
cur_frm.cscript.start_date = function(doc, dt, dn){
@@ -130,7 +131,7 @@
total_earn += flt(tbl[i].amount);
}
- doc.gross_pay = total_earn + flt(doc.arrear_amount) + flt(doc.leave_encashment_amount);
+ doc.gross_pay = total_earn;
refresh_many(['amount','gross_pay']);
}
@@ -161,17 +162,6 @@
refresh_many(['net_pay', 'rounded_total']);
}
-// trigger on arrear
-// ------------------------------------------------------------------------
-cur_frm.cscript.arrear_amount = function(doc,dt,dn){
- calculate_earning_total(doc, dt, dn);
- calculate_net_pay(doc, dt, dn);
-}
-
-// trigger on encashed amount
-// ------------------------------------------------------------------------
-cur_frm.cscript.leave_encashment_amount = cur_frm.cscript.arrear_amount;
-
// validate
// ------------------------------------------------------------------------
cur_frm.cscript.validate = function(doc, dt, dn) {
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index 89dc628..e076c0f 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -291,7 +291,7 @@
"collapsible": 0,
"columns": 0,
"fieldname": "journal_entry",
- "fieldtype": "Data",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -302,6 +302,7 @@
"label": "Journal Entry",
"length": 0,
"no_copy": 0,
+ "options": "Journal Entry",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -1158,68 +1159,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "arrear_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": "Arrear Amount",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "arrear_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "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,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "leave_encashment_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": "Leave Encashment Amount",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "encashment_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "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,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "gross_pay",
"fieldtype": "Currency",
"hidden": 0,
@@ -1256,8 +1195,6 @@
"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,
@@ -1309,7 +1246,35 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "total_loan_repayment",
"fieldname": "loan_repayment",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Loan repayment",
+ "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": "principal_amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1318,9 +1283,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Loan Repayment",
+ "label": "Principal Amount",
"length": 0,
"no_copy": 0,
+ "options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -1338,7 +1304,122 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "description": "Gross Pay + Arrear Amount + Encashment Amount - Total Deduction - Loan Repayment",
+ "fieldname": "interest_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Interest Amount",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_48",
+ "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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_loan_repayment",
+ "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": "Total Loan Repayment",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company:company:default_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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "net_pay_info",
+ "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": "net pay info",
+ "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,
+ "description": "Gross Pay - Total Deduction - Loan Repayment",
"fieldname": "net_pay",
"fieldtype": "Currency",
"hidden": 0,
@@ -1367,6 +1448,32 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
@@ -1399,6 +1506,32 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "section_break_55",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"description": "Net Pay (in words) will be visible once you save the Salary Slip.",
"fieldname": "total_in_words",
"fieldtype": "Data",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 9d57a5d..55314ac 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -324,25 +324,28 @@
disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total"))
- self.gross_pay = flt(self.arrear_amount) + flt(self.leave_encashment_amount)
self.total_deduction = 0
+ self.gross_pay = 0
self.sum_components('earnings', 'gross_pay')
self.sum_components('deductions', 'total_deduction')
self.set_loan_repayment()
- self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.loan_repayment))
+ self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment))
self.rounded_total = rounded(self.net_pay,
self.precision("net_pay") if disable_rounded_total else 0)
def set_loan_repayment(self):
- employee_loan = frappe.db.sql("""select sum(total_payment) as loan_repayment from `tabRepayment Schedule`
+ employee_loan = frappe.db.sql("""select sum(principal_amount) as principal_amount, sum(interest_amount) as interest_amount,
+ sum(total_payment) as total_loan_repayment from `tabRepayment Schedule`
where payment_date between %s and %s and parent in (select name from `tabEmployee Loan`
where employee = %s and repay_from_salary = 1 and docstatus = 1)""",
- (self.start_date, self.end_date, self.employee), as_dict=True)
+ (self.start_date, self.end_date, self.employee), as_dict=True)
if employee_loan:
- self.loan_repayment = employee_loan[0].loan_repayment
+ self.principal_amount = employee_loan[0].principal_amount
+ self.interest_amount = employee_loan[0].interest_amount
+ self.total_loan_repayment = employee_loan[0].total_loan_repayment
def on_submit(self):
if self.net_pay < 0:
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py
index 9999f1e..cf76ee7 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py
@@ -14,7 +14,7 @@
class TestSalarySlip(unittest.TestCase):
def setUp(self):
- make_earning_salary_component(["Basic Salary", "Allowance", "HRA"])
+ make_earning_salary_component(["Basic Salary", "Special Allowance", "HRA"])
make_deduction_salary_component(["Professional Tax", "TDS"])
for dt in ["Leave Application", "Leave Allocation", "Salary Slip"]:
@@ -143,8 +143,8 @@
ss = frappe.get_doc("Salary Slip",
self.make_employee_salary_slip("test_employee@salary.com", "Monthly"))
ss.submit()
- self.assertEquals(ss.loan_repayment, 582)
- self.assertEquals(ss.net_pay, (flt(ss.gross_pay) - (flt(ss.total_deduction) + flt(ss.loan_repayment))))
+ self.assertEquals(ss.total_loan_repayment, 582)
+ self.assertEquals(ss.net_pay, (flt(ss.gross_pay) - (flt(ss.total_deduction) + flt(ss.total_loan_repayment))))
def test_payroll_frequency(self):
fiscal_year = get_fiscal_year(nowdate(), company="_Test Company")[0]
@@ -322,8 +322,8 @@
"idx": 3
},
{
- "salary_component": 'Allowance',
- "abbr":'A',
+ "salary_component": 'Special Allowance',
+ "abbr":'SA',
"condition": 'H < 10000',
"formula": 'BS*.5',
"idx": 4
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.py b/erpnext/hr/doctype/salary_structure/test_salary_structure.py
index 36e50d3..665f8a8 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.py
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.py
@@ -17,7 +17,7 @@
def setUp(self):
self.make_holiday_list()
frappe.db.set_value("Company", erpnext.get_default_company(), "default_holiday_list", "Salary Structure Test Holiday List")
- make_earning_salary_component(["Basic Salary", "Allowance", "HRA"])
+ make_earning_salary_component(["Basic Salary", "Special Allowance", "HRA"])
make_deduction_salary_component(["Professional Tax", "TDS"])
make_employee("test_employee@salary.com")
make_employee("test_employee_2@salary.com")
@@ -139,8 +139,8 @@
"idx": 3
},
{
- "salary_component": 'Allowance',
- "abbr":'A',
+ "salary_component": 'Special Allowance',
+ "abbr":'SA',
"condition": 'H < 10000',
"formula": 'BS*.5',
"idx": 4
diff --git a/erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json b/erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json
index 0c38d45..cb4003a 100644
--- a/erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json
+++ b/erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json
@@ -6,7 +6,7 @@
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
- "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"HTML\", \"options\": \" <h3 style=\\\"text-align: right;\\\"><span style=\\\"line-height: 1.42857;\\\">{{doc.name}}</span></h3>\\n<div>\\n <hr style=\\\"text-align: center;\\\">\\n</div> \"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"employee\"}, {\"print_hide\": 0, \"fieldname\": \"company\"}, {\"print_hide\": 0, \"fieldname\": \"employee_name\"}, {\"print_hide\": 0, \"fieldname\": \"department\"}, {\"print_hide\": 0, \"fieldname\": \"designation\"}, {\"print_hide\": 0, \"fieldname\": \"branch\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"start_date\"}, {\"print_hide\": 0, \"fieldname\": \"end_date\"}, {\"print_hide\": 0, \"fieldname\": \"total_working_days\"}, {\"print_hide\": 0, \"fieldname\": \"leave_without_pay\"}, {\"print_hide\": 0, \"fieldname\": \"payment_days\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_lwp\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"earnings\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_lwp\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"deductions\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"arrear_amount\"}, {\"print_hide\": 0, \"fieldname\": \"leave_encashment_amount\"}, {\"print_hide\": 0, \"fieldname\": \"gross_pay\"}, {\"print_hide\": 0, \"fieldname\": \"total_deduction\"}, {\"print_hide\": 0, \"fieldname\": \"net_pay\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\"}, {\"print_hide\": 0, \"fieldname\": \"total_in_words\"}]",
+ "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"HTML\", \"options\": \" <h3 style=\\\"text-align: right;\\\"><span style=\\\"line-height: 1.42857;\\\">{{doc.name}}</span></h3>\\n<div>\\n <hr style=\\\"text-align: center;\\\">\\n</div> \"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"employee\"}, {\"print_hide\": 0, \"fieldname\": \"company\"}, {\"print_hide\": 0, \"fieldname\": \"employee_name\"}, {\"print_hide\": 0, \"fieldname\": \"department\"}, {\"print_hide\": 0, \"fieldname\": \"designation\"}, {\"print_hide\": 0, \"fieldname\": \"branch\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"start_date\"}, {\"print_hide\": 0, \"fieldname\": \"end_date\"}, {\"print_hide\": 0, \"fieldname\": \"total_working_days\"}, {\"print_hide\": 0, \"fieldname\": \"leave_without_pay\"}, {\"print_hide\": 0, \"fieldname\": \"payment_days\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_lwp\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"earnings\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_lwp\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"deductions\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"gross_pay\"}, {\"print_hide\": 0, \"fieldname\": \"total_deduction\"}, {\"print_hide\": 0, \"fieldname\": \"net_pay\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\"}, {\"print_hide\": 0, \"fieldname\": \"total_in_words\"}]",
"idx": 0,
"modified": "2016-08-22 00:21:42.600548",
"modified_by": "Administrator",
diff --git a/erpnext/hr/report/salary_register/salary_register.py b/erpnext/hr/report/salary_register/salary_register.py
index 1e36b92..88f6f47 100644
--- a/erpnext/hr/report/salary_register/salary_register.py
+++ b/erpnext/hr/report/salary_register/salary_register.py
@@ -22,7 +22,7 @@
for e in earning_types:
row.append(ss_earning_map.get(ss.name, {}).get(e))
- row += [ss.arrear_amount, ss.leave_encashment_amount, ss.gross_pay]
+ row += [ss.gross_pay]
for d in ded_types:
row.append(ss_ded_map.get(ss.name, {}).get(d))
@@ -50,8 +50,7 @@
salary_components[_(component.type)].append(component.salary_component)
columns = columns + [(e + ":Currency:120") for e in salary_components[_("Earning")]] + \
- [ _("Arrear Amount") + ":Currency:120", _("Leave Encashment Amount") + ":Currency:150",
- _("Gross Pay") + ":Currency:120"] + [(d + ":Currency:120") for d in salary_components[_("Deduction")]] + \
+ [_("Gross Pay") + ":Currency:120"] + [(d + ":Currency:120") for d in salary_components[_("Deduction")]] + \
[_("Total Deduction") + ":Currency:120", _("Net Pay") + ":Currency:120"]
return columns, salary_components[_("Earning")], salary_components[_("Deduction")]
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 45cd268..28d012f 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -201,7 +201,7 @@
"fieldname": "with_operations",
"fieldtype": "Check",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -1302,6 +1302,276 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "website_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": "Website",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "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,
+ "depends_on": "",
+ "fieldname": "show_in_website",
+ "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": "Show in Website",
+ "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": "route",
+ "fieldtype": "Small Text",
+ "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": "Route",
+ "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,
+ "depends_on": "show_in_website",
+ "description": "Item Image (if not slideshow)",
+ "fieldname": "website_image",
+ "fieldtype": "Attach 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",
+ "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": "thumbnail",
+ "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": "Thumbnail",
+ "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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "website_items",
+ "columns": 0,
+ "depends_on": "show_in_website",
+ "fieldname": "sb_web_spec",
+ "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": "Website Specifications",
+ "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,
+ "depends_on": "show_in_website",
+ "fieldname": "web_long_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": "Website 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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "show_in_website",
+ "fieldname": "show_items",
+ "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": "Show Items",
+ "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,
+ "depends_on": "eval:(doc.show_in_website && doc.with_operations)",
+ "fieldname": "show_operations",
+ "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": "Show Operations",
+ "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
}
],
"hide_heading": 0,
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 8102057..a3d3da3 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -6,7 +6,7 @@
from frappe.utils import cint, cstr, flt
from frappe import _
from erpnext.setup.utils import get_exchange_rate
-from frappe.model.document import Document
+from frappe.website.website_generator import WebsiteGenerator
from operator import itemgetter
@@ -14,7 +14,13 @@
"items": "templates/form_grid/item_grid.html"
}
-class BOM(Document):
+class BOM(WebsiteGenerator):
+ website = frappe._dict(
+ # page_title_field = "item_name",
+ condition_field = "show_in_website",
+ template = "templates/generators/bom.html"
+ )
+
def autoname(self):
names = frappe.db.sql_list("""select name from `tabBOM` where item=%s""", self.item)
@@ -34,6 +40,8 @@
self.name = 'BOM-' + self.item + ('-%.3i' % idx)
def validate(self):
+ # if not self.route:
+ self.route = frappe.scrub(self.name).replace('_', '-')
self.clear_operations()
self.validate_main_item()
self.validate_currency()
@@ -47,6 +55,9 @@
self.validate_operations()
self.calculate_cost()
+ def get_context(self, context):
+ context.parents = [{'name': 'boms', 'title': _('All BOMs') }]
+
def on_update(self):
self.check_recursion()
self.update_exploded_items()
@@ -428,6 +439,10 @@
if not d.description:
d.description = frappe.db.get_value('Operation', d.operation, 'description')
+def get_list_context(context):
+ context.title = _("Bill of Materials")
+ # context.introduction = _('Boms')
+
def get_bom_items_as_dict(bom, company, qty=1, fetch_exploded=1, fetch_scrap_items=0):
item_dict = {}
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
index 50f1c6c..b846bc6 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
@@ -21,8 +21,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Operation",
"length": 0,
"no_copy": 0,
@@ -33,6 +33,7 @@
"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,
@@ -49,8 +50,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Workstation",
"length": 0,
"no_copy": 0,
@@ -61,6 +62,7 @@
"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,
@@ -77,8 +79,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@@ -88,6 +90,7 @@
"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,
@@ -104,14 +107,15 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 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,
@@ -128,8 +132,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Hour Rate",
"length": 0,
"no_copy": 0,
@@ -140,6 +144,7 @@
"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,
@@ -157,8 +162,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Operation Time ",
"length": 0,
"no_copy": 0,
@@ -169,6 +174,7 @@
"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,
@@ -185,8 +191,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Operating Cost",
"length": 0,
"no_copy": 0,
@@ -197,6 +203,7 @@
"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,
@@ -213,8 +220,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Base Hour Rate(Company Currency)",
"length": 0,
"no_copy": 0,
@@ -224,6 +231,7 @@
"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,
@@ -241,8 +249,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Operating Cost(Company Currency)",
"length": 0,
"no_copy": 0,
@@ -252,6 +260,34 @@
"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,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "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,
@@ -269,7 +305,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-10-21 18:38:14.700637",
+ "modified": "2017-02-10 07:12:41.255544",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Operation",
@@ -278,5 +314,6 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_website_item/__init__.py b/erpnext/manufacturing/doctype/bom_website_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_item/__init__.py
diff --git a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json
new file mode 100644
index 0000000..7df728b
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json
@@ -0,0 +1,176 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-02-10 05:36:19.757356",
+ "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": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "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": 1,
+ "set_only_once": 0,
+ "unique": 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_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Workstation",
+ "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": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item 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,
+ "unique": 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_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Qty",
+ "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": "website_image",
+ "fieldtype": "Attach",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "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
+ }
+ ],
+ "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,
+ "modified": "2017-02-12 12:48:56.949861",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Website Item",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py
new file mode 100644
index 0000000..4088a7f
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, 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 BOMWebsiteItem(Document):
+ pass
diff --git a/erpnext/manufacturing/doctype/bom_website_operation/__init__.py b/erpnext/manufacturing/doctype/bom_website_operation/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_operation/__init__.py
diff --git a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json
new file mode 100644
index 0000000..8f28dd7
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json
@@ -0,0 +1,176 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-02-10 05:27:16.031403",
+ "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": "operation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "workstation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Workstation",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Workstation",
+ "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": "time_in_mins",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Operation Time",
+ "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": "website_image",
+ "fieldtype": "Attach",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "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": "thumbnail",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Thumbnail",
+ "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
+ }
+ ],
+ "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,
+ "modified": "2017-02-12 16:32:44.316447",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Website Operation",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py
new file mode 100644
index 0000000..bcc5dda
--- /dev/null
+++ b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, 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 BOMWebsiteOperation(Document):
+ pass
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index d4ba119..6fff4ce 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -371,4 +371,6 @@
erpnext.patches.v7_2.update_abbr_in_salary_slips
erpnext.patches.v7_2.rename_evaluation_criteria
erpnext.patches.v7_2.update_party_type
+erpnext.patches.v7_2.setup_auto_close_settings
erpnext.patches.v7_2.empty_supplied_items_for_non_subcontracted
+erpnext.patches.v7_2.arrear_leave_encashment_as_salary_component
diff --git a/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
new file mode 100644
index 0000000..0e5dab3
--- /dev/null
+++ b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
@@ -0,0 +1,32 @@
+import frappe
+
+def execute():
+ frappe.reload_doctype('Salary Slip', 'Salary Component')
+ salary_components = ['Arrear', 'Leave Encashment']
+ for salary_component in salary_components:
+ if not frappe.db.exists('Salary Component', salary_component):
+ sal_comp = frappe.get_doc({
+ "doctype": "Salary Component",
+ "salary_component": salary_component,
+ "type": "Earning"
+ }).insert()
+
+ salary_slips = frappe.db.sql("""select name, arrear_amount, leave_encashment_amount from `tabSalary Slip`
+ where docstatus !=2 and (arrear_amount > 0 or leave_encashment_amount > 0)""", as_dict=True)
+
+ for salary_slip in salary_slips:
+ doc = frappe.get_doc('Salary Slip', salary_slip.name)
+
+ if salary_slip.get("arrear_amount") > 0:
+ r = doc.append('earnings', {
+ 'salary_component': 'Arrear',
+ 'amount': salary_slip.arrear_amount
+ })
+ r.db_update()
+
+ if salary_slip.get("leave_encashment_amount") > 0:
+ r = doc.append('earnings', {
+ 'salary_component': 'Leave Encashment',
+ 'amount': salary_slip.leave_encashment_amount
+ })
+ r.db_update()
\ No newline at end of file
diff --git a/erpnext/patches/v7_2/setup_auto_close_settings.py b/erpnext/patches/v7_2/setup_auto_close_settings.py
new file mode 100644
index 0000000..4eef2b9
--- /dev/null
+++ b/erpnext/patches/v7_2/setup_auto_close_settings.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ # update the selling settings and set the close_opportunity_after_days
+ frappe.reload_doc("selling", "doctype", "selling_settings")
+ frappe.db.set_value("Selling Settings", "Selling Settings", "close_opportunity_after_days", 15)
+
+ # Auto close Replied opportunity
+ frappe.db.sql("""update `tabOpportunity` set status='Closed' where status='Replied'
+ and date_sub(curdate(), interval 15 Day)>modified""")
+
+ # create Support Settings doctype and update close_issue_after_days
+ frappe.reload_doc("support", "doctype", "support_settings")
+ frappe.db.set_value("Support Settings", "Support Settings", "close_issue_after_days", 7)
\ No newline at end of file
diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css
index 1617ea7..4f41937 100644
--- a/erpnext/public/css/website.css
+++ b/erpnext/public/css/website.css
@@ -250,3 +250,24 @@
.product-image-wrapper {
padding-bottom: 40px;
}
+.duration-bar {
+ display: inline-block;
+ color: white;
+ background: #8FD288;
+ padding: 2px;
+}
+.duration-invisible {
+ visibility: hidden;
+}
+.duration-value {
+ float: right;
+}
+.bar-outer-text {
+ color: #8FD288;
+ background: none;
+ float: none;
+ border: none;
+}
+.bom-spec {
+ margin-bottom: 20px;
+}
\ No newline at end of file
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index f3167bb..bf7143a 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -133,3 +133,19 @@
set_query(df.options, df.fieldname);
});
}
+
+/* if item code is selected in child table
+ then list down warehouses with its quantity
+ else apply default filters.
+*/
+erpnext.queries.setup_warehouse_query = function(frm){
+ frm.set_query('warehouse', 'items', function(doc, cdt, cdn) {
+ var row = locals[cdt][cdn];
+ var filters = erpnext.queries.warehouse(frm.doc);
+ if(row.item_code){
+ $.extend(filters, {"query":"erpnext.controllers.queries.warehouse_query"});
+ filters["filters"].push(["Bin", "item_code", "=", row.item_code]);
+ }
+ return filters
+ });
+}
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index a1d200f..35d0b42 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -129,7 +129,7 @@
if(frm.doc["contact_person"]) {
frappe.call({
- method: "erpnext.utilities.doctype.contact.contact.get_contact_details",
+ method: "frappe.email.doctype.contact.contact.get_contact_details",
args: {contact: frm.doc.contact_person },
callback: function(r) {
if(r.message)
diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less
index a645f28..b733dab 100644
--- a/erpnext/public/less/website.less
+++ b/erpnext/public/less/website.less
@@ -320,4 +320,30 @@
.product-image-wrapper {
padding-bottom: 40px;
+}
+
+.duration-bar {
+ display: inline-block;
+ color: white;
+ background: #8FD288;
+ padding: 3px;
+}
+
+.duration-invisible {
+ visibility: hidden;
+}
+
+.duration-value {
+ float: right;
+}
+
+.bar-outer-text {
+ color: #8FD288;
+ background: none;
+ float: none;
+ border: none;
+}
+
+.bom-spec {
+ margin-bottom: 20px;
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index f01e484..8130ce8 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -24,6 +24,8 @@
// formatter for material request item
frm.set_indicator_formatter('item_code',
function(doc) { return (doc.qty<=doc.delivered_qty) ? "green" : "orange" })
+
+ erpnext.queries.setup_warehouse_query(frm);
}
});
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.json b/erpnext/selling/doctype/selling_settings/selling_settings.json
index f1bfe95..11b83c6 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.json
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.json
@@ -24,7 +24,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Customer Naming By",
"length": 0,
"no_copy": 0,
@@ -33,6 +35,7 @@
"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,
@@ -50,7 +53,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Campaign Naming By",
"length": 0,
"no_copy": 0,
@@ -59,6 +64,7 @@
"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,
@@ -77,7 +83,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Default Customer Group",
"length": 0,
"no_copy": 0,
@@ -86,6 +94,7 @@
"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,
@@ -104,7 +113,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Default Territory",
"length": 0,
"no_copy": 0,
@@ -113,6 +124,7 @@
"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,
@@ -130,7 +142,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Default Price List",
"length": 0,
"no_copy": 0,
@@ -139,6 +153,38 @@
"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,
+ "default": "15",
+ "description": "Auto close Opportunity after 15 days",
+ "fieldname": "close_opportunity_after_days",
+ "fieldtype": "Int",
+ "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": "Close Opportunity After Days",
+ "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,
@@ -156,13 +202,16 @@
"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,
@@ -180,7 +229,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Sales Order Required",
"length": 0,
"no_copy": 0,
@@ -189,6 +240,7 @@
"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,
@@ -206,7 +258,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Delivery Note Required",
"length": 0,
"no_copy": 0,
@@ -215,6 +269,7 @@
"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,
@@ -232,7 +287,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Maintain Same Rate Throughout Sales Cycle",
"length": 0,
"no_copy": 0,
@@ -240,6 +297,7 @@
"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,
@@ -257,7 +315,9 @@
"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 user to edit Price List Rate in transactions",
"length": 0,
"no_copy": 0,
@@ -265,6 +325,7 @@
"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,
@@ -282,7 +343,9 @@
"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 Item to be added multiple times in a transaction",
"length": 0,
"no_copy": 0,
@@ -291,6 +354,7 @@
"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,
@@ -308,7 +372,9 @@
"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 multiple Sales Orders against a Customer's Purchase Order",
"length": 0,
"no_copy": 0,
@@ -317,6 +383,7 @@
"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,
@@ -334,7 +401,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Validate Selling Price for Item against Purchase Rate or Valuation Rate",
"length": 0,
"no_copy": 0,
@@ -343,6 +412,7 @@
"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,
@@ -361,7 +431,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-10-20 08:17:45.621151",
+ "modified": "2017-02-17 13:06:03.520385",
"modified_by": "Administrator",
"module": "Selling",
"name": "Selling Settings",
@@ -377,7 +447,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -392,7 +461,9 @@
"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
}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 5dd8ceb..0d8b41f 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -5,17 +5,6 @@
frappe.ui.form.on("Company", {
setup: function(frm) {
- frm.fields_dict['default_payable_account'].get_query = function() {
- return{
- filters: {
- "root_type": "Liability",
- "account_type": "Payable"
- }
- }
- }
- },
-
- onload: function(frm) {
erpnext.company.setup_queries(frm);
},
@@ -146,6 +135,7 @@
["default_payable_account", {"account_type": "Payable"}],
["default_expense_account", {"root_type": "Expense"}],
["default_income_account", {"root_type": "Income"}],
+ ["default_payroll_payable_account", {"root_type": "Liability"}],
["round_off_account", {"root_type": "Expense"}],
["write_off_account", {"root_type": "Expense"}],
["exchange_gain_loss_account", {"root_type": "Expense"}],
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 1e988aa..46acbc1 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -821,6 +821,35 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "default_payroll_payable_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Payroll Payable Account",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Account",
+ "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": "round_off_cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -976,6 +1005,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
+
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Credit Days Based On",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 93f02f8..dd7bca9 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -50,7 +50,7 @@
def validate_default_accounts(self):
for field in ["default_bank_account", "default_cash_account", "default_receivable_account", "default_payable_account",
"default_expense_account", "default_income_account", "stock_received_but_not_billed",
- "stock_adjustment_account", "expenses_included_in_valuation"]:
+ "stock_adjustment_account", "expenses_included_in_valuation", "default_payroll_payable_account"]:
if self.get(field):
for_company = frappe.db.get_value("Account", self.get(field), "company")
if for_company != self.name:
diff --git a/erpnext/setup/doctype/company/fixtures/india/__init__.py b/erpnext/setup/doctype/company/fixtures/india/__init__.py
index 0f4bd4f..2cf43c9 100644
--- a/erpnext/setup/doctype/company/fixtures/india/__init__.py
+++ b/erpnext/setup/doctype/company/fixtures/india/__init__.py
@@ -10,7 +10,9 @@
{'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'},
{'doctype': 'Salary Component', 'salary_component': 'Provident Fund', 'description': 'Provident fund', 'type': 'Deduction'},
{'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance', 'description': 'House Rent Allowance', 'type': 'Earning'},
- {'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'}
+ {'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'},
+ {'doctype': 'Salary Component', 'salary_component': 'Arrear', 'description': 'Arrear', 'type': 'Earning'},
+ {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment', 'description': 'Leave Encashment', 'type': 'Earning'}
]
for d in docs:
diff --git a/erpnext/setup/setup_wizard/install_fixtures.py b/erpnext/setup/setup_wizard/install_fixtures.py
index 5e08203..e6b4208 100644
--- a/erpnext/setup/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/install_fixtures.py
@@ -33,6 +33,9 @@
# salary component
{'doctype': 'Salary Component', 'salary_component': _('Income Tax'), 'description': _('Income Tax'), 'type': 'Deduction'},
{'doctype': 'Salary Component', 'salary_component': _('Basic'), 'description': _('Basic'), 'type': 'Earning'},
+ {'doctype': 'Salary Component', 'salary_component': _('Arrear'), 'description': _('Arrear'), 'type': 'Earning'},
+ {'doctype': 'Salary Component', 'salary_component': _('Leave Encashment'), 'description': _('Leave Encashment'), 'type': 'Earning'},
+
# expense claim type
{'doctype': 'Expense Claim Type', 'name': _('Calls'), 'expense_type': _('Calls')},
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 8f87198..23806d4 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -13,14 +13,7 @@
return (doc.docstatus==1 || doc.qty<=doc.actual_qty) ? "green" : "orange"
})
- frm.set_query("warehouse", "items", function() {
- return {
- filters: [
- ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
- ["Warehouse", "is_group", "=", 0]
- ]
- }
- })
+ erpnext.queries.setup_warehouse_query(frm);
}
});
diff --git a/erpnext/stock/doctype/warehouse/warehouse.json b/erpnext/stock/doctype/warehouse/warehouse.json
index 7272da1..9beea6c 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.json
+++ b/erpnext/stock/doctype/warehouse/warehouse.json
@@ -807,6 +807,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
+ "search_fields": "",
"show_name_in_global_search": 1,
"sort_order": "DESC",
"title_field": "warehouse_name",
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index 2798f70..a1f8077 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -82,8 +82,10 @@
def auto_close_tickets():
""" auto close the replied support tickets after 7 days """
+ auto_close_after_days = frappe.db.get_value("Support Settings", "Support Settings", "close_issue_after_days") or 7
+
issues = frappe.db.sql(""" select name from tabIssue where status='Replied' and
- modified<DATE_SUB(CURDATE(), INTERVAL 7 DAY) """, as_dict=True)
+ modified<DATE_SUB(CURDATE(), INTERVAL %s DAY) """, (auto_close_after_days), as_dict=True)
for issue in issues:
doc = frappe.get_doc("Issue", issue.get("name"))
diff --git a/erpnext/support/doctype/support_settings/__init__.py b/erpnext/support/doctype/support_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/support/doctype/support_settings/__init__.py
diff --git a/erpnext/support/doctype/support_settings/support_settings.js b/erpnext/support/doctype/support_settings/support_settings.js
new file mode 100644
index 0000000..1d1069d
--- /dev/null
+++ b/erpnext/support/doctype/support_settings/support_settings.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Support Settings', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/support/doctype/support_settings/support_settings.json b/erpnext/support/doctype/support_settings/support_settings.json
new file mode 100644
index 0000000..1ca03c7
--- /dev/null
+++ b/erpnext/support/doctype/support_settings/support_settings.json
@@ -0,0 +1,92 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-02-17 13:07:35.686409",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "7",
+ "description": "Auto close Issue after 7 days",
+ "fieldname": "close_issue_after_days",
+ "fieldtype": "Int",
+ "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": "Close Issue After Days",
+ "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
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 1,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-02-17 13:07:46.049536",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Support 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/support/doctype/support_settings/support_settings.py b/erpnext/support/doctype/support_settings/support_settings.py
new file mode 100644
index 0000000..bb3c53a
--- /dev/null
+++ b/erpnext/support/doctype/support_settings/support_settings.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, 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 SupportSettings(Document):
+ pass
diff --git a/erpnext/templates/generators/bom.html b/erpnext/templates/generators/bom.html
new file mode 100644
index 0000000..84b3aab
--- /dev/null
+++ b/erpnext/templates/generators/bom.html
@@ -0,0 +1,115 @@
+{% extends "templates/web.html" %}
+
+{% block title %} {{ title }} {% endblock %}
+
+{% block breadcrumbs %}
+ {% include "templates/includes/breadcrumbs.html" %}
+{% endblock %}
+
+{% block page_content %}
+{% from "erpnext/templates/includes/macros.html" import product_image %}
+{% from "erpnext/templates/includes/macros.html" import media_image %}
+<div class="bom-content" style="margin-top:20px;">
+ <div class="bom-page-content" itemscope itemtype="http://schema.org/Product">
+ <div class="row">
+ <div class="col-sm-12">
+ <h1 itemprop="name" style="margin-top: 0px;">{{ name }}</h1>
+
+ <p class="text-muted">
+ {{ _("Item") }}: <span itemprop="itemName">{{ item_name }}</span></p>
+ <br>
+
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-4">
+ {{ media_image(website_image, item_name, "product-full-image") }}
+ <br>
+ </div>
+ <div class="col-sm-offset-1 col-sm-4">
+ <p>{{ _("Quantity") }}: <span itemprop="productID">{{ quantity }}</span></p>
+ <br>
+ </div>
+ </div>
+
+ {% if show_items -%}
+ <div class="row items" style="margin-top: 40px">
+ <div class="col-md-12">
+ <h3>{{ _("Items") }}</h3>
+ <hr>
+ {% for d in items -%}
+ <div class="row">
+ <div class="col-sm-4">{{ media_image(d.image, d.item_name, "product-full-image") }}</div>
+ <div class="col-sm-4"><div><b>{{ d.item_name }}</b></div>
+ {% if d.item_name != d.item_code -%}
+ <div class="text-muted">{{ d.item_code }}</div>
+ {%- endif %}
+ <br>
+ {{ d.description }}
+ </div>
+ <div class="col-sm-4">{{ _("Qty") }}: {{ d.qty }}</div>
+ </div>
+ <hr>
+ {%- endfor %}
+ </div>
+ </div>
+ {%- endif %}
+
+ {% if show_operations -%}
+ <div class="row operations" style="margin-top: 40px">
+ <div class="col-md-12">
+ <h3>{{ _("Operations") }}</h3>
+ <hr>
+ {% for d in operations -%}
+ <div class="row">
+ <div class="col-sm-3 bom-spec">{{ media_image(d.image, d.operation, "product-full-image") }}</div>
+ <div class="col-sm-3 bom-spec"><div>{{ d.operation }}</div>
+ <div class="text-muted">{{ d.description }}</div>
+ </div>
+
+ <div class="col-sm-3 bom-spec"><b>{{ _("Workstation") }}</b><br>{{ d.workstation }}</div>
+ <div class="col-sm-3 bom-spec"><b>{{ _("Time(in mins)") }}</b><br><div class="duration"><span class="duration-bar">
+ <span class="duration-value">{{ d.time_in_mins }}</span></span></div></div>
+ </div>
+ <hr>
+ {%- endfor %}
+ </div>
+ </div>
+ {%- endif %}
+
+ <div class="row" style="margin-top: 30px;">
+ <div class="col-sm-12">
+ <br>
+ <div class="h6 text-uppercase">{{ _("Description") }}</div>
+ <div itemprop="description" class="item-desc">
+ {{ web_long_description or _("No description given") }}</div>
+ <br>
+ </div>
+ </div>
+
+ </div>
+</div>
+<script>
+ frappe.ready(function() {
+ var max_width = $(".duration").width() * 0.8;
+ var durations = [];
+ $(".duration .duration-bar").each(function() {
+ durations.push($(this).find(".duration-value").html());
+ });
+ var max_duration = Math.max(...durations);
+ var width_factor = max_width/max_duration;
+
+ $(".duration .duration-bar").each(function() {
+ var duration = $(this).find(".duration-value").html();
+ $(this).width(duration * width_factor);
+ if($(this).width() < $(this).find(".duration-value").width()) {
+ var html = $($(this).html());
+ html.addClass("duration-bar");
+ html.addClass("bar-outer-text");
+ $(this).find(".duration-value").removeClass("duration-value").addClass("duration-invisible");
+ $(this).closest(".duration").append(html);
+ }
+ });
+ })
+</script>
+{% endblock %}
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html
index 675b7af..863d48e 100644
--- a/erpnext/templates/includes/macros.html
+++ b/erpnext/templates/includes/macros.html
@@ -19,3 +19,17 @@
{%- endif %}
</div>
{% endmacro %}
+
+{% macro media_image(website_image, name, css_class="") %}
+ <div class="product-image sidebar-image-wrapper {{ css_class }}">
+ {% if not website_image -%}
+ <div class="sidebar-standard-image"> <div class="standard-image" style="background-color: rgb(250, 251, 252);">{{name}}</div> </div>
+ {%- endif %}
+ {% if website_image -%}
+ <a href="{{ frappe.utils.quoted(website_image) }}">
+ <img itemprop="image" src="{{ frappe.utils.quoted(website_image) | abs_url }}"
+ class="img-responsive img-thumbnail sidebar-image" style="min-height:100%; min-width:100%;">
+ </a>
+ {%- endif %}
+ </div>
+{% endmacro %}
diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html
index b91cd73..750fa38 100644
--- a/erpnext/templates/pages/home.html
+++ b/erpnext/templates/pages/home.html
@@ -18,7 +18,7 @@
<a class="product-link" href="{{ item.route|abs_url }}">
<div class="col-sm-4 col-xs-4 product-image-wrapper">
<div class="product-image-img">
- {{ product_image_square(item.thumbnail or item.image) }}
+ {{ product_image_square(item.thumbnail or item.image) }}
<div class="product-text" itemprop="name">{{ item.item_name }}</div>
</div>
</div>