Merge branch 'master' into staging-fixes

This commit is contained in:
Ameya Shenoy 2018-11-05 06:45:04 +00:00
commit 4a75d58d89
No known key found for this signature in database
GPG Key ID: AC016A555657D0A3
4 changed files with 18 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '10.1.66'
__version__ = '10.1.67'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -807,15 +807,25 @@ frappe.ui.form.on('Payment Entry', {
var write_off_row = $.map(frm.doc["deductions"] || [], function(t) {
return t.account==r.message[account] ? t : null; });
if (!write_off_row.length) {
var row = frm.add_child("deductions");
var row = [];
var difference_amount = flt(frm.doc.difference_amount,
precision("difference_amount"));
if (!write_off_row.length && difference_amount) {
row = frm.add_child("deductions");
row.account = r.message[account];
row.cost_center = r.message["cost_center"];
} else {
var row = write_off_row[0];
row = write_off_row[0];
}
if (row) {
row.amount = flt(row.amount) + difference_amount;
} else {
frappe.msgprint(__("No gain or loss in the exchange rate"))
}
row.amount = flt(row.amount) + flt(frm.doc.difference_amount);
refresh_field("deductions");
frm.events.set_unallocated_amount(frm);

View File

@ -55,7 +55,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
]
row += [(d.base_net_rate * d.qty)/d.stock_qty, d.base_net_amount] \
if d.stock_uom != d.uom else [d.base_net_rate, d.base_net_amount]
if d.stock_uom != d.uom and d.stock_qty != 0 else [d.base_net_rate, d.base_net_amount]
total_tax = 0
for tax in tax_columns:

View File

@ -69,7 +69,8 @@ class EmployeeAdvance(Document):
where employee_advance = %s and docstatus=1 and allocated_amount > 0
""", self.name)[0][0]
frappe.db.set_value("Employee Advance", self.name, "claimed_amount", flt(claimed_amount))
if claimed_amount:
frappe.db.set_value("Employee Advance", self.name, "claimed_amount", flt(claimed_amount))
@frappe.whitelist()
def get_due_advance_amount(employee, posting_date):