mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
[usability] item price moved to price list
This commit is contained in:
@@ -31,13 +31,9 @@ class DocType:
|
||||
def get_item_details(self, name):
|
||||
det = webnotes.conn.sql("""select description, stock_uom from `tabItem`
|
||||
where name = %s""", name)
|
||||
rate = webnotes.conn.sql("""select ref_rate from `tabItem Price`
|
||||
where price_list = %s and parent = %s
|
||||
and ref_currency = %s""", (self.doc.price_list, name, self.doc.currency))
|
||||
return {
|
||||
'description' : det and det[0][0] or '',
|
||||
'uom': det and det[0][1] or '',
|
||||
'rate': rate and flt(rate[0][0]) or 0.00
|
||||
'uom': det and det[0][1] or ''
|
||||
}
|
||||
|
||||
def check_duplicate(self, finder=0):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-23 16:55:51",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-10 14:54:19",
|
||||
"modified": "2013-09-09 15:47:56",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -53,17 +53,18 @@
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"oldfieldtype": "Text",
|
||||
"print_width": "300px",
|
||||
"width": "300px"
|
||||
"print_width": "300px"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "rate",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"hidden": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Rate",
|
||||
"oldfieldname": "rate",
|
||||
"oldfieldtype": "Currency"
|
||||
"oldfieldtype": "Currency",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
|
||||
@@ -49,16 +49,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
this.frm.set_query("selling_price_list", function() {
|
||||
return { filters: { buying_or_selling: "Selling" } };
|
||||
});
|
||||
|
||||
this.frm.set_query("price_list_currency", function() {
|
||||
return {
|
||||
query: "controllers.queries.get_price_list_currency",
|
||||
filters: {
|
||||
price_list: me.frm.doc.selling_price_list,
|
||||
buying_or_selling: "Selling"
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
if(!this.fname) {
|
||||
|
||||
@@ -141,20 +141,19 @@ def _get_basic_details(args, item_bean, warehouse_fieldname):
|
||||
return out
|
||||
|
||||
def _get_price_list_rate(args, item_bean, meta):
|
||||
base_ref_rate = item_bean.doclist.get({
|
||||
"parentfield": "ref_rate_details",
|
||||
"price_list": args.selling_price_list,
|
||||
"ref_currency": args.price_list_currency,
|
||||
"buying_or_selling": "Selling"})
|
||||
ref_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip,
|
||||
`tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and
|
||||
ip.item_code=%s and pl.buying_or_selling='Selling'""",
|
||||
(args.selling_price_list, args.item_code), as_dict=1)
|
||||
|
||||
if not base_ref_rate:
|
||||
if not ref_rate:
|
||||
return {}
|
||||
|
||||
# found price list rate - now we can validate
|
||||
from utilities.transaction_base import validate_currency
|
||||
validate_currency(args, item_bean.doc, meta)
|
||||
|
||||
return {"ref_rate": flt(base_ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)}
|
||||
return {"ref_rate": flt(ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)}
|
||||
|
||||
def _get_item_discount(item_group, customer):
|
||||
parent_item_groups = [x[0] for x in webnotes.conn.sql("""SELECT parent.name
|
||||
|
||||
Reference in New Issue
Block a user