Merge branch 'master' into develop
This commit is contained in:
commit
e97d40806f
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '7.2.3'
|
__version__ = '7.2.4'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -651,7 +651,8 @@ def get_payment_entry(ref_doc, args):
|
|||||||
if args.get("party_account"):
|
if args.get("party_account"):
|
||||||
# Modified to include the posting date for which the exchange rate is required.
|
# Modified to include the posting date for which the exchange rate is required.
|
||||||
# Assumed to be the posting date in the reference document
|
# Assumed to be the posting date in the reference document
|
||||||
exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"),
|
exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"),
|
||||||
|
args.get("party_account"), args.get("party_account_currency"),
|
||||||
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
||||||
|
|
||||||
je = frappe.new_doc("Journal Entry")
|
je = frappe.new_doc("Journal Entry")
|
||||||
@ -686,7 +687,8 @@ def get_payment_entry(ref_doc, args):
|
|||||||
bank_row.update(bank_account)
|
bank_row.update(bank_account)
|
||||||
# Modified to include the posting date for which the exchange rate is required.
|
# Modified to include the posting date for which the exchange rate is required.
|
||||||
# Assumed to be the posting date of the reference date
|
# Assumed to be the posting date of the reference date
|
||||||
bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"],
|
bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date")
|
||||||
|
or ref_doc.get("transaction_date"), bank_account["account"],
|
||||||
bank_account["account_currency"], ref_doc.company)
|
bank_account["account_currency"], ref_doc.company)
|
||||||
|
|
||||||
bank_row.cost_center = cost_center
|
bank_row.cost_center = cost_center
|
||||||
|
@ -4,19 +4,18 @@
|
|||||||
frappe.query_reports["Monthly Salary Register"] = {
|
frappe.query_reports["Monthly Salary Register"] = {
|
||||||
"filters": [
|
"filters": [
|
||||||
{
|
{
|
||||||
"fieldname":"month",
|
"fieldname":"from_date",
|
||||||
"label": __("Month"),
|
"label": __("From"),
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Date",
|
||||||
"options": "\nJan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
|
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||||
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
|
"reqd": 1
|
||||||
"Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"fiscal_year",
|
"fieldname":"to_date",
|
||||||
"label": __("Fiscal Year"),
|
"label": __("To"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Date",
|
||||||
"options": "Fiscal Year",
|
"default": frappe.datetime.get_today(),
|
||||||
"default": sys_defaults.fiscal_year,
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"employee",
|
"fieldname":"employee",
|
||||||
|
@ -18,7 +18,7 @@ def execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
for ss in salary_slips:
|
for ss in salary_slips:
|
||||||
row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
|
row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
|
||||||
ss.company, ss.month, ss.leave_withut_pay, ss.payment_days]
|
ss.company, ss.start_date, ss.end_date, ss.leave_withut_pay, ss.payment_days]
|
||||||
|
|
||||||
for e in earning_types:
|
for e in earning_types:
|
||||||
row.append(ss_earning_map.get(ss.name, {}).get(e))
|
row.append(ss_earning_map.get(ss.name, {}).get(e))
|
||||||
@ -38,7 +38,7 @@ def get_columns(salary_slips):
|
|||||||
columns = [
|
columns = [
|
||||||
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120",
|
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120",
|
||||||
_("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120",
|
_("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120",
|
||||||
_("Company") + ":Link/Company:120", _("Month") + "::80", _("Leave Without Pay") + ":Float:130",
|
_("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:130",
|
||||||
_("Payment Days") + ":Float:120"
|
_("Payment Days") + ":Float:120"
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -60,23 +60,18 @@ def get_columns(salary_slips):
|
|||||||
def get_salary_slips(filters):
|
def get_salary_slips(filters):
|
||||||
conditions, filters = get_conditions(filters)
|
conditions, filters = get_conditions(filters)
|
||||||
salary_slips = frappe.db.sql("""select * from `tabSalary Slip` where docstatus = 1 %s
|
salary_slips = frappe.db.sql("""select * from `tabSalary Slip` where docstatus = 1 %s
|
||||||
order by employee, month""" % conditions, filters, as_dict=1)
|
order by employee""" % conditions, filters, as_dict=1)
|
||||||
|
|
||||||
if not salary_slips:
|
if not salary_slips:
|
||||||
frappe.throw(_("No salary slip found for month {0} and year {1}").format(
|
frappe.throw(_("No salary slip found between {0} and {1}").format(
|
||||||
filters.get("month"), filters.get("fiscal_year")))
|
filters.get("from_date"), filters.get("to_date")))
|
||||||
|
|
||||||
return salary_slips
|
return salary_slips
|
||||||
|
|
||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = ""
|
conditions = ""
|
||||||
if filters.get("month"):
|
if filters.get("from_date"): conditions += " and start_date >= %(from_date)s"
|
||||||
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
|
if filters.get("to_date"): conditions += " and end_date <= %(to_date)s"
|
||||||
"Dec"].index(filters["month"]) + 1
|
|
||||||
filters["month"] = month
|
|
||||||
conditions += " and month = %(month)s"
|
|
||||||
|
|
||||||
if filters.get("fiscal_year"): conditions += " and fiscal_year = %(fiscal_year)s"
|
|
||||||
if filters.get("company"): conditions += " and company = %(company)s"
|
if filters.get("company"): conditions += " and company = %(company)s"
|
||||||
if filters.get("employee"): conditions += " and employee = %(employee)s"
|
if filters.get("employee"): conditions += " and employee = %(employee)s"
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
|
|||||||
return {
|
return {
|
||||||
query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
|
query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
|
||||||
filters: {
|
filters: {
|
||||||
"from": doc.reference_type,
|
"from": doc.reference_type + " Item",
|
||||||
"parent": doc.reference_name
|
"parent": doc.reference_name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user