diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 4beb35b454..24de2c6971 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.0.12' +__version__ = '10.0.13' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html index 83325aabed..90e8059376 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.html +++ b/erpnext/accounts/report/general_ledger/general_ledger.html @@ -17,12 +17,12 @@
{%= __("Date") %} | +{%= __("Date") %} | {%= __("Ref") %} | {%= __("Party") %} | {%= __("Debit") %} | {%= __("Credit") %} | -{%= __("Balance") %} | +{%= __("Balance") %} | {%= data[i].balance_in_account_currency %} | +{%= get_currency_symbol(data[i].account_currency)%} + {%= data[i].balance_in_account_currency %} | {% } else { %} -{%= data[i].balance %} | +{%= get_currency_symbol()%} + {%= data[i].balance %} | {% } %} {% } %} diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 72fe793582..b6b26b1eed 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -238,7 +238,7 @@ def get_result_as_list(data, filters): inv_details = get_supplier_invoice_details() for d in data: - if not d.posting_date: + if not d.get('posting_date'): balance, balance_in_account_currency = 0, 0 balance, label = get_balance(d, balance, 'debit', 'credit') @@ -254,7 +254,7 @@ def get_result_as_list(data, filters): d['balance_in_account_currency'] = d.get('balance') d['account_currency'] = filters.account_currency - d['bill_no'] = inv_details.get(d.against_voucher, '') + d['bill_no'] = inv_details.get(d.get('against_voucher'), '') return data diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py index 2106bb2b3a..9969c55a91 100644 --- a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py +++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py @@ -53,7 +53,7 @@ def get_sales_payment_data(filters, columns): def get_conditions(filters): conditions = "1=1" - if filters.get("from_date"): conditions += "a.posting_date >= %(from_date)s" + if filters.get("from_date"): conditions += " and a.posting_date >= %(from_date)s" if filters.get("to_date"): conditions += " and a.posting_date <= %(to_date)s" if filters.get("company"): conditions += " and a.company=%(company)s" if filters.get("customer"): conditions += " and a.customer = %(customer)s" diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 2f01915e43..158aac0c1b 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -152,7 +152,7 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False): conditions = [] - return frappe.db.sql("""select tabItem.name, tabItem.item_group, tabItem.image, + return frappe.db.sql("""select tabItem.name, tabItem.item_group, if(length(tabItem.item_name) > 40, concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name, if(length(tabItem.description) > 40, \ diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 757c752f63..d82f7ab61d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -648,6 +648,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } }).fail(() => this.frm.set_value('shipping_rule', '')); } + else { + me.calculate_taxes_and_totals(); + } }, set_actual_charges_based_on_currency: function() { diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index ac7c830675..c0e90e04fd 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -162,8 +162,14 @@ class Company(Document): self._set_default_account("default_expense_account", "Cost of Goods Sold") if not self.default_income_account: - self.db_set("default_income_account", frappe.db.get_value("Account", - {"account_name": _("Sales"), "company": self.name})) + income_account = frappe.db.get_value("Account", + {"account_name": _("Sales"), "company": self.name, "is_group": 0}) + + if not income_account: + income_account = frappe.db.get_value("Account", + {"account_name": _("Sales Account"), "company": self.name}) + + self.db_set("default_income_account", income_account) if not self.default_payable_account: self.db_set("default_payable_account", self.default_payable_account) diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index 456b43482a..1578bb68ce 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -85,18 +85,22 @@ def get_item_warehouse_projected_qty(items_to_consider): from tabBin where item_code in ({0}) and (warehouse != "" and warehouse is not null)"""\ .format(", ".join(["%s"] * len(items_to_consider))), items_to_consider): - - item_warehouse_projected_qty.setdefault(item_code, {})[warehouse] = flt(projected_qty) - + + if item_code not in item_warehouse_projected_qty: + item_warehouse_projected_qty.setdefault(item_code, {}) + + if warehouse not in item_warehouse_projected_qty.get(item_code): + item_warehouse_projected_qty[item_code][warehouse] = flt(projected_qty) + warehouse_doc = frappe.get_doc("Warehouse", warehouse) - + while warehouse_doc.parent_warehouse: if not item_warehouse_projected_qty.get(item_code, {}).get(warehouse_doc.parent_warehouse): item_warehouse_projected_qty.setdefault(item_code, {})[warehouse_doc.parent_warehouse] = flt(projected_qty) else: item_warehouse_projected_qty[item_code][warehouse_doc.parent_warehouse] += flt(projected_qty) warehouse_doc = frappe.get_doc("Warehouse", warehouse_doc.parent_warehouse) - + return item_warehouse_projected_qty def create_material_request(material_requests):
---|