fix: not able to cancel sales invoice (#38979) (cherry picked from commit a117ef3cb88223f0a9f94f863e232b2771b277c8) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
parent
4e2304818b
commit
f8625f3eb7
@ -35,7 +35,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
super.onload();
|
super.onload();
|
||||||
|
|
||||||
// Ignore linked advances
|
// Ignore linked advances
|
||||||
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
|
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries", "Serial and Batch Bundle"];
|
||||||
|
|
||||||
if(!this.frm.doc.__islocal) {
|
if(!this.frm.doc.__islocal) {
|
||||||
// show credit_to in print format
|
// show credit_to in print format
|
||||||
@ -408,6 +408,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
}
|
}
|
||||||
|
|
||||||
on_submit() {
|
on_submit() {
|
||||||
|
super.on_submit();
|
||||||
|
|
||||||
$.each(this.frm.doc["items"] || [], function(i, row) {
|
$.each(this.frm.doc["items"] || [], function(i, row) {
|
||||||
if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt)
|
if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt)
|
||||||
})
|
})
|
||||||
|
@ -37,7 +37,9 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
|
|||||||
super.onload();
|
super.onload();
|
||||||
|
|
||||||
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log',
|
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log',
|
||||||
'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
|
'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries",
|
||||||
|
'Serial and Batch Bundle'
|
||||||
|
];
|
||||||
|
|
||||||
if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
|
if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
|
||||||
// show debit_to in print format
|
// show debit_to in print format
|
||||||
@ -197,6 +199,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
|
|||||||
on_submit(doc, dt, dn) {
|
on_submit(doc, dt, dn) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
super.on_submit();
|
||||||
if (frappe.get_route()[0] != 'Form') {
|
if (frappe.get_route()[0] != 'Form') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -715,6 +715,11 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
|
|
||||||
on_submit() {
|
on_submit() {
|
||||||
|
if (in_list(["Purchase Invoice", "Sales Invoice"], this.frm.doc.doctype)
|
||||||
|
&& !this.frm.doc.update_stock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.refresh_serial_batch_bundle_field();
|
this.refresh_serial_batch_bundle_field();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user