[minor] fixes for expense claim status

This commit is contained in:
mbauskar 2017-04-25 12:55:21 +05:30 committed by Nabin Hait
parent 5687e2da9d
commit 9cf6d630e9
4 changed files with 27 additions and 3 deletions

View File

@ -514,7 +514,7 @@ class JournalEntry(AccountsController):
def update_expense_claim(self):
for d in self.accounts:
if d.reference_type=="Expense Claim" and d.party:
if d.reference_type=="Expense Claim" and d.reference_name:
doc = frappe.get_doc("Expense Claim", d.reference_name)
update_reimbursed_amount(doc)

View File

@ -18,14 +18,20 @@ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({
});
},
expense_type: function(frm, cdt, cdn) {
expense_type: function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!doc.company) {
d.expense_type = "";
frappe.msgprint(__("Please set the Company"));
this.frm.refresh_fields()
return;
}
return frappe.call({
method: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_claim_account",
args: {
"expense_claim_type": d.expense_type,
"company": frm.company
"company": doc.company
},
callback: function(r) {
if (r.message) {

View File

@ -389,3 +389,4 @@ erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate
erpnext.patches.v8_0.set_null_to_serial_nos_for_disabled_sales_invoices
erpnext.patches.v8_0.enable_booking_asset_depreciation_automatically
erpnext.patches.v8_0.set_project_copied_from
erpnext.patches.v8_0.update_status_as_paid_for_completed_expense_claim

View File

@ -0,0 +1,17 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
""" set status as Paid in Expense Claim if total_sactioned_amount
and total_amount_reimbursed is equal """
frappe.db.sql("""
update
`tabExpense Claim`
set status = 'Paid'
where
total_sanctioned_amount = total_amount_reimbursed
""")