diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 980bc6f9f1..f50f14b2e3 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1 +1 @@
-__version__ = '4.18.0'
+__version__ = '4.18.1'
diff --git a/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
index 04fe746780..310a4df748 100755
--- a/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
+++ b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
@@ -1,15 +1,15 @@
{
- "creation": "2012-05-01 12:46:31",
- "doc_type": "Journal Voucher",
- "docstatus": 0,
- "doctype": "Print Format",
- "html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n
\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"
\" + doc.total_amount or 0 + \"\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n
\n
\n
{{ value }}
\n
\n\n {%- endfor -%}\n\n
\n
\n
\n {{ _(\"For\") }} {{ doc.company }},
\n
\n
\n
\n {{ _(\"Authorized Signatory\") }}\n
\n
\n\n",
- "idx": 1,
- "modified": "2015-01-12 11:03:22.893209",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Payment Receipt Voucher",
- "owner": "Administrator",
- "print_format_type": "Server",
+ "creation": "2012-05-01 12:46:31",
+ "doc_type": "Journal Voucher",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"
\" + frappe.utils.cstr(doc.total_amount or 0) + \"\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n
\n
\n
{{ value }}
\n
\n\n {%- endfor -%}\n\n
\n
\n
\n {{ _(\"For\") }} {{ doc.company }},
\n
\n
\n
\n {{ _(\"Authorized Signatory\") }}\n
\n
\n\n",
+ "idx": 1,
+ "modified": "2015-01-16 11:03:22.893209",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment Receipt Voucher",
+ "owner": "Administrator",
+ "print_format_type": "Server",
"standard": "Yes"
-}
\ No newline at end of file
+}
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index dfa0b2e404..c72cefc9b9 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -4,7 +4,7 @@ app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors"
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "4.18.0"
+app_version = "4.18.1"
error_report_email = "support@erpnext.com"
diff --git a/erpnext/patches/v4_2/discount_amount.py b/erpnext/patches/v4_2/discount_amount.py
index e23a10e06c..3ce10caf89 100644
--- a/erpnext/patches/v4_2/discount_amount.py
+++ b/erpnext/patches/v4_2/discount_amount.py
@@ -6,7 +6,7 @@ import frappe
from frappe.modules import scrub, get_doctype_module
def execute():
- for dt in ["Quotation", "Sales Order", "Delivery Note", "Sales invoice"]:
+ for dt in ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]:
frappe.reload_doc(get_doctype_module(dt), "doctype", scrub(dt))
frappe.db.sql("""update `tab{0}` set base_discount_amount=discount_amount,
discount_amount=discount_amount/conversion_rate""".format(dt))
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 4f3480c0bb..81a2f590a1 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -45,7 +45,6 @@ class StockEntry(StockController):
self.validate_warehouse(pro_obj)
self.validate_production_order()
self.get_stock_and_rate()
- self.validate_incoming_rate()
self.validate_bom()
self.validate_finished_goods()
self.validate_return_reference_doc()
@@ -190,16 +189,10 @@ class StockEntry(StockController):
+ self.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
def validate_valuation_rate(self):
- if self.purpose in ["Manufacture", "Repack"]:
- valuation_at_source, valuation_at_target = 0, 0
- for d in self.get("mtn_details"):
- if d.s_warehouse and not d.t_warehouse:
- valuation_at_source += flt(d.amount)
- if d.t_warehouse and not d.s_warehouse:
- valuation_at_target += flt(d.amount)
+ for d in self.get('mtn_details'):
+ if d.t_warehouse:
+ self.validate_value("incoming_rate", ">", 0, d, raise_exception=IncorrectValuationRateError)
- if valuation_at_target < valuation_at_source:
- frappe.throw(_("Total valuation for manufactured or repacked item(s) can not be less than total valuation of raw materials"))
def set_total_amount(self):
self.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")])
@@ -241,7 +234,7 @@ class StockEntry(StockController):
incoming_rate = flt(self.get_incoming_rate(args), self.precision("incoming_rate", d))
if incoming_rate > 0:
d.incoming_rate = incoming_rate
- d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
+ d.amount = flt(flt(d.transfer_qty) * flt(d.incoming_rate), self.precision("amount", d))
if not d.t_warehouse:
raw_material_cost += flt(d.amount)
@@ -255,8 +248,9 @@ class StockEntry(StockController):
if d.bom_no:
bom = frappe.db.get_value("BOM", d.bom_no, ["operating_cost", "quantity"], as_dict=1)
operation_cost_per_unit = flt(bom.operating_cost) / flt(bom.quantity)
- d.incoming_rate = operation_cost_per_unit + (raw_material_cost + flt(self.total_fixed_cost)) / flt(d.transfer_qty)
- d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
+ d.incoming_rate = flt(operation_cost_per_unit +
+ (raw_material_cost + flt(self.total_fixed_cost)) / flt(d.transfer_qty), self.precision("incoming_rate", d))
+ d.amount = flt(flt(d.transfer_qty) * flt(d.incoming_rate), self.precision("transfer_qty", d))
break
def get_incoming_rate(self, args):
@@ -280,11 +274,6 @@ class StockEntry(StockController):
return incoming_rate
- def validate_incoming_rate(self):
- for d in self.get('mtn_details'):
- if d.t_warehouse:
- self.validate_value("incoming_rate", ">", 0, d, raise_exception=IncorrectValuationRateError)
-
def validate_bom(self):
for d in self.get('mtn_details'):
if d.bom_no and not frappe.db.sql("""select name from `tabBOM`
diff --git a/setup.py b/setup.py
index e949dd6c3f..146361f044 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import os
-version = "4.18.0"
+version = "4.18.1"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()