mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
item-wise price list rate, editable report
This commit is contained in:
@@ -67,7 +67,7 @@ class DocType(DocListController):
|
||||
if not self.doc.fields.get("__islocal"):
|
||||
matched=True
|
||||
ref_uom = webnotes.conn.get_value("Stock Ledger Entry",
|
||||
{"item_code": self.doc.name, "is_cancelled": "No"}, "stock_uom")
|
||||
{"item_code": self.doc.name}, "stock_uom")
|
||||
if ref_uom:
|
||||
if cstr(ref_uom) != cstr(self.doc.stock_uom):
|
||||
matched = False
|
||||
|
||||
@@ -7,8 +7,6 @@ import unittest
|
||||
import webnotes
|
||||
import webnotes.defaults
|
||||
from webnotes.utils import cint
|
||||
from accounts.utils import get_stock_and_account_difference
|
||||
|
||||
|
||||
class TestPurchaseReceipt(unittest.TestCase):
|
||||
def test_make_purchase_invoice(self):
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes, unittest
|
||||
from accounts.utils import get_stock_and_account_difference
|
||||
|
||||
test_dependencies = ["Item"]
|
||||
test_records = []
|
||||
|
||||
@@ -22,7 +22,6 @@ class DocType(StockController):
|
||||
|
||||
def on_submit(self):
|
||||
self.insert_stock_ledger_entries()
|
||||
self.set_stock_value_difference()
|
||||
self.make_gl_entries()
|
||||
|
||||
def on_cancel(self):
|
||||
@@ -275,26 +274,6 @@ class DocType(StockController):
|
||||
"posting_time": self.doc.posting_time
|
||||
})
|
||||
|
||||
def set_stock_value_difference(self):
|
||||
"""stock_value_difference is the increment in the stock value"""
|
||||
from stock.utils import get_buying_amount
|
||||
|
||||
item_list = [d.item_code for d in self.entries]
|
||||
warehouse_list = [d.warehouse for d in self.entries]
|
||||
if not (item_list and warehouse_list):
|
||||
webnotes.throw(_("Invalid Item or Warehouse Data"))
|
||||
|
||||
stock_ledger_entries = self.get_stock_ledger_entries(item_list, warehouse_list)
|
||||
|
||||
stock_value_difference = {}
|
||||
for d in self.entries:
|
||||
diff = get_buying_amount(self.doc.doctype, self.doc.name, d.voucher_detail_no,
|
||||
stock_ledger_entries.get((d.item_code, d.warehouse), []))
|
||||
stock_value_difference.setdefault(d.warehouse, 0.0)
|
||||
stock_value_difference[d.warehouse] -= diff
|
||||
|
||||
webnotes.conn.set(self.doc, "stock_value_difference", json.dumps(stock_value_difference))
|
||||
|
||||
def get_gl_entries_for_stock(self, warehouse_account=None):
|
||||
if not self.doc.cost_center:
|
||||
msgprint(_("Please enter Cost Center"), raise_exception=1)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-03-28 10:35:31",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-08-29 16:46:33",
|
||||
"modified": "2013-09-24 15:35:12",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -155,15 +155,6 @@
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "stock_value_difference",
|
||||
"fieldtype": "Long Text",
|
||||
"hidden": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Stock Value Difference",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user