Merge pull request #11406 from rohitwaghchaure/payment_entry_differnece_amount_issue

[Fix] Wrong difference amount in the payment entry for the internal transfer type
This commit is contained in:
Saurabh 2017-11-02 12:07:14 +05:30 committed by GitHub
commit 38008f8daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);