Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry_list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
frappe.listview_settings["Payment Entry"] = {
add_fields: ["unallocated_amount", "docstatus"],
get_indicator: function (doc) {
if (doc.docstatus === 2) {
return [__("Cancelled"), "red", "docstatus,=,2"];
}

if (doc.docstatus === 0) {
return [__("Draft"), "orange", "docstatus,=,0"];
}

if (flt(doc.unallocated_amount) > 0) {
return [__("Unreconciled"), "orange", "docstatus,=,1|unallocated_amount,>,0"];
}

return [__("Reconciled"), "green", "docstatus,=,1|unallocated_amount,=,0"];
},
onload: function (listview) {
if (listview.page.fields_dict.party_type) {
listview.page.fields_dict.party_type.get_query = function () {
Expand Down
16 changes: 14 additions & 2 deletions erpnext/public/js/utils/unreconcile.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ erpnext.accounts.unreconcile_payment = {
selected_allocations
);
erpnext.accounts.unreconcile_payment.create_unreconcile_docs(
selection_map
selection_map,
frm
);
d.hide();
} else {
Expand All @@ -156,12 +157,23 @@ erpnext.accounts.unreconcile_payment = {
}
},

create_unreconcile_docs(selection_map) {
create_unreconcile_docs(selection_map, frm) {
frappe.call({
method: "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.create_unreconcile_doc_for_selection",
args: {
selections: selection_map,
},
callback: function (r) {
if (r.exc) {
return;
}

if (frm && !frm.is_new()) {
frm.reload_doc();
}

frappe.show_alert({ message: __("Unreconciled successfully"), indicator: "green" });
},
});
},
};
Loading