45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 | |
| // License: GNU General Public License v3. See license.txt
 | |
| 
 | |
| frappe.query_reports["Accounts Payable"] = {
 | |
| 	"filters": [
 | |
| 		{
 | |
| 			"fieldname":"company",
 | |
| 			"label": __("Company"),
 | |
| 			"fieldtype": "Link",
 | |
| 			"options": "Company",
 | |
| 			"default": frappe.defaults.get_user_default("company")
 | |
| 		},
 | |
| 		{
 | |
| 			"fieldname":"account",
 | |
| 			"label": __("Account"),
 | |
| 			"fieldtype": "Link",
 | |
| 			"options": "Account",
 | |
| 			"get_query": function() {
 | |
| 				var company = frappe.query_report.filters_by_name.company.get_value();
 | |
| 				return {
 | |
| 					"query": "erpnext.controllers.queries.get_account_list",
 | |
| 					"filters": {
 | |
| 						"report_type": "Balance Sheet",
 | |
| 						"company": company,
 | |
| 						"master_type": "Supplier"
 | |
| 					}
 | |
| 				}
 | |
| 			}
 | |
| 		},
 | |
| 		{
 | |
| 			"fieldname":"report_date",
 | |
| 			"label": __("Date"),
 | |
| 			"fieldtype": "Date",
 | |
| 			"default": get_today()
 | |
| 		},
 | |
| 		{
 | |
| 			"fieldname":"ageing_based_on",
 | |
| 			"label": __("Ageing Based On"),
 | |
| 			"fieldtype": "Select",
 | |
| 			"options": 'Posting Date' + NEWLINE + 'Due Date',
 | |
| 			"default": "Posting Date"
 | |
| 		}
 | |
| 	]
 | |
| }
 |