[Feature] Provision to allow unlink the payment against the invoice

This commit is contained in:
Rohit Waghchaure 2016-10-19 17:03:23 +05:30
parent 05245d6328
commit 8055bd39ba
4 changed files with 37 additions and 4 deletions

View File

@ -10,6 +10,7 @@
"doctype": "DocType",
"document_type": "Other",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
@ -194,6 +195,32 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "unlink_payment_on_cancellation_of_invoice",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Unlink Payment on Cancellation of Invoice",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@ -207,8 +234,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-10-05 16:13:10.978208",
"modified_by": "rohitw1991@gmail.com",
"modified": "2016-10-19 16:37:11.664552",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
"owner": "Administrator",

View File

@ -578,6 +578,7 @@ class PurchaseInvoice(BuyingController):
if not self.is_return:
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
if frappe.db.get_single_value('Accounts Settings', 'unlink_payment_on_cancellation_of_invoice'):
unlink_ref_doc_from_payment_entries(self.doctype, self.name)
self.update_prevdoc_status()

View File

@ -136,6 +136,7 @@ class SalesInvoice(SellingController):
self.check_close_sales_order("sales_order")
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
if frappe.db.get_single_value('Accounts Settings', 'unlink_payment_on_cancellation_of_invoice'):
unlink_ref_doc_from_payment_entries(self.doctype, self.name)
if self.is_return:

View File

@ -7,4 +7,8 @@
* Credit Controller: Role that is allowed to submit transactions that exceed credit limits set.
* Make Payment via Journal Entry: If checked, on invoice if uer has clicked on payment system open the journal entry else payment entry
* Unlink Payment on Cancellation of Invoice: If checked system inlink the payment against the invoice else shows the link error.
{next}