Merge pull request #450 from saurabh6790/master
[Reports] [No Sales Order From Customers] and [Item Reorder Level]
diff --git a/accounts/doctype/gl_entry/gl_entry.py b/accounts/doctype/gl_entry/gl_entry.py
index 112e449..a2ef25a 100644
--- a/accounts/doctype/gl_entry/gl_entry.py
+++ b/accounts/doctype/gl_entry/gl_entry.py
@@ -160,13 +160,13 @@
def update_outstanding_amt(self):
# get final outstanding amt
bal = flt(sql("""select sum(debit) - sum(credit) from `tabGL Entry`
- where against_voucher=%s and against_voucher_type=%s
- and ifnull(is_cancelled,'No') = 'No'""",
- (self.doc.against_voucher, self.doc.against_voucher_type))[0][0] or 0.0)
-
+ where against_voucher=%s and against_voucher_type=%s and account = %s
+ and ifnull(is_cancelled,'No') = 'No'""", (self.doc.against_voucher,
+ self.doc.against_voucher_type, self.doc.account))[0][0] or 0.0)
+
if self.doc.against_voucher_type == 'Purchase Invoice':
bal = -bal
-
+
elif self.doc.against_voucher_type == "Journal Voucher":
against_voucher_amount = flt(webnotes.conn.sql("""select sum(debit) - sum(credit)
from `tabGL Entry` where voucher_type = 'Journal Voucher' and voucher_no = %s
diff --git a/accounts/page/accounts_home/accounts_home.js b/accounts/page/accounts_home/accounts_home.js
index 7f623d7..b920bfd 100644
--- a/accounts/page/accounts_home/accounts_home.js
+++ b/accounts/page/accounts_home/accounts_home.js
@@ -128,16 +128,6 @@
icon: "icon-table",
items: [
{
- "label":wn._("Customer Account Head"),
- route: "query-report/Customer Account Head",
- doctype: "Account"
- },
- {
- "label":wn._("Supplier Account Head"),
- route: "query-report/Supplier Account Head",
- doctype: "Account"
- },
- {
"label":wn._("General Ledger"),
page: "general-ledger"
},
@@ -248,6 +238,11 @@
doctype: "Account"
},
{
+ "label":wn._("Supplier Account Head"),
+ route: "query-report/Supplier Account Head",
+ doctype: "Account"
+ },
+ {
"label":wn._("Item-wise Sales Register"),
route: "query-report/Item-wise Sales Register",
doctype: "Sales Invoice"
diff --git a/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/accounts/report/item_wise_sales_register/item_wise_sales_register.py
index f6e26af..f3ed2a1 100644
--- a/accounts/report/item_wise_sales_register/item_wise_sales_register.py
+++ b/accounts/report/item_wise_sales_register/item_wise_sales_register.py
@@ -59,7 +59,7 @@
def get_items(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select si.name, si.posting_date, si.debit_to, si.project_name,
- si.customer, si.remarks, si.territory, si_item.item_code, si_item.item_name,
+ si.customer, si.remarks, si.territory, si.company, si_item.item_code, si_item.item_name,
si_item.item_group, si_item.sales_order, si_item.delivery_note, si_item.income_account,
si_item.qty, si_item.basic_rate, si_item.amount
from `tabSales Invoice` si, `tabSales Invoice Item` si_item