brotherton-erpnext/erpnext/accounts/report/general_ledger/general_ledger.js

93 lines
2.1 KiB
JavaScript
Raw Normal View History

// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
2014-02-14 10:17:51 +00:00
frappe.query_reports["General Ledger"] = {
"filters": [
{
"fieldname":"company",
2014-04-14 10:55:30 +00:00
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
2014-02-14 10:17:51 +00:00
"default": frappe.defaults.get_user_default("company"),
"reqd": 1
},
{
"fieldname":"from_date",
2014-04-14 10:55:30 +00:00
"label": __("From Date"),
"fieldtype": "Date",
2014-02-14 10:17:51 +00:00
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
"reqd": 1,
"width": "60px"
},
{
"fieldname":"to_date",
2014-04-14 10:55:30 +00:00
"label": __("To Date"),
"fieldtype": "Date",
2014-02-14 10:17:51 +00:00
"default": frappe.datetime.get_today(),
"reqd": 1,
"width": "60px"
},
{
"fieldname":"account",
2014-04-14 10:55:30 +00:00
"label": __("Account"),
"fieldtype": "Link",
"options": "Account",
"get_query": function() {
2014-02-14 10:17:51 +00:00
var company = frappe.query_report.filters_by_name.company.get_value();
return {
"doctype": "Account",
"filters": {
"company": company,
}
}
}
},
{
"fieldname":"voucher_no",
2014-04-14 10:55:30 +00:00
"label": __("Voucher No"),
"fieldtype": "Data",
},
{
"fieldtype": "Break",
},
{
"fieldname":"party_type",
"label": __("Party Type"),
2015-07-10 04:41:07 +00:00
"fieldtype": "Select",
2015-07-13 04:53:41 +00:00
"options": ["", "Customer", "Supplier"],
"default": ""
},
{
"fieldname":"party",
"label": __("Party"),
"fieldtype": "Dynamic Link",
"get_options": function() {
var party_type = frappe.query_report.filters_by_name.party_type.get_value();
var party = frappe.query_report.filters_by_name.party.get_value();
if(party && !party_type) {
frappe.throw(__("Please select Party Type first"));
}
return party_type;
}
},
{
"fieldname":"group_by_voucher",
2014-04-14 10:55:30 +00:00
"label": __("Group by Voucher"),
"fieldtype": "Check",
"default": 1
},
{
"fieldname":"group_by_account",
2014-04-14 10:55:30 +00:00
"label": __("Group by Account"),
"fieldtype": "Check",
},
{
"fieldname":"letter_head",
"label": __("Letter Head"),
"fieldtype": "Link",
"options": "Letter Head",
"default": frappe.defaults.get_default("letter_head"),
}
]
}