Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta
2013-02-12 19:23:48 +05:30
10 changed files with 16 additions and 20 deletions

View File

@@ -33,6 +33,7 @@ cur_frm.cscript.refresh = function(doc) {
}
cur_frm.fields_dict.voucher_no.get_query = function(doc) {
// TO-do: check for pos, it should not come
if (!doc.account) msgprint("Please select Account first");
else {
return repl("select gle.voucher_no, gle.posting_date, gle.%(account_type)s \
@@ -44,7 +45,8 @@ cur_frm.fields_dict.voucher_no.get_query = function(doc) {
and (ifnull(gle.against_voucher, '') = '' \
or ifnull(gle.against_voucher, '') = gle.voucher_no ) \
and ifnull(gle.%(account_type)s, 0) > 0 \
and (select ifnull(abs(sum(debit) - sum(credit)), 0) from `tabGL Entry` \
and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0) \
from `tabGL Entry` \
where against_voucher_type = '%(dt)s' \
and against_voucher = gle.voucher_no \
and voucher_no != gle.voucher_no \

View File

@@ -39,16 +39,14 @@ class DocType:
(self.doc.voucher_type, self.doc.voucher_no, self.doc.account))
total_amount = total_amount and flt(total_amount[0][0]) or 0
reconciled_payment = webnotes.conn.sql("""
select sum(%s) - sum(%s) from `tabGL Entry` where
select sum(ifnull(%s, 0)) - sum(ifnull(%s, 0)) from `tabGL Entry` where
against_voucher = %s and voucher_no != %s
and account = %s and ifnull(is_cancelled, 'No') = 'No'""" %
((self.doc.account_type == 'debit' and 'credit' or 'debit'), self.doc.account_type,
'%s', '%s', '%s'), (self.doc.voucher_no, self.doc.voucher_no, self.doc.account))
reconciled_payment = reconciled_payment and flt(reconciled_payment[0][0]) or 0
ret = {
'total_amount': total_amount,
'pending_amt_to_reconcile': total_amount - reconciled_payment

View File

@@ -269,9 +269,6 @@ class DocType(BuyingController):
if not cstr(data[0]['currency']) == cstr(self.doc.currency):
msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " currency : " + cstr(data[0]['currency']) + " does not match with currency of current document.")
raise Exception
if not flt(data[0]['conversion_rate']) == flt(self.doc.conversion_rate):
msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " conversion_rate : " + cstr(data[0]['conversion_rate']) + " does not match with conversion_rate of current document.")
raise Exception
def set_aging_date(self):
if self.doc.is_opening != 'Yes':