PageRenderTime 28ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/reports/sales_items_by_customer.asp

http://github.com/khaneh/Orders
ASP | 22 lines | 15 code | 6 blank | 1 comment | 0 complexity | 1558d629831ad9cd691cd4d0f96a9572 MD5 | raw file
 1<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%
 2Response.CodePage = 65001
 3Response.CharSet = "utf-8"
 4
 5'Response.Buffer=false
 6reportTitle = "گزارش آيتم هاي فروش بر حسب مشتري"
 7%>
 8<!--#include File="../include_farsiDateHandling.asp"-->
 9<!--#include File="../include_JS_InputMasks.asp"-->
10
11<!--#include File="reports_top.asp"-->
12<%
13	dateFrom = request("dateFrom")
14	dateTo = request("dateTo")
15	salses_items = request("salses_items")
16
17	mySQL = "SELECT InvoiceLines.Item AS [كد آيتم فروش], SUM(InvoiceLines.AppQtty) AS [تعداد فروش], COUNT(InvoiceLines.AppQtty) AS [تعداد فاكتور], SUM(InvoiceLines.Price)  AS قيمت, SUM(InvoiceLines.Discount) AS تخفيف, SUM(InvoiceLines.Reverse) AS برگشت,SUM(InvoiceLines.Vat) AS ماليات , Accounts.ID AS [حساب مشتري], Accounts.AccountTitle AS [نام مشتري],  Users.RealName AS [مسئول حساب] FROM InvoiceLines INNER JOIN Invoices ON InvoiceLines.Invoice = Invoices.ID INNER JOIN Accounts ON Invoices.Customer = Accounts.ID INNER JOIN Users ON Accounts.CSR = Users.ID WHERE (Invoices.Voided = 0) AND (Invoices.Issued = 1) AND (InvoiceLines.Item IN (" & salses_items & ")) AND (Invoices.IssuedDate >= N'" & dateFrom & "') AND (Invoices.IssuedDate <= N'" & dateTo & "') GROUP BY InvoiceLines.Item, Accounts.ID, Accounts.AccountTitle, Users.RealName ORDER BY Accounts.AccountTitle"
18
19%>
20<!--#include File="reports_tah.asp"-->
21
22