diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index fe93bc493b..ccb7e8f936 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.1.17'
+__version__ = '10.1.18'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index 78015b40c8..3d8aedcdcc 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -4,12 +4,21 @@
.print-format {
padding: 8mm;
margin:4mm;
- font-size:10px;
+ font-size: 10.0pt !important;
font-family: Tahoma, sans-serif;
}
}
{% } %}
+
+
{%= __(report.report_name) %}
{%= filters.customer || filters.supplier %}
@@ -126,9 +135,14 @@
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %}
{%= dateutil.str_to_user(data[i]["posting_date"]) %} |
- {%= data[i]["voucher_type"] %}
- {%= data[i]["voucher_no"] %} |
- {% if(!filters.show_pdc_in_print) { %}
+
+ {% if(!filters.show_pdc_in_print) { %}
+ {%= data[i]["voucher_type"] %}
+
+ {% } %}
+ {%= data[i]["voucher_no"] %}
+ |
+ {% if(!filters.show_pdc_in_print) { %}
{% if(!(filters.customer || filters.supplier)) { %}
{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 065ab632b4..61096837f5 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -136,7 +136,7 @@ class ReceivablePayableReport(object):
return_entries = self.get_return_entries(args.get("party_type"))
data = []
- pdc_details = get_pdc_details(args.get("party_type"))
+ pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
@@ -182,6 +182,7 @@ class ReceivablePayableReport(object):
row.append(company_currency)
pdc = pdc_details.get((gle.voucher_no, gle.party), {})
+
remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount"))
row += [pdc.get("pdc_date"), pdc.get("pdc_ref"),
flt(pdc.get("pdc_amount")), remaining_balance]
@@ -414,7 +415,7 @@ def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_dat
return [age] + outstanding_range
-def get_pdc_details(party_type):
+def get_pdc_details(party_type, report_date):
pdc_details = frappe._dict()
for pdc in frappe.db.sql("""
@@ -427,13 +428,14 @@ def get_pdc_details(party_type):
on
(pref.parent = pent.name)
where
- pent.docstatus < 2 and pent.reference_date >= pent.posting_date
+ pent.docstatus < 2 and pent.reference_date >= %s
and pent.party_type = %s
- group by pent.party, pref.reference_name""", party_type, as_dict=1):
+ group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1):
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
if scrub(party_type):
- amount_field = "jea.debit_in_account_currency + jea.credit_in_account_currency"
+ amount_field = ("jea.debit_in_account_currency"
+ if party_type == 'Supplier' else "jea.credit_in_account_currency")
else:
amount_field = "jea.debit + jea.credit"
@@ -447,9 +449,9 @@ def get_pdc_details(party_type):
on
(jea.parent = je.name)
where
- je.docstatus < 2 and je.cheque_date >= je.posting_date
+ je.docstatus < 2 and je.cheque_date >= %s
and jea.party_type = %s
- group by jea.party, jea.reference_name""".format(amount_field), party_type, as_dict=1):
+ group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1):
if (pdc.invoice_no, pdc.party) in pdc_details:
pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount
else:
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 6942a8cac0..007299a798 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -607,6 +607,9 @@ def validate_bom_no(item, bom_no):
for d in bom.items:
if (d.item_code.lower() == item.lower()):
rm_item_exists = True
+ for d in bom.scrap_items:
+ if (d.item_code.lower() == item.lower()):
+ rm_item_exists = True
if bom.item.lower() == item.lower() or \
bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower():
rm_item_exists = True
diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js
index ebb92dac8f..b2e0b85556 100644
--- a/erpnext/public/js/utils/item_quick_entry.js
+++ b/erpnext/public/js/utils/item_quick_entry.js
@@ -319,7 +319,8 @@ frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
["parent", "=", $(e.target).attr("data-fieldname")],
["attribute_value", "like", e.target.value + "%"]
],
- fields: ["attribute_value"]
+ fields: ["attribute_value"],
+ parent: "Item"
},
callback: function(r) {
if (r.message) {
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index cd343fbbdf..1a57a099a3 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -456,7 +456,8 @@ $.extend(erpnext.item, {
],
fields: ["attribute_value"],
limit_start: 0,
- limit_page_length: 500
+ limit_page_length: 500,
+ parent: "Item"
}
}).then((r) => {
if(r.message) {
@@ -598,7 +599,8 @@ $.extend(erpnext.item, {
["parent","=", i],
["attribute_value", "like", term + "%"]
],
- fields: ["attribute_value"]
+ fields: ["attribute_value"],
+ parent: "Item"
},
callback: function(r) {
if (r.message) {
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 067acc79c4..552d284b23 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -320,7 +320,7 @@ def get_price_list_rate(args, item_doc, out):
out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \
/ flt(args.conversion_rate)
if not args.price_list_uom_dependant:
- out.price_list_rate = flt(out.price_list_rate * (args.conversion_factor or 1.0))
+ out.price_list_rate = flt(out.price_list_rate * (flt(args.conversion_factor) or 1.0))
if not out.price_list_rate and args.transaction_type=="buying":
from erpnext.stock.doctype.item.item import get_last_purchase_details
diff --git a/erpnext/stock/report/item_variant_details/item_variant_details.py b/erpnext/stock/report/item_variant_details/item_variant_details.py
index f1488f8eff..7379eb4e50 100644
--- a/erpnext/stock/report/item_variant_details/item_variant_details.py
+++ b/erpnext/stock/report/item_variant_details/item_variant_details.py
@@ -14,10 +14,15 @@ def get_data(item):
if not item:
return []
item_dicts = []
+ variants = None
variant_results = frappe.db.sql("""select name from `tabItem`
where variant_of = %s""", item, as_dict=1)
- variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results])
+ if not variant_results:
+ frappe.msgprint(_("There isn't any item variant for the selected item"))
+ return []
+ else:
+ variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results])
order_count_map = get_open_sales_orders_map(variants)
stock_details_map = get_stock_details_map(variants)
|