diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index daf01ab801..3ae74e481e 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -52,7 +52,6 @@ class DocType(SellingController): sales_com_obj = get_obj('Sales Common') sales_com_obj.check_stop_sales_order(self) sales_com_obj.check_active_sales_items(self) - sales_com_obj.check_conversion_rate(self) sales_com_obj.validate_max_discount(self, 'entries') self.validate_customer_account() self.validate_debit_acc() diff --git a/public/js/transaction.js b/public/js/transaction.js index 79ea53623f..3cb40514a8 100644 --- a/public/js/transaction.js +++ b/public/js/transaction.js @@ -173,8 +173,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ this.frm.doc.plc_conversion_rate !== this.frm.doc.conversion_rate) { this.frm.set_value("plc_conversion_rate", this.frm.doc.conversion_rate); } - - this.calculate_taxes_and_totals(); + if(flt(this.frm.doc.conversion_rate)>0.0) this.calculate_taxes_and_totals(); }, get_price_list_currency: function(buying_or_selling) { diff --git a/selling/doctype/quotation/quotation.py b/selling/doctype/quotation/quotation.py index 8eb3654e62..8209548fcb 100644 --- a/selling/doctype/quotation/quotation.py +++ b/selling/doctype/quotation/quotation.py @@ -111,8 +111,6 @@ class DocType(SellingController): sales_com_obj = get_obj('Sales Common') sales_com_obj.check_active_sales_items(self) sales_com_obj.validate_max_discount(self,'quotation_details') - sales_com_obj.check_conversion_rate(self) - def on_update(self): # Set Quotation Status diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py index 8271c82874..ad626da460 100644 --- a/selling/doctype/sales_common/sales_common.py +++ b/selling/doctype/sales_common/sales_common.py @@ -74,21 +74,6 @@ class DocType(TransactionBase): msgprint("You cannot give more than " + cstr(discount[0]['max_discount']) + " % discount on Item Code : "+cstr(d.item_code)) raise Exception - # Check Conversion Rate (i.e. it will not allow conversion rate to be 1 for Currency other than default currency set in Global Defaults) - # =========================================================================== - def check_conversion_rate(self, obj): - default_currency = get_company_currency(obj.doc.company) - if not default_currency: - msgprint('Message: Please enter default currency in Company Master') - raise Exception - if (obj.doc.currency == default_currency and flt(obj.doc.conversion_rate) != 1.00) or not obj.doc.conversion_rate or (obj.doc.currency != default_currency and flt(obj.doc.conversion_rate) == 1.00): - msgprint("Please Enter Appropriate Conversion Rate for Customer's Currency to Base Currency (%s --> %s)" % (obj.doc.currency, default_currency), raise_exception = 1) - - if (obj.doc.price_list_currency == default_currency and flt(obj.doc.plc_conversion_rate) != 1.00) or not obj.doc.plc_conversion_rate or (obj.doc.price_list_currency != default_currency and flt(obj.doc.plc_conversion_rate) == 1.00): - msgprint("Please Enter Appropriate Conversion Rate for Price List Currency to Base Currency (%s --> %s)" % (obj.doc.price_list_currency, default_currency), raise_exception = 1) - - - # Get Tax rate if account type is TAX # ========================================================================= def get_rate(self, arg): diff --git a/selling/doctype/sales_order/sales_order.py b/selling/doctype/sales_order/sales_order.py index 435a9768aa..66b487e450 100644 --- a/selling/doctype/sales_order/sales_order.py +++ b/selling/doctype/sales_order/sales_order.py @@ -130,7 +130,7 @@ class DocType(SellingController): self.validate_warehouse() sales_com_obj = get_obj(dt = 'Sales Common') sales_com_obj.check_active_sales_items(self) - sales_com_obj.check_conversion_rate(self) + sales_com_obj.validate_max_discount(self,'sales_order_details') self.doclist = sales_com_obj.make_packing_list(self,'sales_order_details') diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index 2d1a3bece6..eb2b204d0c 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -95,7 +95,7 @@ class DocType(SellingController): self.validate_uom_is_integer("stock_uom", "qty") sales_com_obj.validate_max_discount(self, 'delivery_note_details') - sales_com_obj.check_conversion_rate(self) + # Set actual qty for each item in selected warehouse self.update_current_stock()