mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
[cart] create quotation on checkout
This commit is contained in:
@@ -18,12 +18,9 @@ from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes import msgprint, _
|
||||
from webnotes.utils import cint, comma_or
|
||||
from webnotes.model.controller import DocListController
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
class DocType(DocListController):
|
||||
def onload(self):
|
||||
self.doclist.extend(webnotes.conn.sql("""select * from `tabItem Price`
|
||||
where price_list_name=%s""", self.doc.name, as_dict=True, update={"doctype": "Item Price"}))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-25 11:35:09",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-11 20:00:07",
|
||||
"modified": "2013-06-14 16:07:25",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -60,6 +60,13 @@
|
||||
"options": "Currency",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "conversion_rate",
|
||||
"fieldtype": "Float",
|
||||
"label": "Conversion Rate",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "Selling",
|
||||
"doctype": "DocField",
|
||||
|
||||
@@ -3,6 +3,9 @@ test_records = [
|
||||
"doctype": "Price List",
|
||||
"price_list_name": "_Test Price List",
|
||||
"currency": "INR",
|
||||
"valid_for_all_countries": 1
|
||||
"valid_for_all_countries": 1,
|
||||
"buying_or_selling": "Selling",
|
||||
"use_for_website": 1,
|
||||
"conversion_rate": 1.0
|
||||
}]
|
||||
]
|
||||
@@ -41,8 +41,8 @@ def get_price_list_currency(args):
|
||||
args = json.loads(args)
|
||||
|
||||
result = webnotes.conn.sql("""select distinct ref_currency from `tabItem Price`
|
||||
where price_list_name=%s and buying_or_selling=%s""" % ("%s", args.get("buying_or_selling")),
|
||||
(args.get("price_list_name"),))
|
||||
where price_list_name=%s and buying_or_selling=%s""",
|
||||
(args.get("price_list_name"), args.get("buying_or_selling")))
|
||||
if result and len(result)==1:
|
||||
return {"price_list_currency": result[0][0]}
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user