Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Rushabh Mehta 2012-11-12 11:25:07 +01:00
commit 928bd86b08
11 changed files with 28 additions and 21 deletions

View File

@ -20,13 +20,6 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.set_breadcrumbs = function(barea) {
cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname);
cur_frm.frm_head.appframe.add_breadcrumb(' in <a href="#!Accounts Browser/Account">\
Chart of Accounts</a>');
cur_frm.frm_head.appframe.add_breadcrumb(' in <a href="#!accounts-home">Accounts</a>');
}
// Refresh
// -----------------------------------------
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
@ -55,7 +48,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.account_type(doc, cdt, cdn);
// show / hide convert buttons
cur_frm.cscript.hide_unhide_group_ledger(doc);
cur_frm.cscript.hide_unhide_group_ledger(doc);
}
}
@ -90,6 +83,10 @@ cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
} else if (cstr(doc.group_or_ledger) == 'Ledger') {
cur_frm.add_custom_button('Convert to Group',
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
cur_frm.add_custom_button('View Ledger', function() {
wn.set_route("general-ledger", "account=" + doc.name);
});
}
}
// Convert group to ledger

View File

@ -74,6 +74,25 @@ cur_frm.fields_dict['entries'].grid.get_field('against_invoice').get_query = fun
return "SELECT `tabSales Invoice`.name, `tabSales Invoice`.debit_to, `tabSales Invoice`.outstanding_amount FROM `tabSales Invoice` WHERE `tabSales Invoice`.debit_to='"+d.account+"' AND `tabSales Invoice`.outstanding_amount > 0 AND `tabSales Invoice`.docstatus = 1 AND `tabSales Invoice`.%(key)s LIKE '%s' ORDER BY `tabSales Invoice`.name DESC LIMIT 200";
}
cur_frm.fields_dict['entries'].grid.get_field('against_jv').get_query = function(doc) {
var d = locals[this.doctype][this.docname];
if(!d.account) {
msgprint("Please select Account first!")
throw "account not selected"
}
return "SELECT `tabJournal Voucher`.name, `tabJournal Voucher`.posting_date,\
`tabJournal Voucher`.user_remark\
from `tabJournal Voucher`, `tabJournal Voucher Detail`\
where `tabJournal Voucher Detail`.account = '"+ esc_quotes(d.account) + "'\
and `tabJournal Voucher`.name like '%s'\
and `tabJournal Voucher`.docstatus=1\
and `tabJournal Voucher`.voucher_type='Journal Entry'\
and `tabJournal Voucher Detail`.parent = `tabJournal Voucher`.name";
}
// TDS Account Head
cur_frm.fields_dict['tax_code'].get_query = function(doc) {
return "SELECT `tabTDS Category Account`.account_head FROM `tabTDS Category Account` WHERE `tabTDS Category Account`.parent = '"+doc.tds_category+"' AND `tabTDS Category Account`.company='"+doc.company+"' AND `tabTDS Category Account`.account_head LIKE '%s' ORDER BY `tabTDS Category Account`.account_head DESC LIMIT 50";

View File

@ -149,16 +149,16 @@ class DocType:
def validate_cheque_info(self):
if self.doc.voucher_type in ['Bank Voucher']:
if not self.doc.cheque_no or not self.doc.cheque_date:
msgprint("Cheque No & Cheque Date is required for " + cstr(self.doc.voucher_type))
msgprint("Reference No & Reference Date is required for " + cstr(self.doc.voucher_type))
raise Exception
if self.doc.cheque_date and not self.doc.cheque_no:
msgprint("Cheque No is mandatory if you entered Cheque Date")
msgprint("Reference No is mandatory if you entered Reference Date")
raise Exception
def validate_entries_for_advance(self):
for d in getlist(self.doclist,'entries'):
if not d.is_advance and not d.against_voucher and not d.against_invoice and d.against_jv:
if not d.is_advance and not d.against_voucher and not d.against_invoice and not d.against_jv:
master_type = self.get_master_type(d.account)
if (master_type == 'Customer' and flt(d.credit) > 0) or (master_type == 'Supplier' and flt(d.debit) > 0):
msgprint("Message: Please check Is Advance as 'Yes' against Account %s if this is an advance entry." % d.account)

View File

@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("lib/js/wn/views/grid_report.js");
wn.require("app/js/account_tree_grid.js");
wn.pages['financial-analytics'].onload = function(wrapper) {

View File

@ -25,8 +25,6 @@ wn.pages['general-ledger'].onload = function(wrapper) {
}
wn.require("lib/js/wn/views/grid_report.js");
erpnext.GeneralLedger = wn.views.GridReport.extend({
init: function(wrapper) {
this._super({
@ -45,6 +43,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
link_formatter: {
filter_input: "account",
open_btn: true,
doctype: "'Account'"
}},
{id: "debit", name: "Debit", field: "debit", width: 100,
formatter: this.currency_formatter},

View File

@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("lib/js/wn/views/grid_report.js");
wn.require("app/js/account_tree_grid.js");
wn.pages['trial-balance'].onload = function(wrapper) {

View File

@ -23,7 +23,6 @@ wn.pages['purchase-analytics'].onload = function(wrapper) {
new erpnext.PurchaseAnalytics(wrapper);
}
wn.require("lib/js/wn/views/grid_report.js");
erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
init: function(wrapper) {

View File

@ -23,8 +23,6 @@ wn.pages['sales-analytics'].onload = function(wrapper) {
new erpnext.SalesAnalytics(wrapper);
}
wn.require("lib/js/wn/views/grid_report.js");
erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
init: function(wrapper) {
this._super({

View File

@ -26,7 +26,6 @@ wn.pages['stock-ageing'].onload = function(wrapper) {
}
wn.require("lib/js/wn/views/grid_report.js");
wn.require("app/js/stock_grid_report.js");
erpnext.StockAgeing = erpnext.StockGridReport.extend({

View File

@ -24,7 +24,6 @@ wn.pages['stock-analytics'].onload = function(wrapper) {
new erpnext.StockAnalytics(wrapper);
}
wn.require("lib/js/wn/views/grid_report.js");
wn.require("app/js/stock_grid_report.js");
erpnext.StockAnalytics = erpnext.StockGridReport.extend({

View File

@ -24,7 +24,6 @@ wn.pages['stock-ledger'].onload = function(wrapper) {
new erpnext.StockLedger(wrapper);
}
wn.require("lib/js/wn/views/grid_report.js");
wn.require("app/js/stock_grid_report.js");
erpnext.StockLedger = erpnext.StockGridReport.extend({