Merge branch 'develop' of github.com:webnotes/erpnext into reports

This commit is contained in:
Nabin Hait
2013-12-16 15:18:34 +05:30
33 changed files with 152 additions and 98 deletions

View File

@@ -5,8 +5,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, fmt_money, getdate
from webnotes.model.code import get_obj
from webnotes import msgprint, _
from webnotes import _
class DocType:
def __init__(self,d,dl):
@@ -130,11 +129,12 @@ def update_outstanding_amt(account, against_voucher_type, against_voucher, on_ca
against_voucher_amount = flt(webnotes.conn.sql("""
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry` where voucher_type = 'Journal Voucher' and voucher_no = %s
and account = %s""", (against_voucher, account))[0][0])
and account = %s and ifnull(against_voucher, '') = ''""",
(against_voucher, account))[0][0])
bal = against_voucher_amount + bal
if against_voucher_amount < 0:
bal = -bal
# Validation : Outstanding can not be negative
if bal < 0 and not on_cancel:
webnotes.throw(_("Outstanding for Voucher ") + against_voucher + _(" will become ") +
@@ -158,4 +158,4 @@ def validate_frozen_account(account, adv_adj):
elif frozen_accounts_modifier not in webnotes.user.get_roles():
webnotes.throw(account + _(" is a frozen account. ") +
_("To create / edit transactions against this account, you need role") + ": " +
frozen_accounts_modifier)
frozen_accounts_modifier)

View File

@@ -145,6 +145,8 @@ def gl_entry_details(doctype, txt, searchfield, start, page_len, filters):
and voucher_no != gle.voucher_no)
!= abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0)
)
and if(gle.voucher_type='Sales Invoice', (select is_pos from `tabSales Invoice`
where name=gle.voucher_no), 0)=0
%(mcond)s
ORDER BY gle.posting_date desc, gle.voucher_no desc
limit %(start)s, %(page_len)s""" % {

View File

@@ -85,7 +85,7 @@ class AccountsReceivableReport(object):
def get_account_map(self):
if not hasattr(self, "account_map"):
self.account_map = dict(((r.name, r) for r in webnotes.conn.sql("""select
account.name, customer.customer_name, customer.territory
account.name, customer.name as customer_name, customer.territory
from `tabAccount` account, `tabCustomer` customer
where account.master_type="Customer"
and customer.name=account.master_name""", as_dict=True)))

View File

@@ -121,6 +121,6 @@ def get_costcenter_account_month_map(filters):
for ad in actual_details.get(ccd.name, {}).get(ccd.account, []):
if ad.month_name == month:
tav_dict.actual += ad.debit - ad.credit
tav_dict.actual += flt(ad.debit) - flt(ad.credit)
return cam_map
return cam_map