Merge branch 'hotfix'
This commit is contained in:
commit
c3fbc04aab
@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '10.1.22'
|
__version__ = '10.1.23'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -39,18 +39,20 @@ frappe.ui.form.on("Tax Rule", "customer", function(frm) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
|
frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
|
||||||
frappe.call({
|
if(frm.doc.supplier) {
|
||||||
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
|
frappe.call({
|
||||||
args: {
|
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
|
||||||
"party": frm.doc.supplier,
|
args: {
|
||||||
"party_type": "supplier"
|
"party": frm.doc.supplier,
|
||||||
},
|
"party_type": "supplier"
|
||||||
callback: function(r) {
|
},
|
||||||
if(!r.exc) {
|
callback: function(r) {
|
||||||
$.each(r.message, function(k, v) {
|
if(!r.exc) {
|
||||||
frm.set_value(k, v);
|
$.each(r.message, function(k, v) {
|
||||||
});
|
frm.set_value(k, v);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
@ -146,6 +146,7 @@ class PayrollEntry(Document):
|
|||||||
ss_list = self.get_sal_slip_list(ss_status=0)
|
ss_list = self.get_sal_slip_list(ss_status=0)
|
||||||
submitted_ss = []
|
submitted_ss = []
|
||||||
not_submitted_ss = []
|
not_submitted_ss = []
|
||||||
|
frappe.flags.via_payroll_entry = True
|
||||||
for ss in ss_list:
|
for ss in ss_list:
|
||||||
ss_obj = frappe.get_doc("Salary Slip",ss[0])
|
ss_obj = frappe.get_doc("Salary Slip",ss[0])
|
||||||
ss_dict = {}
|
ss_dict = {}
|
||||||
@ -159,7 +160,7 @@ class PayrollEntry(Document):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
ss_obj.submit()
|
ss_obj.submit()
|
||||||
submitted_ss.append(ss_dict)
|
submitted_ss.append(ss_obj)
|
||||||
|
|
||||||
except frappe.ValidationError:
|
except frappe.ValidationError:
|
||||||
not_submitted_ss.append(ss_dict)
|
not_submitted_ss.append(ss_dict)
|
||||||
@ -168,8 +169,15 @@ class PayrollEntry(Document):
|
|||||||
frappe.msgprint(_("Salary Slip submitted for period from {0} to {1}")
|
frappe.msgprint(_("Salary Slip submitted for period from {0} to {1}")
|
||||||
.format(ss_obj.start_date, ss_obj.end_date))
|
.format(ss_obj.start_date, ss_obj.end_date))
|
||||||
|
|
||||||
|
self.email_salary_slip(submitted_ss)
|
||||||
|
|
||||||
return create_submit_log(submitted_ss, not_submitted_ss, jv_name)
|
return create_submit_log(submitted_ss, not_submitted_ss, jv_name)
|
||||||
|
|
||||||
|
def email_salary_slip(self, submitted_ss):
|
||||||
|
if frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee"):
|
||||||
|
for ss in submitted_ss:
|
||||||
|
ss.email_salary_slip()
|
||||||
|
|
||||||
def get_loan_details(self):
|
def get_loan_details(self):
|
||||||
"""
|
"""
|
||||||
Get loan details from submitted salary slip based on selected criteria
|
Get loan details from submitted salary slip based on selected criteria
|
||||||
|
@ -411,7 +411,7 @@ class SalarySlip(TransactionBase):
|
|||||||
else:
|
else:
|
||||||
self.set_status()
|
self.set_status()
|
||||||
self.update_status(self.name)
|
self.update_status(self.name)
|
||||||
if(frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")):
|
if(frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry:
|
||||||
self.email_salary_slip()
|
self.email_salary_slip()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
|
@ -104,7 +104,7 @@ def get_stock_ledger_entries(filters, items):
|
|||||||
item_conditions_sql = ''
|
item_conditions_sql = ''
|
||||||
if items:
|
if items:
|
||||||
item_conditions_sql = ' and sle.item_code in ({})'\
|
item_conditions_sql = ' and sle.item_code in ({})'\
|
||||||
.format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items]))
|
.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items]))
|
||||||
|
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ def get_item_details(items, sle, filters):
|
|||||||
select name, item_name, description, item_group, brand, stock_uom
|
select name, item_name, description, item_group, brand, stock_uom
|
||||||
from `tabItem`
|
from `tabItem`
|
||||||
where name in ({0})
|
where name in ({0})
|
||||||
""".format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items])), as_dict=1):
|
""".format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1):
|
||||||
item_details.setdefault(item.name, item)
|
item_details.setdefault(item.name, item)
|
||||||
|
|
||||||
if filters.get('show_variant_attributes', 0) == 1:
|
if filters.get('show_variant_attributes', 0) == 1:
|
||||||
@ -219,7 +219,7 @@ def get_item_reorder_details(items):
|
|||||||
select parent, warehouse, warehouse_reorder_qty, warehouse_reorder_level
|
select parent, warehouse, warehouse_reorder_qty, warehouse_reorder_level
|
||||||
from `tabItem Reorder`
|
from `tabItem Reorder`
|
||||||
where parent in ({0})
|
where parent in ({0})
|
||||||
""".format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items])), as_dict=1)
|
""".format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])), as_dict=1)
|
||||||
|
|
||||||
return dict((d.parent + d.warehouse, d) for d in item_reorder_details)
|
return dict((d.parent + d.warehouse, d) for d in item_reorder_details)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ def get_stock_ledger_entries(filters, items):
|
|||||||
item_conditions_sql = ''
|
item_conditions_sql = ''
|
||||||
if items:
|
if items:
|
||||||
item_conditions_sql = 'and sle.item_code in ({})'\
|
item_conditions_sql = 'and sle.item_code in ({})'\
|
||||||
.format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items]))
|
.format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items]))
|
||||||
|
|
||||||
return frappe.db.sql("""select concat_ws(" ", posting_date, posting_time) as date,
|
return frappe.db.sql("""select concat_ws(" ", posting_date, posting_time) as date,
|
||||||
item_code, warehouse, actual_qty, qty_after_transaction, incoming_rate, valuation_rate,
|
item_code, warehouse, actual_qty, qty_after_transaction, incoming_rate, valuation_rate,
|
||||||
@ -97,7 +97,7 @@ def get_item_details(items, sl_entries):
|
|||||||
select name, item_name, description, item_group, brand, stock_uom
|
select name, item_name, description, item_group, brand, stock_uom
|
||||||
from `tabItem`
|
from `tabItem`
|
||||||
where name in ({0})
|
where name in ({0})
|
||||||
""".format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items])), as_dict=1):
|
""".format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items])), as_dict=1):
|
||||||
item_details.setdefault(item.name, item)
|
item_details.setdefault(item.name, item)
|
||||||
|
|
||||||
return item_details
|
return item_details
|
||||||
|
Loading…
x
Reference in New Issue
Block a user