[fix] shot ledger buttons for closed DN / PR

This commit is contained in:
Rushabh Mehta
2015-11-04 15:31:41 +05:30
parent d48c2394e8
commit 20a7d820ab
3 changed files with 19 additions and 19 deletions

View File

@@ -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) {

View File

@@ -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") {

View File

@@ -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'),