From cfb54ceb43cd620c1eb6e9da40f18c49e460d871 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 Jul 2013 11:38:08 +0530 Subject: [PATCH 1/2] [material request/purchase order] [bug] required date automatically set #433 --- .../purchase_common/purchase_common.js | 3 +- .../purchase_order_item.txt | 30 +++++++++---------- .../material_request_item.txt | 30 +++++++++---------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index 0d4a615ec1..1974aa7f8e 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -107,7 +107,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ plc_conversion_rate: me.frm.doc.plc_conversion_rate, is_subcontracted: me.frm.doc.is_subcontracted, company: me.frm.doc.company, - currency: me.frm.doc.currency + currency: me.frm.doc.currency, + transaction_date: me.frm.doc.transaction_date } }, callback: function(r) { diff --git a/buying/doctype/purchase_order_item/purchase_order_item.txt b/buying/doctype/purchase_order_item/purchase_order_item.txt index 1ee27004df..d73f115a3a 100755 --- a/buying/doctype/purchase_order_item/purchase_order_item.txt +++ b/buying/doctype/purchase_order_item/purchase_order_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:06", "docstatus": 0, - "modified": "2013-07-08 13:51:42", + "modified": "2013-07-09 11:37:24", "modified_by": "Administrator", "owner": "Administrator" }, @@ -25,6 +25,20 @@ "doctype": "DocType", "name": "Purchase Order Item" }, + { + "doctype": "DocField", + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "print_hide": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, { "doctype": "DocField", "fieldname": "schedule_date", @@ -40,20 +54,6 @@ "reqd": 1, "search_index": 1 }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 0, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, { "description": "If Supplier Part Number exists for given Item, it gets stored here", "doctype": "DocField", diff --git a/stock/doctype/material_request_item/material_request_item.txt b/stock/doctype/material_request_item/material_request_item.txt index 7d9a417211..992b4cf239 100644 --- a/stock/doctype/material_request_item/material_request_item.txt +++ b/stock/doctype/material_request_item/material_request_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-22 01:28:02", "docstatus": 0, - "modified": "2013-03-07 07:03:25", + "modified": "2013-07-09 11:37:12", "modified_by": "Administrator", "owner": "Administrator" }, @@ -25,20 +25,6 @@ "doctype": "DocType", "name": "Material Request Item" }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "schedule_date", - "fieldtype": "Date", - "label": "Required Date", - "no_copy": 1, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "print_hide": 0, - "print_width": "100px", - "reqd": 1, - "width": "100px" - }, { "doctype": "DocField", "fieldname": "item_code", @@ -53,6 +39,20 @@ "search_index": 1, "width": "100px" }, + { + "allow_on_submit": 0, + "doctype": "DocField", + "fieldname": "schedule_date", + "fieldtype": "Date", + "label": "Required Date", + "no_copy": 1, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "print_hide": 0, + "print_width": "100px", + "reqd": 1, + "width": "100px" + }, { "doctype": "DocField", "fieldname": "description", From 5758f7e3b75a80aef7e678714660700600668be3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 Jul 2013 12:05:33 +0530 Subject: [PATCH 2/2] [stock-entry] show gl if auto inventory accounting #561 --- public/js/controllers/stock_controller.js | 14 +++++++++++++- stock/doctype/delivery_note/delivery_note.js | 4 +++- stock/doctype/stock_entry/stock_entry.js | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/public/js/controllers/stock_controller.js b/public/js/controllers/stock_controller.js index 3021d756b9..ccbca4e9c0 100644 --- a/public/js/controllers/stock_controller.js +++ b/public/js/controllers/stock_controller.js @@ -19,7 +19,7 @@ wn.provide("erpnext.stock"); erpnext.stock.StockController = wn.ui.form.Controller.extend({ show_stock_ledger: function() { var me = this; - this.frm.add_custom_button("Show Stock Ledger", function() { + this.frm.add_custom_button("Stock Ledger", function() { wn.route_options = { voucher_no: me.frm.doc.name, from_date: cur_frm.doc.posting_date, @@ -27,5 +27,17 @@ erpnext.stock.StockController = wn.ui.form.Controller.extend({ }; wn.set_route('stock-ledger'); }, "icon-bar-chart"); + }, + show_general_ledger: function() { + if(doc.docstatus==1) { + cur_frm.add_custom_button('Accounting Ledger', function() { + wn.route_options = { + "voucher_no": doc.name, + "from_date": doc.posting_date, + "to_date": doc.posting_date, + }; + wn.set_route("general-ledger"); + }); + } } }); \ No newline at end of file diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js index 117e77eacb..936ca9eb5e 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/stock/doctype/delivery_note/delivery_note.js @@ -34,7 +34,9 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Installation Note', this.make_installation_note); - if (doc.docstatus==1) cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); + if (doc.docstatus==1) { + cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); + } if(doc.docstatus==0 && !doc.__islocal) { cur_frm.add_custom_button('Make Packing Slip', cur_frm.cscript['Make Packing Slip']); diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 1f4aafa9e5..468d3d7a96 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -103,6 +103,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ this.toggle_enable_bom(); if (this.frm.doc.docstatus==1) { this.show_stock_ledger(); + if(wn.boot.auto_inventory_accounting) + this.show_general_ledger(); } if(this.frm.doc.docstatus === 1 &&