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

This commit is contained in:
Rushabh Mehta 2013-02-05 11:31:56 +05:30
commit e9c334a778
3 changed files with 45 additions and 39 deletions

View File

@ -248,6 +248,7 @@ class DocType(AccountsController):
from accounts.general_ledger import make_gl_entries
gl_map = []
for d in self.doclist.get({"parentfield": "entries"}):
if d.debit or d.credit:
gl_map.append(
self.get_gl_dict({
"account": d.account,
@ -262,7 +263,7 @@ class DocType(AccountsController):
"cost_center": d.cost_center
}, cancel)
)
if gl_map:
make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj)
def get_outstanding(self, args):

View File

@ -422,6 +422,7 @@ class DocType(BuyingController):
abbr = self.get_company_abbr()
# parent's gl entry
if self.doc.grand_total:
gl_entries.append(
self.get_gl_dict({
"account": self.doc.credit_to,
@ -506,6 +507,8 @@ class DocType(BuyingController):
"cost_center": self.doc.write_off_cost_center
}, is_cancel)
)
if gl_entries:
make_gl_entries(gl_entries, cancel=is_cancel)

View File

@ -637,6 +637,7 @@ class DocType(SellingController):
abbr = self.get_company_abbr()
# parent's gl entry
if self.doc.grand_total:
gl_entries.append(
self.get_gl_dict({
"account": self.doc.debit_to,
@ -745,6 +746,7 @@ class DocType(SellingController):
update_outstanding = self.doc.is_pos and self.doc.write_off_account and 'No' or 'Yes'
merge_entries=cint(self.doc.is_pos)!=1 and 1 or 0
if gl_entries:
make_gl_entries(gl_entries, cancel=is_cancel,
update_outstanding=update_outstanding, merge_entries=merge_entries)