Skip to content

Commit

Permalink
fix: added filters and events
Browse files Browse the repository at this point in the history
  • Loading branch information
MhmdSinanKT committed Oct 17, 2024
1 parent 0859108 commit ab66d1c
Show file tree
Hide file tree
Showing 2 changed files with 294 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,85 @@
// For license information, please see license.txt

frappe.query_reports["Detailed Project Summary"] = {
"filters": [
{
label: __("From Date"),
fieldname: "from_date",
fieldtype: "Date",
default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
reqd: 1
},
{
label: __("To Date"),
fieldname: "to_date",
fieldtype: "Date",
default: frappe.datetime.get_today(),
reqd: 1
},
{
label: __("Department"),
fieldname: "department",
fieldtype: "Link",
options: "Department",
get_query: function(){
return {
filters: {
'is_compliance': 1
}
}
}
},
// {
// label: __("Employee"),
// fieldname: "employee",
// fieldtype: "Link",
// options: "Employee",
// get_query: function(){
// return {
// filters: {
// 'department': frappe.query_report.get_filter_value('department')
// }
// }
// }
// },
],
formatter: function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (data.department_row) {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();
}
return value;
}
filters: [
{
label: __("From Date"),
fieldname: "from_date",
fieldtype: "Date",
default: "Today",
reqd: 1,
},
{
label: __("To Date"),
fieldname: "to_date",
fieldtype: "Date",
default: "Today",
reqd: 1,
},
{
label: __("Department"),
fieldname: "department",
fieldtype: "Link",
options: "Department",
get_query: function () {
return {
filters: {
is_compliance: 1,
},
};
},
},
{
label: __("Customer"),
fieldname: "customer",
fieldtype: "Link",
options: "Customer",
},
{
label: __("Status"),
fieldname: "status",
fieldtype: "Select",
options: "\nOpen\nInvoiced\nPaid\nHold\nOverdue\nCompleted\nCancelled",
},
{
label: __("Reference Type"),
fieldname: "reference_type",
fieldtype: "Select",
options: "\nProject\nEvent",
},
{
label: __("Project"),
fieldname: "project",
fieldtype: "Link",
options: "Project",
},
{
label: __("Invoiced"),
fieldname: "invoiced",
fieldtype: "Select",
options: "\nYes\nNo",
},
// {
// label: __("Employee"),
// fieldname: "employee",
// fieldtype: "Link",
// options: "Employee",
// get_query: function(){
// return {
// filters: {
// 'department': frappe.query_report.get_filter_value('department')
// }
// }
// }
// },
],
formatter: function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (data.department_row) {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();
}
return value;
},
};
Loading

0 comments on commit ab66d1c

Please sign in to comment.