/beta/order/Inquiry.asp
ASP | 2088 lines | 1850 code | 144 blank | 94 comment | 208 complexity | c083b6c85a1802c3070a0020ba546cc2 MD5 | raw file
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
- 'Order (2)
- PageTitle="استعلام"
- SubmenuItem=9
- if not Auth(2 , 9) then NotAllowdToViewThisPage() 'استعلام
- %>
- <!--#include file="top.asp" -->
- <!--#include File="../include_farsiDateHandling.asp"-->
- <!--#include File="../include_UtilFunctions.asp"-->
- <!--#include File="../include_JS_InputMasks.asp"-->
- <%
- 'Server.ScriptTimeout = 3600
- %>
- <STYLE>
- .CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
- .CustTable td {padding:5;}
- .CustTable a {text-decoration:none;color:#000088}
- .CustTable a:hover {text-decoration:underline;}
- .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
- .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
- .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
- .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
- .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
- </STYLE>
- <%
- '-----------------------------
- ' Trace Quote
- '-----------------------------
- if Request.QueryString("act")="" then
- %>
- <SCRIPT LANGUAGE='JavaScript'>
- <!--
- function checkValidation(){
- if (document.all.search_box.value != ''){
- return true;
- }
- else{
- document.all.search_box.focus();
- return false;
- }
- }
- //-->
- </SCRIPT>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <!-- Trace Quote -->
- <FORM METHOD=POST ACTION="?act=search" onSubmit="return checkValidation();">
- <TR bgcolor="#AAAAEE"><TD colspan="4">
- <FONT SIZE="" COLOR="#555599" ><B>پيگيري استعلام:</B></FONT>
- </TD></TR>
- <TR bgcolor="#AAAAEE">
- <TD>نام مشتري يا شركت يا شماره استعلام:</TD>
- <TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
- <TD><INPUT TYPE="submit" NAME="SubmitB" Value="جستجو" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><% if Auth(2 , 5) then %><A HREF="?act=advancedSearch">جستجوي پيشرفته</A><% End If %></TD>
- </TR>
- </FORM>
- </TABLE>
- </TD></TR>
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <!-- Input Quote -->
- <FORM METHOD=POST ACTION="?act=quoteInpCustSearch" onsubmit="if (document.all.CustomerNameSearchBox.value=='') return false;">
- <TR bgcolor="#AAAAEE">
- <TD>
- <FONT SIZE="" COLOR="#555599" ><B>ورود استعلام جديد:</B></FONT>
- </TD>
- </TR>
- <TR bgcolor="#AAAAEE">
- <TD>گام اول : جستجو براي نام حساب
- <INPUT TYPE="text" NAME="CustomerNameSearchBox">
- <INPUT TYPE="submit" value="جستجو"><br>
- <SCRIPT LANGUAGE="JavaScript">
- document.all.CustomerNameSearchBox.focus();
- </SCRIPT>
- </TD>
- </TR>
- </FORM>
- </TABLE>
- </TD></TR>
- </TABLE>
- <script language="JavaScript">
- document.all.search_box.focus();
- </script>
- <hr>
- <%
- '
- elseif Request.QueryString("act")="search" then
- %>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
- <FORM METHOD=POST ACTION="?act=search" onSubmit="return checkValidation();">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <TR bgcolor="#AAAAEE">
- <TD>نام مشتري يا شركت يا شماره استعلام:</TD>
- <TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
- <TD><INPUT TYPE="submit" NAME="SubmitB" Value="جستجو" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><A HREF="?act=advancedSearch">جستجوي پيشرفته</A></TD>
- </TR>
- </TABLE>
- </TD></TR>
- </FORM>
- </TABLE>
- <script language="JavaScript">
- <!--
- document.all.search_box.focus();
- //-->
- </script>
- <hr>
- <%
-
- search=request("search_box")
- if search="" then
- 'By Default show Open Quotes of Current User
- myCriteria= "Quotes.CreatedBy = " & session("ID")
- elseif isNumeric(search) then
- search=clng(search)
- myCriteria= "Quotes.ID = '"& search & "'"
- else
- search=sqlSafe(search)
- myCriteria= "REPLACE([company_name], ' ', '') LIKE REPLACE(N'%"& search & "%', ' ', '') OR REPLACE([customer_name], ' ', '') LIKE REPLACE(N'%"& search & "%', ' ', '')"
- End If
- mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon , Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued "&_
- " FROM Quotes INNER JOIN "&_
- " OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status LEFT OUTER JOIN "&_
- " Invoices INNER JOIN "&_
- " InvoiceQuoteRelations ON Invoices.ID = InvoiceQuoteRelations.Invoice ON Quotes.ID = InvoiceQuoteRelations.Quote "&_
- " WHERE ("& myCriteria & ") "&_
- " ORDER BY Quotes.order_date DESC, Quotes.ID DESC "
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- tmpCounter=0
- %>
- <div align="center" dir="LTR" >
- <table border="1" cellspacing="0" cellpadding="2" dir="RTL" borderColor="#555588" >
- <TR valign=top bgcolor="#CCCCFF">
- <TD width="41"># استعلام</TD>
- <TD width="65">تاريخ استعلام<br>تاريخ اعتبار</TD>
- <TD width="130">نام شركت - مشتري</TD>
- <TD width="110">عنوان كار</TD>
- <TD width="36">نوع</TD>
- <TD width="76">مرحله</TD>
- <TD width="56">استعلام گيرنده</TD>
- <TD width="40">فاكتور</TD>
- </TR>
- <% Do while not RS1.eof
- if isnull(RS1("InvoiceID")) then
- InvoiceStatus="<span style='color:red;'><b>ندارد</b></span>"
- else
- if RS1("Voided") then
- style="style='color:Red' Title='باطل شده'"
- elseif RS1("Issued") then
- style="style='color:Red' Title='صادر شده'"
- elseif RS1("Approved") then
- style="style='color:Green' Title='تاييد شده'"
- else
- style="style='color:#3399FF' Title='تاييد نشده'"
- end if
- InvoiceStatus="<A " & style & " HREF='../AR/AccountReport.asp?act=showInvoice&invoice=" & RS1("InvoiceID")& "' Target='_blank'>" & RS1("InvoiceID") & "</A>"
- end if
-
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- Else
- tmpColor="#EEEEEE"
- End If
- %>
- <TR valign=top bgcolor="<%=tmpColor%>">
- <TD width="40" DIR="LTR"><A HREF="?act=show"e=<%=RS1("ID")%>" target="_blank"><%=RS1("ID")%></A></TD>
- <TD width="65" DIR="LTR"><%=RS1("order_date")%><br><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
- <TD width="130"><%=RS1("company_name")%><br><span style='color:gray'><%=RS1("customer_name")%></span><br>تلفن:(<%=RS1("telephone")%>) </TD>
- <TD width="80"><%=RS1("order_title")%> </TD>
- <TD width="40"><%=RS1("order_kind")%></TD>
- <TD width="85"><%=RS1("marhale")%></TD>
- <TD width="50"><%=RS1("salesperson")%> </TD>
- <TD width="30"><%=InvoiceStatus%> </TD>
- </TR>
- <TR bgcolor="#FFFFFF">
- <TD colspan="10" style="height:10px"></TD>
- </TR>
- <% RS1.moveNext
- Loop
- %> <TR bgcolor="#ccccFF">
- <TD colspan="10">تعداد نتايج جستجو: <%=tmpCounter%></TD>
- </TR>
- </TABLE>
- </div>
- <HR>
- <%
- elseif request("search_box")<>"" Then
-
- %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
- <TR bgcolor="#FFFFDD">
- <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red;padding:5px;">اين استعلام قابل پيگيري نيست<br>
- (يا قبلا فاكتور شده يا كنسل شده و يا اصلا وجود ندارد)<br><br>
- براي اطمينان به <A HREF="?act=show"e=<%=request("search_box")%>" style="color:blue;">اصلاح و نمايش</A> مراجعه كنيد.</TD>
- </TR>
- </TABLE>
- <%
- End If
- '----------------------------------------------------------------------------------------------------------
- elseif Request.QueryString("act")="approve" then
- if isnumeric(request("quote")) then
- quote=request("quote")
- set rs = Conn.Execute("select * form Quotes where id=" & quote)
- If RS1.EOF then
- response.write "<BR><BR><BR><BR><CENTER>شماره استعلام معتبر نيست</CENTER>"
- response.end
- End If
- msg=""
- if IsNull(rs("qtty")) then msg="تيراژ را ثبت كنيد<br>"
- if IsNull(rs("paperZise") or rs("paperZise")="") then msg=msg &"سايز را ثبت كنيد<br>"
- if IsNull(rs("property") or rs("property")="") then msg=msg & "مشخصات را ثبت كنيد<br>"
- set typeProp = server.createobject("MSXML2.DomDocument")
- set orderProp = server.createobject("MSXML2.DomDocument")
- orderProp.loadXML(rs("property"))
- orderType= rs("type")
- set rs=Conn.Execute("select * from OrderTraceTypes where id="&orderType)
- typeProp.loadXML(rs("property"))
- set rs=nothing
- oldTmp="---first---"
- for each tmp in orderProp.selectNodes("//key")
- if oldTmp <> tmp.parentNode.nodeName then
- oldTmp = tmp.parentNode.nodeName
- key = "/keys/" & oldTmp & "/key"
- oldGroup="---first---"
- oldLabel="---first---"
- maxID=-1
- oldID=-1
- rowEmpty=false
- for each mykey in orderProp.SelectNodes(key)
- id=myKey.GetAttribute("id")
- if maxID<id then maxID=id
- next
- for id = 0 to maxID
- For Each myKey In orderProp.SelectNodes(key & "[@id='" & id & "']")
- thisName = myKey.GetAttribute("name")
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(0)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- thisItem = typeKey.GetAttribute("item")
- if thisName="description" then thisDesc = myKey.text
-
- isRow =false
- if thisName<>"" then
- isRow=true
- 'if ((oldGroup<>thisGroup or oldID<>id) and oldGroup <> "---first---") then
- if oldGroup<>thisGroup or oldID<>id then
- 'if typeKey.GetAttribute("grouplabel")<>""
- a=2
- end if
- 'if oldLabel<>thisLabel and thisType<>"radio" then
-
- end if
- 'desc=
-
- oldGroup=thisGroup
- oldLabel=thisLabel
- oldID=id
- next
- next
- end if
- next
- 'Conn.Execute("update Quotes set qApproved=1 where id=" & quote)
- end if
- 'response.redirect "?act=show"e=" & quote
- elseif Request.QueryString("act")="show" then
- if isnumeric(request("quote")) then
- quote=request("quote")
- 'mySQL="SELECT Accounts.ID AS AccID, Accounts.AccountTitle, Quotes.* FROM Accounts INNER JOIN Quotes ON Accounts.ID = Quotes.Customer WHERE (Quotes.ID='"& quote & "')"
- mySQL= "SELECT Quotes.*, Accounts.ID AS AccID, Accounts.AccountTitle, "&_
- "Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued "&_
- "FROM Quotes INNER JOIN "&_
- "Accounts ON Accounts.ID = Quotes.Customer LEFT OUTER JOIN "&_
- "InvoiceQuoteRelations INNER JOIN "&_
- "Invoices ON InvoiceQuoteRelations.Invoice = Invoices.ID ON InvoiceQuoteRelations.Quote = Quotes.ID "&_
- "WHERE (Quotes.ID='"& quote & "')"
- 'response.write mySQL
- set RS1=conn.execute (mySQL)
- If RS1.EOF then
- response.write "<BR><BR><BR><BR><CENTER>شماره استعلام معتبر نيست</CENTER>"
- response.end
- End If
- If RS1("Step")=4 then
- stamp="<div style='border:2 dashed red;width:150px; text-align:center; padding: 10px;color:red;font-size:15pt;font-weight:bold;'>رد شده</div>"
- End If
- %>
- <table border="0" cellpadding="0" cellspacing="0" align="center">
- <tr height="10">
- <td colspan=2></td>
- </tr>
- <tr height="10">
- <td width="150"></td>
- <td valign="top"><div style='position:absolute;'><%=stamp%></div></td>
- </tr>
- <tr height="20">
- <td colspan=2></td>
- </tr>
- </table>
- <CENTER>
- <%if not CBool(rs1("qApproved")) then%>
- <input type="button" value="ويرايش" Class="GenButton" onclick="window.location='?act=editQuote"e=<%=quote%>';">
- <input title="در صورت تاييد، پيشنويس به صورت خودكار ايجاد خواهد شد." type="button" value="تاييد" Class="GenButton" onclick="window.location='?act=approve"e=<%=quote%>';">
- <%else%>
- <% If RS1("Step")<>5 Then %>
- <input type="button" value="تبديل به سفارش" Class="GenButton" onclick="window.location='?act=convertToOrder"e=<%=quote%>';">
- <% Else %>
- <font color="red"> (<b>تبديل به سفارش شده</b>)</font>
- <% End If %>
- <%end if%>
- <input type="button" value="كپي استعلام" Class="GenButton" onclick="window.location='?act=copy"e=<%=quote%>';">
- <%' ReportLogRow = PrepareReport ("OrderForm.rpt", "Order_ID", quote, "/beta/dialog_printManager.asp?act=Fin") %>
- <!--INPUT TYPE="button" value=" چاپ " Class="GenButton" style="border:1 solid blue;" onclick="printThisReport(this,<% 'ReportLogRow%>);"-->
- <% If isnull(RS1("InvoiceID")) Then %>
- <input type="button" value="پيش نويس قيمت" Class="GenButton" onclick="window.location='../AR/InvoiceInput.asp?act=getInvoice&selectedCustomer=<%=RS1("AccID")%>&selectedQuotes=<%=quote%>';">
- <% Else %>
- <input type="button" value="پيش نويس قيمت (<%=RS1("InvoiceID")%>)" Class="GenButton" style="color:#3399FF;" onclick="window.location='../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("InvoiceID")%>';">
- <% End If %>
-
- </CENTER>
-
- <BR>
- <TABLE class="" cellspacing="0" cellpadding="2" align="center" style="background-color:#CCCCCC; color:black; direction:RTL; width:700; border: 2 solid #555599;">
- <TR bgcolor="#555599">
- <TD align="left"><FONT COLOR="YELLOW">حساب:</FONT></TD>
- <TD align="right" colspan=5 height="25px">
- <span id="customer" style="color:yellow;"><%' after any changes in this span "./Customers.asp" must be revised%>
- <span><%=RS1("AccID") & " - "& RS1("AccountTitle")%></span>.
- </span>
- </TD>
- </TR>
-
- <TR bgcolor="#555599" height=30 style="color:yellow;">
- <TD align="left">شماره استعلام:</TD>
- <TD align="right"><%=RS1("ID")%></TD>
- <TD align="left">تاريخ:</TD>
- <TD><span dir="LTR"><%=RS1("order_date")%></span></TD>
- <TD align="left">ساعت:</TD>
- <TD align="right"><%=RS1("order_time")%></TD>
- </TR>
- <TR height=30>
- <TD align="left">نام شركت:</TD>
- <TD><%=RS1("company_name")%></TD>
- <TD align="left">موعد اعتبار:</TD>
- <TD align="right" dir=LTR><%=RS1("return_date")%></TD>
- <TD align="left">ساعت اعتبار:</TD>
- <TD align="right" dir=LTR><%=RS1("return_time")%></TD>
- </TR>
- <TR height=30>
- <TD align="left">نام مشتري:</TD>
- <TD><%=RS1("customer_name")%></TD>
- <TD align="left">نوع استعلام:</TD>
- <TD><%=RS1("order_kind")%></TD>
- <TD align="left">استعلام گيرنده:</TD>
- <TD><%=RS1("salesperson")%> </TD>
- </TR>
- <TR height=30>
- <TD align="left">تلفن:</TD>
- <TD><%=RS1("telephone")%></TD>
- <TD align="left">عنوان كار داخل فايل:</TD>
- <TD colspan="3"><%=RS1("order_title")%></TD>
- </TR>
-
- <TR height=30>
- <td align="left">تعداد:</td>
- <td><%=rs1("qtty")%></td>
- <TD align="left">سايز:</TD>
- <TD><%=RS1("PaperSize")%></TD>
- <TD align="left">زمان توليد:</TD>
- <TD>
- <%if RS1("productionDuration") = 0 then
- response.write "<font color=red>نامعلوم</font>"
- else
- response.write RS1("productionDuration") & " روز"
- end if %>
-
- </TD>
- </TR>
- <TR height=30>
- <TD align="left">مرحله:</TD>
- <TD colspan="3"><%=RS1("marhale")%></TD>
- <TD align="left">قيمت كل:</TD>
- <TD><span class="price"><%=RS1("Price")%></span></TD>
- </TR>
- <TR height=30>
- <TD align="left" valign="top" colspan="3">توضيحات بيشتر:</TD>
- <TD colspan="3">
- <%if not IsNull(RS1("Notes")) then response.write replace(RS1("Notes"),chr(13),"<br>")%>
- </TD>
- </TR>
- </TABLE>
- <%
- set rs = conn.Execute("select *,users.RealName from QuoteLogs inner join Users on QuoteLogs.LastUpdatedBy=users.ID where QuoteLogs.QuoteID=" & quote & " and QuoteLogs.ID in (select min(id) from QuoteLogs group by QuoteID,productionDuration)")
- if not rs.eof then
- %>
- <TABLE class="" cellspacing="0" cellpadding="2" align="center" style="background-color:#CCCCCC; color:black; direction:RTL; width:700; border: 2 solid #555599;">
- <tr bgcolor="#555599" height=30 style="color:yellow;">
- <td>تاريخ</td>
- <td>ساعت</td>
- <td>زمان توليد</td>
- <td>توسط</td>
- </tr>
- <%
- while not rs.eof
- response.write "<tr><td>" & rs("LastUpdatedDate") & "</td><td>" & rs("LastUpdatedTime") & "</td><td>"
- if CInt(rs("productionDuration"))=0 then
- response.write "<font color=red>نامعلوم</font>"
- else
- response.write rs("productionDuration") & " روز"
- end if
- response.write "</td><td>" & rs("RealName") & "</td></tr>"
- rs.moveNext
- wend
- %>
- <tr>
-
- </tr>
- </table>
- <%
- end if
- %>
- <BR>
- <%
- if (not (IsNull(rs1("property")) or rs1("property")="")) then
- %>
- <div>جزئيات استعلام</div>
- <%
- set rs=Conn.Execute("select * from OrderTraceTypes where id="&rs1("type"))
- set typeProp = server.createobject("MSXML2.DomDocument")
- set orderProp = server.createobject("MSXML2.DomDocument")
-
- orderProp.loadXML(rs1("property"))
- typeProp.loadXML(rs("property"))
- set rs=nothing
- sub showKey(key)
- oldGroup="---first---"
- oldLabel="---first---"
- maxID=-1
- oldID=-1
- rowEmpty=false
- for each mykey in orderProp.SelectNodes(key)
- id=myKey.GetAttribute("id")
- if maxID<id then maxID=id
- next
- thisRow = "<div class='myRow'>"'<div class='exteraArea' id='" & Replace(key,"/","-") & "-0'>"
- for id = 0 to maxID
- For Each myKey In orderProp.SelectNodes(key & "[@id='" & id & "']")
- thisName = myKey.GetAttribute("name")
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(0)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- if thisType="radio" then
- radioID = CInt(myKey.text)
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(radioID - 1)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- end if
- isRow =false
- if Replace(key,"/","-")="keys-service-key" then response.write "::--------::" & myKey.text
- if thisName<>"" then
- isRow=true
- if oldID<>id then thisRow = thisRow & "<div class='exteraArea' id='" & Replace(key,"/","-") & "-" & id & "'>"
- if (oldGroup<>thisGroup and oldID=id and oldGroup <> "---first---") then thisRow = thisRow & "</div>"
- if oldGroup<>thisGroup or oldID<>id then
- thisRow = thisRow & "<div class='mySection'>"
- if typeKey.GetAttribute("grouplabel")<>"" then thisRow = thisRow & "<b>" & typeKey.GetAttribute("grouplabel") & "</b>"
- end if
- if oldLabel<>thisLabel and thisType<>"radio" then thisRow = thisRow & "<label class='myLabel'>" & thisLabel & ": </label>"
-
- if left(thisType,6)="option" then set myOptions=typeKey
- myText=""
- select case thisType
- case "option"
- for each optKey in myOptions.selectNodes("option")
- if optKey.text=myKey.text then
- myText = optKey.GetAttribute("label")
- exit for
- end if
- next
- case "option-other"
- if left(myKey.text,6)="other:" then
- myText = mid(myKey.text,7)
- else
- for each optKey in myOptions.selectNodes("option")
- if optKey.text=myKey.text then
- myText = optKey.GetAttribute("label")
- exit for
- end if
- next
- end if
- if myText="" then myText = myKey.text
- case "check"
- if left(myKey.text,2)="on" then myText = "<img src='/images/Checkmark-32.png' width='15px'>"
- case "radio"
- myText=thisLabel
- case else
- myText = myKey.text
- end select
- set myOptions=nothing
- thisRow = thisRow & "<span class='myProp'>" & myText & "</span>"
- else
- if id=0 then
- thisRow=""
- rowEmpty=true
- end if
- end if
- oldGroup=thisGroup
- oldLabel=thisLabel
- oldID=id
- if typeKey.GetAttribute("br")="yes" then thisRow = thisRow & "<br><br>"
- Next
- if isRow then thisRow = thisRow & "</div></div>"
- next
- 'response.write maxID
- if not rowEmpty then thisRow = thisRow & "</div>" '"<div id='extreArea" &Replace(key,"/","-")& "'></div>"
- response.write thisRow 'prependTo
- ' response.write
- end sub
- oldTmp="---first---"
- for each tmp in orderProp.selectNodes("//key")
- if oldTmp<>tmp.parentNode.nodeName then
- oldTmp=tmp.parentNode.nodeName
- call showKey("/keys/" & oldTmp & "/key")
- end if
- next
- ' call showKey("/keys/printing/key")
- ' call showKey("keys/binding/key")
- ' call showKey("keys/service/key")
- ' call showKey("keys/delivery/key")
-
- end if
- %>
- <br><br>
- <table class="CustTable" cellspacing='1' align=center style="width:700; ">
- <tr>
- <td colspan="2" class="CusTableHeader"><span style="width:450;text-align:center;">يادداشت ها</span><span style="width:100;text-align:left;background-color:red;"><input class="GenButton" type="button" value="نوشتن يادداشت" onclick="window.location = '../home/message.asp?RelatedTable=quotes&RelatedID=<%=quote%>&retURL=<%=Server.URLEncode("../order/Inquiry.asp?act=show"e=""e)%>';"></span></td>
- </tr>
- <%
- mySQL="SELECT * FROM Messages INNER JOIN Users ON Messages.MsgFrom = Users.ID WHERE (Messages.RelatedTable = 'quotes') AND (Messages.RelatedID = "& quote & ") ORDER BY Messages.ID DESC"
- Set RS = conn.execute(mySQL)
- if NOT RS.eof then
- tmpCounter=0
- Do While NOT RS.eof
- tmpCounter=tmpCounter+1
- %>
- <tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>">
- <td>از <%=RS("RealName")%><br>
- <%=RS("MsgDate")%> <BR> <%=RS("MsgTime")%>
- </td>
- <td dir='RTL'><%=replace(RS("MsgBody"),chr(13),"<br>")%></td>
- </tr>
- <%
- RS.moveNext
- Loop
- else
- %>
- <tr class="CusTD3">
- <td colspan="2">هيچ</td>
- </tr>
- <%
- end if
- RS.close
- %>
- </table><BR>
- <%
- end if
- elseif Request.QueryString("act")="advancedSearch" then
- '------ Advanced Search
- %>
- <!--#include File="../include_JS_InputMasks.asp"-->
- <%
- 'Server.ScriptTimeout = 3600
- tmpTime=time
- tmpTime=Hour(tmpTime)&":"&Minute(tmpTime)
- if instr(tmpTime,":")<3 then tmpTime="0" & tmpTime
- if len(tmpTime)<5 then tmpTime=Left(tmpTime,3) & "0" & Right(tmpTime,1)
- if request("resultsCount")="" OR not isnumeric(request("resultsCount")) then
- resultsCount = 50
- else
- resultsCount = cint(request("resultsCount"))
- end if
- %>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="700" align="center" bordercolor="#555599">
- <FORM METHOD=POST ACTION="?act=advancedSearch" onSubmit="return checkValidation();">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="1" dir="RTL" width="100%" bgcolor="white">
- <TR bgcolor="#EEEEEE">
- <TD><INPUT TYPE="checkbox" NAME="check_sefaresh" onclick="check_sefaresh_Click()" checked></TD>
- <TD>شماره استعلام</TD>
- <TD><INPUT TYPE="text" NAME="az_sefaresh" dir="LTR" value="<%=request.form("az_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);"></TD>
- <TD>تا</TD>
- <TD><INPUT TYPE="text" NAME="ta_sefaresh" dir="LTR" value="<%=request.form("ta_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);" ></TD>
- <td rowspan="12" style="width:1px" bgcolor="#555599"></td>
- <TD><INPUT TYPE="checkbox" NAME="check_kind" onclick="check_kind_Click()" checked></TD>
- <TD>نوع استعلام</TD>
- <TD colspan="3"><SELECT NAME="order_kind_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <OPTION value="افست" <%if request.form("order_kind_box")="افست" then response.write "selected" %> >افست</option>
- <OPTION value="ديجيتال" <%if request.form("order_kind_box")="ديجيتال" then response.write "selected" %> >ديجيتال</option>
- <OPTION value="سياه و سفيد" <%if request.form("order_kind_box")="سياه و سفيد" then response.write "selected" %> >سياه و سفيد</option>
- <OPTION value="طراحي" <%if request.form("order_kind_box")="طراحي" then response.write "selected" %> >طراحي</option>
- <OPTION value="صحافي" <%if request.form("order_kind_box")="صحافي" then response.write "selected" %> >صحافي</option>
- <OPTION value="فيلم" <%if request.form("order_kind_box")="فيلم" then response.write "selected" %> >فيلم</option>
- <OPTION value="زينك" <%if request.form("order_kind_box")="زينك" then response.write "selected" %> >زينك</option>
- <OPTION value="لمينت" <%if request.form("order_kind_box")="لمينت" then response.write "selected" %> >لمينت</option>
- <OPTION value="متفرقه" <%if request.form("order_kind_box")="متفرقه" then response.write "selected" %> >متفرقه</option>
- </SELECT></TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_tarikh_sefaresh" onclick="check_tarikh_sefaresh_Click()" checked>
- </TD>
- <TD>تاريخ استعلام</TD>
- <TD>
- <INPUT TYPE="text" NAME="az_tarikh_sefaresh" dir="LTR" value="<%=request.form("az_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);" onBlur="if(acceptDate(this))document.all.ta_tarikh_sefaresh.value=this.value;" maxlength="10">
- </TD>
- <TD>تا</TD>
- <TD>
- <INPUT TYPE="text" NAME="ta_tarikh_sefaresh" dir="LTR" value="<%=request.form("ta_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" maxlength="10">
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_marhale" onclick="check_marhale_Click()" checked>
- </TD>
- <TD>مرحله</TD>
- <TD>
- <SELECT NAME="marhale_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <%
- set RS_STEP=Conn.Execute ("SELECT * FROM QuoteSteps WHERE (IsActive=1)")
- Do while not RS_STEP.eof
- %>
- <OPTION value="<%=RS_STEP("ID")%>" <%if cint(request("marhale_box"))=cint(RS_STEP("ID")) then response.write "selected" %> ><%=RS_STEP("name")%></option>
- <%
- RS_STEP.moveNext
- loop
- RS_STEP.close
- %>
- </SELECT>
- </TD>
- <TD>
- <span id="marhale_not_check_label" style='font-weight:bold;color:red'>نباشد</span>
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="marhale_not_check" onclick="marhale_not_check_Click();" checked>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD>
- <INPUT TYPE="checkbox" NAME="check_tarikh_tahvil" onclick="check_tarikh_tahvil_Click()" checked>
- </TD>
- <TD>تاريخ اعتبار</TD>
- <TD>
- <INPUT TYPE="text" NAME="az_tarikh_tahvil" dir="LTR" value="<%=request.form("az_tarikh_tahvil")%>" size="10" onblur="acceptDate(this)" maxlength="10" onKeyPress="return maskDate(this);">
- </TD>
- <TD>تا</TD>
- <TD>
- <INPUT TYPE="text" NAME="ta_tarikh_tahvil" dir="LTR" value="<%=request.form("ta_tarikh_tahvil")%>" onblur="acceptDate(this)" maxlength="10" size="10" onKeyPress="return maskDate(this);">
- </TD>
- <td colspan="5"></td>
-
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD colspan="5"> </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_closed" onclick="check_closed_Click()" checked>
- </TD>
- <TD colspan="4">
- <span id="check_closed_label" style='color:black;'>فقط استعلام هاي باز</span>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD colspan="5"> </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_salesperson" onclick="check_salesperson_Click()" checked>
- </TD>
- <TD>استعلام گيرنده</TD>
- <TD colspan="3">
- <SELECT NAME="salesperson_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <% set RSV=Conn.Execute ("SELECT RealName,id FROM Users WHERE Display=1 ORDER BY RealName")
- Do while not RSV.eof
- %>
- <option value="<%=RSV("RealName")%>"
- <%
- if request.form("salesperson_box")="" then
- if RSV("id")=session("id") then response.write " selected "
- else
- if RSV("RealName")=request.form("salesperson_box") then response.write " selected "
- end if
- %> >
- <%=RSV("RealName")%>
- </option>
- <%
- RSV.moveNext
- Loop
- RSV.close
- %>
- </SELECT>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD>
- <INPUT TYPE="checkbox" NAME="check_company_name" onclick="check_company_name_Click()" checked>
- </TD>
- <TD>نام شركت</TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="company_name_box" value="<%=request.form("company_name_box")%>">
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_telephone" onclick="check_telephone_Click()" checked>
- </TD>
- <TD>تلفن</TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="telephone_box" value="<%=request.form("telephone_box")%>">
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_customer_name" onclick="check_customer_name_Click()" checked>
- </TD>
- <TD>نام مشتري</TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="customer_name_box" value="<%=request.form("customer_name_box")%>">
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_order_title" onclick="check_order_title_Click()" checked>
- </TD>
- <TD>عنوان استعلام</TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="order_title_box" value="<%=request.form("order_title_box")%>">
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#AAAAEE">
- <td colspan="11" style="height:30px">
- <TABLE align="center" width="50%">
- <TR>
- <TD><INPUT TYPE="submit" Name="Submit" Value="تاييد" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><INPUT TYPE="button" Name="Cancel" Value="پاك كن" style="font-family:tahoma,arial; font-size:10pt;width:100px;" onclick="window.location='?act=advancedSearch';"></TD>
- </TR>
- <TR>
- <TD align="left">تعداد نتايج:</TD>
- <TD> <INPUT TYPE="Text" Name="resultsCount" value="<%=resultsCount%>" maxlength="4" size="4" onKeyPress="return maskNumber(this);"></TD>
- </TR>
- </TABLE>
- </td>
- </TR>
- </TABLE>
- </TD></TR>
- </FORM>
- </TABLE>
- <hr>
- <SCRIPT LANGUAGE='JavaScript'>
- <!--
- function check_sefaresh_Click(){
- if ( document.all.check_sefaresh.checked ) {
- document.all.az_sefaresh.style.visibility = "visible";
- document.all.ta_sefaresh.style.visibility = "visible";
- document.all.az_sefaresh.focus();
- }
- else{
- document.all.az_sefaresh.style.visibility = "hidden";
- document.all.ta_sefaresh.style.visibility = "hidden";
- }
- }
- function check_tarikh_sefaresh_Click(){
- if ( document.all.check_tarikh_sefaresh.checked ) {
- document.all.az_tarikh_sefaresh.style.visibility = "visible";
- document.all.ta_tarikh_sefaresh.style.visibility = "visible";
- document.all.az_tarikh_sefaresh.focus();
- }
- else{
- document.all.az_tarikh_sefaresh.style.visibility = "hidden";
- document.all.ta_tarikh_sefaresh.style.visibility = "hidden";
- }
- }
- function check_tarikh_tahvil_Click(){
- if ( document.all.check_tarikh_tahvil.checked ) {
- document.all.az_tarikh_tahvil.style.visibility = "visible";
- document.all.ta_tarikh_tahvil.style.visibility = "visible";
- document.all.az_tarikh_tahvil.focus();
- }
- else{
- document.all.az_tarikh_tahvil.style.visibility = "hidden";
- document.all.ta_tarikh_tahvil.style.visibility = "hidden";
- }
- }
- function check_company_name_Click(){
- if (document.all.check_company_name.checked) {
- document.all.company_name_box.style.visibility = "visible";
- document.all.company_name_box.focus();
- }
- else{
- document.all.company_name_box.style.visibility = "hidden";
- }
- }
- function check_customer_name_Click(){
- if (document.all.check_customer_name.checked) {
- document.all.customer_name_box.style.visibility = "visible";
- document.all.customer_name_box.focus();
- }
- else{
- document.all.customer_name_box.style.visibility = "hidden";
- }
- }
- function check_kind_Click(){
- if (document.all.check_kind.checked) {
- document.all.order_kind_box.style.visibility = "visible";
- document.all.order_kind_box.focus();
- }
- else{
- document.all.order_kind_box.style.visibility = "hidden";
- }
- }
- function check_marhale_Click(){
- if (document.all.check_marhale.checked) {
- document.all.marhale_box.style.visibility = "visible";
- document.all.marhale_box.focus();
- document.all.marhale_not_check.style.visibility = "visible";
- marhale_not_check_Click();
- }
- else{
- document.all.marhale_box.style.visibility = "hidden";
- document.all.marhale_not_check.style.visibility = "hidden";
- document.all.marhale_not_check_label.style.color='#BBBBBB'
- }
- }
- function check_salesperson_Click(){
- if (document.all.check_salesperson.checked) {
- document.all.salesperson_box.style.visibility = "visible";
- document.all.salesperson_box.focus();
- }
- else{
- document.all.salesperson_box.style.visibility = "hidden";
- }
- }
- function check_telephone_Click(){
- if (document.all.check_telephone.checked) {
- document.all.telephone_box.style.visibility = "visible";
- document.all.telephone_box.focus();
- }
- else{
- document.all.telephone_box.style.visibility = "hidden";
- }
- }
- function check_order_title_Click(){
- if (document.all.check_order_title.checked) {
- document.all.order_title_box.style.visibility = "visible";
- document.all.order_title_box.focus();
- }
- else{
- document.all.order_title_box.style.visibility = "hidden";
- }
- }
- function marhale_not_check_Click(){
- if (document.all.marhale_not_check.checked) {
- document.all.marhale_not_check_label.style.color='red'
- }
- else{
- document.all.marhale_not_check_label.style.color='#BBBBBB'
- }
- }
- function vazyat_not_check_Click(){
- if (document.all.vazyat_not_check.checked) {
- document.all.vazyat_not_check_label.style.color='red'
- }
- else{
- document.all.vazyat_not_check_label.style.color='#BBBBBB'
- }
- }
- function check_closed_Click(){
- if (document.all.check_closed.checked) {
- document.all.check_closed_label.style.color='black'
- }
- else{
- document.all.check_closed_label.style.color='#BBBBBB'
- }
- }
- function Form_Load(){
- <%
- maybeAND = ""
- myCriteria = ""
- If request.form("check_sefaresh") = "on" Then
- if request.form("az_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & " Quotes.ID >= " & request.form("az_sefaresh")
- maybeAND=" AND "
- End If
- if request.form("ta_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & " Quotes.ID <= " & request.form("ta_sefaresh")
- maybeAND=" AND "
- End If
- If (request.form("az_sefaresh") = "") AND (request.form("ta_sefaresh") = "") then
- response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_tarikh_sefaresh") = "on" Then
- if request.form("az_tarikh_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & "order_date >= '" & request.form("az_tarikh_sefaresh") & "'"
- maybeAND=" AND "
- End If
- if request.form("ta_tarikh_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & "order_date <= '" & request.form("ta_tarikh_sefaresh") & "'"
- maybeAND=" AND "
- End If
- If (request.form("az_tarikh_sefaresh") = "") AND (request.form("ta_tarikh_sefaresh") = "") then
- response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_tarikh_tahvil") = "on" Then
- if request.form("az_tarikh_tahvil") <> "" then
- myCriteria = myCriteria & maybeAND & "return_date >= '" & request.form("az_tarikh_tahvil") & "'"
- maybeAND=" AND "
- End If
- if request.form("ta_tarikh_tahvil") <> "" then
- myCriteria = myCriteria & maybeAND & "return_date <= '" & request.form("ta_tarikh_tahvil") & "'"
- maybeAND=" AND "
- End If
- If (request.form("az_tarikh_tahvil") = "") AND (request.form("ta_tarikh_tahvil") = "") then
- response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_company_name") = "on" AND request.form("company_name_box") <> "" ) then
- myCriteria = myCriteria & maybeAND & "company_name Like N'%" & request.form("company_name_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_company_name.checked = false;" & vbCrLf
- response.write "document.all.company_name_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_customer_name") = "on" AND request.form("customer_name_box") <> "")then
- myCriteria = myCriteria & maybeAND & "customer_name Like N'%" & request.form("customer_name_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_customer_name.checked = false;" & vbCrLf
- response.write "document.all.customer_name_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_kind") = "on" then
- myCriteria = myCriteria & maybeAND & "order_kind = N'" & request.form("order_kind_box") & "'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_kind.checked = false;" & vbCrLf
- response.write "document.all.order_kind_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request("check_marhale") = "on" then
- If request("marhale_not_check") = "on" then
- myCriteria = myCriteria & maybeAND & "NOT(step = " & request("marhale_box") & ")"
- Else
- myCriteria = myCriteria & maybeAND & "step = " & request("marhale_box")
- response.write "document.all.marhale_not_check.checked = false;" & vbCrLf
- response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
- End If
- maybeAND=" AND "
- Else
- response.write "document.all.check_marhale.checked = false;" & vbCrLf
- response.write "document.all.marhale_box.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.marhale_not_check.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
- End If
- If request.form("check_salesperson") = "on" then
- myCriteria = myCriteria & maybeAND & "salesperson = N'" & request.form("salesperson_box") & "'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_salesperson.checked = false;" & vbCrLf
- response.write "document.all.salesperson_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_order_title") = "on" AND request.form("order_title_box") <> "")then
- myCriteria = myCriteria & maybeAND & "order_title Like N'%" & request.form("order_title_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_order_title.checked = false;" & vbCrLf
- response.write "document.all.order_title_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_telephone") = "on" AND request.form("telephone_box") <> "")then
- myCriteria = myCriteria & maybeAND & "telephone Like N'%" & request.form("telephone_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_telephone.checked = false;" & vbCrLf
- response.write "document.all.telephone_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request("check_closed") = "on" then
- myCriteria = myCriteria & maybeAND & "Quotes.Closed=0"
- Else
- If request("Submit")="تاييد" then
- response.write "document.all.check_closed.checked = false;" & vbCrLf
- response.write "document.all.check_closed_label.style.color='#BBBBBB';" & vbCrLf
- End If
- End If
- %>
- }
- function checkValidation(){
- return true;
- }
- Form_Load();
- //-->
- </SCRIPT>
- <%
- if request("Submit")="تاييد" then
- IF maybeAND <> " AND " THEN
- response.write "Nothing !!!!!!!!!!"
- ELSE
- mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon , Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued, DRV_invoice.price "&_
- " FROM Quotes INNER JOIN "&_
- " OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status LEFT OUTER JOIN "&_
- " Invoices INNER JOIN "&_
- " InvoiceQuoteRelations ON Invoices.ID = InvoiceQuoteRelations.Invoice ON Quotes.ID = InvoiceQuoteRelations.Quote "&_
- " left outer join (select Invoice,SUM(InvoiceLines.Price +InvoiceLines.Vat - InvoiceLines.Discount -InvoiceLines.Reverse) as price from InvoiceLines inner join Invoices on invoiceLines.invoice=invoices.id where invoices.voided=0 group by Invoice) DRV_invoice on Invoices.ID=DRV_invoice.Invoice "&_
- " WHERE ("& myCriteria & ") "&_
- " ORDER BY Quotes.order_date DESC, Quotes.ID DESC "
- ' mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon "&_
- ' " FROM Quotes JOIN OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status "&_
- ' " WHERE ("& myCriteria & ") ORDER BY order_date DESC, Quotes.ID DESC"
- '
- 'response.write mySQL
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- tmpCounter=0
- %>
- <div align="center" dir="LTR">
- <TABLE border="1" cellspacing="0" cellpadding="1" dir="RTL" borderColor="#555588">
- <TR bgcolor="#CCCCFF">
- <TD width="41"># استعلام</TD>
- <TD width="46">تاريخ استعلام</TD>
- <TD width="56">اعتبار تا</TD>
- <TD width="116">نام شركت</TD>
- <TD width="106">نام مشتري</TD>
- <TD >عنوان كار</TD>
- <TD width="36">نوع</TD>
- <TD width="46">مرحله</TD>
- <TD width="36">استعلام گيرنده</TD>
- <TD width="40">فاكتور</TD>
- <td width="50">قيمت</td>
- </TR>
- <% Do while not RS1.eof and tmpCounter < resultsCount
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- Else
- tmpColor="#DDDDDD"
- End If
- if RS1("Closed") then
- tmpStyle="background-color:#FFCCCC;"
- else
- tmpStyle=""
- End If
-
- if isnull(RS1("InvoiceID")) then
- InvoiceStatus="<span style='color:red;'><b>ندارد</b></span>"
- else
- if RS1("Voided") then
- style="style='color:Red' Title='باطل شده'"
- elseif RS1("Issued") then
- style="style='color:Red' Title='صادر شده'"
- elseif RS1("Approved") then
- style="style='color:Green' Title='تاييد شده'"
- else
- style="style='color:#3399FF' Title='تاييد نشده'"
- end if
- InvoiceStatus="<A " & style & " HREF='../AR/AccountReport.asp?act=showInvoice&invoice=" & RS1("InvoiceID")& "' Target='_blank'>" & RS1("InvoiceID") & "</A>"
- end if
- %>
- <TR bgcolor="<%=tmpColor%>" title="<%=RS1("StatusName")%>">
- <TD DIR="LTR"><A HREF="?act=show"e=<%=RS1("ID")%>" target="_blank"><%=RS1("ID")%></A></TD>
- <TD DIR="LTR"><%=RS1("order_date")%></TD>
- <TD DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
- <TD ><%=RS1("company_name") & "<br>تلفن:("& RS1("telephone")& ")"%> </TD>
- <TD ><%=RS1("customer_name")%> </TD>
- <TD ><%=RS1("order_title")%> </TD>
- <TD ><%=RS1("order_kind")%></TD>
- <TD style="<%=tmpStyle%>"><%=RS1("marhale")%></TD>
- <TD ><%=RS1("salesperson")%> </TD>
- <TD ><%=InvoiceStatus%> </TD>
- <td><%if isnull(RS1("price")) then response.write "----" else response.write Separate(RS1("price")) end if %></td>
- </TR>
- <TR bgcolor="#FFFFFF">
- <TD colspan="12" style="height:10px"></TD>
- </TR>
- <% RS1.moveNext
- Loop
- if tmpCounter >= resultsCount then
- %> <TR bgcolor="#CCCCCC">
- <TD align="center" colspan="10" style="padding:15px;font-size:12pt;color:red;cursor:hand;" onclick="document.all.resultsCount.focus();"><B>تعداد نتايج جستجو بيش از <%=resultsCount%> ركورد است.</B></TD>
- </TR>
- <% else
- %> <TR bgcolor="#ccccFF">
- <TD colspan="10">تعداد نتايج جستجو: <%=tmpCounter%></TD>
- </TR>
- <% end if
- %>
- </TABLE>
- </div>
- <BR>
- <% else
- %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
- <TR bgcolor="#FFFFDD">
- <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red">هيچ جوابي نداريم به شما بدهيم.</TD>
- </TR>
- </TABLE>
- <hr>
- <% End If
- End If
- End If
- ' Trace Quote End.
- '-----------------------------
- '-----------------------------
- ' Quote Input
- '-----------------------------
- elseif Request.QueryString("act")="quoteInpCustSearch" then
- if isnumeric(request("CustomerNameSearchBox")) then
- conn.close
- response.redirect "?act=getQuote&selectedCustomer=" & request("CustomerNameSearchBox")
- elseif request("CustomerNameSearchBox") <> "" then
- SA_TitleOrName=request("CustomerNameSearchBox")
- mySQL="SELECT * FROM Accounts WHERE (REPLACE(AccountTitle, ' ', '') LIKE REPLACE(N'%"& sqlSafe(SA_TitleOrName) & "%', ' ', '') ) ORDER BY AccountTitle"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode("چنين حسابي پيدا نشد.<br><a href='../CRM/AccountEdit.asp?act=getAccount'>حساب جديد؟</a>")
- end if
- SA_TitleOrName=request("CustomerNameSearchBox")
- SA_Action="return true;"
- SA_SearchAgainURL="Inquiry.asp"
- SA_StepText="گام دوم : انتخاب حساب"
- %>
- <br>
- <FORM METHOD=POST ACTION="?act=getType">
- <!--#include File="../AR/include_SelectAccount.asp"-->
- </FORM>
- <%
- end if
- elseif Request.QueryString("act")="getType" then
- customerID=request("selectedCustomer")
- mySQL="SELECT * FROM Accounts WHERE (ID='"& CustomerID & "')"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode("چنين حسابي پيدا نشد.<br><a href='..//CRM/AccountEdit.asp?act=getAccount'>حساب جديد؟</a>")
- end if
- %>
- <br>
- <div dir='rtl'>
- <B>گام سوم : گرفتن نوع استعلام</B>
- </div>
- <form method="post" action="?act=getQuote">
- <input name="selectedCustomer" type="hidden" value="<%=customerID%>">
- <SELECT NAME="OrderType" style='font-family: tahoma,arial ; font-size: 9pt; font-weight: bold; width: 100px' tabIndex="7">
- <OPTION value="-1" style='color:red;'>انتخاب كنيد</option>
- <%
- Set RS2 = conn.Execute("SELECT [User] as ID, DefaultOrderType FROM UserDefaults WHERE ([User] = "& session("ID") & ") OR (UserDefaults.[User] = 0) ORDER BY ABS(UserDefaults.[User]) DESC")
- defaultOrderType=RS2("DefaultOrderType")
- RS2.close
- Set RS2 = Nothing
- set RS_TYPE=Conn.Execute ("SELECT ID, Name FROM OrderTraceTypes WHERE (IsActive=1) ORDER BY ID")
- Do while not RS_TYPE.eof
- %>
- <OPTION value="<%=RS_TYPE("ID")%>" <%if RS_TYPE("ID")=defaultOrderType then response.write "selected"%>><%=RS_TYPE("Name")%></option>
- <%
- RS_TYPE.moveNext
- loop
- RS_TYPE.close
- set RS_TYPE = nothing
- %>
- </SELECT>
- <input type="submit" value="ادامه">
- </form>
- <%
- elseif Request.QueryString("act")="getQuote" then
- customerID=request("selectedCustomer")
- mySQL="SELECT * FROM Accounts WHERE (ID='"& CustomerID & "')"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode("چنين حسابي پيدا نشد.<br><a href='..//CRM/AccountEdit.asp?act=getAccount'>حساب جديد؟</a>")
- end if
- rs1.close
- set rs1=nothing
- set rs=Conn.Execute("select * from OrderTraceTypes where id=" & request("orderType"))
- if rs.eof then
- conn.close
- response.redirect "?errmsg=" & server.urlEncode("نوع سفارش را تعيين كنيد")
- end if
- orderTypeID=rs("id")
- rs.close
- set rs=nothing
-
- %>
- <script type="text/javascript" src="calcOrder.js"></script>
- <script type="text/javascript">
- function checkValidation() {
- if ($('input[name="CustomerName"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert("نام مشتري را وارد كنيد");
- $('input[name="CustomerName"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="SalesPerson"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert("استعلام گيرنده را وارد كنيد");
- $('input[name="SalesPerson"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="ReturnDate"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert("موعد اعتبار را وارد كنيد");
- $('input[name="ReturnDate"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="ReturnTime"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert("زمان (ساعت) اعتبار را وارد كنيد");
- $('input[name="ReturnTime"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="OrderTitle"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert("عنوان كار داخل فايل را وارد كنيد");
- $('input[name="OrderTitle"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else {
- return makeOutXML();
- }
- }
- TransformXmlURL("/service/xml_getOrderProperty.asp?act=getProperty&type=<%=orderTypeID%>","/xsl/orderEditProperty.xsl", function(result){
- $("#orderDetails").html(result);
- readyForm();
- });
- TransformXmlURL("/service/xml_getOrderProperty.asp?act=getNew&isOrder=&typeID=<%=orderTypeID%>&id=<%=CustomerID%>","/xsl/orderEditHeader.xsl", function(result){
- $("#orderHeader").html(result);
- });
- </script>
-
- <br>
- <div dir='rtl'><B>گام چهارم : گرفتن استعلام</B>
- </div>
- <br>
- <!-- گرفتن استعلام -->
- <hr>
- <FORM METHOD=POST ACTION="?act=submitQuote" onSubmit="return checkValidation();">
- <div id="orderHeader"></div>
- <div class="downBtn">
- <hr/>
- <INPUT TYPE="submit" id='Submit' Name="Submit" Value="تاييد" style="width:100px;" tabIndex="14">
- <INPUT TYPE="button" Name="Cancel" Value="انصراف" style="width:100px;" onClick="window.location='Inquiry.asp';" tabIndex="15">
- </div>
- </FORM>
- <div id='orderDetails'></div>
- <%
- set orderProp=nothing
- elseif Request.QueryString("act")="submitQuote" then
- //-------------------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------------------------
- set rs=Conn.Execute("select * from OrderTraceTypes where id=" & request("orderType"))
- if rs.eof then
- conn.close
- response.redirect "?errmsg=" & server.urlEncode("نوع سفارش را تعيين كنيد")
- end if
- orderTypeID=rs("id")
- orderTypeName=rs("name")
- set orderProp = server.createobject("MSXML2.DomDocument")
- if rs("property")<>"" then
- orderProp.loadXML(rs("property"))
- myXML = fetchKeyValues()
- end if
- rs.close
- set rs=nothing
- response.write "test!"
- function fetchKeyValues()
- 'key="---first---"
- response.write "ddd<br>"
- thisRow="<?xml version=""1.0""?><data>"
- for each row in orderProp.selectNodes("/keys/row")
- rowName = row.GetAttribute("name")
- response.write rowName&"<br>"
- for id=0 to cint(request(rowName & "-maxID"))
- thisRow = thisRow & "<" & rowName & " id=""" & id & """>"
- for each group in row.selectNodes("./group")
- groupName = group.GetAttribute("name")
- for each key in group.selectNodes("./key")
- thisName = key.GetAttribute("name")
- if IsArray(request.form(thisName)) then
- value = request.form(thisName)(id)
- else
- value = request.form(thisName)
- end if
- if value <> "" then
- thisRow = thisRow & "<key name=""" & thisName & """"
- select case key.GetAttribute("type")
- case "check"
- if cint(mid(value,4))=id then thisRow = thisRow & ">" & value & "</key>"
- case else
- if request.form(groupName & "-disBtn")<>"" then
- if cint(trim(split(request.form(thisGroup & "-disBtn"),",")(id)))=id then thisRow = thisRow & ">" & value & "</key>"
- else
- thisRow = thisRow & ">" & value & "</key>"
- end if
- end select
-
- end if
- next
- next
- thisRow = thisRow & "</" & rowName & ">"
- next
- next
- thisRow = thisRow & "</data>"
- fetchKeyValues = thisRow
- response.write thisRow
- response.end
- end function
-
-
- CreationDate=shamsiToday()
- CustomerID=request.form("CustomerID")
- if CustomerID="" OR not isNumeric(CustomerID) then
- conn.close
- response.redirect "?act=getQuote&selectedCustomer=" & CustomerID & "&errMsg=" & Server.URLEncode("خطا در نام مشتري<br>اطلاعات وارد نشد…<BR>")
- end if
- orderType=request.form("OrderType")
- if orderType="" OR not isNumeric(OrderType) then
- conn.close
- response.redirect "?act=getQuote&selectedCustomer=" & CustomerID & "&errMsg=" & Server.URLEncode("خطا در نوع استعلام<br>اطلاعات وارد نشد…<BR>")
- end if
- set RS1=Conn.Execute ("SELECT Name FROM OrderTraceTypes WHERE (ID='"& orderType & "') AND (IsActive=1)")
- if RS1.eof then
- conn.close
- response.redirect "?act=getQuote&selectedCustomer=" & CustomerID & "&errMsg=" & Server.URLEncode("خطا در نوع استعلام<br>اطلاعات وارد نشد…<BR>")
- else
- orderTypeName=RS1("Name")
- end if
- RS1.close
- defaultVaziat = "در جريان" ' 1
- defaultMarhale = "ثبت شده" ' 1
-
- mySQL="SET NOCOUNT ON;INSERT INTO Quotes (CreatedDate, CreatedBy, Customer, Closed, order_date, order_time, return_date, return_time, company_name, customer_name, telephone, order_title, order_kind, Type, vazyat, marhale, salesperson, status, step, LastUpdatedDate, LastUpdatedTime, LastUpdatedBy, Notes,property,productionDuration, Qtty, price, PaperSize) VALUES ('"&_
- CreationDate & "', '"& session("ID") & "', '"& CustomerID & "', '0', N'"& sqlSafe(request.form("OrderDate")) & "', N'"& sqlSafe(request.form("OrderTime")) & "', N'"& sqlSafe(request.form("ReturnDate")) & "', N'"& sqlSafe(request.form("ReturnTime")) & "', N'"& sqlSafe(request.form("CompanyName")) & "', N'"& sqlSafe(request.form("CustomerName")) & "', N'"& sqlSafe(request.form("Telephone")) & "', N'"& sqlSafe(request.form("OrderTitle")) & "', N'"& orderTypeName & "', '"& orderType & "', N'" & defaultVaziat & "', N'" & defaultMarhale & "', N'"& sqlSafe(request.form("SalesPerson")) & "', 1, 1, N'"& CreationDate & "', N'"& currentTime10() & "', '"& session("ID") & "', N'"& sqlSafe(request.form("Notes")) & "',N'" & myXML & "', " & sqlSafe(request.form("productionDuration")) & "," & sqlSafe(request.form("qtty")) & ",'" & sqlSafe(request.form("totalPrice")) & "', N'" & sqlSafe(request.form("PaperSize")) & "'); SELECT SCOPE_IDENTITY() AS NewQuote;SET NOCOUNT OFF"
- set RS1 = Conn.execute(mySQL)'.NextRecordSet
- QuoteID = RS1 ("NewQuote")
- RS1.close
- conn.close
- 'response.redirect "?act=show"e=" & QuoteID & "&msg=" & Server.URLEncode("اطلاعات استعلام ثبت شد")
- ' Quote Input End
- '-----------------------------
- '-----------------------------
- ' Quote Edit
- '-----------------------------
- elseif Request.QueryString("act")="editQuote" then
- quote = request("quote")
- if quote <> "" then
- if isNumeric(quote) then
- quote=clng(quote)
- else
- quote=""
- end if
- end if
-
- If quote="" Then
- response.write "<br><br>"
- call showAlert("شماره استعلام اشتباه است .", CONST_MSG_ERROR )
- response.end
- End If
- mySQL = "SELECT Quotes.*, Accounts.ID AS AccID, Accounts.AccountTitle FROM Quotes INNER JOIN Accounts ON Quotes.Customer = Accounts.ID WHERE (Quotes.ID ='"& quote & "')"
- set RS2=Conn.Execute (mySQL)
- if RS2.eof then
- response.write "<br><br>"
- call showAlert("شماره استعلام اشتباه است .", CONST_MSG_ERROR )
- response.end
- else
- CustomerID=RS2("AccID")
- end if
- if RS2("salesperson")<>session("csrName") then
- response.write "<br>"
- call showAlert("استعلام گيرنده اين استعلام شما نيستيد..<BR>قبل از ويرايش با استعلام گيرنده هماهنگ كنيد.", CONST_MSG_ALERT )
- end if
- relatedApprovedInvoiceID = 0
- ' mySQL="SELECT Invoices.Issued, Invoices.Approved, Invoices.ApprovedBy, Invoices.ID FROM InvoiceOrderRelations INNER JOIN Invoices ON InvoiceOrderRelations.Invoice = Invoices.ID WHERE (InvoiceOrderRelations.[Order] = '" & quote & "') AND (Invoices.Voided = 0)"
- ' set RS3=Conn.Execute (mySQL)
- ' if not(RS3.eof) then
- ' FoundInvoice=RS3("ID")
- ' if RS3("Issued") then
- ' Conn.Close
- ' response.redirect "../order/TraceOrder.asp?act=show&order=" & quote & "&errMsg=" & Server.URLEncode("يك فاكتور صادر شده مرتبط با با اين استعلام شماره پيدا كرده ايم.(شماره فاكتور: <A HREF='../AR/AccountReport.asp?act=showInvoice&invoice="& FoundInvoice & "' target='_blank'>" & FoundInvoice & "</a>)<BR> لذاست كه امكاني براي تغيير در اين استعلام وجود ندارد.")
- ' elseif RS3("Approved") then
- ' tmpDesc="<B>تاييد شده</B>"
- ' tmpColor="Yellow"
- ' relatedApprovedInvoiceID = RS3("id")
- ' relatedApprovedInvoiceBy = RS3("ApprovedBy")
- ' response.write "<br>"
- ' call showAlert("يك فاكتور <b>تاييد شده</b> با شماره <A HREF='../AR/AccountReport.asp?act=showInvoice&invoice="& FoundInvoice &"' target='_blank'>" & FoundInvoice & "</A> براي اين استعلام وجود دارد <BR>كه با تغيير استعلام توسط شما از حالت تاييد خارج خواهد شد." , CONST_MSG_ALERT )
- ' else
- ' tmpDesc=""
- ' tmpColor="#FFFFBB"
- ' response.write "<br>"
- ' call showAlert("توجه!<br>استعلامي كه شما جستجو كرديد قبلا در يك فاكتور <B>تاييد نشده</B> وجود دارد<br><A HREF='../AR/AccountReport.asp?act=showInvoice&invoice=" & FoundInvoice & "'>نمايش فاكتور مربوطه (" & FoundInvoice & ")</A>", CONST_MSG_INFORM )
- ' end if
- ' end if
- %>
- <style>
- Table { font-size: 8pt;}
- INPUT { font-family:Tahoma,arial; font-size: 8pt;}
- SELECT { font-family:Tahoma,arial; font-size: 8pt;}
- </style>
- <font face="tahoma">
- <input type="hidden" Name='tmpDlgArg' value=''>
- <input type="hidden" Name='tmpDlgTxt' value=''>
- <FORM METHOD=POST ACTION="?act=submitEditQuote" onSubmit="return checkValidation();">
-
- <INPUT TYPE="hidden" name="relatedApprovedInvoiceBy" value="<%=relatedApprovedInvoiceBy%>">
- <INPUT TYPE="hidden" name="relatedApprovedInvoiceID" value="<%=relatedApprovedInvoiceID%>">
- <br>
- <div align="center">ويرايش استعلام</div>
- <br>
- <TABLE cellspacing="0" cellpadding="2" dir="RTL" width="700" align="center" style="border: 2px solid #555599;">
- <TR bgcolor="#555599">
- <TD align="left"><FONT COLOR="YELLOW">حساب:</FONT></TD>
- <TD align="right" colspan=5 height="25px">
- <span id="customer" style="color:yellow;"><%' after any changes in this span "./Customers.asp" must be revised%>
- <INPUT TYPE="hidden" NAME="customerID" value="<%=customerID%>"><span><%=customerID & " - "& RS2("AccountTitle")%></span>.
- </span>
- <INPUT class="GenButton" TYPE="button" value="تغيير" onClick="selectCustomer();">
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <TD align="left"><FONT COLOR="YELLOW">شماره استعلام:</FONT></TD>
- <TD align="right">
- <!-- quote -->
- <INPUT TYPE="text" disabled maxlength="6" size="5" tabIndex="1" dir="LTR" value="<%=RS2("ID")%>">
- <INPUT TYPE="hidden" NAME="quote" value="<%=RS2("ID")%>">
- </TD>
- <TD align="left"><FONT COLOR="YELLOW">تاريخ:</FONT></TD>
- <TD><TABLE border="0">
- <TR>
- <TD dir="LTR">
- <INPUT disabled TYPE="text" maxlength="10" size="8" value="<%=RS2("order_date")%>">
- <INPUT TYPE="hidden" NAME="OrderDate" value="<%=RS2("order_date")%>">
- </TD>
- <TD dir="RTL"><FONT COLOR="YELLOW"><%="؟شنبه"%></FONT></TD>
- </TR>
- </TABLE></TD>
- <TD align="left"><FONT COLOR="YELLOW">ساعت:</FONT></TD>
- <TD align="right">
- <INPUT disabled TYPE="text" maxlength="5" size="3" dir="LTR" value="<%=RS2("order_time")%>">
- <INPUT TYPE="hidden" NAME="OrderTime" value="<%=RS2("order_time")%>"></TD>
- </TR>
- <TR bgcolor="#CCCCCC">
- <TD align="left">نام شركت:</TD>
- <TD align="right">
- <!-- CompanyName -->
- <INPUT TYPE="text" NAME="CompanyName" maxlength="50" size="25" tabIndex="2" value="<%=RS2("company_name")%>"></TD>
- <TD align="left">موعد اعتبار:</TD>
- <TD><TABLE border="0">
- <TR>
- <TD dir="LTR"><INPUT TYPE="text" NAME="ReturnDate" onblur="acceptDate(this)" maxlength="10" size="8" tabIndex="5" onKeyPress="return maskDate(this);" value="<%=RS2("return_date")%>"></TD>
- <TD dir="RTL">(?شنبه)</TD>
- </TR>
- </TABLE></TD>
- <TD align="left">ساعت اعتبار:</TD>
- <TD align="right"><INPUT TYPE="text" NAME="ReturnTime" maxlength="6" size="3" tabIndex="6" dir="LTR" onKeyPress="return maskTime(this);" value="<%=RS2("return_time")%>"></TD>
- </TR>
- <TR bgcolor="#CCCCCC">
- <TD align="left">نام مشتري:</TD>
- <TD align="right">
- <!-- CustomerName -->
- <INPUT TYPE="text" NAME="CustomerName" maxlength="50" size="25" tabIndex="3" value="<%=RS2("customer_name")%>"></TD>
- <TD align="left">نوع استعلام:</TD>
- <TD>
- <SELECT NAME="OrderType" style='font-family: tahoma,arial ; font-size: 9pt; font-weight: bold; width: 100px' tabIndex="7" onchange="alert('توجه داشته باشيد كه تغيير نوع سفارش باعث اختلال در جزئيات سفارش خواهد شد. آيا مسوليت آنرا ميپذيريد؟');">
- <%
- thisOrderType=RS2("Type")
- set RS_TYPE=Conn.Execute ("SELECT ID, Name FROM OrderTraceTypes WHERE (IsActive=1) ORDER BY ID")
- Do while not RS_TYPE.eof
- %>
- <OPTION value="<%=RS_TYPE("ID")%>" <%if thisOrderType=RS_TYPE("ID") then response.write "selected" %> ><%=RS_TYPE("Name")%></option>
- <%
- RS_TYPE.moveNext
- loop
- RS_TYPE.close
- set RS_TYPE = nothing
- %>
- </SELECT></TD>
- <TD align="left">استعلام گيرنده:</TD>
- <TD><INPUT NAME="SalesPerson" Type="TEXT"value="<%=RS2("salesperson")%>" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 100px' tabIndex="88" readonly>
- </TD>
- </TR>
- <TR bgcolor="#CCCCCC">
- <TD align="left">تلفن:</TD>
- <TD align="right">
- <!-- Telephone -->
- <INPUT TYPE="text" NAME="Telephone" maxlength="50" size="25" tabIndex="4" value="<%=RS2("telephone")%>"></TD>
- <TD align="left">عنوان كار داخل فايل:</TD>
- <TD align="right" colspan="3"><INPUT TYPE="text" NAME="OrderTitle" maxlength="255" size="50" tabIndex="9" value="<%=RS2("order_title")%>"></TD>
- </TR>
- <TR bgcolor="#CCCCCC">
- <td align="left">تيراژ:</td>
- <td>
- <input type="text" name="qtty" value="<%=rs2("qtty")%>" tabindex="9">
- </td>
- <td align="left">سايز:</td>
- <td>
- <input type="text" value="<%=rs2("paperSize")%>" name="paperSize" tabIndex="14">
- </td>
- <td align="left">قيمت كل:</td>
- <td >
- <input type="text" value="<%=rs2("price")%>" name="totalPrice" id='totalPrice' style="background-color:#FED;border-width:0;" <%if rs2("property")<>"" then response.write " readonly='readonly'"%>>
- </td>
- </TR>
- <TR bgcolor="#CCCCCC">
- <td>تخمين زمان توليد:</td>
- <td>
- <input name="productionDuration" type="text" size="2" value="<%=RS2("productionDuration")%>">
- <span>روز</span><br>
- <small>(صفر به معني معلوم نبودن زمان است)</small>
- </td>
- <TD align="left">توضيحات بيشتر:</TD>
- <TD align="right" colspan="3"><TEXTAREA NAME="Notes" tabIndex="10" style="width:100%"><%=RS2("Notes")%></TEXTAREA></TD>
-
- </TR>
- <tr bgcolor="#CCCCCC">
- <TD align="left">مرحله:</TD>
- <TD>
- <SELECT NAME="Marhale" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px' tabIndex="13" >
- <%
- set RS_STEP=Conn.Execute ("SELECT * FROM QuoteSteps WHERE (IsActive=1)")
- Do while not RS_STEP.eof
- %>
- <OPTION value="<%=RS_STEP("ID")%>" <%if RS2("step")=RS_STEP("ID") then response.write "selected" %> ><%=RS_STEP("name")%></option>
- <%
- RS_STEP.moveNext
- loop
- RS_STEP.close
- set RS_STEP = nothing
- %>
- </SELECT>
- </TD>
- <td colspan="4"></td>
- </tr>
- <tr bgcolor="#CCCCCC">
- <td colspan="6">
- <script type="text/javascript" src="/js/jquery-1.7.min.js"></script>
- <script type="text/javascript" src="calcOrder.js"></script>
- <div>جزئيات استعلام</div>
- <div>
- <br>براي محاسبه خودكار قيمتها بايد روي پارامترهاي هر سطر برويد و آنرا تغيير دهيد و يا آن سلول را ترك نماييد.
- <br>همچنين ميتوانيد قيمت خود را وارد نماييد اما در صورتي كه دوباره يكي از پارامترهاي مربوطه رو تغيير بديد دوباره قيمت محاسبه خواهد شد.
- <br>محاسبه برخي از قيمتها از روي پارامترهاي ساير خطوط خواهد بود. مثلا تيراژ در ماشين، تيراژي خواهد بود كه در سلفون و يو وي و ورني محاسبه ميشود. و در صورتي كه تيراژ ماشين رو عوض كنيم بايد سلولهاي مربوط به اين آيتمها رو ترك كنيم تا دوباره قيمتشون محاسبه بشه
- </div>
- <%
- set rs=Conn.Execute("select * from OrderTraceTypes where id="&rs2("type"))
- set typeProp = server.createobject("MSXML2.DomDocument")
- set orderProp = server.createobject("MSXML2.DomDocument")
-
- if rs2("property")<>"" then orderProp.loadXML(rs2("property"))
- if rs("property")<>"" then typeProp.loadXML(rs("property"))
- set rs=nothing
- ' for each item in typeProp.SelectNodes("//key")
- ' response.write item.parentNode.nodeName & ": " & item.xml & "<br>"
- ' next
- ' response.end
- sub showKeyEdit(key)
- 'key="/keys/printing/key"
- oldGroup="---first---"
- oldLabel="---first---"
- thisRow = "<div class='myRow'>"
- maxID=0
- oldID=0
- for each mykey in orderProp.SelectNodes(key)
- id=myKey.GetAttribute("id")
- if maxID<id then maxID=id
- next
- thisRow = thisRow & "<input type='hidden' value='" & maxID & "' id='" & Replace(key,"/","-") & "-maxID'>"
- ' response.write "<div class='myRow'><div class='exteraArea' id='" & Replace(key,"/","-") & "-0'>"
- for id = 0 to maxID
- thisRow = thisRow & "<div class='exteraArea' id='" & Replace(key,"/","-") & "-" & id & "'>"
- ' thisRow = thisRow & "<img title='حذف اين خط' src='/images/cancelled.gif' onclick='$(this).parent().remove();'>"
- For Each myKey In typeProp.SelectNodes(key)
- thisType = myKey.GetAttribute("type")
- thisName = myKey.GetAttribute("name")
- thisLabel= myKey.GetAttribute("label")
- thisGroup= myKey.GetAttribute("group")
- hasValue=false
- set thisValue= orderProp.SelectNodes(key & "[@id='" & id & "' and @name='" & thisName & "']")
- if thisValue.length>0 then hasValue=true
- ' response.write hasValue & "<br>"
- if (oldGroup<>thisGroup and oldID=id and oldGroup <> "---first---") then thisRow = thisRow & "</div>"
- if oldGroup<>thisGroup or oldID<>id then
- thisRow = thisRow & "<div class='mySection' groupName='" & thisGroup & "'>"
- if myKey.GetAttribute("disable")="1" then
- thisRow = thisRow & "<input type='checkbox' value='" & id & "' name='" & thisGroup & "-disBtn' onclick='disGroup(this);"
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " calc_" & myKey.GetAttribute("group") & "(this);"
- thisRow = thisRow & "'"
- if hasValue then
- thisRow = thisRow & " checked='checked'"
- disText=""
- else
- disText=" disabled='disabled' "
- end if
- thisRow = thisRow & ">"
- else
- disText=""
- end if
- end if
- if oldLabel<>thisLabel then thisRow = thisRow & "<label class='myLabel'>" & thisLabel & "</label>"
-
- select case thisType
- case "option"
- thisRow = thisRow & "<select " & disText & " class='myInput' name='" & thisName & "'"
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " onchange='calc_" & myKey.GetAttribute("group") & "(this);' "
- thisRow = thisRow & ">"
- for each myOption in myKey.getElementsByTagName("option")
- thisRow = thisRow & "<option value='" & myOption.text & "'"
- if hasValue then
- if thisValue(0).text=myOption.text then thisRow = thisRow & " selected='selected' "
- end if
- if myOption.GetAttribute("price")<>"" then
- thisRow = thisRow & " price='" & myOption.GetAttribute("price") & "' "
- end if
- thisRow = thisRow & ">" & myOption.GetAttribute("label") & "</option>"
- next
- thisRow = thisRow & "</select>"
- case "option-other"
- thisRow = thisRow & "<select " & disText & " class='myInput' name='" & thisName & "' onchange='checkOther(this);"
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " calc_" & myKey.GetAttribute("group") & "(this);"
- thisRow = thisRow & "'"
- thisRow = thisRow & ">"
- for each myOption in myKey.getElementsByTagName("option")
- thisRow = thisRow & "<option value='" & myOption.text & "'"
- if hasValue then
- if thisValue(0).text=myOption.text then thisRow = thisRow & " selected='selected' "
- end if
- if myOption.GetAttribute("price")<>"" then
- thisRow = thisRow & " price='" & myOption.GetAttribute("price") & "' "
- end if
- thisRow = thisRow & ">" & myOption.GetAttribute("label") & "</option>"
- next
- if hasValue then
- if left(thisValue(0).text,6)="other:" then
- thisRow = thisRow & "<option value='" & thisValue(0).text & "' selected='selected'>" & mid(thisValue(0).text,7) & "</option></select>"
- else
- thisRow = thisRow & "<option value='-1'>ساير</option></select>"
- end if
- else
- thisRow = thisRow & "<option value='-1'>ساير</option></select>"
- end if
- thisRow = thisRow & "<input type='text' name='" & thisName & "-addValue' onblur='addOther(this);'>"
- case "text"
- thisRow = thisRow & "<input " & disText & " type='text' class='myInput' size='" & myKey.text & "' name='" & thisName & "' "
- if myKey.GetAttribute("readonly")="yes" then thisRow =thisRow & " readonly='readonly' "
- if hasValue then
- thisRow = thisRow & "value='" & thisValue(0).text & "'"
- else
- if myKey.GetAttribute("default")<>"" then thisRow = thisRow & "value='" & myKey.GetAttribute("default") & "'"
- end if
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " onblur='calc_" & myKey.GetAttribute("group") & "(this);' "
- thisRow = thisRow & ">"
- case "textarea"
- thisRow = thisRow & "<textarea name='" & thisName & "' style='width:600px;' cols='" & myKey.text & "'>"
- if hasValue then thisRow = thisRow & thisValue(0).text
- thisRow = thisRow & "</textarea>"
- case "check"
- thisRow = thisRow & "<input type='checkbox' value='on-" & id & "' name='" & thisName & "' "
- if hasValue then
- if left(thisValue(0).text,2)="on" then thisRow = thisRow & "checked='checked'"
- else
- if myKey.text="checked" then thisRow = thisRow & "checked='checked'"
- end if
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " onclick='calc_" & myKey.GetAttribute("group") & "(this);' "
- if IsNumeric(myKey.GetAttribute("price")) then
- thisRow = thisRow & " price='" & myKey.GetAttribute("price") & "' "
- end if
- thisRow = thisRow & ">"
- case "radio":
- 'response.write hasValue
- thisRow = thisRow & "<input " & disText & " type='radio' value='" & myKey.text & "' name='" & thisName & "'"
- if hasValue then
- if myKey.text = thisValue(0).text then thisRow = thisRow & " checked='checked' "
-
- else
- if myKey.GetAttribute("default")="yes" then thisRow = thisRow & " checked='checked' "
- end if
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " onchange='calc_" & myKey.GetAttribute("group") & "(this);' "
- thisRow = thisRow & ">"
- case "service":
- thisRow = thisRow & "<select " & disText & "class='myInput' name='" & thisName & "'"
- if myKey.GetAttribute("blur")="yes" then thisRow = thisRow & " onchange='calc_" & myKey.GetAttribute("group") & "(this);' "
- thisRow = thisRow & ">"
- set rs = Conn.Execute("select * from outServices")
- while not rs.eof
- thisRow = thisRow & "<option value='" & rs(id) & "'"
- if hasValue then
- if thisValue(0).text=myOption.text then thisRow = thisRow & " selected='selected' "
- end if
- thisRow = thisRow & ">" & rs("name") & "</option>"
- rs.moveNext
- wend
- thisRow = thisRow & "</select>"
- end select
- if myKey.GetAttribute("force")="yes" then thisRow = thisRow & "<span style='color:red;margin:0 0 0 2px;padding:0;'>*</span>"
- oldGroup=thisGroup
- oldLabel=thisLabel
- oldID=id
- if myKey.GetAttribute("br")="yes" then thisRow = thisRow & "<br>"
- Next
- thisRow = thisRow & "</div></div>"
- next
- thisRow = thisRow & "<div id='extreArea" &Replace(key,"/","-")& "'></div>"
- response.write thisRow 'prependTo
- response.write "<div class='btn'><img title='اضافه' src='/images/Plus-32.png' width='20px' onclick='cloneRow(""" & key & """);'><img title='حذف آخرين خط' src='/images/cancelled.gif' onclick='removeRow(""" & key & """);'></div></div>"
- end sub
-
- oldTmp="---first---"
- for each tmp in typeProp.selectNodes("//key")
- if oldTmp<>tmp.parentNode.nodeName then
- oldTmp=tmp.parentNode.nodeName
- call showKeyEdit("/keys/" & oldTmp & "/key")
- end if
- next
-
- ' call showKeyEdit("/keys/printing/key")
- ' call showKeyEdit("keys/binding/key")
- ' call showKeyEdit("keys/service/key")
- ' call showKeyEdit("keys/delivery/key")
-
- %>
-
- </td>
- </tr>
- <TR bgcolor="#CCCCCC">
- <TD colspan="6">
- <TABLE align="center" width="50%" border="0">
- <TR>
- <TD><INPUT TYPE="submit" Name="Submit" tabIndex="16" Value="تاييد" onFocus="noNextField=true;" onBlur="noNextField=false;" style="width:100px;"></TD>
- <TD> </TD>
- <TD align="left"><INPUT TYPE="button" Name="Cancel" tabIndex="17" Value="انصراف" style="width:100px;" onClick="window.location='Inquiry.asp?act=show"e=<%=quote%>';"></TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- </FORM>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- document.all.CompanyName.focus();
- var noNextField = false;
- function documentKeyDown() {
- var theKey = event.keyCode;
- var o = window.event.srcElement;
- if (theKey == 9) {
- if (noNextField) // Don't Move
- if(event.shiftKey){
- noNextField=false;
- event.keyCode=9
- }
- else
- return false;
- else { // send focus to next box
- if (false){
- }
- else if(o.name == 'quote'){
- // quote
- if (o.value.length<5){
- return false;
- }
- }
- else if(o.name == 'ReturnTime'){
- // Return Time
- var soutput = o.value;
- var len = o.value.length;
- if (len==0){
- return true;
- }
- else if (len==3){
- soutput = soutput + '00'
- o.value = soutput;
- }
- else if (len==4){
- var tempString =soutput.charAt(len-1);
- soutput = soutput.substring(0,len-1) + '0' + tempString
- o.value = soutput;
- }
- else if(len!=5)
- return false;
- }
- event.keyCode=9
- return true;
- }
- }
- }
- document.onkeydown = documentKeyDown;
- function checkValidation(){
- return true;
- }
- function selectCustomer(){
- document.all.tmpDlgArg.value="#"
- document.all.tmpDlgTxt.value="نام حسابي را كه مي خواهيد جستجو كنيد وارد كنيد:"
- window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
- if (document.all.tmpDlgTxt.value !="") {
- window.showModalDialog('../AR/dialog_SelectAccount.asp?act=select&search='+escape(document.all.tmpDlgTxt.value), document.all.tmpDlgArg, 'dialogWidth:780px; dialogHeight:500px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
- if (document.all.tmpDlgArg.value!="#"){
- Arguments=document.all.tmpDlgArg.value.split("#")
- theSpan=document.getElementById("customer");
- theSpan.getElementsByTagName("input")[0].value=Arguments[0];
- theSpan.getElementsByTagName("span")[0].innerText=Arguments[0]+" - "+Arguments[1];
- }
- }
- }
- //-->
- </SCRIPT>
- </TABLE>
- <br>
- </font>
- <%
- elseif Request.QueryString("act")="submitEditQuote" then
- quote = request("quote")
- if quote <> "" then
- if isNumeric(quote) then
- quote=clng(quote)
- else
- quote=""
- end if
- end if
-
- If quote="" Then
- response.write "<br><br>"
- call showAlert("شماره استعلام اشتباه است .", CONST_MSG_ERROR )
- response.end
- End If
- orderType=request.form("OrderType")
- if orderType="" OR not isNumeric(OrderType) then
- conn.close
- response.redirect "?errMsg=" & Server.URLEncode("خطا در نوع استعلام<br>اطلاعات وارد نشد…<BR>")
- else
- set RS1=Conn.Execute ("SELECT Name FROM OrderTraceTypes WHERE (ID='"& orderType & "') AND (IsActive=1)")
- if RS1.eof then
- conn.close
- response.redirect "?errMsg=" & Server.URLEncode("خطا در نوع استعلام<br>اطلاعات وارد نشد…<BR>")
- else
- orderTypeName=RS1("Name")
- end if
- RS1.close
- end if
- 'set RS1=Conn.Execute ("SELECT Name FROM OrderTraceStatus WHERE (IsActive=1) and ID = " & request.form("Vazyat"))
- 'statusName = RS1("name")
- set rs=Conn.Execute("select * from OrderTraceTypes where id=" & request("orderType"))
- if rs.eof then
- conn.close
- response.redirect "?errmsg=" & server.urlEncode("نوع سفارش را تعيين كنيد")
- end if
- orderTypeID=rs("id")
- orderTypeName=rs("name")
- set orderProp = server.createobject("MSXML2.DomDocument")
- if rs("property")<>"" then
- orderProp.loadXML(rs("property"))
- myXML = fetchKeyValues()
- end if
- rs.close
- set rs=nothing
-
-
- set RS1=Conn.Execute ("SELECT Name FROM QuoteSteps WHERE (IsActive=1) and ID = " & request.form("Marhale"))
- stepName = RS1("name")
- set RS3=Conn.Execute ("SELECT * FROM Quotes WHERE (ID = "& quote & ")")
- OrderDate = sqlSafe(request.form("OrderDate"))
- OrderTime = sqlSafe(request.form("OrderTime"))
- ReturnDate = sqlSafe(request.form("ReturnDate"))
- ReturnTime = sqlSafe(request.form("ReturnTime"))
- CompanyName = sqlSafe(request.form("CompanyName"))
- CustomerName = sqlSafe(request.form("CustomerName"))
- Telephone = sqlSafe(request.form("Telephone"))
- OrderTitle = sqlSafe(request.form("OrderTitle"))
- 'Vazyat = sqlSafe(request.form("Vazyat"))
- Marhale = sqlSafe(request.form("Marhale"))
- SalesPerson = sqlSafe(request.form("SalesPerson"))
- ' Qtty = sqlSafe(request.form("Qtty"))
- Size = sqlSafe(request.form("Size"))
- ' SimplexDuplex = sqlSafe(request.form("SimplexDuplex"))
- Price = sqlSafe(request.form("totalPrice"))
- Notes = sqlSafe(request.form("Notes"))
- productionDuration = sqlSafe(request.form("productionDuration"))
- mySql="UPDATE Quotes SET Customer='"& request.form("CustomerID") & "', order_date= N'"& OrderDate & "', order_time= N'"& OrderTime & "', return_date= N'"& ReturnDate & "', return_time= N'"& ReturnTime & "', company_name= N'"& CompanyName & "', customer_name= N'"& CustomerName & "', telephone= N'"& Telephone & "', order_title= N'"& OrderTitle & "', order_kind= N'"& orderTypeName & "', Type= '"& orderType & "', step= "& Marhale & ", marhale= N'"& stepName & "', salesperson= N'"& SalesPerson & "' , LastUpdatedDate=N'"& shamsitoday() & "' , LastUpdatedTime=N'"& currentTime10() & "', LastUpdatedBy=N'"& session("ID")& "', Notes= N'"& Notes & "', property=N'" & myXML & "', paperSize= N'"& Size & "', Price= N'"& Price & "', productionDuration = " & productionDuration & " WHERE (ID = N'"& quote & "')"
- ', qtty= N'"& Qtty & "', paperSize= N'"& Size & "', SimplexDuplex= N'"& SimplexDuplex & "', Price= N'"& Price & "'
- conn.Execute mySql
- response.write quote &" UPDATED<br>"
- response.write "<A HREF='orderEdit.asp'>Back</A>"
- ' if request.form("Marhale")="10" then
- ' call InformCSRorderIsReady(quote , RS3("CreatedBy"))
- ' end if
- ' if not request.form("relatedApprovedInvoiceID")="0" then
- ' call UnApproveInvoice(request.form("relatedApprovedInvoiceID") , request.form("relatedApprovedInvoiceBy"))
- ' end if
- conn.close
- response.redirect "?act=show"e=" & quote & "&msg=" & Server.URLEncode("اطلاعات استعلام به روز شد")
-
- elseif Request.QueryString("act")="convertToOrder" then
- If isnumeric(request("quote")) then
- quote=request("quote")
- mySQL="SELECT Quotes.Customer FROM Quotes WHERE (Quotes.ID='"& quote & "')"
- set RS1=conn.execute (mySQL)
- If RS1.EOF then
- response.write "<BR><BR><BR><BR><CENTER>شماره استعلام معتبر نيست</CENTER>"
- conn.close
- response.end
- End If
- CustomerID = RS1("Customer")
- RS1.close
- set rs = Conn.Execute("select * from accounts where id=" & CustomerID)
- if rs.eof then
- conn.close
- response.write "<BR><BR><BR><BR><CENTER>خطاي عجيب شماره مشتري معتبر نيست!</CENTER>"
- response.end
- end if
- if (cdbl(rs("arBalance"))+cdbl(rs("creditLimit")) < 0) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode("بدهي اين حساب از ميزان اعتبار آن بيشتر شده،<br> لطفا با سرپرست فروش هماهنگ كنيد.<br><a href='../CRM/AccountInfo.asp?act=show&selectedCustomer=" & CustomerID & "'>نمايش حساب</a>")
- end if
- rs.close
- set rs = nothing
- CreationDate = shamsiToday()
- OrderTime = Left(currentTime10(),5)
- ' create order for the same customer
- mySQL="INSERT INTO Orders (CreatedDate, CreatedBy, Customer) VALUES ('"& CreationDate & "', '"& session("ID") & "', '"& CustomerID & "');SELECT @@Identity AS NewOrder"
- set RS1 = Conn.execute(mySQL).NextRecordSet
- OrderID = RS1("NewOrder")
- RS1.close
- ' create orders_trace row and copy info from quote
- mySQL= "INSERT INTO orders_trace (radif_sefareshat, order_date, order_time, company_name, customer_name, telephone, order_title, order_kind, Type, vazyat, marhale, salesperson, status, step, LastUpdatedDate, LastUpdatedTime, LastUpdatedBy, property) "&_
- "SELECT '" & OrderID & "', N'"& CreationDate & "', N'"& OrderTime & "', company_name, customer_name, telephone, order_title, order_kind, Type, N'در جريان', N'در صف شروع', salesperson, 1, 1, N'"& CreationDate & "', N'"& currentTime10() & "', '"& session("ID") & "',property FROM Quotes WHERE ID='" & quote & "'; "
- conn.Execute(mySQL)
- ' relate invoices to the new order
- mySQL= "INSERT INTO InvoiceOrderRelations ([Invoice], [Order]) SELECT [Invoice], '" & OrderID & "' AS [Order] FROM InvoiceQuoteRelations WHERE Quote = '" & quote & "';"
- conn.Execute(mySQL)
- ' remove relation to previous quote
- mySQL= "DELETE FROM InvoiceQuoteRelations WHERE Quote = '" & quote & "';"
- conn.Execute(mySQL)
- 'close the quote
- mySQL= "UPDATE Quotes SET Closed = 1, step = 5, marhale = 'تبديل به سفارش شده' WHERE [ID] = '" & quote & "';"
- conn.Execute(mySQL)
- ' keeping the relation
- mySQL= "INSERT INTO QuoteOrderRelations ([QuoteId], [OrderId]) VALUES ('" & quote & "' , '" & OrderID & "');"
- conn.Execute(mySQL)
- conn.close
- response.redirect "../order/TraceOrder.asp?act=show&order=" & OrderID & "&msg=" & Server.URLEncode("استعلام به سفارش كپي شد")
- End If
- response.write "<br><br>"
- call showAlert("شماره استعلام اشتباه است .", CONST_MSG_ERROR )
- response.end
- end if
- 'Conn.Close
- %>
- <!--#include file="tah.asp" -->