mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
[Reports][Supplier Account Head -> Account] and [Project wise Stock Tracking -> Project]
This commit is contained in:
@@ -72,7 +72,7 @@ cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
// Hide Fields
|
||||
// ------------
|
||||
cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
|
||||
par_flds = ['project_name', 'due_date', 'sales_order_main',
|
||||
par_flds = ['due_date', 'sales_order_main',
|
||||
'delivery_note_main', 'get_items', 'is_opening', 'conversion_rate',
|
||||
'source', 'cancel_reason', 'total_advance', 'gross_profit',
|
||||
'gross_profit_percent', 'get_advances_received',
|
||||
|
||||
@@ -127,6 +127,16 @@ wn.module_page["Accounts"] = [
|
||||
right: true,
|
||||
icon: "icon-table",
|
||||
items: [
|
||||
{
|
||||
"label":wn._("Customer Account Head"),
|
||||
route: "query-report/Customer Account Head",
|
||||
doctype: "Account"
|
||||
},
|
||||
{
|
||||
"label":wn._("Supplier Account Head"),
|
||||
route: "query-report/Supplier Account Head",
|
||||
doctype: "Account"
|
||||
},
|
||||
{
|
||||
"label":wn._("General Ledger"),
|
||||
page: "general-ledger"
|
||||
|
||||
0
accounts/report/supplier_account_head/__init__.py
Normal file
0
accounts/report/supplier_account_head/__init__.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute(filters=None):
|
||||
account_map = get_account_map()
|
||||
columns = get_columns(account_map)
|
||||
data = []
|
||||
suppliers = webnotes.conn.sql("select name from tabSupplier where docstatus < 2")
|
||||
for supplier in suppliers:
|
||||
row = [supplier[0]]
|
||||
for company in sorted(account_map):
|
||||
row.append(account_map[company].get(supplier[0], ''))
|
||||
data.append(row)
|
||||
|
||||
return columns, data
|
||||
|
||||
def get_account_map():
|
||||
accounts = webnotes.conn.sql("""select name, company, master_name
|
||||
from `tabAccount` where master_type = 'Supplier'
|
||||
and ifnull(master_name, '') != '' and docstatus < 2""", as_dict=1)
|
||||
|
||||
account_map = {}
|
||||
for acc in accounts:
|
||||
account_map.setdefault(acc.company, {}).setdefault(acc.master_name, {})
|
||||
account_map[acc.company][acc.master_name] = acc.name
|
||||
|
||||
return account_map
|
||||
|
||||
def get_columns(account_map):
|
||||
columns = ["Supplier:Link/Supplier:120"] + \
|
||||
[(company + ":Link/Account:120") for company in sorted(account_map)]
|
||||
|
||||
return columns
|
||||
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-06-04 12:56:17",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-04 12:56:46",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"ref_doctype": "Account",
|
||||
"report_name": "Supplier Account Head",
|
||||
"report_type": "Script Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "Supplier Account Head"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user