fix: Bulk payment generation against invoices

This commit is contained in:
Deepesh Garg 2022-11-17 15:53:56 +05:30
parent c460141f0d
commit 2dfe849c7d
3 changed files with 8 additions and 6 deletions

View File

@ -63,7 +63,7 @@ frappe.listview_settings["Purchase Invoice"] = {
}); });
listview.page.add_action_item(__("Payment"), ()=>{ listview.page.add_action_item(__("Payment"), ()=>{
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment"); erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
}); });
} }
}; };

View File

@ -29,7 +29,7 @@ frappe.listview_settings['Sales Invoice'] = {
}); });
listview.page.add_action_item(__("Payment"), ()=>{ listview.page.add_action_item(__("Payment"), ()=>{
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment"); erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
}); });
} }
}; };

View File

@ -73,7 +73,7 @@ def task(doc_name, from_doctype, to_doctype):
}, },
"Sales Invoice": { "Sales Invoice": {
"Delivery Note": sales_invoice.make_delivery_note, "Delivery Note": sales_invoice.make_delivery_note,
"Payment": payment_entry.get_payment_entry, "Payment Entry": payment_entry.get_payment_entry,
}, },
"Delivery Note": { "Delivery Note": {
"Sales Invoice": delivery_note.make_sales_invoice, "Sales Invoice": delivery_note.make_sales_invoice,
@ -94,11 +94,11 @@ def task(doc_name, from_doctype, to_doctype):
}, },
"Purchase Invoice": { "Purchase Invoice": {
"Purchase Receipt": purchase_invoice.make_purchase_receipt, "Purchase Receipt": purchase_invoice.make_purchase_receipt,
"Payment": payment_entry.get_payment_entry, "Payment Entry": payment_entry.get_payment_entry,
}, },
"Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice}, "Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice},
} }
if to_doctype in ["Advance Payment", "Payment"]: if to_doctype in ["Advance Payment", "Payment Entry"]:
obj = mapper[from_doctype][to_doctype](from_doctype, doc_name) obj = mapper[from_doctype][to_doctype](from_doctype, doc_name)
else: else:
obj = mapper[from_doctype][to_doctype](doc_name) obj = mapper[from_doctype][to_doctype](doc_name)
@ -151,7 +151,9 @@ def update_logger(doc_name, e, from_doctype, to_doctype, status, log_date=None,
def show_job_status(fail_count, deserialized_data_count, to_doctype): def show_job_status(fail_count, deserialized_data_count, to_doctype):
if not fail_count: if not fail_count:
frappe.msgprint( frappe.msgprint(
_("Creation of {0} successful").format(to_doctype), _("Creation of <b><a href='/app/{0}'>{1}(s)</a></b> successful").format(
to_doctype.lower().replace(" ", "-"), to_doctype
),
title="Successful", title="Successful",
indicator="green", indicator="green",
) )