PageRenderTime 20ms CodeModel.GetById 18ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/reports/invoices_isA_by_customer.asp

http://github.com/khaneh/Orders
ASP | 24 lines | 14 code | 8 blank | 2 comment | 0 complexity | ce4da37e3cb368dec098b23ed8953940 MD5 | raw file
 1<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%
 2'Response.Buffer=false
 3Response.CodePage = 65001
 4Response.CharSet = "utf-8"
 5
 6reportTitle = "گزارش جمع فروش و برگشت الف بر حسب مشتري"
 7%>
 8<!--#include File="../include_farsiDateHandling.asp"-->
 9<!--#include File="../include_JS_InputMasks.asp"-->
10
11
12<!--#include File="reports_top.asp"-->
13<%
14
15	dateFrom = request("dateFrom")
16	dateTo = request("dateTo")
17
18
19	mySQL = "SELECT Accounts.ID AS كد, Accounts.AccountTitle AS [عنوان حساب], Accounts.City1 AS شهر, Accounts.Address1 AS آدرس, Accounts.EconomicalCode AS كداقتصادي, SUM(Invoices.IsReverse * Invoices.TotalReceivable) AS SumReverse, SUM((1 - Invoices.IsReverse) * Invoices.TotalReceivable) AS [جمع برگشت], COUNT(Accounts.AccountTitle) AS InvoiceCount FROM Accounts INNER JOIN Invoices ON Accounts.ID = Invoices.Customer WHERE (Invoices.Issued = 1) AND (Invoices.Voided = 0) AND (Invoices.IssuedDate >= N'" & dateFrom & "') AND (Invoices.IssuedDate <= N'" & dateTo & "') AND (Invoices.IsA = 1) GROUP BY Accounts.AccountTitle, Accounts.EconomicalCode, Accounts.ID, Accounts.City1, Accounts.Address1, Accounts.Tel1, Accounts.Mobile1 ORDER BY Accounts.ID"
20	
21	'mySQL = "SELECT Accounts.ID AS كد, Accounts.AccountTitle AS [عنوان حساب], Accounts.City1 AS شهر, Accounts.Address1 AS آدرس, Accounts.Tel1 AS تلفن, Accounts.Mobile1 AS موبايل, Accounts.EconomicalCode AS كداقتصادي, SUM(Invoices.IsReverse * Invoices.TotalReceivable) AS [جمع برگشت], SUM((1 - Invoices.IsReverse) * Invoices.TotalReceivable) AS [جمع فاكتور], COUNT(Accounts.AccountTitle) AS [تعداد فاكتورها] FROM Accounts INNER JOIN Invoices ON Accounts.ID = Invoices.Customer WHERE (Invoices.Issued = 1) AND (Invoices.Voided = 0) AND (Invoices.IssuedDate >= N'" & dateFrom & "') AND (Invoices.IssuedDate <= N'" & dateTo & "') AND (Invoices.IsA = 1) GROUP BY Accounts.AccountTitle, Accounts.EconomicalCode, Accounts.ID, Accounts.City1, Accounts.Address1, Accounts.Tel1, Accounts.Mobile1 ORDER BY Accounts.ID"
22	
23%>
24<!--#include File="reports_tah.asp"-->