diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json index e2a68734581..43fd366bb99 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json @@ -72,6 +72,7 @@ "permlevel": 0 }, { + "depends_on": "eval: doc.buying || doc.selling", "fieldname": "applicable_for", "fieldtype": "Select", "label": "Applicable For", @@ -244,7 +245,7 @@ "icon": "icon-gift", "idx": 1, "istable": 0, - "modified": "2015-02-05 05:11:42.530822", + "modified": "2015-02-26 04:26:13.240166", "modified_by": "Administrator", "module": "Accounts", "name": "Pricing Rule", diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index ca85a61ca73..f0a2f08f329 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -48,7 +48,8 @@ class SellingController(StockController): def set_missing_lead_customer_details(self): if getattr(self, "customer", None): from erpnext.accounts.party import _get_party_details - party_details = _get_party_details(self.customer, ignore_permissions=self.flags.ignore_permissions) + party_details = _get_party_details(self.customer, + ignore_permissions=self.flags.ignore_permissions) if not self.meta.get_field("sales_team"): party_details.pop("sales_team") diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 141747fbdaa..de4dc37a7f7 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -157,6 +157,7 @@ def get_item_details(item_code): def make_quotation(source_name, target_doc=None): def set_missing_values(source, target): quotation = frappe.get_doc(target) + quotation.currency = None # set it as default from customer quotation.run_method("set_missing_values") quotation.run_method("calculate_taxes_and_totals") diff --git a/erpnext/hr/doctype/appraisal/test_appraisal.py b/erpnext/hr/doctype/appraisal/test_appraisal.py index 9ec8bda8138..f70dc481c80 100644 --- a/erpnext/hr/doctype/appraisal/test_appraisal.py +++ b/erpnext/hr/doctype/appraisal/test_appraisal.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt from __future__ import unicode_literals diff --git a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py index 3215f3372c5..e3029d980a0 100644 --- a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt from __future__ import unicode_literals diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.js b/erpnext/hr/doctype/salary_manager/salary_manager.js index 825bf26ce8d..834f5d45145 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.js +++ b/erpnext/hr/doctype/salary_manager/salary_manager.js @@ -5,7 +5,7 @@ var display_activity_log = function(msg) { if(!cur_frm.ss_html) cur_frm.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div'); cur_frm.ss_html.innerHTML = - '
'+__("Activity Log:")+'
'+msg+'
'; + '

'+__("Activity Log:")+'

'+msg+'
'; } //Create salary slip @@ -38,25 +38,8 @@ cur_frm.cscript.make_bank_entry = function(doc,cdt,cdn){ } cur_frm.cscript.make_jv = function(doc, dt, dn) { - var call_back = function(r, rt){ - var jv = frappe.model.make_new_doc_and_get_name('Journal Entry'); - jv = locals['Journal Entry'][jv]; - jv.voucher_type = 'Bank Entry'; - jv.user_remark = __('Payment of salary for the month {0} and year {1}', [doc.month, doc.fiscal_year]); - jv.fiscal_year = doc.fiscal_year; - jv.company = doc.company; - jv.posting_date = dateutil.obj_to_str(new Date()); - - // credit to bank - var d1 = frappe.model.add_child(jv, 'Journal Entry Account', 'accounts'); - d1.account = r.message['default_bank_account']; - d1.credit = r.message['amount'] - - // debit to salary account - var d2 = frappe.model.add_child(jv, 'Journal Entry Account', 'accounts'); - d2.debit = r.message['amount'] - - loaddoc('Journal Entry', jv.name); - } - return $c_obj(doc, 'get_acc_details', '', call_back); + return $c_obj(doc, 'make_journal_entry', '', function(r) { + var doc = frappe.model.sync(r.message)[0]; + frappe.set_route("Form", doc.doctype, doc.name); + }); } diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.json b/erpnext/hr/doctype/salary_manager/salary_manager.json index f49832ee125..21560a47c23 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.json +++ b/erpnext/hr/doctype/salary_manager/salary_manager.json @@ -7,16 +7,10 @@ "doctype": "DocType", "document_type": "Other", "fields": [ - { - "fieldname": "document_description", - "fieldtype": "HTML", - "label": "Document Description", - "options": "
You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here
", - "permlevel": 0 - }, { "fieldname": "section_break0", "fieldtype": "Section Break", + "label": "Select Employees", "permlevel": 0 }, { @@ -42,6 +36,19 @@ "options": "Branch", "permlevel": 0 }, + { + "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip", + "fieldname": "send_email", + "fieldtype": "Check", + "label": "Send Email", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, { "fieldname": "department", "fieldtype": "Link", @@ -57,10 +64,11 @@ "permlevel": 0 }, { - "fieldname": "column_break1", - "fieldtype": "Column Break", + "fieldname": "select_payroll_year_and_month", + "fieldtype": "Section Break", + "label": "Select Payroll Year and Month", "permlevel": 0, - "width": "50%" + "precision": "" }, { "fieldname": "fiscal_year", @@ -70,6 +78,12 @@ "permlevel": 0, "reqd": 1 }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, { "fieldname": "month", "fieldtype": "Select", @@ -79,16 +93,11 @@ "reqd": 1 }, { - "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip", - "fieldname": "send_email", - "fieldtype": "Check", - "label": "Send Email", - "permlevel": 0 - }, - { - "fieldname": "section_break1", + "fieldname": "process_payroll", "fieldtype": "Section Break", - "permlevel": 0 + "label": "Process Payroll", + "permlevel": 0, + "precision": "" }, { "fieldname": "column_break2", @@ -144,7 +153,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2015-02-05 05:11:44.876131", + "modified": "2015-02-25 07:21:04.778082", "modified_by": "Administrator", "module": "HR", "name": "Salary Manager", diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index 64258206738..eeb6ac051bf 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, flt +from frappe.utils import cint, flt, nowdate from frappe import _ from frappe.model.document import Document @@ -75,7 +75,6 @@ class SalaryManager(Document): def create_sal_slip(self): """ Creates salary slip for selected employees if already not created - """ emp_list = self.get_emp_list() @@ -99,9 +98,9 @@ class SalaryManager(Document): def create_log(self, ss_list): - log = "No employee for the above selected criteria OR salary slip already created" + log = "

No employee for the above selected criteria OR salary slip already created

" if ss_list: - log = "Created Salary Slip has been created: \ + log = "Salary Slip Created For\

%s" % '
'.join(ss_list) return log @@ -149,7 +148,7 @@ class SalaryManager(Document): if submitted_ss: mail_sent_msg = self.send_email and " (Mail has been sent to the employee)" or "" log = """ - Submitted Salary Slips%s:\ + Salary Slips Submitted %s:\

%s

""" % (mail_sent_msg, '
'.join(submitted_ss)) @@ -179,17 +178,27 @@ class SalaryManager(Document): return flt(tot[0][0]) - def get_acc_details(self): - """ - get default bank account,default salary acount from company - """ - amt = self.get_total_salary() + def make_journal_entry(self, salary_account = None): + amount = self.get_total_salary() default_bank_account = frappe.db.get_value("Company", self.company, "default_bank_account") - if not default_bank_account: - frappe.msgprint(_("You can set Default Bank Account in Company master")) - return { - 'default_bank_account' : default_bank_account, - 'amount' : amt - } + journal_entry = frappe.new_doc('Journal Entry') + journal_entry.voucher_type = 'Bank Entry' + journal_entry.user_remark = _('Payment of salary for the month {0} and year {1}').format(self.month, + self.fiscal_year) + journal_entry.fiscal_year = self.fiscal_year + journal_entry.company = self.company + journal_entry.posting_date = nowdate() + journal_entry.set("accounts", [ + { + "account": salary_account, + "debit": amount + }, + { + "account": default_bank_account, + "credit": amount + }, + ]) + + return journal_entry.as_dict() diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json index 2962c48ab01..bf03b2bf070 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.json +++ b/erpnext/manufacturing/doctype/production_order/production_order.json @@ -351,7 +351,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2015-02-25 01:01:11.550217", + "modified": "2015-02-26 04:03:28.164713", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order", @@ -380,5 +380,6 @@ "report": 1, "role": "Material User" } - ] + ], + "title_field": "production_item" } \ No newline at end of file diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 0566a94716b..a016262119d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -130,3 +130,4 @@ erpnext.patches.v5_0.update_from_bom erpnext.patches.v5_0.update_account_types erpnext.patches.v5_0.update_sms_sender erpnext.patches.v5_0.set_appraisal_remarks +erpnext.patches.v5_0.update_time_log_title diff --git a/erpnext/patches/v5_0/set_appraisal_remarks.py b/erpnext/patches/v5_0/set_appraisal_remarks.py index b71de2fae34..8652c32cf0e 100644 --- a/erpnext/patches/v5_0/set_appraisal_remarks.py +++ b/erpnext/patches/v5_0/set_appraisal_remarks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals diff --git a/erpnext/patches/v5_0/update_journal_entry_title.py b/erpnext/patches/v5_0/update_journal_entry_title.py index d1b1d401852..eaa2be054fe 100644 --- a/erpnext/patches/v5_0/update_journal_entry_title.py +++ b/erpnext/patches/v5_0/update_journal_entry_title.py @@ -1,3 +1,7 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals import frappe def execute(): diff --git a/erpnext/patches/v5_0/update_sms_sender.py b/erpnext/patches/v5_0/update_sms_sender.py index 9dde44d6c69..7ffc703c43b 100644 --- a/erpnext/patches/v5_0/update_sms_sender.py +++ b/erpnext/patches/v5_0/update_sms_sender.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json index 9194f82f147..2316cc8f160 100644 --- a/erpnext/projects/doctype/time_log/time_log.json +++ b/erpnext/projects/doctype/time_log/time_log.json @@ -229,12 +229,20 @@ "permlevel": 1, "print_hide": 1, "read_only": 0 + }, + { + "fieldname": "title", + "fieldtype": "Data", + "hidden": 1, + "label": "Title", + "permlevel": 0, + "precision": "" } ], "icon": "icon-time", "idx": 1, "is_submittable": 1, - "modified": "2015-02-24 03:57:27.652685", + "modified": "2015-02-26 02:22:10.312376", "modified_by": "Administrator", "module": "Projects", "name": "Time Log", @@ -271,5 +279,5 @@ "write": 1 } ], - "title_field": "activity_type" + "title_field": "title" } \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index 8e15efecdef..3e7d667aa6f 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -1,8 +1,6 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -# For license information, please see license.txt - from __future__ import unicode_literals import frappe, json from frappe import _ @@ -19,6 +17,7 @@ from frappe.model.document import Document class TimeLog(Document): def validate(self): self.set_status() + self.set_title() self.validate_overlap() self.validate_timings() self.calculate_total_hours() @@ -53,6 +52,16 @@ class TimeLog(Document): if self.sales_invoice: self.status="Billed" + def set_title(self): + if self.production_order: + self.title = _("{0} for {1}").format(self.operation, self.production_order) + elif self.task: + self.title = _("{0} for {1}").format(self.activity_type, self.task) + elif self.project: + self.title = _("{0} for {1}").format(self.activity_type, self.project) + else: + self.title = self.activity_type + def validate_overlap(self): """Checks if 'Time Log' entries overlap for a user, workstation. """ self.validate_overlap_for("user")