Merge pull request #1371 from nabinhait/hotfix
Minor fix in opening purchase invoice and AR report
This commit is contained in:
commit
47fcc0310d
@ -32,6 +32,9 @@ class DocType(BuyingController):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
if not self.doc.is_opening:
|
||||||
|
self.doc.is_opening = 'No'
|
||||||
|
|
||||||
super(DocType, self).validate()
|
super(DocType, self).validate()
|
||||||
|
|
||||||
self.po_required()
|
self.po_required()
|
||||||
@ -45,15 +48,8 @@ class DocType(BuyingController):
|
|||||||
self.check_for_stopped_status()
|
self.check_for_stopped_status()
|
||||||
self.validate_with_previous_doc()
|
self.validate_with_previous_doc()
|
||||||
self.validate_uom_is_integer("uom", "qty")
|
self.validate_uom_is_integer("uom", "qty")
|
||||||
|
|
||||||
if not self.doc.is_opening:
|
|
||||||
self.doc.is_opening = 'No'
|
|
||||||
|
|
||||||
self.set_aging_date()
|
self.set_aging_date()
|
||||||
|
|
||||||
#set against account for credit to
|
|
||||||
self.set_against_expense_account()
|
self.set_against_expense_account()
|
||||||
|
|
||||||
self.validate_write_off_account()
|
self.validate_write_off_account()
|
||||||
self.update_raw_material_cost()
|
self.update_raw_material_cost()
|
||||||
self.update_valuation_rate("entries")
|
self.update_valuation_rate("entries")
|
||||||
@ -215,7 +211,8 @@ class DocType(BuyingController):
|
|||||||
against_accounts = []
|
against_accounts = []
|
||||||
stock_items = self.get_stock_items()
|
stock_items = self.get_stock_items()
|
||||||
for item in self.doclist.get({"parentfield": "entries"}):
|
for item in self.doclist.get({"parentfield": "entries"}):
|
||||||
if auto_accounting_for_stock and item.item_code in stock_items:
|
if auto_accounting_for_stock and item.item_code in stock_items \
|
||||||
|
and self.doc.is_opening == 'No':
|
||||||
# in case of auto inventory accounting, against expense account is always
|
# in case of auto inventory accounting, against expense account is always
|
||||||
# Stock Received But Not Billed for a stock item
|
# Stock Received But Not Billed for a stock item
|
||||||
item.expense_head = stock_not_billed_account
|
item.expense_head = stock_not_billed_account
|
||||||
|
@ -132,8 +132,8 @@ class AccountsReceivableReport(object):
|
|||||||
if not hasattr(self, "gl_entries"):
|
if not hasattr(self, "gl_entries"):
|
||||||
conditions, values = self.prepare_conditions()
|
conditions, values = self.prepare_conditions()
|
||||||
self.gl_entries = webnotes.conn.sql("""select * from `tabGL Entry`
|
self.gl_entries = webnotes.conn.sql("""select * from `tabGL Entry`
|
||||||
where docstatus < 2 {} order by posting_date, account""".format(conditions),
|
where docstatus < 2 {0} order by posting_date, account""".format(conditions),
|
||||||
values, as_dict=True)
|
values, as_dict=True, debug=1)
|
||||||
|
|
||||||
return self.gl_entries
|
return self.gl_entries
|
||||||
|
|
||||||
@ -153,8 +153,8 @@ class AccountsReceivableReport(object):
|
|||||||
if not account_map:
|
if not account_map:
|
||||||
webnotes.throw(_("No Customer Accounts found."))
|
webnotes.throw(_("No Customer Accounts found."))
|
||||||
else:
|
else:
|
||||||
accounts_list = ['"{}"'.format(ac) for ac in account_map]
|
accounts_list = ['"{0}"'.format(ac) for ac in account_map]
|
||||||
conditions.append("account in ({})".format(", ".join(accounts_list)))
|
conditions.append("account in ({0})".format(", ".join(accounts_list)))
|
||||||
|
|
||||||
return " and ".join(conditions), values
|
return " and ".join(conditions), values
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user