[git fixes] salary manager, time log title, notificaitons
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index e2a6873..43fd366 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 ca85a61..f0a2f08 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -48,7 +48,8 @@
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 141747fb..de4dc37 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -157,6 +157,7 @@
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 9ec8bda..f70dc48 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 3215f33..e3029d9 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 825bf26..834f5d4 100644
--- a/erpnext/hr/doctype/salary_manager/salary_manager.js
+++ b/erpnext/hr/doctype/salary_manager/salary_manager.js
@@ -5,7 +5,7 @@
if(!cur_frm.ss_html)
cur_frm.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div');
cur_frm.ss_html.innerHTML =
- '<div class="panel"><div class="panel-heading">'+__("Activity Log:")+'</div>'+msg+'</div>';
+ '<div class="padding"><h4>'+__("Activity Log:")+'</h4>'+msg+'</div>';
}
//Create salary slip
@@ -38,25 +38,8 @@
}
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 f49832e..21560a4 100644
--- a/erpnext/hr/doctype/salary_manager/salary_manager.json
+++ b/erpnext/hr/doctype/salary_manager/salary_manager.json
@@ -8,15 +8,9 @@
"document_type": "Other",
"fields": [
{
- "fieldname": "document_description",
- "fieldtype": "HTML",
- "label": "Document Description",
- "options": "<div class=\"alert alert-info\">You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here</div>",
- "permlevel": 0
- },
- {
"fieldname": "section_break0",
"fieldtype": "Section Break",
+ "label": "Select Employees",
"permlevel": 0
},
{
@@ -43,6 +37,19 @@
"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",
"label": "Department",
@@ -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",
@@ -71,6 +79,12 @@
"reqd": 1
},
{
+ "fieldname": "column_break_11",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "month",
"fieldtype": "Select",
"label": "Month",
@@ -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 6425820..eeb6ac0 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 @@
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 @@
def create_log(self, ss_list):
- log = "<b>No employee for the above selected criteria OR salary slip already created</b>"
+ log = "<p>No employee for the above selected criteria OR salary slip already created</p>"
if ss_list:
- log = "<b>Created Salary Slip has been created: </b>\
+ log = "<b>Salary Slip Created For</b>\
<br><br>%s" % '<br>'.join(ss_list)
return log
@@ -149,7 +148,7 @@
if submitted_ss:
mail_sent_msg = self.send_email and " (Mail has been sent to the employee)" or ""
log = """
- <b>Submitted Salary Slips%s:</b>\
+ <b>Salary Slips Submitted %s:</b>\
<br><br> %s <br><br>
""" % (mail_sent_msg, '<br>'.join(submitted_ss))
@@ -179,17 +178,27 @@
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 2962c48..bf03b2b 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 0566a94..a016262 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -130,3 +130,4 @@
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 b71de2f..8652c32 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 d1b1d40..eaa2be0 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 9dde44d..7ffc703 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 9194f82..2316cc8 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 8e15efe..3e7d667 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 @@
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 @@
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")