Merge branch 'master' into develop

This commit is contained in:
Saurabh 2018-01-22 15:29:15 +05:30
commit ef31637549
8 changed files with 31 additions and 16 deletions

View File

@ -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'''

View File

@ -17,12 +17,12 @@
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 15%">{%= __("Date") %}</th>
<th style="width: 12%">{%= __("Date") %}</th>
<th style="width: 15%">{%= __("Ref") %}</th>
<th style="width: 25%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Debit") %}</th>
<th style="width: 15%">{%= __("Credit") %}</th>
<th style="width: 15%">{%= __("Balance") %}</th>
<th style="width: 18%">{%= __("Balance") %}</th>
</tr>
</thead>
<tbody>
@ -76,9 +76,11 @@
{% } %}
{% } %}
{% if(filters.print_in_account_currency) { %}
<td style="text-align: right">{%= data[i].balance_in_account_currency %}</td>
<td style="text-align: right">{%= get_currency_symbol(data[i].account_currency)%}
{%= data[i].balance_in_account_currency %}</td>
{% } else { %}
<td style="text-align: right">{%= data[i].balance %}</td>
<td style="text-align: right">{%= get_currency_symbol()%}
{%= data[i].balance %}</td>
{% } %}
</tr>
{% } %}

View File

@ -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

View File

@ -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"

View File

@ -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, \

View File

@ -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() {

View File

@ -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)

View File

@ -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):