Merge branch 'develop' into sla_fix
This commit is contained in:
commit
d82175da36
@ -2,20 +2,8 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Employee Benefit Application', {
|
frappe.ui.form.on('Employee Benefit Application', {
|
||||||
setup: function(frm) {
|
|
||||||
if(!frm.doc.employee || !frm.doc.date) {
|
|
||||||
frappe.throw(__("Please select Employee and Date first"));
|
|
||||||
} else {
|
|
||||||
frm.set_query("earning_component", "employee_benefits", function() {
|
|
||||||
return {
|
|
||||||
query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
|
|
||||||
filters: {date: frm.doc.date, employee: frm.doc.employee}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
employee: function(frm) {
|
employee: function(frm) {
|
||||||
|
frm.trigger('set_earning_component');
|
||||||
var method, args;
|
var method, args;
|
||||||
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
||||||
method = "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
|
method = "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
|
||||||
@ -35,6 +23,21 @@ frappe.ui.form.on('Employee Benefit Application', {
|
|||||||
get_max_benefits(frm, method, args);
|
get_max_benefits(frm, method, args);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
date: function(frm) {
|
||||||
|
frm.trigger('set_earning_component');
|
||||||
|
},
|
||||||
|
|
||||||
|
set_earning_component: function(frm) {
|
||||||
|
if(!frm.doc.employee && !frm.doc.date) return;
|
||||||
|
frm.set_query("earning_component", "employee_benefits", function() {
|
||||||
|
return {
|
||||||
|
query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
|
||||||
|
filters: {date: frm.doc.date, employee: frm.doc.employee}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
payroll_period: function(frm) {
|
payroll_period: function(frm) {
|
||||||
var method, args;
|
var method, args;
|
||||||
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
||||||
|
|||||||
@ -103,8 +103,8 @@ class TestTimesheet(unittest.TestCase):
|
|||||||
{
|
{
|
||||||
"billable": 1,
|
"billable": 1,
|
||||||
"activity_type": "_Test Activity Type",
|
"activity_type": "_Test Activity Type",
|
||||||
"from_type": now_datetime(),
|
"from_time": now_datetime(),
|
||||||
"hours": 3,
|
"to_time": now_datetime() + datetime.timedelta(hours=3),
|
||||||
"company": "_Test Company"
|
"company": "_Test Company"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -113,8 +113,8 @@ class TestTimesheet(unittest.TestCase):
|
|||||||
{
|
{
|
||||||
"billable": 1,
|
"billable": 1,
|
||||||
"activity_type": "_Test Activity Type",
|
"activity_type": "_Test Activity Type",
|
||||||
"from_type": now_datetime(),
|
"from_time": now_datetime(),
|
||||||
"hours": 3,
|
"to_time": now_datetime() + datetime.timedelta(hours=3),
|
||||||
"company": "_Test Company"
|
"company": "_Test Company"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@ -29,7 +29,20 @@ frappe.query_reports["HSN-wise-summary of outward supplies"] = {
|
|||||||
"placeholder":"Company GSTIN",
|
"placeholder":"Company GSTIN",
|
||||||
"options": [""],
|
"options": [""],
|
||||||
"width": "80"
|
"width": "80"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"from_date",
|
||||||
|
"label": __("From Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": "80"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"to_date",
|
||||||
|
"label": __("To Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": "80"
|
||||||
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
onload: (report) => {
|
onload: (report) => {
|
||||||
fetch_gstins(report);
|
fetch_gstins(report);
|
||||||
|
|||||||
@ -88,7 +88,9 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
for opts in (("company", " and company=%(company)s"),
|
for opts in (("company", " and company=%(company)s"),
|
||||||
("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s"),
|
("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s"),
|
||||||
("company_gstin", " and company_gstin=%(company_gstin)s")):
|
("company_gstin", " and company_gstin=%(company_gstin)s"),
|
||||||
|
("from_date", " and posting_date >= %(from_date)s"),
|
||||||
|
("to_date", "and posting_date <= %(to_date)s")):
|
||||||
if filters.get(opts[0]):
|
if filters.get(opts[0]):
|
||||||
conditions += opts[1]
|
conditions += opts[1]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user