feat: Auto allocate advance payments only against orders (#34727)
feat: Auto allocate advance payments only againt orders
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index a07f75d..d943126 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -55,6 +55,14 @@
},
allocate_advances_automatically: function(frm) {
+ frm.trigger('fetch_advances');
+ },
+
+ only_include_allocated_payments: function(frm) {
+ frm.trigger('fetch_advances');
+ },
+
+ fetch_advances: function(frm) {
if(frm.doc.allocate_advances_automatically) {
frappe.call({
doc: frm.doc,