forked from frappe/erpnext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:webnotes/erpnext
- Loading branch information
Showing
17 changed files
with
247 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
wn.pages['general-ledger'].onload = function(wrapper) { | ||
wn.ui.make_app_page({ | ||
parent: wrapper, | ||
title: 'General Ledger', | ||
single_column: true | ||
}); | ||
|
||
erpnext.general_ledger = new wn.views.GridReport({ | ||
parent: $(wrapper).find('.layout-main'), | ||
appframe: wrapper.appframe, | ||
doctypes: ["Company", "Account", "GL Entry"], | ||
filters: [ | ||
{fieldtype:"Select", label: "Company", options:"Company", | ||
filter: function(val, item) { | ||
return item.company == val || val == "Select Company"; | ||
}}, | ||
{fieldtype:"Select", label: "Account", options:"Account", | ||
filter: function(val, item) { | ||
return item.account == val || val == "Select Account"; | ||
}}, | ||
{fieldtype:"Date", label: "From Date"}, | ||
{fieldtype:"Label", label: "To"}, | ||
{fieldtype:"Date", label: "To Date"}, | ||
{fieldtype:"Button", label: "Refresh"}, | ||
], | ||
setup: function() { | ||
this.setup_filters(); | ||
this.setup_columns(); | ||
}, | ||
setup_filters: function() { | ||
var me = this; | ||
// default filters | ||
this.filter_inputs.company.val(sys_defaults.company); | ||
this.filter_inputs.from_date.val(dateutil.str_to_user(sys_defaults.year_start_date)); | ||
this.filter_inputs.to_date.val(dateutil.str_to_user(sys_defaults.year_end_date)); | ||
this.filter_inputs.refresh.click(function() { me.refresh(); }) | ||
}, | ||
setup_columns: function() { | ||
this.columns = [ | ||
{id: "posting_date", name: "Posting Date", field: "posting_date", width: 100, | ||
formatter: this.date_formatter}, | ||
{id: "account", name: "Account", field: "account", width: 240}, | ||
{id: "debit", name: "Debit", field: "debit", width: 100, | ||
formatter: this.currency_formatter}, | ||
{id: "credit", name: "Credit", field: "credit", width: 100, | ||
formatter: this.currency_formatter}, | ||
]; | ||
}, | ||
prepare_data: function() { | ||
this.prepare_data_view(wn.report_dump.data["GL Entry"]); | ||
}, | ||
dataview_filter: function(item) { | ||
var filters = wn.cur_grid_report.filter_inputs; | ||
for (i in filters) { | ||
var filter = filters[i].get(0); | ||
if(filter.opts.filter && !filter.opts.filter($(filter).val(), item)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}, | ||
}); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import webnotes | ||
|
||
@webnotes.whitelist() | ||
def get_chart(): | ||
company = webnotes.form_dict.get('company') | ||
res = {} | ||
res["chart"] = webnotes.conn.sql("""select name, parent_account, | ||
if(debit_or_credit="Debit", "D", ""), | ||
if(is_pl_account="Yes", "Y", "") from | ||
tabAccount where company=%s and docstatus < 2 order by lft""", (company, )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Page, general-ledger | ||
[ | ||
|
||
# These values are common in all dictionaries | ||
{ | ||
'creation': '2012-09-13 13:50:13', | ||
'docstatus': 0, | ||
'modified': '2012-09-13 13:50:13', | ||
'modified_by': u'Administrator', | ||
'owner': u'Administrator' | ||
}, | ||
|
||
# These values are common for all Page | ||
{ | ||
'doctype': 'Page', | ||
'module': u'Accounts', | ||
'name': '__common__', | ||
'page_name': u'general-ledger', | ||
'standard': u'Yes', | ||
'title': u'General Ledger' | ||
}, | ||
|
||
# Page, general-ledger | ||
{ | ||
'doctype': 'Page', | ||
'name': u'general-ledger' | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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/>. | ||
|
||
data_map = { | ||
"Account": { | ||
"columns": ["name", "parent_account", "lft", "rgt", "debit_or_credit", "is_pl_account", | ||
"company"], | ||
"order_by": "lft" | ||
}, | ||
"GL Entry": { | ||
"columns": ["account", "posting_date", "cost_center", "debit", "credit", "is_opening", | ||
"company"], | ||
"conditions": ["ifnull(is_cancelled, 'No')='No'"], | ||
"order_by": "posting_date" | ||
}, | ||
"Company": { | ||
"columns": ["name"], | ||
"conditions": ["docstatus < 2"] | ||
}, | ||
"Fiscal Year": { | ||
"columns": ["name", "year_start_date", | ||
"adddate(year_start_date, interval 1 year) as year_end_date"] | ||
} | ||
} |
Oops, something went wrong.