mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
[fix] shot ledger buttons for closed DN / PR
This commit is contained in:
@@ -249,13 +249,7 @@ cur_frm.cscript.update_status = function(label, status){
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript['Unstop Sales Order'] = function() {
|
cur_frm.cscript['Unstop Sales Order'] = function() {
|
||||||
var doc = cur_frm.doc;
|
cur_frm.cscript.update_status('Re-open', 'Draft')
|
||||||
return $c('runserverobj', {
|
|
||||||
'method':'unstop_sales_order',
|
|
||||||
'docs': doc
|
|
||||||
}, function(r,rt) {
|
|
||||||
cur_frm.refresh();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
|
|||||||
@@ -41,12 +41,15 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc.docstatus==1 && doc.status!="Closed") {
|
if (doc.docstatus==1) {
|
||||||
this.show_stock_ledger();
|
this.show_stock_ledger();
|
||||||
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
|
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
|
||||||
this.show_general_ledger();
|
this.show_general_ledger();
|
||||||
}
|
}
|
||||||
cur_frm.add_custom_button(__("Close"), this.close_delivery_note)
|
|
||||||
|
if(doc.status !== "Closed") {
|
||||||
|
cur_frm.add_custom_button(__("Close"), this.close_delivery_note)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1 && !doc.is_return && doc.status!="Closed") {
|
if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1 && !doc.is_return && doc.status!="Closed") {
|
||||||
|
|||||||
@@ -29,10 +29,13 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
refresh: function() {
|
refresh: function() {
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
this.show_stock_ledger();
|
if(this.frm.doc.docstatus===1) {
|
||||||
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
|
this.show_stock_ledger();
|
||||||
this.show_general_ledger();
|
if (cint(frappe.defaults.get_default("auto_accounting_for_stock"))) {
|
||||||
|
this.show_general_ledger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.frm.doc.is_return && this.frm.doc.status!="Closed") {
|
if(!this.frm.doc.is_return && this.frm.doc.status!="Closed") {
|
||||||
if(this.frm.doc.docstatus==0) {
|
if(this.frm.doc.docstatus==0) {
|
||||||
cur_frm.add_custom_button(__('From Purchase Order'),
|
cur_frm.add_custom_button(__('From Purchase Order'),
|
||||||
|
|||||||
Reference in New Issue
Block a user