Merge branch 'master' into develop

This commit is contained in:
Saurabh 2017-07-25 16:15:50 +05:30
commit fb4f320df4
3 changed files with 17 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe
from erpnext.hooks import regional_overrides
__version__ = '8.5.4'
__version__ = '8.5.5'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -514,6 +514,12 @@ def check_if_scrap_warehouse_mandatory(bom_no):
return res
@frappe.whitelist()
def set_production_order_ops(name):
po = frappe.get_doc('Production Order', name)
po.set_production_order_operations()
po.save()
@frappe.whitelist()
def make_stock_entry(production_order_id, purpose, qty=None):
production_order = frappe.get_doc("Production Order", production_order_id)

View File

@ -40,8 +40,10 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
},
calculate_discount_amount: function(){
if (frappe.meta.get_docfield(this.frm.doc.doctype, "discount_amount"))
if (frappe.meta.get_docfield(this.frm.doc.doctype, "discount_amount")) {
this.set_discount_amount();
this.apply_discount_amount();
}
},
_calculate_taxes_and_totals: function() {
@ -451,6 +453,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
}
},
set_discount_amount: function() {
if(this.frm.doc.additional_discount_percentage) {
this.frm.doc.discount_amount = flt(flt(this.frm.doc[frappe.scrub(this.frm.doc.apply_discount_on)])
* this.frm.doc.additional_discount_percentage / 100, precision("discount_amount"));
}
},
apply_discount_amount: function() {
var me = this;
var distributed_amount = 0.0;