[fix] [minor] show stock ledger, general ledger, fixes post changes in script manager trigger [issue] webnotes/wnframework#228

This commit is contained in:
Anand Doshi
2013-07-30 14:42:15 +05:30
parent 7180eb6f20
commit a648f46d4e
16 changed files with 106 additions and 103 deletions

View File

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

View File

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

View File

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

View File

@@ -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("");
}