Merge branch 'master' into staging

This commit is contained in:
Saurabh 2017-11-02 12:14:42 +05:30
commit 62fd4007b0
8 changed files with 33 additions and 26 deletions

View File

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

View File

@ -648,13 +648,13 @@ frappe.ui.form.on('Payment Entry', {
set_difference_amount: function(frm) {
var unallocated_amount = 0;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
if(frm.doc.party) {
var party_amount = frm.doc.payment_type=="Receive" ?
frm.doc.paid_amount : frm.doc.received_amount;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
if(frm.doc.total_allocated_amount < party_amount) {
if(frm.doc.payment_type == "Receive") {
unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions);

View File

@ -87,6 +87,7 @@ frappe.ui.form.on('Employee Loan', {
},
employee_loan_application: function (frm) {
if(frm.doc.employee_loan_application){
return frappe.call({
method: "erpnext.hr.doctype.employee_loan.employee_loan.get_employee_loan_application",
args: {
@ -102,7 +103,8 @@ frappe.ui.form.on('Employee Loan', {
frm.set_value("rate_of_interest", r.message.rate_of_interest);
}
}
})
});
}
},
repayment_method: function (frm) {

View File

@ -34,7 +34,9 @@ def get_categories():
return response
@frappe.whitelist()
def get_item_details(hub_sync_id):
def get_item_details(hub_sync_id=None):
if not hub_sync_id:
return
connection = get_connection()
return connection.get_doc('Hub Item', hub_sync_id)

View File

@ -382,6 +382,7 @@ erpnext.hub.Hub = class Hub {
},
method: "erpnext.hub_node.get_item_details",
callback: (r) => {
if (!r || !r.message) return;
let item = r.message;
this.item_cache[item_code] = item;
this.render_item_page(item);

View File

@ -477,6 +477,8 @@ def make_delivery_note(source_name, target_doc=None):
target.qty = flt(source.qty) - flt(source.delivered_qty)
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
if item:
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
or item.selling_cost_center \
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")

View File

@ -57,7 +57,7 @@ class Item(WebsiteGenerator):
if not self.description:
self.description = self.item_name
if self.is_sales_item and not self.is_item_from_hub:
if self.is_sales_item and not self.get('is_item_from_hub'):
self.publish_in_hub = 1
def after_insert(self):

View File

@ -32,7 +32,7 @@ class Issue(Document):
if email_id:
if not self.lead:
self.lead = frappe.db.get_value("Lead", {"email_id": email_id})
if not self.contact:
if not self.contact and not self.customer:
self.contact = frappe.db.get_value("Contact", {"email_id": email_id})
if self.contact: