Problem in new query report

70 views
Skip to first unread message

Amit Bondwal

unread,
Sep 4, 2014, 5:12:58 AM9/4/14
to erpnext-u...@googlegroups.com
Hi Everyone,

I write a sql query to calculate the profit base on only buying price and selling price and percentage profit itemwise,  and total profit on base of quantity of items.
It works fine in mariadb database console. 
But when I tried to build a query report it give the below error:-

My sql query is given below:--

Write a SELECT query. Note result is not paged (all data is sent in one go).To format columns, give column labels in the query.
[Label]:[Field Type]/[Options]:[Width]

Example:
Employee:Link/Employee:200
Rate:Currency:120

My sql query is given below:--

select `tabSales Invoice Item`.name,`tabSales Invoice Item`.creation,`tabSales Invoice Item`.item_name,`tabSales Invoice Item`.rate,`tabItem Price`.price_list_rate,((`tabSales Invoice Item`.rate-`tabItem Price`.price_list_rate)*100)/`tabItem Price`.price_list_rate AS "% Profit on each Item",  `tabSales Invoice Item`.qty,    `tabItem Price`.price_list_rate*`tabSales Invoice Item`.qty AS "Total_Buyuing_Price",`tabSales Invoice Item`.amount,`tabSales Invoice Item`.amount-(`tabItem Price`.price_list_rate*`tabSales Invoice Item`.qty) AS "Total Profit on no. of Items"  from `tabSales Invoice Item`,`tabItem Price` where `tabSales Invoice Item`.item_name=`tabItem Price`.item_name AND `tabItem Price`.buying=1 order by `tabSales Invoice Item`.name;



Could you help me to build this query report.

Regards

Amit Bondwal

Anand Doshi

unread,
Sep 4, 2014, 5:41:23 AM9/4/14
to ERPNext User's Forum
Make sure there is no empty space or blank line before "select..."

-Anand.


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/9bd96ec3-46d8-4d32-a057-5000635b71c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amit Bondwal

unread,
Sep 4, 2014, 6:08:39 AM9/4/14
to erpnext-u...@googlegroups.com
Hi Anand,

There is no extra space before "select".

Regards

Amit


Anand Doshi

unread,
Sep 4, 2014, 6:44:08 AM9/4/14
to ERPNext User's Forum
Can you send javascript console's output?

-Anand.


Amit Bondwal

unread,
Sep 4, 2014, 7:00:14 AM9/4/14
to erpnext-u...@googlegroups.com
Hi Anand, 

I did not put any javascript, I put the sql query in query section and left the java script blank,  Then I got a error which I have pasted in my previous mail, I tested my sql query in cmmand line interface only.

I don't know how to build query report. Is there any link or example to build query report. That will be much helpful.

Regards
Amit Bondwal



Anand Doshi

unread,
Sep 4, 2014, 7:06:37 AM9/4/14
to ERPNext User's Forum
Amit,

We display our server-side error messages in the javascript console. Hence, check if there are any errors. Also, check the network tab for a response with an error.

-Anand.



Amit Bondwal

unread,
Sep 4, 2014, 7:28:15 AM9/4/14
to erpnext-u...@googlegroups.com
Hi Anand,

Where can I check these logs?



Anand Doshi

unread,
Sep 4, 2014, 7:37:31 AM9/4/14
to ERPNext User's Forum
Reply all
Reply to author
Forward
0 new messages