fix: add df to leaderboard config

This commit is contained in:
prssanna 2019-09-27 15:09:40 +05:30
parent d095acdad5
commit 8f7ed71e9e

View File

@ -5,24 +5,43 @@ import frappe
def get_leaderboards(): def get_leaderboards():
leaderboards = { leaderboards = {
"Customer": { "Customer": {
"fields": ['total_sales_amount', 'total_qty_sold', 'outstanding_amount'], "fields": [
{'fieldname': 'total_sales_amount', 'fieldtype': 'Currency'},
'total_qty_sold',
{'fieldname': 'outstanding_amount', 'fieldtype': 'Currency'}
],
"method": "erpnext.startup.leaderboard.get_all_customers", "method": "erpnext.startup.leaderboard.get_all_customers",
}, },
"Item": { "Item": {
"fields": ["total_sales_amount", "total_qty_sold", "total_purchase_amount", "fields": [
"total_qty_purchased", "available_stock_qty", "available_stock_value"], {'fieldname': 'total_sales_amount', 'fieldtype': 'Currency'},
'total_qty_sold'
{'fieldname': 'total_purchase_amount', 'fieldtype': 'Currency'},
'total_qty_purchased',
'available_stock_qty',
{'fieldname': 'available_stock_value', 'fieldtype': 'Currency'}
],
"method": "erpnext.startup.leaderboard.get_all_items", "method": "erpnext.startup.leaderboard.get_all_items",
}, },
"Supplier": { "Supplier": {
"fields": ["total_purchase_amount", "total_qty_purchased", "outstanding_amount"], "fields": [
{'fieldname': 'total_purchase_amount', 'fieldtype': 'Currency'},
'total_qty_purchased',
{'fieldname': 'outstanding_amount', 'fieldtype': 'Currency'}
],
"method": "erpnext.startup.leaderboard.get_all_suppliers", "method": "erpnext.startup.leaderboard.get_all_suppliers",
}, },
"Sales Partner": { "Sales Partner": {
"fields": ["total_sales_amount", "total_commission"], "fields": [
{'fieldname': 'total_sales_amount', 'fieldtype': 'Currency'},
{'fieldname': 'total_commission', 'fieldtype': 'Currency'}
],
"method": "erpnext.startup.leaderboard.get_all_sales_partner", "method": "erpnext.startup.leaderboard.get_all_sales_partner",
}, },
"Sales Person": { "Sales Person": {
"fields": ["total_sales_amount"], "fields": [
{'fieldname': 'total_sales_amount', 'fieldtype': 'Currency'}
],
"method": "erpnext.startup.leaderboard.get_all_sales_person", "method": "erpnext.startup.leaderboard.get_all_sales_person",
} }
} }