Merge pull request #9189 from mbauskar/mysql-lockout
[hotfix] fixes for mysql Lock wait timeout exceeded
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index eea2e47..f9eb269 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
-__version__ = '8.0.46'
+__version__ = '8.0.47'
def get_default_company(user=None):
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 0f0569a..f61931a 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -198,7 +198,7 @@
customers = [frappe._dict({'name': customers})]
for data in customers:
- contact = frappe.db.sql(""" select email_id, phone from `tabContact`
+ contact = frappe.db.sql(""" select email_id, phone, mobile_no from `tabContact`
where is_primary_contact =1 and name in
(select parent from `tabDynamic Link` where link_doctype = 'Customer' and link_name = %s
and parenttype = 'Contact')""", data.name, as_dict=1)
@@ -320,6 +320,7 @@
si_doc = frappe.new_doc('Sales Invoice')
si_doc.offline_pos_name = name
si_doc.update(doc)
+ si_doc.set_posting_time = 1
si_doc.customer = get_customer_id(doc)
si_doc.due_date = doc.get('posting_date')
submit_invoice(si_doc, name, doc)
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 1b670d1..14b26db 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -717,7 +717,7 @@
item = this.get_item(item.value);
var searchtext =
Object.keys(item)
- .filter(key => ['customer_name', 'customer_group', 'value', 'label', 'email_id', 'phone'].includes(key))
+ .filter(key => ['customer_name', 'customer_group', 'value', 'label', 'email_id', 'phone', 'mobile_no'].includes(key))
.map(key => item[key])
.join(" ")
.toLowerCase();
@@ -795,6 +795,7 @@
customer_group: c.customer_group,
territory: c.territory,
phone: contact ? contact["phone"] : '',
+ mobile_no: contact ? contact["mobile_no"] : '',
email_id: contact ? contact["email_id"] : ''
}
});
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index ba847c0..390bb27 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -21,11 +21,13 @@
<th style="width: 40%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Invoiced Amount") %}</th>
<th style="width: 15%">{%= __("Paid Amount") %}</th>
+ <th style="width: 15%">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
<th style="width: 15%">{%= __("Outstanding Amount") %}</th>
{% } else { %}
<th style="width: 40%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Total Invoiced Amount") %}</th>
<th style="width: 15%">{%= __("Total Paid Amount") %}</th>
+ <th style="width: 15%">{%= report.report_name === "Accounts Receivable Summary" ? __('Credit Note Amount') : __('Debit Note Amount') %}</th>
<th style="width: 15%">{%= __("Total Outstanding Amount") %}</th>
{% } %}
</tr>
@@ -45,6 +47,8 @@
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
+ {%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %}</td>
+ <td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{% } else { %}
<td></td>
@@ -54,6 +58,7 @@
{%= format_currency(data[i]["Invoiced Amount"]) %}</td>
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"]) %}</td>
+ <td style="text-align: right">{% report.report_name === "Accounts Receivable" ? format_currency(data[i][__("Credit Note Amt")]) : format_currency(data[i][__("Debit Note Amt")]) %} </td>
<td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"]) %}</td>
{% } %}
@@ -67,6 +72,7 @@
{% } %}
<td style="text-align: right">{%= format_currency(data[i][__("Total Invoiced Amt")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Total Paid Amt")]) %}</td>
+ <td style="text-align: right">{%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")]) : format_currency(data[i][__("Debit Note Amt")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Total Outstanding Amt")]) %}</td>
{% } %}
{% } %}
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index 81bcccb..845a2c5 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -17,9 +17,11 @@
if party_naming_by == "Naming Series":
columns += [ args.get("party_type") + " Name::140"]
+ credit_debit_label = _("Credit Note Amt") if args.get('party_type') == 'Customer' else _("Debit Note Amt")
columns += [
_("Total Invoiced Amt") + ":Currency/currency:140",
_("Total Paid Amt") + ":Currency/currency:140",
+ credit_debit_label + ":Currency/currency:140",
_("Total Outstanding Amt") + ":Currency/currency:160",
"0-" + str(self.filters.range1) + ":Currency/currency:100",
str(self.filters.range1) + "-" + str(self.filters.range2) + ":Currency/currency:100",
@@ -56,7 +58,7 @@
row += [self.get_party_name(args.get("party_type"), party)]
row += [
- party_dict.invoiced_amt, party_dict.paid_amt, party_dict.outstanding_amt,
+ party_dict.invoiced_amt, party_dict.paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
party_dict.range1, party_dict.range2, party_dict.range3, party_dict.range4,
]
@@ -77,6 +79,7 @@
frappe._dict({
"invoiced_amt": 0,
"paid_amt": 0,
+ "credit_amt": 0,
"outstanding_amt": 0,
"range1": 0,
"range2": 0,
@@ -104,7 +107,7 @@
if args.get("party_type") == "Supplier":
cols += ["bill_no", "bill_date"]
- cols += ["invoiced_amt", "paid_amt",
+ cols += ["invoiced_amt", "paid_amt", "credit_amt",
"outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency"]
if args.get("party_type") == "Supplier":
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
index f5aced3..8275c84 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
@@ -694,7 +694,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-12-15 14:45:07.733480",
+ "modified": "2017-06-09 14:45:07.888888",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Ledger Entry",
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index 55a307c..b5d2e3f 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -129,3 +129,5 @@
frappe.db.commit()
frappe.db.sql("""alter table `tabStock Ledger Entry`
add index posting_sort_index(posting_date, posting_time, name)""")
+
+ frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"])
diff --git a/erpnext/templates/includes/projects/project_timesheets.html b/erpnext/templates/includes/projects/project_timesheets.html
index 3a9aecd..66f4771 100644
--- a/erpnext/templates/includes/projects/project_timesheets.html
+++ b/erpnext/templates/includes/projects/project_timesheets.html
@@ -5,7 +5,7 @@
<div class='col-xs-9'>
<span class="indicator {{ "blue" if timesheet.info.status=="Submitted" else "red" if timesheet.info.status=="Draft" else "darkgrey" }}" title="{{ timesheet.info.status }}" > {{ timesheet.info.name }} </span>
<div class="small text-muted item-timestamp">
- {{ __("From") }} {{ frappe.format_date(timesheet.from_time) }} {{ __("to") }} {{ frappe.format_date(timesheet.to_time) }}
+ {{ _("From") }} {{ frappe.format_date(timesheet.from_time) }} {{ _("to") }} {{ frappe.format_date(timesheet.to_time) }}
</div>
</div>
<div class='col-xs-1 gravatar-top'>