mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
[fix] [minor] show stock ledger, general ledger, fixes post changes in script manager trigger [issue] webnotes/wnframework#228
This commit is contained in:
@@ -36,6 +36,8 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
||||
|
||||
if (doc.docstatus==1) {
|
||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
||||
this.show_stock_ledger();
|
||||
this.show_general_ledger();
|
||||
}
|
||||
|
||||
if(doc.docstatus==0 && !doc.__islocal) {
|
||||
|
||||
@@ -33,6 +33,9 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
||||
this.make_purchase_invoice);
|
||||
}
|
||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
|
||||
|
||||
this.show_stock_ledger();
|
||||
this.show_general_ledger();
|
||||
}
|
||||
|
||||
cur_frm.add_custom_button(wn._('From Purchase Order'),
|
||||
@@ -68,6 +71,10 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
||||
var item = wn.model.get_doc(cdt, cdn);
|
||||
wn.model.round_floats_in(item, ["qty", "received_qty"]);
|
||||
|
||||
if(!(item.received_qty || item.rejected_qty) && item.qty) {
|
||||
item.received_qty = item.qty;
|
||||
}
|
||||
|
||||
if(item.qty > item.received_qty) {
|
||||
msgprint(wn._("Error") + ": " + wn._(wn.meta.get_label(item.doctype, "qty", item.name))
|
||||
+ " > " + wn._(wn.meta.get_label(item.doctype, "received_qty", item.name)));
|
||||
|
||||
@@ -25,8 +25,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
set_default_account: function() {
|
||||
var me = this;
|
||||
|
||||
if (sys_defaults.auto_inventory_accounting && !this.frm.doc.expense_adjustment_account) {
|
||||
if (this.frm.doc.purpose == "Sales Return")
|
||||
if (cint(wn.defaults.get_default("auto_inventory_accounting")) && !this.frm.doc.expense_adjustment_account) {
|
||||
if (this.frm.doc.purpose == "Sales Return")
|
||||
account_for = "stock_in_hand_account";
|
||||
else if (this.frm.doc.purpose == "Purchase Return")
|
||||
account_for = "stock_received_but_not_billed";
|
||||
@@ -78,7 +78,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
}
|
||||
};
|
||||
|
||||
if (sys_defaults.auto_inventory_accounting) {
|
||||
if(cint(wn.defaults.get_default("auto_inventory_accounting"))) {
|
||||
this.frm.add_fetch("company", "stock_adjustment_account", "expense_adjustment_account");
|
||||
|
||||
this.frm.fields_dict["expense_adjustment_account"].get_query = function() {
|
||||
@@ -105,11 +105,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
erpnext.hide_naming_series();
|
||||
this.toggle_related_fields(this.frm.doc);
|
||||
this.toggle_enable_bom();
|
||||
if (this.frm.doc.docstatus==1) {
|
||||
this.show_stock_ledger();
|
||||
if(wn.boot.auto_inventory_accounting)
|
||||
this.show_general_ledger();
|
||||
}
|
||||
this.show_stock_ledger();
|
||||
this.show_general_ledger();
|
||||
|
||||
if(this.frm.doc.docstatus === 1 &&
|
||||
wn.boot.profile.can_create.indexOf("Journal Voucher")!==-1) {
|
||||
|
||||
@@ -68,6 +68,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
|
||||
} else if(this.frm.doc.docstatus == 1) {
|
||||
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify its effect.");
|
||||
this.show_stock_ledger();
|
||||
this.show_general_ledger();
|
||||
} else {
|
||||
this.frm.set_intro("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user