· 8 years ago · Nov 30, 2017, 07:28 PM
1<% '(C) Copyright 2000-2011 - Marathon Data Systems, LLC. - All Rights Reserved %>
2<% Response.CacheControl = "no-cache" %>
3<!-- #INCLUDE VIRTUAL="/functions.asp" -->
4<%
5Call CheckLogin
6Server.ScriptTimeout = 6000
7
8cCustom = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Custom")
9lAaron = (cCustom = "AARON")
10lABCAustin = (cCustom = "ABCAUSTIN")
11lABR130785 = (cCustom = "ABR130785")
12lAmerican = (cCustom = "AMERICAN")
13lAnderson = (cCustom = "ANDERSON")
14lAtomic = (cCustom = "ATOMIC")
15lBlackCloud = (cCustom = "BLACKCLOUD")
16lBUGMAN = (cCustom = "BUGMAN")
17lBugOut = (cCustom = "BUGOUT")
18lBizzyBees336794 = (cCustom = "BIZZYBEES336794")
19lCentex = (cCustom = "CENTEX")
20lChemtec = (cCustom = "CHEMTEC")
21lClark = (cCustom = "CLARK")
22lClark338110 = (cCustom = "CLARK338110")
23lCooper = (cCustom = "COOPER")
24lCopesan = (cCustom = "COPESAN")
25lFalcon = (cCustom = "FALCON")
26lGriffin = (cCustom = "GRIFFIN")
27lGuardian = (cCustom = "GUARDIAN")
28lHolders = (cCustom = "HOLDERS")
29lHumphreys = (cCustom = "HUMPHREYS302281")
30lInsectek = (cCustom = "INSECTEK")
31lIsotech = (cCustom = "ISOTECH")
32lJHI126824 = (cCustom = "JHI126824")
33lJNJ = (cCustom = "JNJ")
34lMagical = (cCustom = "MAGICAL")
35lMcCall = (cCustom = "MCCALL")
36lMDS = (cCustom = "MDS")
37lMiddleton = (cCustom = "MIDDLETON")
38lMSC = (cCustom = "MSC")
39lNJLawn = (cCustom = "NJLAWN")
40lPacwest = (cCustom = "PACWEST")
41lParamount113406 = (cCustom = "PARAMOUNT113406")
42lPestrite = (cCustom = "PESTRITE333037")
43lPermaguard = (cCustom = "PERMAGUARD")
44lPioneer338376 = (cCustom = "PIONEER338376")
45lPrestoX = (cCustom = "PRESTOX")
46lReliable = (cCustom = "RELIABLE301180")
47lRK = (cCustom = "RK")
48lRollins = (cCustom = "ROLLINS")
49lRosePest = (cCustom = "ROSEPEST107931")
50lRussell = (cCustom = "RUSSELL")
51lSelect = (cCustom = "SELECT")
52lSexton = (cCustom = "SEXTON")
53lSMS = (cCustom = "SMS")
54lSOS = (cCustom = "SOS")
55lSteritech = (cCustom = "STERITECH")
56lSuburban = (cCustom = "SUBURBAN")
57lSwingle = (cCustom = "SWINGLE")
58lTerminator = (cCustom = "TERMINATOR")
59
60lUseChemicals = (oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseChemicals") = "Y")
61lUseDetailedDescription = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseDetailedDescription")
62lCopesanPart = (oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Copesan") = "Y")
63lUseRequired = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseRequiredFields")
64lShowExtraChemInfo = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowExtraChemInfo")
65lUseMultipleTargets = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("MultipleSrvTargets")
66lLinkTargetToService = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LinkTargetToService")
67lLinkChemToService = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LinkChemToService")
68lPostBatchInv = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostBatchInv")
69lUseOregonPesticideReport = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseOregonPesticideReport")
70lUseProductionValue = (oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseProductionValue") = "Y")
71cRequiredFields = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ReqFieldsServOrder")
72lUseInventory = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseInventory")
73lUsePeriodLockDown = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UsePeriodLockDown")
74lPostPeriodWarn = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostPeriodWarn")
75lPostPeriodWarnFuture = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostPeriodWarnFuture")
76lPostDateWarn = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostDateWarn")
77nPostDateWarnDays = CDbl(oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostDateWarnDays"))
78lPestPacLite = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PestPacLite")
79cChemicalAutoCalcOnBlur = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ChemicalAutoCalcOnBlur")
80'DS 02/02/2011 FB 7482
81lPostEditInst = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostEditInst")
82
83If lPestPacLite Then
84 cPPLclass = "Hidden"
85Else
86 cPPLclass = ""
87End If
88
89Sub DisplayUDFPost(nI, lDisabled, nTabIndex, cValue, cBranchID, nCount)
90 cType = "UserDef" & nI & "Type"
91 cName = "UserDef" & nI & nCount
92
93 'Check to set TabIndex
94 If Em(nTabIndex) Then nTabIndex = -1
95
96 Select Case oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))(cType)
97 Case "T":
98 If lDisabled Then
99 Response.Write "<input tabindex='" & ntabIndex & "' type=text readonly name='" & cName & "' size=10 maxlength=10 value='" & cValue & "'>"
100 Else
101 Response.Write "<input tabindex='" & ntabIndex & "' type=text name='" & cName & "' size=10 maxlength=10 value='" & cValue & "'>"
102 End If
103 Case "D":
104 If lDisabled Then
105 Response.Write "<input tabindex='" & ntabIndex & "' type=text readonly " & VClass("Date","") & " name='" & cName & "' size=10 maxlength=10 value='" & cValue & "'>"
106 Else
107 Response.Write "<input tabindex='" & ntabIndex & "' type=text " & VClass("Date","") & " name='" & cName & "' size=10 maxlength=10 value='" & cValue & "'>"
108 End If
109 Case "C":
110 If lDisabled Then
111 If cValue = "1" Then
112 Response.Write "<input tabindex='" & ntabIndex & "' type=checkbox disabled name='" & cName & "' value='1' checked>"
113 Else
114 Response.Write "<input tabindex='" & ntabIndex & "' type=checkbox disabled name='" & cName & "' value='1'>"
115 End If
116 Else
117 If cValue = "1" Then
118 Response.Write "<input tabindex='" & ntabIndex & "' type=checkbox name='" & cName & "' value='1' checked>"
119 Else
120 Response.Write "<input tabindex='" & ntabIndex & "' type=checkbox name='" & cName & "' value='1'>"
121 End If
122 End If
123 Case "S":
124 If lDisabled Then
125 Response.Write "<input tabindex=" & ntabIndex & " readonly type=text name='" & cName & "' size=10 maxlength=10 onkeypress = 'javascript: vUCaseKey(this)' value='" & cValue & "' onBlur='VBScript:Call UserDefChoiceOnBlur(" & nI & ", " & cBranchID & ", " & nCount & ")' onKeyDown='VBScript:Call UserDefChoiceOnKeyDown(" & nI & ", " & cBranchID & ", " & nCount & ")' " & VClass("lookup","UserDefChoiceOnKeyDown(" & nI & ", " & cBranchID & ", " & nCount & ")|1") & ">"
126 Response.Write "<input type=hidden name='UserDefID" & nI & nCount & "' value=''>"
127 Else
128 Response.Write "<input tabindex=" & ntabIndex & " type=text name='" & cName & "' size=10 maxlength=10 onkeypress = 'javascript: vUCaseKey(this)' value='" & cValue & "' onBlur='VBScript:Call UserDefChoiceOnBlur(" & nI & ", " & cBranchID & ", " & nCount & ")' onKeyDown='VBScript:Call UserDefChoiceOnKeyDown(" & nI & ", " & cBranchID & ", " & nCount & ")' " & VClass("lookup","UserDefChoiceOnKeyDown(" & nI & ", " & cBranchID & ", " & nCount & ")|1") & ">"
129 Response.Write "<input type=hidden name='UserDefID" & nI & nCount & "' value=''>"
130 End If
131 Case "N":
132 If lDisabled Then
133 Response.Write "<input tabindex='" & ntabIndex & "' type=text readonly name='" & cName & "' size=10 maxlength=10 value='" & cValue & "' onblur='javascript: vUserDefNumBlur(this)' onkeypress='javascript: vNumKey(this,1)'>"
134 Else
135 Response.Write "<input tabindex='" & ntabIndex & "' type=text name='" & cName & "' size=10 maxlength=10 value='" & cValue & "' onblur='javascript: vUserDefNumBlur(this)' onkeypress='javascript: vNumKey(this,1)'>"
136 End If
137 End Select
138End Sub
139
140cMode = Request("Mode")
141cSearchMode = Request("SearchMode")
142cReview = Request("Review")
143
144If Request("InventoryBatchID") <> "" Then
145 cBatchID = Request("InventoryBatchID")
146Else
147 cBatchID = Coalesce(Request("BatchID"), oGlobals("InvoiceBatchID"))
148End If
149
150cPublic = oGlobals("InvoiceBatchPublic")
151
152If Not Em(cBatchID) Then
153 Set objBatch = Server.CreateObject("PestPacService.InvoiceBatch")
154 Set oBatch = objBatch.LoadRecordset(oGlobals("Database"),oGlobals("CompanyID"), cBatchID)
155 Set objBatch = Nothing
156 Call CheckRSError(oBatch)
157
158 Call CheckCompany(oBatch("CompanyID"),oGlobals("CompanyID"))
159
160 If oBatch("Lock") Then
161 oGlobals("InvoiceBatchID") = ""
162 oGlobals("InvoiceBatchPublic") = "1"
163
164 Response.Redirect "default.asp"
165 Else
166 oGlobals("InvoiceBatchID") = cBatchID
167 oGlobals("InvoiceBatchPublic") = FormatBoolToCheckbox(oBatch("Public"))
168 End If
169Else
170 oGlobals("InvoiceBatchID") = ""
171End If
172
173nChanged = 0
174nUnprint = 0
175
176Select Case cMode
177 Case "Next", "Done", "Post":
178 nPosted = 0
179 For nI = 1 To CDbl(Request("OrderCount"))
180 If Request("OldPost" & nI) <> Request("Post" & nI) Then
181 nChanged = nChanged + 1
182 End If
183 If Request("Post" & nI) = "1" Then
184 nPosted = nPosted + 1
185 End If
186
187 If lSwingle Then
188 If Request("Unprint" & nI) = "1" Then
189 nUnprint = nUnprint + 1
190 End If
191 End If
192 Next
193
194 If nChanged + nPosted + nUnprint <> 0 Then
195 If lCooper Then
196 cSaveLog = 1
197 Else
198 cSaveLog = 0
199 End If
200
201 Set objOrder = Server.CreateObject("PestPacService.Order")
202 Set objOrderLine = Server.CreateObject("PestPacService.OrderLine")
203 Set objOrderLineMeasurement = Server.CreateObject("PestPacService.OrderLineMeasurement")
204 Set objOrderChemical = Server.CreateObject("PestPacService.OrderChemical")
205 Set objOrderTarget = Server.CreateObject("PestPacService.OrderTarget")
206 Set objBatch = Server.CreateObject("PestPacService.InvoiceBatch")
207
208 ' reserve new batch number if necessary'
209 If Em(cBatchID) Then
210 cBatchID = objBatch.Reserve(oGlobals("Database"), oGlobals("CompanyID"), oGlobals("DefaultBranchID"))
211 Call CheckError(cBatchID)
212 Else
213 cBatchID = objBatch.LookupOpen(oGlobals("Database"), oGlobals("CompanyID"), cBatchID, oGlobals("DefaultBranchID"))
214 Call CheckError(cBatchID)
215 End If
216
217 ' check for batch and insert if necessary'
218 cCount = objBatch.Lookup(oGlobals("Database"), oGlobals("CompanyID"), cBatchID)
219 Call CheckError(cCount)
220
221 If CDbl(cCount) = 0 Then
222 If lCentex or lBlackCloud Then
223 cPublic = "1"
224 End If
225
226 cOK = objBatch.Insert(oGlobals("Database"), oGlobals("CompanyID"), oGlobals("UserID"),oGlobals("DefaultBranchID") , cBatchID, cPublic)
227 Call CheckError(cOK)
228 End If
229 Set objBatch = Nothing
230
231 For nI = 1 To CDbl(Request("OrderCount"))
232 If Request("OldPost" & nI) <> Request("Post" & nI) Or Request("Post" & nI) = "1" Then
233 Set oFields = Server.CreateObject("Scripting.Dictionary")
234 Set oLineFields = Server.CreateObject("Scripting.Dictionary")
235 Set oChemFields = Server.CreateObject("Scripting.Dictionary")
236
237 cOrderID = Request("OrderID" & nI)
238
239 oFields("BatchID") = cBatchID
240 oFields("Posted") = Request("Post" & nI)
241 oFields("OrderNum") = Request("OrderNum" & nI)
242 oFields("InvoiceDate") = Request("InvoiceDate" & nI)
243 oFields("WorkDate") = Request("WorkDate" & nI)
244 oFields("WorkTime") = Request("WorkTime" & nI)
245 oFields("WorkAmPm") = Request("WorkAmPm" & nI)
246 oFields("Duration") = Request("Duration" & nI)
247 oFields("TechCode") = Request("Tech" & nI)
248 oFields("OrderType") = Request("OrderType" & nI)
249 oFields("Total") = Request("NewTotal" & nI)
250 oFields("Payment") = Request("Payment" & nI)
251 oFields("Discount") = Request("Discount" & nI)
252 oFields("AdjustmentReason") = Request("AdjustmentReason" & nI)
253 oFields("NextServiceDate") = Request("NextServiceDate" & nI)
254 oFields("NextServiceTime") = Request("NextServiceTime" & nI)
255 oFields("NextServiceAmPm") = Request("NextServiceAmPm" & nI)
256
257 'hide reference field -dbb 9/7/06
258 cReference = Request("Reference" & nI)
259 If IsNumeric(cReference) And (Len(cReference) = 15 Or Len(cReference) = 16) Then
260 oFields("Reference") = HideCard(cReference)
261 Else
262 oFields("Reference") = cReference
263 End If
264
265 oFields("GLARCodeID") = Request("GLARCodeID" & nI)
266 oFields("CommentID") = Request("CommentID" & nI)
267 oFields("Comment") = Request("Comment" & nI)
268 oFields("FieldCommentID") = Request("FieldCommentID" & nI)
269 oFields("FieldComment") = Request("FieldComment" & nI)
270
271 If Em(Request("MethodOfPaymentID" & nI))Then
272 oFields("MethodOfPaymentID") = "0"
273 Else
274 oFields("MethodOfPaymentID") = Request("MethodOfPaymentID" & nI)
275 End If
276
277 oFields("TechProd1") = Request("ProdAmount1" & nI)
278 oFields("TechProd2") = Request("ProdAmount2" & nI)
279 oFields("TechProd3") = Request("ProdAmount3" & nI)
280 oFields("TechProd4") = Request("ProdAmount4" & nI)
281 oFields("TechProd5") = Request("ProdAmount5" & nI)
282
283 oFields("RenewalAdvance") = Request("RenewalAdvance" & nI)
284
285 oFields("UserDef14") = Request("UserDef14" & nI)
286 oFields("UserDef15") = Request("UserDef15" & nI)
287 oFields("UserDef16") = Request("UserDef16" & nI)
288 oFields("UserDef17") = Request("UserDef17" & nI)
289 oFields("UserDef18") = Request("UserDef18" & nI)
290 oFields("UserDef19") = Request("UserDef19" & nI)
291 oFields("UserDef20") = Request("UserDef20" & nI)
292 oFields("UserDef21") = Request("UserDef21" & nI)
293 oFields("UserDef22") = Request("UserDef22" & nI)
294 oFields("UserDef23") = Request("UserDef23" & nI)
295 oFields("UserDef56") = Request("UserDef56" & nI)
296 oFields("UserDef57") = Request("UserDef57" & nI)
297
298 oFields("TargetID") = Request("TargetID" & nI)
299
300 oFields("Custom") = cCustom
301
302 'It's very unlikely that you would unpost an order with the intent of redownloading it. Don't lost the TimeOut. -dpr 05-07-2008
303 oFields("TimeOut") = Request("TimeOut" & nI)
304 'oFields("TimeOut") = "1900-01-01 00:00:00.000"
305 oFields("PostingSwingleBatchPrint") = Request("PostingSwingleBatchPrint" & nI)
306
307 oFields("TechID") = Request("TechID1_" & nI)
308 oFields("TechID2") = Request("TechID2_" & nI)
309 oFields("TechID3") = Request("TechID3_" & nI)
310 oFields("TechID4") = Request("TechID4_" & nI)
311 oFields("TechID5") = Request("TechID5_" & nI)
312 oFields("TechShare") = Request("TechShare1_" & nI)
313 oFields("TechShare2") = Request("TechShare2_" & nI)
314 oFields("TechShare3") = Request("TechShare3_" & nI)
315 oFields("TechShare4") = Request("TechShare4_" & nI)
316 oFields("TechShare5") = Request("TechShare5_" & nI)
317 oFields("TechBonus1") = Request("TechBonus1_" & nI)
318 oFields("TechBonus2") = Request("TechBonus2_" & nI)
319 oFields("TechBonus3") = Request("TechBonus3_" & nI)
320 oFields("TechBonus4") = Request("TechBonus4_" & nI)
321 oFields("TechBonus5") = Request("TechBonus5_" & nI)
322
323 oFields("TechIDTwo") = Request("TechID2_" & nI)
324 oFields("TechIDThree") = Request("TechID3_" & nI)
325 oFields("TechIDFour") = Request("TechID4_" & nI)
326 oFields("TechIDFive") = Request("TechID5_" & nI)
327
328 If lMSC Then
329 If Coalesce(oFields("TechID"),"0") <> "0" And Coalesce(oFields("TechID2"),"0") = "0" Then
330 oFields("TechShare") = 1
331 oFields("TechShare2") = 0
332 ElseIf Coalesce(Request("OldTechID2_" & nI),"0") = "0" And Coalesce(oFields("TechID2"),"0") <> "0" Then
333 oFields("TechShare") = .5
334 oFields("TechShare2") = .5
335 End If
336 End If
337
338 '-- Added temporarily to debug viking issue -cdk 4/6/09
339 If Request("OrderType" & nI) <> Request("OrigOrderType" & nI) Then
340 Call UpdateLog("U_VikingPost", "Order Type on order changed from " & Request("OrigOrderType" & nI) & " to " & Request("OrderType" & nI) & " (Order " & Request("OrderNum" & nI) & ") by " & oGlobals("Username"), oGlobals("DefaultBranchID"))
341 End If
342
343 cOK = objOrder.SavePostingData(oGlobals("Database"), cOrderID, oGlobals("UserID"), oGlobals("Date"), oFields)
344 Call CheckError(cOK & " - save posting data")
345
346 If IsCustom("ISS128788") Then
347 cOK = ISSUpdateCreditMemoRequired(cOrderID, Coalesce(Request("CreditMemoRequired" & nI), "0"))
348 End If
349
350 If cMode <> "Post" Then
351 Set oOrderInfo = objOrder.LoadRecordset(oGlobals("Database"), cOrderID)
352 Call CheckRSError(oOrderInfo)
353 Call UpdateLog("SP_ServiceOrder", "Saved Service Order Posting Data (Order " & oOrderInfo("OrderNum") & ")", oOrderInfo("BranchID"))
354 End If
355
356 If lBugOut Then
357 Set objCustom = Server.CreateObject("PestPacCustom.Report")
358 cOK = objCustom.UpdateServiceOrderBranch(oGlobals("Database"), oGlobals("CompanyID"), Request("OrderID" & nI), Request("BranchID" & nI))
359 Set objCustom = Nothing
360 Call CheckError(cOK)
361 ElseIf lMagical Then
362 Set oMagic = Server.Createobject("Scripting.Dictionary")
363 oMagic("OrderID") = Trim(Request("OrderID" & nI))
364 oMagic("PONumber") = Trim(Request("PONumber" & nI))
365 cOK = ExecuteNonQuery("ReportCustom119772_01OrderUpdatePONumber", oMagic)
366 Set oMagic = Nothing
367 End If
368
369 ' Added 12/01/2005 by JLF for McCall. Auto-adds a 2nd line item of 'OIL TAX'
370 ' when the order is saved for only the service codes of 'OIL-2' and 'OIL-4'.
371
372 ' Create the scripting dictionary for everyone to avoid errors in the save line routine
373 Set oOilTaxFields = Server.CreateObject("Scripting.Dictionary")
374 oOilTaxFields("ServiceID") = ""
375
376 If lMcCall Then
377 cOil2Codes = "~AB #1 KPFUL COM~AB #1 KPFUL RES~AB #1 WLCL COM~AB #1 WLCL RES~AB #2 KPFUL COM~AB #2 KPFUL RES~AB #2 WLCL COM~AB #2 WLCL RES~"
378 cOil4Codes = "~#1 KP FULL COM~#1 KP FULL RES~#1 WIL CALL COM~#1 WIL CALL RES~#2 KP FUL RES~#2 KP FULL COM~#2 WIL CALL COM~#2 WIL CALL RES~"
379 nFilledLines = 0
380
381 ' Count the number of filled-in service lines
382 For nCount = 1 To CDbl(Request("Lines") & nI)
383 If Not Em(Request(nCount & "ServiceID" & nI)) Then
384 nFilledLines = nFilledLines + 1
385 End If
386 Next
387
388 ' Only add/edit oil tax line if total # of lines filled in is 1 or 2
389 ' (1 line = OIL service alone; we have to add the OIL TAX line.
390 ' 2 lines = OIL service + OIL TAX; we only have to edit the OIL TAX line.)
391
392 If nFilledLines = 1 Or nFilledLines = 2 Then
393 ' Get the service code of the first line
394 cServiceCode = Request("1ServiceCode" & nI)
395 cOilQuantity = Request("1Quantity" & nI)
396
397 If InStr(1, cOil2Codes, "~" & cServiceCode & "~") > 0 Or _
398 InStr(1, cOil4Codes, "~" & cServiceCode & "~") > 0 Then
399
400 ' Lookup the ServiceID of the "OIL TAX" service code
401 Set objService = Server.CreateObject("PestPacLookup.Service")
402 cServiceID = objService.LookupCode(oGlobals("Database"), oGlobals("CompanyID"), "OIL TAX")
403
404 ' Calculate the "OIL TAX" line and save the data into oOilTaxFields
405 If cServiceID <> -1 Then
406 oOilTaxFields("ServiceID") = cServiceID
407 oOilTaxFields("Description") = "Oil Tax"
408
409 If oOilTaxFields("ServiceID") = cServiceID Then
410 oOilTaxFields("Quantity") = 1
411
412 If InStr(1, cOil2Codes, "~" & cServiceCode & "~") > 0 Then
413 oOilTaxFields("UnitPrice") = CDbl(cOilQuantity) * 0.02
414 ElseIf InStr(1, cOil4Codes, "~" & cServiceCode & "~") > 0 Then
415 oOilTaxFields("UnitPrice") = CDbl(cOilQuantity) * 0.04
416 End If
417 ' -- Hardcoded GL CodeID and GL Code. MH 12-15-06
418 oOilTaxFields("Cost") = 0
419 oOilTaxFields("Taxable") = 0
420 oOilTaxFields("GLCodeID") = 35
421 oOilTaxFields("OffsetDays") = 0
422 oOilTaxFields("Sequence") = 0
423 oOilTaxFields("ServiceCode") = "OIL TAX"
424 oOilTaxFields("GLCode") = "044"
425 ' -- End MH
426 End If
427 End If
428 End If
429 End If
430 End If
431
432 If lMcCall And Not Em(oOilTaxFields("ServiceID")) Then
433 cNumLines = CDbl(Coalesce(Request("Lines" & nI),"0")) + 1 ' Need to increment the line counter so another line will be added for the "OIL TAX" line
434 Else
435 cNumLines = CDbl(Coalesce(Request("Lines" & nI),"0"))
436 End If
437 ' End 12/01/2005 JLF
438
439 For nLineCount = 1 To cNumLines
440 ' 12/01/2005 by JLF to support above mod for oil tax auto-insert.
441 If lMcCall And nLineCount = 2 And Not Em(oOilTaxFields("ServiceID")) Then
442 cID = oOilTaxFields("ServiceID")
443 Else
444 cID = Request(nLineCount & "ServiceID" & nI)
445 End If
446 ' End 12/01/2005 JLF
447
448 cOrderLineMeasurementID = Request(nLineCount & "PriceByMeasurementLineMeasurementID" & nI)
449 cOrderLineMeasurementDelete = Request(nLineCount & "PriceByMeasurementDelete" & nI)
450
451 If Request(nLineCount & "DeleteLine" & nI) = "1" Or Em(cID) Then
452 If Request(nLineCount & "OrderLineID" & nI) <> "0" And Not Em(Request(nLineCount & "OrderLineID" & nI)) Then
453 cOK = objOrderLine.Delete(oGlobals("Database"), Request(nLineCount & "OrderLineID" & nI))
454 Call CheckError(cOK & " - delete line")
455 End If
456
457 If cOrderLineMeasurementID <> "0" And Not Em(cOrderLineMeasurementID) Then
458 cOK = objOrderLineMeasurement.Delete(oGlobals("Database"), cOrderLineMeasurementID)
459 Call CheckError(cOK & " - DeleteLineMeasurement")
460 End If
461 Else
462 ' 12/01/2005 by JLF to support above mod for oil tax auto-insert.
463 If lMcCall And nLineCount = 2 And Not Em(oOilTaxFields("ServiceID")) Then
464 oLineFields("ServiceID") = cID
465 oLineFields("Description") = oOilTaxFields("Description")
466 oLineFields("Quantity") = oOilTaxFields("Quantity")
467 oLineFields("UnitPrice") = oOilTaxFields("UnitPrice")
468 oLineFields("Cost") = oOilTaxFields("Cost")
469 oLineFields("Taxable") = oOilTaxFields("Taxable")
470 oLineFields("GLCodeID") = oOilTaxFields("GLCodeID")
471 cOrderLineID = Request(nLineCount & "OrderLineID" & nI)
472 Else
473 oLineFields("ServiceID") = cID
474
475 If lUseDetailedDescription Then
476 oLineFields("Description") = Request(nLineCount & "HiddenDescription" & nI)
477 Else
478 oLineFields("Description") = Request(nLineCount & "Description" & nI)
479 End If
480
481 oLineFields("DetailedDescription") = Request(nLineCount & "HiddenDetailedDescription" & nI)
482
483 oLineFields("Quantity") = Request(nLineCount & "Quantity" & nI)
484 oLineFields("UnitPrice") = Request(nLineCount & "UnitPrice" & nI)
485
486 If lUseProductionValue Then
487 oLineFields("ProductionValue") = Request(nLineCount & "ProductionValue" & nI)
488 ElseIf lNJLawn Then
489 'Mod 23A stipulates specific order types this can be used with. -dpr 2011-06-20 FB 8755
490 If oFields("OrderType") = "SO" Or oFields("OrderType") = "PR" Then
491 oLineFields("ProductionValue") = Coalesce(Request(nLineCount & "ProductionValue" & nI), 0)
492 Else
493 oLineFields("ProductionValue") = 0
494 End If
495 Else
496 oLineFields("ProductionValue") = Request(nLineCount & "UnitPrice" & nI)
497 End If
498
499 oLineFields("Cost") = Request(nLineCount & "Cost" & nI)
500 oLineFields("Taxable") = Request(nLineCount & "Taxable" & nI)
501 oLineFields("GLCodeID") = Request(nLineCount & "GLCodeID" & nI)
502 cOrderLineID = Request(nLineCount & "OrderLineID" & nI)
503 End If
504 ' End 12/01/2005 JLF
505
506 ' Save line measurements - cdk 5/15/07
507 Set oMeasurements = Server.CreateObject("Scripting.Dictionary")
508 oMeasurements("LineID") = cSetupLineID
509 oMeasurements("ServiceID") = Request(nLineCount & "ServiceID" & nI)
510 oMeasurements("MeasurementTypeID") = Request(nLineCount & "PriceByMeasurementTypeID" & nI)
511 oMeasurements("Measurement") = Request(nLineCount & "PriceByMeasurementQuantity" & nI)
512 oMeasurements("MeasurementLocation") = Request(nLineCount & "PriceByMeasurementLocation" & nI)
513 oMeasurements("Comment") = Request(nLineCount & "PriceByMeasurementComment" & nI)
514 oMeasurements("PrintDetail") = Request(nLineCount & "PriceByMeasurementPrintDetail" & nI)
515 oMeasurements("PriceDate") = Request(nLineCount & "PriceByMeasurementPriceDate" & nI)
516 oMeasurements("BasePrice") = Request(nLineCount & "PriceByMeasurementBasePrice" & nI)
517 oMeasurements("UnitPrice") = Request(nLineCount & "PriceByMeasurementUnitPrice" & nI)
518 oMeasurements("MinPrice") = Request(nLineCount & "PriceByMeasurementMinPrice" & nI)
519 oMeasurements("Override") = Request(nLineCount & "PriceByMeasurementOverride" & nI)
520 oMeasurements("PriceAdjustor") = Request(nLineCount & "PriceByMeasurementPriceAdjustor" & nI)
521 oMeasurements("PriceAdjustorReasonID") = Request(nLineCount & "PriceByMeasurementPriceAdjustorReasonID" & nI)
522 oMeasurements("CustomerDiscountDollars") = Request(nLineCount & "PriceByMeasurementCustomerDiscountDollars" & nI)
523 oMeasurements("CustomerDiscountPercent") = Request(nLineCount & "PriceByMeasurementCustomerDiscountPercent" & nI)
524 oMeasurements("DiscountExpirationDate") = Request(nLineCount & "PriceByMeasurementDiscountExpirationDate" & nI)
525
526 If Coalesce(cOrderLineID, "0") = "0" Then
527 cOrderLineID = objOrderLine.Insert(oGlobals("Database"), cOrderID, oGlobals("CompanyID"))
528 Call CheckError(cOrderLineID & " - insert line")
529 End If
530
531 If cOrderLineMeasurementDelete = "0" Then
532 If Not Em(Request(nLineCount & "PriceByMeasurementQuantity" & nI)) Then
533 If Em(cOrderLineMeasurementID) Or cOrderLineMeasurementID = "0" Then
534 cOrderLineMeasurementID = objOrderLineMeasurement.Insert(oGlobals("Database"), cOrderLineID, oGlobals("CompanyID"))
535 Call CheckError(cOrderLineMeasurementID & " - Insert Line Measurement")
536 End If
537 End If
538 Else
539 If Not Em(cOrderLineMeasurementID) And cOrderLineMeasurementID <> "0" Then
540 cOK = objOrderLineMeasurement.Delete(oGlobals("Database"), cOrderLineMeasurementID)
541 Call CheckError(cOK & " - Delete Line Measurement")
542 End If
543 End If
544
545 cOK = objOrderLine.Save(oGlobals("Database"), cOrderLineID, oLineFields, cSaveLog)
546 Call CheckError(cOK & " - Line Save")
547
548 If Not Em(Request(nLineCount & "PriceByMeasurementQuantity" & nI)) And cOrderLineMeasurementDelete = "0" Then
549 cOK = objOrderLineMeasurement.Save(oGlobals("Database"), cOrderLineMeasurementID, oMeasurements)
550 Call CheckError(cOK & " - Line Measurement Save")
551 End If
552 End If
553 Next
554
555 For nChemCount = 1 To CDbl(Coalesce(Request("ChemLines" & nI),"0"))
556 cChemicalID = Request(nChemCount & "ChemicalID" & nI)
557 If Request(nChemCount & "DeleteChemLine" & nI) = "1" Or Em(cChemicalID) Or (Trim(Request(nChemCount & "Qty" & nI)) = "0.0000" And Trim(Request(nChemCount & "UndilutedQty" & nI)) = "0.0000" And Not oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostZeroQtyChemical")) Then
558 If Request(nChemCount & "OrderChemLineID" & nI) <> "0" And Not Em(Request(nChemCount & "OrderChemLineID" & nI)) Then
559 cOK = objOrderChemical.Delete(oGlobals("Database"), Request(nChemCount & "OrderChemLineID" & nI))
560 Call CheckError(cOK & " - delete chemical line")
561 End If
562 Else
563 oChemFields("ChemicalID") = cChemicalID
564 oChemFields("UnitOfMeasureID") = Request(nChemCount & "UnitOfMeasureID" & nI)
565 oChemFields("MethodID") = Request(nChemCount & "MethodID" & nI)
566 oChemFields("LotNumber") = Request(nChemCount & "LotNumber" & nI)
567 oChemFields("Qty") = Request(nChemCount & "Qty" & nI)
568 If Request(nChemCount & "DilutionInputMethod" & nI) = "T" Then
569 oChemFields("DilutionFactor") = Request(nChemCount & "DilutionFactor1_" & nI)
570 Else
571 oChemFields("DilutionFactor") = Request(nChemCount & "DilutionFactor2_" & nI)
572 End If
573 oChemFields("UndilutedQty") = Request(nChemCount & "UndilutedQty" & nI)
574 oChemFields("UndilutedUOMID") = Request(nChemCount & "UndilutedUOMID" & nI)
575 oChemFields("Comment") = Request(nChemCount & "ChemicalComment" & nI)
576 oChemFields("ApplicationEquipmentID") = Request(nChemCount & "ApplicationEquipmentID" & nI)
577 oChemFields("ApplicationRateID") = Request(nChemCount & "ApplicationRateID" & nI)
578 oChemFields("BASquareFootage") = Request(nChemCount & "BASquareFootage" & nI)
579 oChemFields("STCubicFootage") = Request(nChemCount & "STCubicFootage" & nI)
580 oChemFields("LinearFootage") = Request(nChemCount & "LinearFootage" & nI)
581 oChemFields("WindDirection") = Request(nChemCount & "WindDirection" & nI)
582 oChemFields("WindVelocity") = Request(nChemCount & "WindVelocity" & nI)
583 oChemFields("AirTemperature") = Request(nChemCount & "AirTemperature" & nI)
584 oChemFields("SkyConditions") = Request(nChemCount & "SkyConditions" & nI)
585 cOrderChemLineID = Request(nChemCount & "OrderChemLineID" & nI)
586
587 oChemFields("OregonSpecificSite") = Request(nChemCount & "OregonSpecificSite" & nI)
588 oChemFields("OregonPurpose") = Request(nChemCount & "OregonPurpose" & nI)
589 oChemFields("UserID") = oGlobals("UserID")
590
591
592 If cOrderChemLineID = "0" Then
593 cOrderChemLineID = objOrderChemical.Insert(oGlobals("Database"), cOrderID, oGlobals("CompanyID"), cChemicalID)
594 Call CheckError(cOrderChemLineID & " - insert line")
595 End If
596
597 cOK = objOrderChemical.Save(oGlobals("Database"), cOrderChemLineID, oChemFields, cSaveLog)
598 Call CheckError(cOK & " - chem line Save")
599
600 'Update ChemAreas
601 Set objPocket = Server.CreateObject("PestPacPocket.Order")
602 cOK = objPocket.ChemicalAreasDelete(oGlobals("Database"), cOrderChemLineID)
603 Call CheckError(cOK)
604
605 cIDs = Request(nChemCount & "ChemAreaIDs" & nI)
606 aIDs = Split(cIDs, ",")
607 nJ = 0
608
609 Do While nJ <= (UBound(aIDs))
610 If Not Em(aIDs(nJ)) Then
611 cOK = objPocket.ChemicalAreaInsert(oGlobals("Database"), cOrderChemLineID, CStr(aIDs(nJ)))
612 Call CheckError(cOK)
613 End If
614 nJ = nJ + 1
615 Loop
616
617 'Update ChemTargets
618 'Put this back to save targets on new chemicals. -dpr 09/20/07
619 Set objPocket = Server.CreateObject("PestPacPocket.Order")
620 cOK = objPocket.ChemicalTargetsDelete(oGlobals("Database"), cOrderChemLineID)
621 Call CheckError(cOK)
622
623 cIDs = Request(nChemCount & "ChemTargetIDs" & nI)
624 aIDs = Split(cIDs, ",")
625 nJ = 0
626 Do While nJ <= (UBound(aIDs))
627 If Not Em(aIDs(nJ)) Then
628 cOK = objPocket.ChemicalTargetInsert(oGlobals("Database"), cOrderChemLineID, CStr(aIDs(nJ)))
629 Call CheckError(cOK)
630 End If
631 nJ = nJ + 1
632 Loop
633 End If
634 Next
635
636 cSetupID = Request("SetupID" & nI)
637 lInitial = (Request("IsInitial" & nI) = "1")
638
639 ' Save special attributes for swingle
640 If lSwingle Then
641 Set objOrderAttributes = Server.CreateObject("PestPacService.OrderAttributes")
642 Set oAttributes = Server.CreateObject("Scripting.Dictionary")
643
644 ' Delete Old Posting Attributes
645 aOldAssignmentIDs = Split(Request("ServiceOrderExistingAssignmentIDs" & nI), "|")
646 For nM = 0 To UBound(aOldAssignmentIDs)
647 If Not Em(aOldAssignmentIDs(nM)) Then
648 cOK = objOrderAttributes.Delete(oGlobals("Database"), aOldAssignmentIDs(nM))
649 Call CheckError(cOK)
650 End If
651 Next
652
653 For nJ = 1 To 6
654 If Not Em(Request("ServiceOrderAttribute" & nI & "_" & nJ)) Then
655 cAssignmentID = objOrderAttributes.Insert(oGlobals("Database"), cOrderID)
656 Call CheckError(cAssignmentID)
657
658 oFields("AttributeID") = Request("ServiceOrderAttributeID" & nI & "_" & nJ)
659 oFields("Description") = Request("ServiceOrderAttribute" & nI & "_" & nJ)
660 oFields("Answer") = ""
661
662 cOK = objOrderAttributes.Save(oGlobals("Database"), cAssignmentID, oFields)
663 Call CheckError(cOK)
664 End If
665 Next
666 End If
667
668 Set oFields = Nothing
669 Set oLineFields = Nothing
670 Set oChemFields = Nothing
671 End If
672
673 ' If Unprint is selected blank out the WorkDate and TechID1 fields in the Service Order
674 If lSwingle And Request("Unprint" & nI) = "1" Then
675 cOrderID = Request("OrderID" & nI)
676 Set objCustomOrder = Server.CreateObject("PestPacCustom.Order")
677 cOK = objCustomOrder.SwingleServiceOrderUnprint(oGlobals("Database"), cOrderID)
678 Call CheckError(cOK)
679 Set objCustomOrder = Nothing
680 End If
681
682 ' create clone order - for bugout mod 42 - kb 10/22/08
683 lCreateClone = 0
684 If lBugOut Then
685 lCreateClone = Request("CreateClone" & nI)
686 End If
687
688 If lCreateClone Then
689 ' change date to 2nd Sunday of following month
690 cCloneOrderDate = Request("OrderDate" & nI)
691 cCloneWorkDate = Request("WorkDate" & nI)
692
693 cCloneOrderDate = DateAdd("m", 1, cCloneOrderDate)
694 cCloneWorkDate = DateAdd("m", 1, cCloneWorkDate)
695
696 cCloneOrderDate = GetDateByWeekAndDay(cCloneOrderDate, 2, 1)
697 cCloneWorkDate = GetDateByWeekAndDay(cCloneWorkDate, 2, 1)
698
699 Set objCloneOrder = Server.CreateObject("PestPacCustom.Order")
700 Set oCloneOrder = objCloneOrder.ServiceOrderDuplicate(oGlobals("Database"), cOrderID, oGlobals("UserID"), cCloneOrderDate, cCloneWorkDate)
701 Call CheckDictError(oCloneOrder)
702 End If
703 ' end clone order
704 Next
705
706 Set objOrder = Nothing
707 Set objOrderLine = Nothing
708 Set objOrderChemical = Nothing
709 Set objOrderTarget = Nothing
710 End If
711
712 If cMode = "Done" Then
713 Response.Redirect "default.asp"
714 ElseIf cMode = "Post" Then
715 Response.Redirect "close.asp?BatchID=" & cBatchID
716 End If
717
718 Case "UnPost":
719 If Not Em(cBatchID) Then
720 'don't release from batch if it was created on a handheld -dbb 1/27/06
721 Set objInvBatch = Server.CreateObject("PestPacService.InvoiceBatch")
722 Set oBatchInfo = objInvBatch.LoadRecordset(oGlobals("Database"),oGlobals("CompanyID"),cBatchID)
723 Set objInvBatch = Nothing
724 Call CheckRSError(oBatchInfo)
725
726 If oBatchInfo("Pocket_TechUserID") = 0 And Em(oBatchInfo("Pocket_WorkDate")) Then
727 'end dbb 1/27/06
728 Set objOrder = Server.CreateObject("PestPacService.Order")
729 Set oOrderBatch = objOrder.LoadBatchRecordset(oGlobals("Database"),oGlobals("CompanyID"),cBatchID)
730 Call CheckRSError(oOrderBatch)
731
732 Set oFields = Server.CreateObject("Scripting.Dictionary")
733 oFields("Posted") = 0
734 oFields("Custom") = cCustom
735
736 Do Until oOrderBatch.EOF
737 cOK = objOrder.SavePostingData(oGlobals("Database"), oOrderBatch("OrderID"), oGlobals("UserID"), oGlobals("Date"), oFields)
738 Call CheckError(cOK & " - save posting data")
739
740 If oOrderBatch.AbsolutePosition Mod 50 = 0 Then Response.Flush
741 oOrderBatch.MoveNext
742 Loop
743 End If
744
745 Set oBatchInfo = Nothing
746 Set objOrder = Nothing
747 End If
748
749 Response.Redirect "/location/"
750
751End Select
752
753If lPostBatchInv Then
754 cActionMode = "Done"
755Else
756 cActionMode = "Post"
757End If
758
759lShowCost = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowCost")
760lEndTime = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("EndTime")
761lShowWorkDate = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowWorkDate")
762lShowPayment = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowPayment")
763lShowGL = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowGL")
764lShowChemical = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowChemical")
765lUseAreaServiced = (oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("AreaServiced") = "Y")
766lEditInvDate = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("EditInvoiceDate")
767cDefaultInvDate = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DefaultInvoiceDate")
768cDefaultPayment = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DefaultPaidAmount")
769If Not lShowPayment Then
770 cDefaultPayment = "Z"
771End If
772cDefaultWorkTime = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DefaultWorkTime")
773lRequirePostTime = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("RequirePostTime")
774lShowComment = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowComment")
775lLockGL = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LockGL")
776lPaymentDiscount = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PaymentDiscount")
777
778If lSwingle Then
779 lUserDefService = False
780Else
781 lUserDefService = (oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDefService") = "Y")
782End If
783
784If Not oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("OrderShowMore") And _
785 CDbl(oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("OrderShowLines")) = 1 Then
786 lSingleLine = True
787Else
788 lSingleLine = False
789End If
790
791cDefaultPostingDate = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DefaultPostingDate")
792lShowRenewal = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PostRenewalAdvance")
793lOrderShowMore = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("OrderShowMore")
794nOrderShowLines = CDbl(oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("OrderShowLines"))
795
796If lCentex Then
797 lOrderShowMore = True
798End If
799
800lShowService = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowService")
801lShowTarget = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowTarget") And Not lSwingle
802
803' find orders to post'
804cDoneStart = CDbl(Coalesce(Request("Start"), "1"))
805
806cStart = CDbl(Coalesce(Request("Start"), "1")) - nChanged
807cCount = oGlobals("PostPaging")
808'cEnd = (cStart+cCount)-1
809
810'save search criteria in hidden fields'
811
812Set oFields = Server.CreateObject("Scripting.Dictionary")
813oFields("Mode") = Trim(Request.Form("Mode"))
814oFields("Start") = Trim(Request.Form("Start"))
815oFields("Posted") = Trim(Request.Form("Posted"))
816
817' Fixed so normal posting functionality works for Humphreys. AT 10/11/2012 FB 12693
818If lHumphreys And cReview = "Y" Then
819 oFields("InvoiceBatchID") = Coalesce(Trim(Request.Form("InvoiceBatchID")), cBatchID)
820Else
821 oFields("InvoiceBatchID") = Trim(Request.Form("InvoiceBatchID"))
822End If
823
824oFields("OrderNum") = Trim(Request.Form("OrderNum"))
825If cMode <> "cawdoloc" Then
826 oFields("LocationCode") = Trim(Request.Form("LocationCode"))
827Else
828 oFields("LocationCode") = Trim(Request("LocationCode"))
829End If
830oFields("BillToCode") = Trim(Request.Form("BillToCode"))
831oFields("TechCode") = Trim(Request.Form("TechCode"))
832oFields("Route") = Trim(Request.Form("Route"))
833oFields("Company") = Trim(Request.Form("Company"))
834oFields("LName") = Trim(Request.Form("LName"))
835oFields("City") = Trim(Request.Form("City"))
836oFields("BWorkDate") = Trim(Request.Form("BWorkDate"))
837oFields("EWorkDate") = Trim(Request.Form("EWorkDate"))
838oFields("Unscheduled") = Trim(Request.Form("Unscheduled"))
839oFields("Recurring") = Trim(Request.Form("Recurring"))
840oFields("Complete") = Trim(Request.Form("Complete"))
841oFields("Sort") = Coalesce(Trim(Request.Form("Sort")),oGlobals("SOSearchField"))
842oFields("Sort2") = Trim(Request.Form("Sort2"))
843oFields("OrderNumList") = Trim(Request.Form("OrderNumList"))
844oFields("BranchID") = Trim(Request.Form("BranchID"))
845oFields("SearchMode") = "P"
846oFields("Custom") = cCustom
847
848' Modified so already-posted orders still show in the batch even if customer is on hold -jek 09/30/03
849'Commented the five lines below so that excluding bill-tos on hold or collection is controlled
850'by the company setup options instead of these settings - dm 7/25/07
851'If oFields("Posted") = "1" Then
852 oFields("ExcludeCreditHold") = "0"
853 oFields("ExcludeCollection") = "0"
854'Else
855' oFields("ExcludeCreditHold") = "1"
856' oFields("ExcludeCollection") = "1"
857'End If
858
859'Custom Selection Criteria For Assured 120147
860oFields("ChargeType") = Trim(Request.Form("ChargeType"))
861oFields("BelongsTo") = Trim(Request.Form("BelongsTo"))
862
863cPreFillTech = Trim(Request.Form("PreFillTech"))
864cPreFillTechID = Trim(Request.Form("PreFillTechID"))
865cPreFillWorkDate = Trim(Request.Form("PreFillWorkDate"))
866cPreFillOrderType = Trim(Request.Form("PreFillOrderType")) 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
867nPreFillChemLines = CDbl(Coalesce(Request.Form("PreFillChemLines"), "0"))
868
869'get dictionary of prefill chemicals
870Set oPreFillChemLines = Server.CreateObject("Scripting.Dictionary")
871For nCount = 1 To nPreFillChemLines
872 cChemicalID = Request("ChemicalID" & nCount)
873
874 If Request.Form("DeleteChemLine" & nCount) <> "1" And Not Em(cChemicalID) Then
875 Set oPreFillChem = Server.CreateObject("Scripting.Dictionary")
876 oPreFillChem("PreFill") = "1"
877 oPreFillChem("ChemLineID") = "0"
878 oPreFillChem("ChemicalCode") = Request.Form("ChemicalCode" & nCount)
879 oPreFillChem("ChemicalID") = cChemicalID
880 oPreFillChem("ChemGroupID") = Request.Form("ChemGroupID" & nCount)
881
882 If Request.Form("DilutionInputMethod" & nCount) = "T" Then
883 oPreFillChem("SODilutionFactor")= Coalesce(Request.Form("DilutionFactor1_" & nCount), 0)
884 Else
885 oPreFillChem("SODilutionFactor")= Coalesce(Request.Form("DilutionFactor2_" & nCount), 0)
886 End If
887
888 'Added these so the dilution factors carry over to next page - DL 01-10-12 FB 10539
889 oPreFillChem("DilutionFactor1_")= Request.Form("DilutionFactor1_" & nCount)
890 oPreFillChem("DilutionFactor2_")= Request.Form("DilutionFactor2_" & nCount)
891 oPreFillChem("LotNumber") = Request.Form("LotNumber" & nCount)
892 oPreFillChem("Quantity") = Request.Form("Quantity" & nCount)
893 oPreFillChem("UnitOfMeasure") = Request.Form("UnitOfMeasure" & nCount)
894 oPreFillChem("UnitOfMeasureID") = Request.Form("UnitOfMeasureID" & nCount)
895 oPreFillChem("UndilutedQty") = Request.Form("UndilutedQty" & nCount)
896 oPreFillChem("UndilutedUOM") = Request.Form("UndilutedUOM" & nCount)
897 oPreFillChem("UndilutedUOMID") = Request.Form("UndilutedUOMID" & nCount)
898 oPreFillChem("MethodOfAppl") = Request.Form("MethodOfAppl" & nCount)
899 oPreFillChem("MethodID") = Request.Form("MethodID" & nCount)
900 oPreFillChem("DilutionCalcType") = Request.Form("DilutionCalcType" & nCount)
901 oPreFillChem("AcceptableDilutionFactors") = Request.Form("AcceptableDilutionFactors" & nCount)
902 oPreFillChem("StandardQuantity") = Coalesce(Request.Form("StandardQuantity" & nCount), 0)
903 oPreFillChem("StandardUOM") = Request.Form("StandardUOM" & nCount)
904
905 oPreFillChem("ApplicationEquipmentCode") = Request.Form("ApplicationEquipmentCode" & nCount)
906 oPreFillChem("ApplicationEquipmentID") = Request.Form("ApplicationEquipmentID" & nCount)
907 oPreFillChem("ApplicationRateCode") = Request.Form("ApplicationRateCode" & nCount)
908 oPreFillChem("ApplicationRateID") = Request.Form("ApplicationRateID" & nCount)
909 oPreFillChem("BASquareFootage") = Request.Form("BASquareFootage" & nCount)
910 oPreFillChem("STCubicFootage") = Request.Form("STCubicFootage" & nCount)
911 oPreFillChem("LinearFootage") = Request.Form("LinearFootage" & nCount)
912 oPreFillChem("WindDirection") = Request.Form("WindDirection" & nCount)
913 oPreFillChem("WindVelocity") = Request.Form("WindVelocity" & nCount)
914 oPreFillChem("AirTemperature") = Request.Form("AirTemperature" & nCount)
915 oPreFillChem("SkyConditions") = Request.Form("SkyConditions" & nCount)
916
917 oPreFillChemLines.Add nCount, oPreFillChem
918 Set oPreFillChem = Nothing
919 End If
920Next
921
922If Not Em(Request("OrderID")) Then
923 oFields("OrderID") = Request("OrderID")
924End If
925
926If Not Em(Request("RunScheduleIDs")) Then
927 oFields("RunScheduleIDs") = Request("RunScheduleIDs")
928 oFields("Posted") = Request("Posted")
929End If
930
931Set objOrder = Server.CreateObject("PestPacService.Order")
932Set oOrder = objOrder.Search(oGlobals("Database"), oGlobals("CompanyID"), oGlobals("UserID"), cStart, cCount, oFields)
933Set objOrder = Nothing
934Call CheckDictError(oOrder)
935
936Set objSysDefaults = Server.CreateObject("PestPac.SysDefaults")
937Set oSysDefaults = objSysDefaults.Load(oGlobals("Database"), oGlobals("CompanyID"))
938Set objSysDefaults = Nothing
939Call CheckDictError(oSysDefaults)
940
941Set oOrderTemp = oOrder("Data")
942
943Set oOrders = oOrderTemp
944
945' Assured mod 252
946If IsCustom("ASSURED") Then
947 nAssuredDollarAmount = CDbl(Coalesce(Request.Form("AssuredDollarAmount"), "-1"))
948
949 If nAssuredDollarAmount > -1 Then
950 For Each oAssuredRow In oOrders
951 Set oAssuredOrder = oOrders.Item(oAssuredRow)
952 nAssuredOrderAmount = CDbl(oAssuredOrder("SubTotal"))
953
954 If nAssuredOrderAmount <> nAssuredDollarAmount Then
955 oOrders.Remove(oAssuredRow)
956 End If
957
958 Set oAssuredOrder = Nothing
959 Next
960 End If
961End If
962
963
964cHits = oOrder("Hits") 'How many records the search found
965cEnd = cStart + (oOrders.Count - 1) 'The index of the last record on this page
966
967'--Added to determine user for Clark - MC 07/25/05
968Set objUser = Server.CreateObject("PestPac.User")
969Set oUser = objUser.LoadRecordset(oGlobals("Database"), oGlobals("UserID"))
970Set objUser = Nothing
971Call CheckRSError(oUser)
972
973cTemplateID = oUser("TemplateID")
974
975Set objAccess = Server.CreateObject("PestPacLookup.Access")
976Set oAccess = objAccess.Load(oGlobals("Database"), cTemplateID)
977
978cTemplateName = oAccess("Name")
979'--End Add
980
981nChemIndexIncrement = 22
982
983'service UDF index array
984Dim aServiceUserDefKeys(11)
985nArrIndex = 0
986
987For nI = 14 To 23
988 aServiceUserDefKeys(nArrIndex) = nI
989 nArrIndex = nArrIndex + 1
990Next
991For nI = 56 To 57
992 aServiceUserDefKeys(nArrIndex) = nI
993 nArrIndex = nArrIndex + 1
994Next
995%>
996<html>
997<head>
998<title><%=oGlobals("Title")%> - Post Service Orders</title>
999<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
1000<link rel="stylesheet" type="text/css" href="/styles/style_ie.css">
1001<style type="text/css">
1002 .L {border-left:1px silver solid;}
1003 .R {border-right:1px silver solid;}
1004 .T {border-top:1px silver solid;}
1005 .B {border-bottom:1px silver solid;}
1006 .RequiredFieldStyle {color: red;}
1007</style>
1008
1009<!--XML needed for the look-up tables-->
1010<xml id="Data">
1011<params>
1012<database></database>
1013<companyid><%=oGlobals("CompanyID")%></companyid>
1014<billtoid></billtoid>
1015<reference></reference>
1016</params>
1017</xml>
1018
1019<xml id="DefaultAttribute">
1020<params>
1021<database></database>
1022<companyid><%=oGlobals("CompanyID")%></companyid>
1023<orderid></orderid>
1024<servicecode></servicecode>
1025<mode></mode>
1026</params>
1027</xml>
1028
1029<xml id="GetChemicalUsageConversion">
1030<params>
1031<database></database>
1032<companyid><%=oGlobals("CompanyID")%></companyid>
1033<chemicalid></chemicalid>
1034<chemicalcode></chemicalcode>
1035<process></process>
1036<dilutedquantity></dilutedquantity>
1037<diluteduomid></diluteduomid>
1038<dilutionrate></dilutionrate>
1039<rawquantity></rawquantity>
1040<rawuomid></rawuomid>
1041</params>
1042</xml>
1043
1044<xml id="ChemicalData">
1045<params>
1046<serviceid></serviceid>
1047<database></database>
1048</params>
1049</xml>
1050
1051<xml id="Taxable">
1052<params>
1053<database></database>
1054<locationstate></locationstate>
1055<serviceid></serviceid>
1056</params>
1057</xml>
1058
1059<%
1060If lSMS Or lABR130785 Then
1061 %>
1062 <xml id="SMSUserDef14Data">
1063 <params>
1064 <database></database>
1065 <companyid><%=oGlobals("CompanyID")%></companyid>
1066 <userdef14string></userdef14string>
1067 <excludesostring></excludesostring>
1068 </params>
1069 </xml>
1070
1071 <xml id="SMSCheckInvoiceExists">
1072 <params>
1073 <database></database>
1074 <companyid><%=oGlobals("CompanyID")%></companyid>
1075 <locationid></locationid>
1076 <workdate></workdate>
1077 <serviceid></serviceid>
1078 <batchid><%=cBatchID%></batchid>
1079 </params>
1080 </xml>
1081 <%
1082End If
1083%>
1084<xml id="EcoSureExportScript1">
1085 <params>
1086 <database></database>
1087 <companyid></companyid>
1088 <salesid></salesid>
1089 <repid></repid>
1090 <officeid></officeid>
1091 <saleprice></saleprice>
1092 <creditcard></creditcard>
1093 <salesdate></salesdate>
1094 </params>
1095</xml>
1096
1097<xml id="EcoSureExportScript2">
1098 <params>
1099 <database></database>
1100 <companyid></companyid>
1101 <salesid></salesid>
1102 <repid></repid>
1103 <officeid></officeid> <!--branchid of ... -->
1104 <saleprice></saleprice>
1105 <creditcard></creditcard>
1106 <salesdate></salesdate>
1107 </params>
1108</xml>
1109<%
1110
1111If lLinkTargetToService And lUseMultipleTargets Then
1112 %>
1113 <xml id="LinkTargetToService">
1114 <params>
1115 <orderid></orderid>
1116 <serviceid></serviceid>
1117 </params>
1118 </xml>
1119 <%
1120End If
1121
1122 'FB 14897 Check required targets
1123If lAnderson Then
1124%>
1125 <xml id="RequiredTargetToService">
1126 <params>
1127 <serviceid></serviceid>
1128 </params>
1129 </xml>
1130<%
1131End If
1132%>
1133
1134<xml id="Lookups">
1135<lookups>
1136<%
1137Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ApplicationEquipment")
1138Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ApplicationRate")
1139
1140'only include technicians for branches included in the set of orders
1141cBranches = "|"
1142cTechBranchXML = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("TechnicianBranch")
1143For Each oRow in oOrders
1144 Set oData = oOrders.Item(oRow)
1145 cBranchID = CStr(oData("BranchID"))
1146
1147 If InStr(cBranches, "|" & cBranchID & "|") = 0 And InStr(cTechBranchXML, "<techbranches" & cBranchID & ">") > 0 Then
1148 cBranches = cBranches & cBranchID & "|"
1149
1150 nStart = InStr(cTechBranchXML, "<techbranches" & cBranchID & ">")
1151 nEnd = InStr(cTechBranchXML, "</techbranches" & cBranchID & ">")
1152 nEnd = nEnd + Len("</techbranches" & cBranchID & ">")
1153 If nStart > 0 Then
1154 Response.Write Mid(cTechBranchXML, nStart, nEnd-nStart)
1155 Else
1156 Response.Write "<techbranches" & cBranchID & "></techbranches" & cBranchID & ">"
1157 End If
1158 End If
1159Next
1160
1161If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("ShowPayment") Then
1162 Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("Method")
1163End If
1164
1165If lShowService Then
1166 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PriceServiceByBranch") Then
1167 'Only include services for branches included in the set of orders -dbb 3/9/06
1168 'Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ServiceBranch")
1169 cBranches = "|"
1170 cServiceBranchXML = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ServiceBranch")
1171 nCountOrder = 0
1172 For Each oRow in oOrders
1173 Set oData = oOrders.Item(oRow)
1174 cBranchID = CStr(oData("BranchID"))
1175
1176 If InStr(cBranches, "|" & cBranchID & "|") = 0 And InStr(cServiceBranchXML, "<servicebranches" & cBranchID & ">") > 0 Then
1177 cBranches = cBranches & cBranchID & "|"
1178
1179 nStart = InStr(cServiceBranchXML, "<servicebranches" & cBranchID & ">")
1180 nEnd = InStr(cServiceBranchXML, "</servicebranches" & cBranchID & ">")
1181 nEnd = nEnd + Len("</servicebranches" & cBranchID & ">")
1182 If nStart > 0 Then
1183 Response.Write Mid(cServiceBranchXML, nStart, nEnd-nStart)
1184 Else
1185 Response.Write "<servicebranches" & cBranchID & "></servicebranches" & cBranchID & ">"
1186 End If
1187 End If
1188 If nCountOrder = 25 Then
1189 Response.Flush
1190 nCountOrder = 0
1191 End if
1192 nCountOrder = nCountOrder + 1
1193 Next
1194 ' -dbb 3/9/06
1195
1196 If lSwingle Then
1197 cBranches = "|"
1198 cServiceBranchXML = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ServiceBranchAllSwingle")
1199 For Each oRow in oOrders
1200 Set oData = oOrders.Item(oRow)
1201 cBranchID = CStr(oData("BranchID"))
1202
1203 If InStr(cBranches, "|" & cBranchID & "|") = 0 And InStr(cServiceBranchXML, "<servicebranchesallswingle" & cBranchID & ">") > 0 Then
1204 cBranches = cBranches & cBranchID & "|"
1205
1206 nStart = InStr(cServiceBranchXML, "<servicebranchesallswingle" & cBranchID & ">")
1207 nEnd = InStr(cServiceBranchXML, "</servicebranchesallswingle" & cBranchID & ">")
1208 nEnd = nEnd + Len("</servicebranchesallswingle" & cBranchID & ">")
1209 If nStart > 0 Then
1210 Response.Write Mid(cServiceBranchXML, nStart, nEnd-nStart)
1211 Else
1212 Response.Write "<servicebranchesallswingle" & cBranchID & "></servicebranchesallswingle" & cBranchID & ">"
1213 End If
1214 End If
1215 Next
1216 End If
1217 Else
1218 Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("Service")
1219 If lSwingle Then
1220 Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ServiceAllSwingle")
1221 End If
1222 End If
1223End If
1224
1225If lUseChemicals Then
1226 %>
1227 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("TargetPest")%>
1228 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("Chemical")%>
1229 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("UnitOfMeasure")%>
1230 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("MethodOfApplication")%>
1231 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("DilutionFactors")%>
1232 <%
1233 If lUseRequired Then
1234 Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("ChemicalGroup")
1235 End If
1236End If
1237%>
1238<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("GLCode")%>
1239<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("Comment")%>
1240<%
1241If lUserDefService Then
1242 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDefByBranch") Then
1243 'only include branches which are included in the set of orders and fields which are displayed -dbb 7/25/05
1244 cBranches = "|"
1245 cUserDefXML = ""
1246 cUserDefBranchesXML = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("UserDefChoiceBranch")
1247
1248 For Each oRow in oOrders
1249 Set oData = oOrders.Item(oRow)
1250 cBranchID = CStr(oData("BranchID"))
1251 nBranchStart = Instr(cUserDefBranchesXML, "<userdefchoicebranches" & cBranchID & ">")
1252 cUserDefXML = cUserDefXML & "<userdefchoicebranches" & cBranchID & ">"
1253
1254 If InStr(cBranches, "|" & cBranchID & "|") = 0 And nBranchStart > 0 Then
1255 cBranches = cBranches & cBranchID & "|"
1256 'This was erroring out because the 3rd argument was larger than the string. Please see me if this is messing things up - DL 09-14-13 FB 16236
1257 'cUserDefBranchXML = Mid(cUserDefBranchesXML, nBranchStart, InStr(cUserDefBranchesXML, "</userdefchoicebranches" & cBranchID & ">"))
1258 cUserDefBranchXML = Mid(cUserDefBranchesXML, nBranchStart, InStr(cUserDefBranchesXML, "</userdefchoicebranches" & cBranchID & ">") - nBranchStart + 24 + Len(cBranchID))
1259
1260
1261 'For nI = 14 To 23
1262 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
1263 nI = aServiceUserDefKeys(nUDFIndex)
1264
1265 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Show") And oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Type") = "S" Then
1266 nStart = InStr(cUserDefBranchXML, "<fieldnum" & nI & ">")
1267 nEnd = InStr(cUserDefBranchXML, "</fieldnum" & nI & ">")
1268 nEnd = nEnd + Len("</fieldnum" & nI & ">")
1269 If nStart > 0 Then
1270 cUserDefXML = cUserDefXML & Mid(cUserDefBranchXML, nStart, nEnd-nStart)
1271 Else
1272 cUserDefXML = cUserDefXML & "<fieldnum" & nI & "></fieldnum" & nI & ">"
1273 End If
1274 End If
1275 Next
1276 End If
1277 cUserDefXML = cUserDefXML & "</userdefchoicebranches" & cBranchID & ">"
1278 Next
1279 Response.Write cUserDefXML
1280 ' -dbb 7/25/05
1281 Else
1282 'For nI = 14 To 23
1283 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
1284 nI = aServiceUserDefKeys(nUDFIndex)
1285
1286 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Show") And oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Type") = "S" Then
1287 Response.Write oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("UserDefChoice" & nI)
1288 End If
1289 Next
1290 End If
1291End If
1292%>
1293<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("Target")%>
1294<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("PriceAdjustmentReason")%>
1295<%
1296If lSwingle Then
1297 Set objAttributes = Server.CreateObject("PestPacLookup.ServiceOrderAttribute")
1298 Set oOrderAttributes = objAttributes.GetAll(oGlobals("Database"), oGlobals("CompanyID"), "")
1299 Set objAttributes = Nothing
1300 Call CheckRSError(oOrderAttributes)
1301
1302 Response.Write "<attributes>"
1303 Do Until oOrderAttributes.EOF
1304 If Len(Trim(oOrderAttributes("Description"))) <= 3 Then
1305 Response.Write "<attribute id='" & oOrderAttributes("AttributeID") & "' description='" & UCase(Trim(oOrderAttributes("Description"))) & "'/>"
1306 End If
1307 If oOrderAttributes.AbsolutePosition Mod 50 = 0 Then Response.Flush
1308 oOrderAttributes.MoveNext
1309 Loop
1310 Response.Write "</attributes>"
1311End If
1312%>
1313<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("OregonSpecificSite")%>
1314<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("OregonPurpose")%>
1315</lookups>
1316</xml>
1317
1318<script language="JScript">var cHelpFile="post-detail"</script>
1319<!-- #INCLUDE VIRTUAL="/includes/hideMenu.inc" -->
1320<script language="JScript" src="/scripts/toolbar.js"></script>
1321<script language="JScript" src="/scripts/links.js"></script>
1322<script language="VBScript" src="/functions.vbs"></script>
1323<script language="VBScript" src="/scripts/xml.vbs"></script>
1324<script language="JScript" src="/scripts/classes.js"></script>
1325<script language="JScript" src="/scripts/xbrowser/jQuery/jquery-1.9.1.min.js"></script>
1326<script language="JScript">
1327 function jqGetVal(cName) {
1328 return $("[name='" + cName + "']").val() || "";
1329 }
1330
1331 function jqSetVal(cName, cVal) {
1332 return $("[name='" + cName + "']").val(cVal);
1333 }
1334</script>
1335<script language="VBScript">
1336nSubmitCount = 0
1337lExecUDCOnBlur = True
1338
1339
1340Sub SetAllToPost(lChecked)
1341 For nI = 1 To <%=oOrders.Count%>
1342 Set oPost = document.all("Post" & nI)
1343 If Not (oPost Is Nothing) Then
1344 oPost.checked = lChecked
1345 End If
1346 Next
1347End Sub
1348
1349Sub butSelAll_OnClick()
1350 Call SetAllToPost(True)
1351End Sub
1352
1353Sub butSelNone_OnClick()
1354 Call SetAllToPost(False)
1355End Sub
1356
1357Function SpansMidnight(nCount)
1358 If document.all("WorkAmPm" & nCount).value = "PM" And document.all("EndAmPm" & nCount).value = "AM" Then
1359 SpansMidnight = True
1360 Exit Function
1361 End If
1362
1363 SpansMidnight = False
1364End Function
1365
1366Function CalcDuration(nCount)
1367 <%
1368 If lSteritech Then
1369 %>
1370 cStartDate = document.all("WorkDate" & nCount).value
1371 cEndDate = document.all("EndDate" & nCount).value
1372 ' added to handle case where they change work date to a later date on screen -jek 1/3/06
1373 If CDate(cStartDate) > CDate(cEndDate) Then
1374 cEndDate = cStartDate
1375 End If
1376 <%
1377 Else
1378 %>
1379 If document.all("WorkAmPm" & nCount).value = "PM" And document.all("EndAmPm" & nCount).value = "AM" Then
1380 cStartDate = FormatDateTime(Date, 2) '"1/1/1900"
1381 cEndDate = FormatDateTime(DateAdd("d",1,Date), 2) '"1/2/1900"
1382 Else
1383 cStartDate = "1/1/1900"
1384 cEndDate = "1/1/1900"
1385 End If
1386 <%
1387 End If
1388 %>
1389
1390 cStartTime = document.all("WorkTime" & nCount).value & " " & document.all("WorkAmPm" & nCount).value
1391 cEndTime = document.all("EndTime" & nCount).value & " " & document.all("EndAmPm" & nCount).value
1392
1393 If Not (IsDate(cStartTime) And IsDate(cEndTime)) Then
1394 CalcDuration = False
1395 Exit Function
1396 End If
1397
1398 nDuration = DateDiff("n", CDate(cStartDate & " " & cStartTime), CDate(cEndDate & " " & cEndTime))
1399
1400 If nDuration >= 0 Then
1401 document.all("Duration" & nCount).value = FormatMinToDur(nDuration)
1402 CalcDuration = True
1403 Else
1404 document.all("Duration" & nCount).value = "00:00"
1405 CalcDuration = False
1406 End If
1407End Function
1408
1409Sub butPostHandler_OnClick()
1410
1411 If nSubmitCount = 1 Then
1412 Exit Sub
1413 End If
1414
1415 <%
1416 If Not ((CDbl(cEnd) = CDbl(cHits)) Or (CDbl(cHits) = 0 And cDoneStart <> 1)) Then
1417 %>
1418 cOK = MsgBox("There are more pages of orders. Are you sure " & vbCrLf & _
1419 "you want to skip them and finish posting now?", vbYesNo)
1420 If cOK = vbYes Then
1421 <%
1422 End If
1423 %>
1424 If Validate() Then
1425 nSubmitCount = 1
1426
1427 Call StopPreserveSession()
1428
1429 frmPost.Mode.value = "<%=cActionMode%>"
1430 frmPost.action = "post.asp"
1431 window.onBeforeUnload = Nothing
1432 frmPost.submit()
1433 End If
1434 <%
1435 If Not ((CDbl(cEnd) = CDbl(cHits)) Or (CDbl(cHits) = 0 And cDoneStart <> 1)) Then
1436 %>
1437 End If
1438 <%
1439 End If
1440 %>
1441End Sub
1442
1443<% If IsCustom("ASSURED") Then %>
1444Sub butMove_OnClick()
1445 cOrderIDs = ""
1446
1447 For zI = 1 To <%=oOrders.Count%>
1448 If document.all("Post" & zI).checked Then
1449 cOrderIDs = cOrderIDs & document.all("OrderID" & zI).value & ","
1450 End If
1451 Next
1452
1453 If Len(cOrderIDs) > 0 Then
1454 cBatchNum = InputBox("Please enter new batch number.")
1455 cBatchNum = Coalesce(cBatchNum, "")
1456 cOrderIDs = Left(cOrderIDs, Len(cOrderIDs) - 1)
1457
1458 If Len(cBatchNum) > 0 Then
1459 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
1460 oXMLHTTP.open "POST", "/xml/AssuredUpdateBatchNum.asp", False
1461 oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
1462 oXMLHTTP.send "OrderIDs=" & cOrderIDs & "&NewBatchNum=" & cBatchNum
1463
1464 If oXMLHTTP.statusText = "OK" Then
1465 Set oResponse = oXMLHTTP.responseXML.documentElement
1466 cStatus = oResponse.selectSingleNode("status").text
1467
1468 If cStatus <> "OK" Then
1469 MsgBox "No open batch with that number exists."
1470 Else
1471 window.onBeforeUnload = Nothing
1472 window.location = "/serviceOrder/post/"
1473 End If
1474 End If
1475
1476 Set oXMLHTTP = Nothing
1477 End If
1478 Else
1479 MsgBox "Please select orders to move."
1480 End If
1481End Sub
1482<% End If %>
1483
1484Sub butCancelHandler_OnClick()
1485 nAns = MsgBox("Do you want to cancel posting?", vbYesNo, "Cancel?")
1486 If nAns = vbYes Then
1487 If nSubmitCount = 1 Then
1488 Exit Sub
1489 End If
1490
1491 nSubmitCount = 1
1492
1493 Call StopPreserveSession()
1494
1495 <%
1496 If lPostBatchInv Then
1497 %>
1498 window.onBeforeUnload = Nothing
1499 window.location = "default.asp"
1500 <%
1501 Else
1502 %>
1503 frmPost.Mode.value = "UnPost"
1504 frmPost.action = "post.asp"
1505 window.onBeforeUnload = Nothing
1506 frmPost.submit()
1507 <%
1508 End If
1509 %>
1510 End If
1511End Sub
1512
1513Sub butNext_OnClick()
1514 If nSubmitCount = 1 Then
1515 Exit Sub
1516 End If
1517
1518 If Validate() Then
1519 nSubmitCount = 1
1520
1521 Call StopPreserveSession()
1522
1523 frmPost.Mode.value = "Next"
1524 <% If lHumphreys And cReview = "Y" Then %>
1525 frmPost.action = "post.asp?cReview=Y"
1526 <% Else %>
1527 frmPost.action = "post.asp"
1528 <% End If %>
1529 frmPost.Start.value = CDbl(frmPost.Start.value) + <%=cCount%>
1530 window.onBeforeUnload = Nothing
1531 frmPost.submit()
1532 End If
1533End Sub
1534
1535' Validates that the checked records have all the fields filled in '
1536Function Validate()
1537 lAnyPosted = False
1538
1539 <%
1540 If lSMS Or lABR130785 Then
1541 %>
1542 cUserDef14String = ""
1543 cExcludeSOString = ""
1544 cUserDef14ThisPage = ""
1545 <%
1546 End If
1547 %>
1548
1549 bWarnedAboutTechSig = false ' 8909
1550 For nI = 1 To <%=oOrders.Count%>
1551 'order type posting validation is done in this loop -dbb 5/21/07
1552 'If document.all("PostAccess" & nI).value = "1" Then
1553 '-
1554 'added lValidDate function to /functions.vbs -aw 10/16/03
1555 If Not (lValidDate(document.all("InvoiceDate" & nI))) Then
1556 Validate = False
1557 Exit Function
1558 End If
1559
1560 If document.all("OrderType" & nI).value = "SO" Then
1561 If CDbl(document.all("NewTotal" & nI).value) < 0.00 Then
1562 alert("Service Orders cannot have a negative total. Use a Credit Memo instead.")
1563 Validate = False
1564 Exit Function
1565 End If
1566 End If
1567
1568 If Not Em(document.all("AuthTransactionID" & nI).value) Then
1569 If CDbl(document.all("AuthAmount" & nI).value) < CDbl(document.all("NewTotal" & nI).value) Then
1570 If MsgBox("The " & FormatCurrency(document.all("AuthAmount" & nI).value, 2) & " that the credit card was authorized for is less than the order total of " & FormatCurrency(document.all("NewTotal" & nI).value,2) & vbcrlf & vbcrlf & "Would you like to continue?", vbYesNo) = vbNo Then
1571 Validate = False
1572 Exit Function
1573 End If
1574
1575 alert("Once this order is posted a billing record for " & FormatCurrency(document.all("AuthAmount" & nI).value, 2) & " will be placed in Credit Card Billing." & vbcrlf & vbcrlf & "The remaining " & FormatCurrency(CDbl(document.all("NewTotal" & nI).value) - CDbl(document.all("AuthAmount" & nI).value), 2) & " will not be charged automatically.")
1576 End If
1577
1578 If Not document.all("Payment" & nI) Is Nothing Then
1579 If CDbl(Coalesce(document.all("Payment" & nI).value, "0")) > 0 Then
1580 If MsgBox("A credit card has already been authorized and will be automatically charged after this order is posted. Are you sure you want to enter a payment amount?", vbYesNo) = vbNo Then
1581 Validate = False
1582 Exit Function
1583 End If
1584 End If
1585 End If
1586 End If
1587
1588 <%
1589 If lShowWorkDate Then
1590 %>
1591 If Not (lValidDate(document.all("WorkDate" & nI))) Then
1592 Validate = False
1593 Exit Function
1594 End If
1595 <%
1596 End If
1597
1598 If lUserDefService Then
1599 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
1600 nI = aServiceUserDefKeys(nUDFIndex)
1601
1602 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Show") Then
1603 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Type") = "D" Then
1604 %>
1605 If Not (lValidDate(document.all("UserDef<%=nI%>" & nI))) Then
1606 window.alert("Invalid Date")
1607 document.all("UserDef<%=nI%>" & nI).focus
1608
1609 Validate = False
1610 Exit Function
1611 End If
1612 <%
1613 ElseIf oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Type") = "N" Then
1614 %>
1615 If Not (lUserDefValidNum(document.all("UserDef<%=nI%>" & nI))) Then
1616 window.alert("Invalid format: Enter numeric value")
1617 document.all("UserDef<%=nI%>" & nI).focus
1618
1619 Validate = False
1620 Exit Function
1621 End If
1622 <%
1623 ElseIf oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Type") = "S" Then
1624 %>
1625 lExecUDCOnBlur = False
1626 If Not lUserDefValidPick(document.all("UserDef<%=nI%>" & nI), document.all("UserDefID<%=nI%>" & nI), <%=nI%>, document.all("BranchID" & nI).value, <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDefByBranch")%>) _
1627 Or document.all("Browse").style.visibility = "visible" Then
1628 document.all("UserDef<%=nI%>" & nI).focus
1629 Validate = False
1630 Exit Function
1631 End If
1632 <%
1633 End If
1634 End If
1635 Next
1636 End If
1637
1638 If lSMS Or lABR130785 Then
1639 %>
1640 If document.all("Post" & nI).checked Then
1641 cUserDef14Val = document.all("UserDef14" & nI).value
1642 cTempBillToID = document.all("BillToID" & nI).value
1643
1644 If Not Em(cUserDef14Val) Then
1645 cUserDef14String = cUserDef14String & cUserDef14Val & "|" & cTempBillToID & ","
1646 cExcludeSOString = cExcludeSOString & document.all("OrderID" & nI).value & ","
1647 End If
1648 End If
1649 <%
1650 End If
1651 %>
1652
1653 ' FB 8909
1654 If Not bWarnedAboutTechSig Then
1655 If document.all("FirstTechSignatureID" & nI).value <> "" And document.all("FirstTechSignatureID" & nI).value <> "0" And document.all("OldTechID1_" & nI).value <> "" And document.all("TechID1_" & nI).value <> document.all("OldTechID1_" & nI).value Then
1656 bWarnedAboutTechSig = True ' only warn them once.
1657 nAns = MsgBox("Warning: Changing the technician will cause the signature to be lost. Continue saving?", vbYesNo)
1658 If nAns <> vbYes Then
1659 Validate = False
1660 Exit Function
1661 End If
1662 End If
1663 End If
1664 Next
1665
1666 <%
1667 If lSMS Or lABR130785 Then
1668 %>
1669 If Not Em(cUserDef14String) Then
1670 cUserDef14String = Left(cUserDef14String, Len(cUserDef14String) - 1)
1671 cExcludeSOString = Left(cExcludeSOString, Len(cExcludeSOString) - 1)
1672
1673 SMSUserDef14Data.selectSingleNode("params/userdef14string").text = cUserDef14String
1674 SMSUserDef14Data.selectSingleNode("params/excludesostring").text = cExcludeSOString
1675
1676 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
1677 oXMLHTTP.open "POST", "/xml/UserDef14ChkDuplicate.asp", False
1678 oXMLHTTP.send SMSUserDef14Data.XMLDocument
1679 If oXMLHTTP.statusText = "OK" Then
1680 Set oResponse = oXMLHTTP.responseXML.documentElement
1681 cFoundDuplicate = oResponse.selectSingleNode("foundduplicate").text
1682 End If
1683 End If
1684 <%
1685 End If
1686 %>
1687
1688 For nI = 1 To <%=oOrders.Count%>
1689 lPost = document.all("Post" & nI).checked
1690
1691 If lPost Then
1692 lAnyPosted = True
1693 Set oOrderType = document.all("OrderType" & nI)
1694 lNS = False
1695 If Left(oOrderType.value,3) = "NS_" Then
1696 lNS = True
1697 End If
1698
1699 'Check posting order type access rights here. If order was already marked as posted and user hasn't
1700 'changed the order type, then it's ok. -dbb 5/21/07
1701 If (document.all("OrderType" & nI).value <> document.all("OriginalPostingOrderType" & nI).value) And _
1702 ((document.all("POSTAccessRight" & nI).value <> "1" And (document.all("OrderType" & nI).value = "SO" Or _
1703 document.all("OrderType" & nI).value = "CB" Or document.all("OrderType" & nI).value = "PR")) Or _
1704 (document.all("POSTESTAccessRight" & nI).value <> "1" And (document.all("OrderType" & nI).value = "ES" Or _
1705 document.all("OrderType" & nI).value = "EW" Or document.all("OrderType" & nI).value = "EL")) Or _
1706 (document.all("POSTCEAccessRight" & nI).value <> "1" And document.all("OrderType" & nI).value = "CE") Or _
1707 (document.all("POSTNSAccessRight" & nI).value <> "1" And document.all("OrderType" & nI).value = "NS")) Then
1708 Alert("You do not have access to post this type of order")
1709 document.all("OrderType" & nI).focus()
1710 Validate = False
1711 Exit Function
1712 End If
1713
1714 <%
1715 If lCentex Then
1716 %>
1717 For nLine = 1 To document.all("Lines" & nI).value
1718 If document.all(nLine & "ServiceCode" & nI).value = "PSR" Or _
1719 document.all(nLine & "ServiceCode" & nI).value = "PSRE" Or _
1720 document.all(nLine & "ServiceCode" & nI).value = "ISR" Or _
1721 document.all(nLine & "ServiceCode" & nI).value = "ISRE" _
1722 Then
1723
1724 If document.all("WorkTime" & nI).value = "" Then
1725 Alert("Start time must be filled in.")
1726 document.all("WorkTime" & nI).focus
1727 Validate = False
1728 Exit Function
1729 End If
1730 End If
1731 Next
1732 <%
1733 ElseIf lClark Then
1734 %>
1735 If document.all("OrderType" & nI).value = "EW" And _
1736 document.all("EstimateSaved" & nI).value = "" Then
1737 MsgBox("Estimate Information must be saved")
1738 document.all("OrderType" & nI).focus
1739 Validate = False
1740 Exit Function
1741 End If
1742 <%
1743 ElseIf lNJLawn And Not lUseProductionValue Then
1744 %>
1745 If document.all("OrderType" & nI).value <> "PR" then
1746 nTotalLineCount = 0
1747 nTotalCheckedCount = 0
1748 For nLine = 1 To document.all("Lines" & nI).value
1749 nTotalLineCount = nTotalLineCount + 1
1750 If document.all(nLine & "ProductionValue" & nI).checked Then
1751 nTotalCheckedCount = nTotalCheckedCount + 1
1752 End If
1753 Next
1754
1755 If nTotalLineCount = nTotalCheckedCount Then
1756 MsgBox("Must leave at least one service on this order")
1757 document.all("1ServiceCode" & nI).focus
1758 Validate = False
1759 Exit Function
1760 End If
1761 End If
1762 <%
1763 End If
1764
1765 If lShowService Then
1766 %>
1767 lService = False
1768 lServiceEntered = False
1769 For nLine = 1 To document.all("Lines" & nI).value
1770 If document.all(nLine & "ServiceType" & nI).value = "S" Then
1771 lService = True
1772 End If
1773
1774 If document.all(nLine & "ServiceCode" & nI).value <> "" Then
1775 lServiceEntered = True
1776 End If
1777 Next
1778
1779 <%
1780 If Not lGuardian Then
1781 %>
1782 If Not lServiceEntered Then
1783 If Not document.all("1ServiceCode" & nI) Is Nothing Then
1784 document.all("1ServiceCode" & nI).focus
1785 End If
1786
1787 alert("You must enter a service code.")
1788 Validate = False
1789 Exit Function
1790 End If
1791 <%
1792 End If
1793 %>
1794 'FB 2113 BY RRN 08-09-2011
1795 If Not (document.all("1DeleteLine1") Is Nothing) Then
1796 nOkToDelete = False
1797
1798 For nLineCount = 2 To document.all("Lines" & nI).value
1799 If (document.all(nLineCount& "ServiceCode" & nI).value <> "") And Not document.all(nLineCount & "DeleteLine" & nI).checked Then
1800 nOkToDelete = True
1801 End If
1802 Next
1803
1804 If document.all("1DeleteLine1").checked And Not nOkToDelete Then
1805 alert("You may not delete this line.")
1806 document.all("1ServiceCode1").focus
1807 Validate = False
1808 Exit Function
1809 End If
1810 End If
1811
1812 If lService Then
1813 document.all("ServiceType" & nI).value = "S"
1814 Else
1815 document.all("ServiceType" & nI).value = "P"
1816 End If
1817 <%
1818 End If
1819
1820 If lCopesanPart Then
1821 %>
1822 If document.all("TechID1_" & nI).value = "" Then
1823
1824 alert("You must enter a Technician.")
1825 Validate = False
1826 Exit Function
1827 End If
1828 If document.all("CopesanSANum" & nI).value = "" and document.all("CopesanTicketNum" & nI).value <> "" Then
1829 If Left(document.all("CopesanTicketNum" & nI).value, 2) = "PR" And document.all("CopesanSAPROverride" & nI).value = "0" Then
1830 cOK = MsgBox("WARNING: Order " & document.all("OrderNum" & nI).value & " is a PR ticket that is not matched to an SA. Are you sure you want to continue?", vbYesNo)
1831 If cOK <> vbYes Then
1832 Validate = False
1833 Exit Function
1834 End If
1835 End If
1836 End If
1837 <%
1838 End If
1839
1840
1841 If lShowWorkDate Then
1842 If lEndTime Then
1843 %>
1844 ' do not require times, duration if line items are all products -aw 03/30/01'
1845 ' If order type is NOT SERVICED, work times are not required - kb 10/3/08
1846 If Left(document.all("OrderType" & nI).value, 2) <> "NS" Then
1847 If document.all("ServiceType" & nI).value = "S" And <%=lRequirePostTime%> Then
1848 If (Not lNS) Then
1849 If Em(document.all("WorkTime" & nI).value) Then
1850 Alert("You must fill in a Start Time")
1851 document.all("WorkTime" & nI).focus
1852 Validate = False
1853 Exit Function
1854 End If
1855
1856 If Em(document.all("EndTime" & nI).value) Then
1857 Alert("You must fill in an End Time")
1858 document.all("EndTime" & nI).focus
1859 Validate = False
1860 Exit Function
1861 End If
1862
1863 If Not CalcDuration(nI) Then
1864 MsgBox("End Time must be after Start Time")
1865 document.all("EndTime" & nI).focus
1866 Validate = False
1867 Exit Function
1868 Else
1869 nDuration = DurationToMinutes(document.all("Duration" & nI).value)
1870
1871 If (nDuration > 720) And (SpansMidnight(nI)) Then
1872 cOK = MsgBox("WARNING: Duration is greater than 12 hours and Work Time spans midnight. Continue?", vbYesNo)
1873 If cOK <> vbYes Then
1874 document.all("WorkTime" & nI).focus
1875 Validate = False
1876 Exit Function
1877 End If
1878 ElseIf SpansMidnight(nI) Then
1879 cOK = MsgBox("WARNING: Work Time spans midnight. Continue?", vbYesNo)
1880 If cOK <> vbYes Then
1881 document.all("WorkTime" & nI).focus
1882 Validate = False
1883 Exit Function
1884 End If
1885 <%
1886 If lChemtec Or lAnderson Then
1887 %>
1888 ElseIf nDuration > 120 Then
1889 cOK = MsgBox("WARNING: Duration is greater than 2 hours. Continue?", vbYesNo)
1890 If cOK <> vbYes Then
1891 document.all("WorkTime" & nI).focus
1892 Validate = False
1893 Exit Function
1894 End If
1895 <%
1896 End If
1897 %>
1898 ElseIf nDuration > 720 Then
1899 cOK = MsgBox("WARNING: Duration is greater than 12 hours. Continue?", vbYesNo)
1900 If cOK <> vbYes Then
1901 document.all("WorkTime" & nI).focus
1902 Validate = False
1903 Exit Function
1904 End If
1905 End If
1906 End If
1907 End If
1908 Else
1909 lCalcDuration = True
1910
1911 If SpansMidnight(nI) Then
1912 cStartDate = "1/1/1900"
1913 cEndDate = "1/2/1900"
1914 Else
1915 cStartDate = "1/1/1900"
1916 cEndDate = "1/1/1900"
1917 End If
1918
1919 cStartTime = document.all("WorkTime" & nI).value & " " & document.all("WorkAmPm" & nI).value
1920 cEndTime = document.all("EndTime" & nI).value & " " & document.all("EndAmPm" & nI).value
1921 If IsDate(cStartTime) And IsDate(cEndTime) Then
1922 nDuration = DateDiff("n", CDate(cStartDate & " " & cStartTime), CDate(cEndDate & " " & cEndTime))
1923
1924 If nDuration < 0 Then
1925 lCalcDuration = False
1926 document.all("Duration" & nI).value = "00:00"
1927 Else
1928 document.all("Duration" & nI).value = FormatMinToDur(nDuration)
1929 End If
1930 Else
1931 document.all("Duration" & nI).value = "00:00"
1932 End If
1933
1934 If Not lCalcDuration Then
1935 MsgBox("End time must be after start time")
1936 document.all("EndTime" & nI).focus
1937 Validate = False
1938 Exit Function
1939 Else
1940 nDuration = DurationToMinutes(document.all("Duration" & nI).value)
1941
1942 If (nDuration > 720) And (SpansMidnight(nI)) Then
1943 cOK = MsgBox("WARNING: Duration is greater than 12 hours and Work Time spans midnight. Continue?", vbYesNo)
1944 If cOK <> vbYes Then
1945 document.all("WorkTime" & nI).focus
1946 Validate = False
1947 Exit Function
1948 End If
1949 ElseIf SpansMidnight(nI) Then
1950 cOK = MsgBox("WARNING: Work Time spans midnight. Continue?", vbYesNo)
1951 If cOK <> vbYes Then
1952 document.all("WorkTime" & nI).focus
1953 Validate = False
1954 Exit Function
1955 End If
1956 ElseIf nDuration > 720 Then
1957 cOK = MsgBox("WARNING: Duration is greater than 12 hours. Continue?", vbYesNo)
1958 If cOK <> vbYes Then
1959 document.all("WorkTime" & nI).focus
1960 Validate = False
1961 Exit Function
1962 End If
1963 End If
1964 End If
1965 End If
1966 End If
1967 ' -aw 03/30/01'
1968 <%
1969 Else
1970 %>
1971 If Left(document.all("OrderType" & nI).value, 2) <> "NS" Then
1972 If IsDate(document.all("WorkTime" & nI).value & " " & document.all("WorkAmPm" & nI).value) Then
1973 nDuration = DurationToMinutes(document.all("Duration" & nI).value)
1974 cStartDate = "1/1/1900 " & document.all("WorkTime" & nI).value & " " & document.all("WorkAmPm" & nI).value
1975 cEndDate = DateAdd("n",nDuration,cStartDate)
1976
1977 If (nDuration > 720) And (DatePart("d",cStartDate) < DatePart("d",cEndDate)) Then
1978 cOK = MsgBox("WARNING: Duration is greater than 12 hours and Work Time spans midnight. Continue?", vbYesNo)
1979 If cOK <> vbYes Then
1980 document.all("Duration" & nI).focus
1981 Validate = False
1982 Exit Function
1983 End If
1984 ElseIf DatePart("d",cStartDate) < DatePart("d",cEndDate) Then
1985 cOK = MsgBox("WARNING: Work Time spans midnight. Continue?", vbYesNo)
1986 If cOK <> vbYes Then
1987 document.all("WorkTime" & nI).focus
1988 Validate = False
1989 Exit Function
1990 End If
1991 ElseIf nDuration > 720 Then
1992 cOK = MsgBox("WARNING: Duration is greater than 12 hours. Continue?", vbYesNo)
1993 If cOK <> vbYes Then
1994 document.all("Duration" & nI).focus
1995 Validate = False
1996 Exit Function
1997 End If
1998 End If
1999 End If
2000 End If
2001 <%
2002 End If
2003 End If
2004 %>
2005
2006 Set oInvDate = document.all("InvoiceDate" & nI)
2007 Set oTech = document.all("Tech1_" & nI)
2008 Set oWorkDate = document.all("WorkDate" & nI)
2009 Set oOriginalWorkDate = document.all("OriginalWorkDate" & nI)
2010 Set oWorkTime = document.all("WorkTime" & nI)
2011 Set oWorkAmPm = document.all("WorkAmPm" & nI)
2012 Set oDuration = document.all("Duration" & nI)
2013 Set oPayment = document.all("Payment" & nI)
2014 Set oReference = document.all("Reference" & nI)
2015 Set oMethodOfPaymentID = document.all("MethodOfPaymentID" & nI)
2016 Set oMethodOfPayment = document.all("MethodOfPayment" & nI)
2017 Set oPeriodCutoffDate = document.all("PeriodCutoffDate" & nI)
2018 Set oEndOfCurrentPeriodDate = document.all("EndOfCurrentPeriodDate" & nI)
2019 Set oSetupID = document.all("SetupID" & nI)
2020 Set oGenerateID = document.all("GenerateID" & nI)
2021
2022 If Em(oInvDate.value) Then
2023 MsgBox("All fields must be filled in")
2024 oInvDate.focus
2025 Validate = False
2026 Exit Function
2027 End If
2028
2029 If Em(oTech.value) Then
2030 'If order type is NOT SERVICED, tech is not required - kb 10/3/08
2031 If Left(document.all("OrderType" & nI).value, 2) = "NS" Then
2032 Validate = True
2033 Else
2034 MsgBox("All fields must be filled in")
2035 oTech.focus
2036 Validate = False
2037 Exit Function
2038 End If
2039 End If
2040
2041 <%
2042 If lShowGL Then
2043 %>
2044 Set oGLARCode = document.all("GLARCode" & nI)
2045 If Em(oGLARCode.value) Then
2046 MsgBox("All fields must be filled in")
2047 oGLARCode.focus
2048 Validate = False
2049 Exit Function
2050 End If
2051
2052 <%
2053 If lShowService Then
2054 %>
2055 For nLine = 1 To document.all("Lines" & nI).value
2056 If Not Em(document.all(nLine & "ServiceCode" & nI).value) Then
2057 Set oGLCode = document.all(nLine & "GLCode" & nI)
2058 If oGLCode.value = "" And document.all(nLine & "DeleteLine" & nI).checked = False Then
2059 MsgBox("All fields must be filled in")
2060 oGLCode.focus
2061 Validate = False
2062 Exit Function
2063 End If
2064 End If
2065 Next
2066 <%
2067 End If
2068 End If
2069
2070 If lShowPayment Then
2071 %>
2072 If Not Em(oPayment.value) Then
2073 If CDbl(oPayment.value) > 0 Then
2074 nNewTotal = CDbl(document.all("NewTotal" & nI).value)
2075 nPayment = CDbl(oPayment.value)
2076
2077 Set oDiscount = document.all("Discount" & nI)
2078 nDiscount = CDbl(Coalesce(oDiscount.value,0))
2079
2080 <%
2081 If lPaymentDiscount Then
2082 %>
2083 If nDiscount > nNewTotal Then
2084 MsgBox("Discount cannot be greater than Total")
2085 oDiscount.focus
2086 Validate = False
2087 Exit Function
2088 End If
2089 <%
2090 End If
2091
2092 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseGL") Then
2093 %>
2094 If nPayment > Round((nNewTotal - nDiscount),2) Then
2095 nAns = MsgBox("Payment amount cannot exceed invoice amount of " & FormatCurrency(nNewTotal - nDiscount,2,,False) & ".")
2096 oPayment.focus
2097 Validate = False
2098 Exit Function
2099 End If
2100 <%
2101 Else
2102 %>
2103 ' Don't warn for associated orders -cdk 11/23/09
2104 If nPayment > Round((nNewTotal - nDiscount),2) And document.all("ParentOrderID" & nI).value = "0" Then
2105 cOK = MsgBox("WARNING: Payment amount exceeds invoice amount of " & FormatCurrency(nNewTotal - nDiscount,2,,False) & "." & vbCrLf & _
2106 "This will create an open credit in the amount of " & FormatCurrency(nPayment - (nNewTotal - nDiscount),2,,False) & ". Continue?", vbYesNo)
2107
2108 If cOK <> vbYes Then
2109 oPayment.focus
2110 Validate = False
2111 Exit Function
2112 End If
2113 End If
2114 <%
2115 End If
2116 %>
2117
2118 If Em(oMethodOfPaymentID.value) Then
2119 MsgBox("All fields must be filled in")
2120 oMethodOfPayment.focus
2121 Validate = False
2122 Exit Function
2123 End If
2124 If Em(oReference.value) Then
2125 MsgBox("All fields must be filled in")
2126 oReference.focus
2127 Validate = False
2128 Exit Function
2129 End If
2130 End If
2131 End If
2132 <%
2133 End If
2134
2135 If lShowWorkDate Then
2136 %>
2137 If Em(oWorkDate.value) And Left(document.all("OrderType" & nI).value, 2) <> "NS" Then
2138 MsgBox("All fields must be filled in")
2139 oWorkDate.focus
2140 Validate = False
2141 Exit Function
2142 End If
2143
2144 ' do not require times, duration if all line items are products -aw 03/30/01'
2145 ' If order type is NOT SERVICED, start time and end time are not required - kb 10/3/08
2146 If document.all("ServiceType" & nI).value = "S" And <%=lRequirePostTime%> And Left(document.all("OrderType" & nI).value, 2) <> "NS" Then
2147 If (Not lNS) Then
2148 If Em(oWorkTime.value) Or _
2149 Em(oWorkAmPm.value) Then
2150 MsgBox("All fields must be filled in")
2151 document.all("WorkTime" & nI).focus
2152 Validate = False
2153 Exit Function
2154 End If
2155
2156 If Em(oDuration.value) Then
2157 MsgBox("All fields must be filled in")
2158 <%
2159 If lEndTime Then
2160 %>
2161 document.all("EndTime" & nI).focus
2162 <%
2163 Else
2164 %>
2165 document.all("Duration" & nI).focus
2166 <%
2167 End If
2168 %>
2169 Validate = False
2170 Exit Function
2171 End If
2172 End If
2173 End If
2174 ' -aw 03/30/01'
2175 <%
2176 End If
2177
2178 If lMSC Then
2179 %>
2180 If CDate(oWorkDate.value) > CDate("<%=oGlobals("Date")%>") Then
2181 MsgBox("Warning: The Work Date may not be future-dated. Please change the work date to continue")
2182 oWorkDate.focus
2183 Validate = False
2184 Exit Function
2185 End If
2186
2187 If Not document.all("TechActive1_" & nI).value Then
2188 cOK = MsgBox("WARNING: Technician is not active. Continue?", vbYesNo)
2189 If cOK <> vbYes Then
2190 oTech.focus
2191 Validate = False
2192 Exit Function
2193 End If
2194 End If
2195 <%
2196 End If
2197 %>
2198
2199 If Not Em(oPeriodCutoffDate.value) Then
2200 dCurrentPeriodStart = FormatDate(DateAdd("d", 1, oPeriodCutoffDate.value))
2201 dCurrentPeriodEnd = FormatDate(oEndOfCurrentPeriodDate.value)
2202 cCurrentPeriodDateRangeMsg = "Current Period: " & dCurrentPeriodStart & " - " & dCurrentPeriodEnd
2203
2204 <%
2205 If lUsePeriodLockDown Then
2206 %>
2207
2208 ' - FB Case 6980 - Allow NS orders to be posted in prior period. 1/6/2011 fgd
2209 'If CDate(oInvDate.value) < CDate(dCurrentPeriodStart) Then
2210 If CDate(oInvDate.value) < CDate(dCurrentPeriodStart) And Not lNS Then
2211 MsgBox("Invoice Date exists in a closed Period." & vbcrlf & vbcrlf & cCurrentPeriodDateRangeMsg)
2212 oInvDate.focus
2213 Validate = False
2214 Exit Function
2215 End If
2216 <%
2217 ElseIf lPostPeriodWarn Then
2218 %>
2219 If CDate(oInvDate.value) < CDate(dCurrentPeriodStart) Then
2220 cOK = MsgBox("WARNING: Invoice Date exists in a closed Period. Continue?" & vbcrlf & vbcrlf & cCurrentPeriodDateRangeMsg, vbYesNo)
2221 If cOK <> vbYes Then
2222 oInvDate.focus
2223 Validate = False
2224 Exit Function
2225 End If
2226 End If
2227 <%
2228 End If
2229
2230 'If lCentex Then 3/17/10 RN
2231 ' They should be using period lockdown now. I left this in case they want to prohibit entering beyond 2 months in advance.
2232 ' Otherwise they can use lPostPeriodWarnFuture to warn. The period lockdown will prevent the batch from being released if it's not in the current period.
2233 ' %>
2234 ' If DateAdd("m", 2, CDate(dCurrentPeriodStart)) < CDate(oInvDate.value) Then
2235 ' Alert "Invoice Date is more than 2 months after last period close date." & vbcrlf & vbcrlf & cCurrentPeriodDateRangeMsg
2236 ' oInvDate.focus
2237 ' Validate = False
2238 ' Exit Function
2239 ' End If
2240 ' <%
2241 'End If
2242
2243 If lPostPeriodWarnFuture Then
2244 %>
2245 If CDate(oInvDate.value) > CDate(dCurrentPeriodEnd) Then
2246 cOK = MsgBox("WARNING: Invoice Date is after the current Period. Continue?" & vbcrlf & vbcrlf & cCurrentPeriodDateRangeMsg, vbYesNo)
2247 If cOK <> vbYes Then
2248 oInvDate.focus
2249 Validate = False
2250 Exit Function
2251 End If
2252 End If
2253 <%
2254 End If
2255 %>
2256 End If
2257
2258 <%
2259 If lPostDateWarn Then
2260 %>
2261 If CDate(oInvDate.value) > CDate("<%=oGlobals("Date")%>") Then
2262 cOK = MsgBox("WARNING: Invoice Date is greater than system date. Continue?", vbYesNo)
2263 If cOK <> vbYes Then
2264 oInvDate.focus
2265 Validate = False
2266 Exit Function
2267 End If
2268 End If
2269 <%
2270 End If
2271
2272 If nPostDateWarnDays > 0 Then
2273 %>
2274 If Abs(DateDiff("d", CDate(oInvDate.value), CDate("<%=oGlobals("Date")%>"))) > <%=nPostDateWarnDays%> Then
2275 cOK = MsgBox("WARNING: Invoice Date is outside of default range. Continue?", vbYesNo)
2276 If cOK <> vbYes Then
2277 oInvDate.focus
2278 Validate = False
2279 Exit Function
2280 End If
2281 End If
2282 <%
2283 End If
2284
2285 If lUseChemicals And lShowChemical And lUseRequired Then
2286 %>
2287 '-- Check Required Chemicals --
2288 nChemLines = CDbl(Coalesce(document.all("ChemLines" & nI).value,0))
2289
2290 For nLine = 1 To nChemLines
2291 If Not Em(document.all(nLine & "ChemicalCode" & nI).value) Then
2292 nChemGroupID = document.all(nLine & "ChemGroupID" & nI).value
2293
2294 Set oReqFields = Lookups.XMLDocument.selectSingleNode("/lookups/chemicalgroups/chemicalgroup[@id=" & nChemGroupID & "]/rfin")
2295 If Not oReqFields Is Nothing Then
2296 aReqFields = Split(oReqFields.text,",")
2297
2298 zI = 0
2299 Do While zI <= UBound(aReqFields)
2300 lChemReq = False
2301 cChemReqMsg = ""
2302 cPreField = Trim(aReqFields(zI))
2303
2304 If Not Em(cPreField) Then
2305 aField = Split(cPreField, "|")
2306 cFieldName = nLine & aField(0) & nI
2307
2308 If Not (document.all(cFieldName) Is Nothing) Then
2309 '-- numeric fields --
2310 If IsNumeric(document.all(cFieldName).value) And InStr("|Qty|DilutionInputMethod|UndilutedQty|BASquareFootage|STCubicFootage|LinearFootage|WindVelocity|AirTemperature|", "|" & aField(0) & "|") > 0 Then
2311 If aField(0) = "DilutionInputMethod" Then
2312 If document.all(nLine & "DilutionInputMethod" & nI).value = "T" Then
2313 cFieldName = nLine & "DilutionFactor1_" & nI
2314 Else
2315 cFieldName = nLine & "DilutionFactor2_" & nI
2316 End If
2317 End If
2318
2319 If CDbl(Coalesce(document.all(cFieldName).value, 0)) = 0 Then
2320 lChemReq = True
2321 cChemReqMsg = aField(1) & " cannot be zero."
2322 End If
2323 '-- character fields --
2324 ElseIf Em(document.all(cFieldName).value) Then
2325 lChemReq = True
2326 cChemReqMsg = aField(1) & " must be filled in."
2327 End If
2328
2329 If aField(0) = "ChemAreaIDs" Then
2330 cFieldName = nLine & "butChemAreas" & nI
2331 ElseIf aField(0) = "ChemTargetIDs" Then
2332 cFieldName = nLine & "butChemTargets" & nI
2333 End If
2334
2335 <%
2336 '-- these fields are auto-calculated and do not need to be checked --
2337 If cChemicalAutoCalcOnBlur = "1" Then
2338 %>
2339 If aField(0) = "DilutionInputMethod" Then
2340 lChemReq = False
2341 End If
2342 <%
2343 End If
2344
2345 If cChemicalAutoCalcOnBlur = "2" Then
2346 %>
2347 If aField(0) = "UndilutedQty" Then
2348 lChemReq = False
2349 End If
2350 <%
2351 End If
2352 %>
2353
2354 If lChemReq Then
2355 alert(cChemReqMsg)
2356 document.all(cFieldName).focus
2357 Validate = False
2358 Exit Function
2359 End If
2360 End If
2361 End If
2362
2363 zI = zI + 1
2364 Loop
2365 End If
2366 End If
2367 Next
2368 <%
2369 End If
2370
2371 If lClark Then
2372 %>
2373 dGlobalDate = CDate("<%=oGlobals("Date")%>")
2374 dEndCurrMonth = DateSerial(Year(dGlobalDate),Month(dGlobalDate)+1,0)
2375
2376 If CDate(oInvDate.value) > dEndCurrMonth Then
2377 MsgBox("Invoice Date may not be past the current month.")
2378 oInvDate.focus
2379 Validate = False
2380 Exit function
2381 End If
2382
2383 If CDate(oWorkDate.value) > dEndCurrMonth Then
2384 MsgBox("Work Date may not be past the current month.")
2385 oWorkDate.focus
2386 Validate = False
2387 Exit function
2388 End If
2389
2390 If Not Em(oSetupID.value) AND ((Month(CDate(oWorkDate.value)) <> Month(CDate(oOriginalWorkDate.value)) OR _
2391 Year(CDate(oWorkDate.value)) <> Year(CDate(oOriginalWorkDate.value)))) Then
2392 cMonthString = Month(CDate(oOriginalWorkDate.value)) & "/" & Year(CDate(oOriginalWorkDate.value))
2393 MsgBox("Work date cannot be rescheduled outside of the original month (" & cMonthString & ").")
2394 oWorkDate.focus
2395 Validate = False
2396 Exit function
2397 End If
2398 <%
2399 ElseIf lSMS Or lABR130785 Then
2400 %>
2401 cUserDef14Val = document.all("UserDef14" & nI).value
2402
2403 If Not Em(cUserDef14Val) Then
2404 If InStr(cUserDef14ThisPage, cUserDef14Val) > 0 Then
2405 alert("Job Report " & cUserDef14Val & " has been entered more than once in this batch.")
2406 document.all("UserDef14" & nI).focus
2407 Validate = False
2408 Exit Function
2409 Else
2410 cUserDef14ThisPage = cUserDef14ThisPage & cUserDef14Val & "|"
2411 End If
2412
2413 If cUserDef14Val = cFoundDuplicate Then
2414 alert("Job Report " & cFoundDuplicate & " already exists for this Bill-To." & vbcrlf & "Please enter a unique Job Report.")
2415 document.all("UserDef14" & nI).focus
2416 Validate = False
2417 Exit Function
2418 End If
2419 End If
2420
2421 '-- Check for invoices/posted orders with a similar work date --
2422 For nLine = 1 To document.all("Lines" & nI).value
2423 If document.all(nLine & "ServiceID" & nI).value <> "" Then
2424 SMSCheckInvoiceExists.selectSingleNode("params/locationid").text = document.all("LocationID" & nI).value
2425 SMSCheckInvoiceExists.selectSingleNode("params/workdate").text = oWorkDate.value
2426 SMSCheckInvoiceExists.selectSingleNode("params/serviceid").text = document.all(nLine & "ServiceID" & nI).value
2427
2428 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2429 oXMLHTTP.open "POST", "/xml/custom/SMSCheckInvoiceExists.asp", False
2430 oXMLHTTP.send SMSCheckInvoiceExists.XMLDocument
2431
2432 If oXMLHTTP.statusText = "OK" Then
2433 Set oResponse = oXMLHTTP.responseXML.documentElement
2434 cRecords = oResponse.selectSingleNode("records").text
2435
2436 If Not Em(cRecords) Then
2437 cMatchType = oResponse.selectSingleNode("matchtype").text
2438
2439 cOK = window.showModalDialog("/dialog/SMSDuplicateOrderPosts.asp?LocationID=" & document.all("LocationID" & nI).value & "&MatchType=" & cMatchType & "&Records=" & cRecords & "&WorkDate=" & oWorkDate.value,,"dialogHeight:550px;dialogWidth:592px")
2440 If cOK <> "Y" Then
2441 oWorkDate.focus
2442 Validate = False
2443 Exit Function
2444 End If
2445 End If
2446 End If
2447 End If
2448 Next
2449 <%
2450 ElseIf lMDS Then
2451 %>
2452 If CDate(oInvDate.value) < CDate("<%=oGlobals("Date")%>") Then
2453 alert("Invoice Date cannot be before today")
2454 oInvDate.focus
2455 Validate = False
2456 Exit Function
2457 End If
2458 <%
2459 ElseIf lRollins Then
2460 %>
2461 If document.all("UserDef20" & nI).value <> "REINSPECT" And Not Em(oGenerateID.value) Then
2462 cOldWorkDate = oOriginalWorkDate.value
2463 cNewWorkDate = oWorkDate.value
2464
2465 If Em(cNewWorkDate) And Not Em(cOldWorkDate) Then
2466 alert("Work Date is required")
2467 frmOrder.WorkDate.focus()
2468 Validate = False
2469 Exit Function
2470 End If
2471
2472 If Not Em(cOldWorkDate) Then
2473 dOldWorkDate = CDate(cOldWorkDate)
2474 dNewWorkDate = CDate(cNewWorkDate)
2475 If Month(dOldWorkDate) <> Month(dNewWorkDate) Or Year(dOldWorkDate) <> Year(dNewWorkDate) Then
2476 alert("Work date cannot be rescheduled outside of the original month.")
2477 oWorkDate.focus
2478 Validate = False
2479 Exit function
2480 End If
2481 End If
2482 End If
2483 <%
2484 ElseIf lMiddleton Then
2485 %>
2486 '-- Techs --
2487 nTechShareSum = GetTechShare(nI)
2488 nTechShareSum = nTechShareSum + document.all("AdditionalTechShareTotal" & nI).value
2489
2490 If nTechShareSum > 1.0 Then
2491 alert("Total share for Techs must not exceed 100%")
2492 document.all("TechShare" & nI).focus
2493 Validate = False
2494 Exit Function
2495 End If
2496 <%
2497 End If
2498
2499 If Not lPrestoX Then
2500 %>
2501 If document.all("OrderType" & nI).value = "SO" Or _
2502 document.all("OrderType" & nI).value = "ES" Or _
2503 document.all("OrderType" & nI).value = "EW" Or _
2504 document.all("OrderType" & nI).value = "EL" Then
2505 If CDbl(document.all("NewTotal" & nI).value) = 0 Then
2506 nAns = MsgBox("Continue posting Service Order " & document.all("OrderNum" & nI).value & " for " & FormatCurrency(0,2) & "?", vbYesNo, "Post?")
2507 If nAns = vbNo Then
2508 document.all("WorkTime" & nI).focus
2509 Validate = False
2510 Exit Function
2511 End If
2512 End If
2513 End If
2514 <%
2515 End If
2516 %>
2517 End If
2518
2519 <%
2520 If lUseChemicals And lShowChemical Then
2521 %>
2522 ' FB 11378 enforce a max qty for each chemical based on the unit of measure -cdk 5/23/12
2523 nChemLines = CDbl(Coalesce(document.all("ChemLines" & nI).value,0))
2524 For nLine = 1 To nChemLines
2525 cUnitID = document.all(nLine & "UnitOfMeasureID" & nI).value
2526 cQty = document.all(nLine & "Qty" & nI).value
2527 cUnit = document.all(nLine & "UnitOfMeasure" & nI).value
2528 cChemicalID = document.all(nLine & "ChemicalID" & nI).value
2529 cChemicalCode = document.all(nLine & "ChemicalCode" & nI).value
2530 cChemTargetIDs = document.all(nLine & "ChemTargetIDs" & nI).value
2531
2532 If Not Em(cChemicalID) Then
2533 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2534 oXMLHTTP.open "POST", "/xml/ApprovedChemicalValidate.asp?Table=UnitsOfMeasure&ID=" & cUnitID & "&ChemicalID=" & cChemicalID & "&Quantity=" & cQty, False
2535 oXMLHTTP.send
2536
2537 If oXMLHTTP.statusText = "OK" Then
2538 Set oResponse = oXMLHTTP.responseXML.documentElement
2539
2540 If oResponse.selectSingleNode("status").text <> "OK" Then
2541 Validate = False
2542 alert("The maximum quantity of " & cChemicalCode & " that can be applied is " & oResponse.selectSingleNode("maxquantity").text & " " & cUnit & "(s).")
2543 document.all(nLine & "Qty" & nI).focus
2544 Exit Function
2545 End If
2546 End If
2547
2548 If Len(cChemTargetIDs) > 0 Then
2549 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2550 oXMLHTTP.open "POST", "/xml/ApprovedChemicalValidate.asp?Table=Targets&ID=" & cChemTargetIDs & "&ChemicalID=" & cChemicalID, False
2551 oXMLHTTP.send
2552
2553 If oXMLHTTP.statusText = "OK" Then
2554 Set oResponse = oXMLHTTP.responseXML.documentElement
2555
2556 If oResponse.selectSingleNode("status").text <> "OK" Then
2557 Validate = False
2558 alert("The following Target Pests are not valid for " & cChemicalCode & ": " & vbcrlf & vbcrlf & oResponse.selectSingleNode("invalidtargets").text)
2559 document.all(nLine & "butChemTargets" & nI).focus
2560 Exit Function
2561 End If
2562 End If
2563 End If
2564 End If
2565 Next
2566 <%
2567 End If
2568 %>
2569 Next
2570
2571 If Not lAnyPosted Then
2572 cOK = MsgBox("WARNING: No Service Orders are selected for Posting. Continue?", vbYesNo)
2573 If cOK <> vbYes Then
2574 Validate = False
2575 Exit Function
2576 End If
2577 End If
2578
2579 <%
2580 'FB14897 Check required targets are select or not
2581 If lAnderson And lLinkTargetToService Then
2582 %>
2583 For nI = 1 To <%=oOrders.Count%>
2584 If document.all("Post" & nI).checked Then
2585 RequiredTargetToService.selectSingleNode("params/serviceid").text = document.all("1ServiceID" & nI).value
2586 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2587 oXMLHTTP.open "POST", "/xml/checkRequiredTargetsToService.asp", False
2588 oXMLHTTP.send RequiredTargetToService.XMLDocument
2589
2590 If oXMLHTTP.statusText = "OK" Then
2591 Set oResponse = oXMLHTTP.responseXML.documentElement
2592 cIsTargetPestRequired = oResponse.selectSingleNode("targetPestRequired").text
2593 If cIsTargetPestRequired = "True" Then
2594 <%If lUseMultipleTargets Then%>
2595 cMultipleTargetList = document.all("MultipleTargetList" & nI).innerHtml
2596
2597 If Em(cMultipleTargetList) Or cMultipleTargetList = "(None)" Then
2598 Validate = False
2599 alert("Please select at least one target pest.")
2600 Exit Function
2601 End If
2602 <%Else %>
2603 cTargetId = document.all("TargetID" & nI).value
2604 If Em(cTargetId) Or cTargetId = "0" Then
2605 Validate = False
2606 alert("Please select target pest.")
2607 Exit Function
2608 End If
2609 <%End If %>
2610
2611 End If
2612 End If
2613 End If
2614 Next
2615 <%
2616 End If
2617 %>
2618
2619 cOpenOrderApplications = ""
2620
2621 For nI = 1 To <%=oOrders.Count%>
2622 If Not document.all("Post" & nI).checked Then
2623 cOrderID = document.all("OrderID" & nI).value
2624 Set oApplication = oGetXMLFromDB("PaymentCheckOpenOrderApplication", False, "OrderID=" & cOrderID)
2625 cApplication = oApplication.selectSingleNode("output").text
2626 cOpenOrderApplications = cOpenOrderApplications & cApplication
2627
2628 If Len(cApplication) > 0 Then
2629 cOpenOrderApplications = cOpenOrderApplications & ", "
2630 End If
2631 End If
2632 Next
2633
2634 If Len(cOpenOrderApplications) > 0 Then
2635 cOpenOrderApplications = Left(cOpenOrderApplications, Len(cOpenOrderApplications) - 2)
2636 End If
2637
2638 If Len(cOpenOrderApplications) > 0 Then
2639 If MsgBox("The following orders have payments applied to them: " & VBCRLF & VBCRLF & cOpenOrderApplications & VBCRLF & VBCRLF & "Unposting these orders will remove the applications and leave the payments as open credits. Are you sure you want to continue?" & VBCRLF, vbYesNo) = vbYes Then
2640 For nI = 1 To <%=oOrders.Count%>
2641 If Not document.all("Post" & nI).checked Then
2642 cOrderID = document.all("OrderID" & nI).value
2643 cOrderNum = document.all("OrderNum" & nI).value
2644
2645 Call UpdateLog("D_Application", "Deleted application to order " & cOrderNum, document.all("BranchID").value)
2646 Set oDeleteResult = oGetXMLFromDB("PaymentDeleteOpenOrderApplication", False, "OrderID=" & cOrderID)
2647 End If
2648 Next
2649 Else
2650 Validate = False
2651 Exit Function
2652 End If
2653 End If
2654
2655 Validate = True
2656End Function
2657
2658Sub ReferenceOnBlur(nCount)
2659 'don't show duplicate reference warning for cash or credit card payments -dbb 5/14/07
2660 If Not Em(document.all("MethodOfPaymentID" & nCount).value) And _
2661 (document.all("MethodOfPaymentID" & nCount).value = "<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("MasterCardID")%>" Or _
2662 document.all("MethodOfPaymentID" & nCount).value = "<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("VisaID")%>" Or _
2663 document.all("MethodOfPaymentID" & nCount).value = "<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("AmericanExpressID")%>" Or _
2664 document.all("MethodOfPaymentID" & nCount).value = "<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DiscoverID")%>" Or _
2665 document.all("MethodOfPaymentID" & nCount).value = "<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("CashID")%>") Then
2666 Exit Sub
2667 End If
2668 '-
2669
2670 Data.selectSingleNode("params/billtoid").text = document.all("BillToID" & nCount).value
2671 Data.selectSingleNode("params/reference").text = document.all("Reference" & nCount).value
2672
2673 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2674 oXMLHTTP.open "POST", "/xml/refpost.asp", False
2675 oXMLHTTP.send Data.XMLDocument
2676 nNumber = CDbl(oXMLHTTP.responseXML.documentElement.selectSingleNode("count").text)
2677 If nNumber > 0 Then
2678 nAns = MsgBox("Payment with similar reference exists. Continue?", vbYesNo, "Duplicate Reference")
2679 If nAns <> vbYes Then
2680 document.all("Reference" & nCount).value = ""
2681 document.all("Reference" & nCount).focus
2682 End If
2683 End If
2684End Sub
2685
2686Sub MethodOfPaymentOnBlur(nCount)
2687 Call XMLOnBlur(document.all("MethodOfPayment" & nCount), document.all("MethodOfPaymentID" & nCount), "/lookups/methods/method")
2688 If Em(document.all("Reference" & nCount).value) Then
2689 cMOP = UCase(document.all("MethodOfPayment" & nCount).value)
2690 If cMOP = "CA" Or cMOP = "CASH" Then
2691 document.all("Reference" & nCount).value = "Cash"
2692 End If
2693 End If
2694End Sub
2695
2696Sub MethodOfPaymentOnKeyDown(nCount)
2697 Call XMLOnKeyDown("methods", "MethodOfPayment" & nCount)
2698End Sub
2699
2700<%
2701If lSwingle Then
2702 %>
2703 Function SwingleFirstLineIsIrrigation(nCount, cBranchID)
2704 <%
2705 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PriceServiceByBranch") Then
2706 %>
2707 Set oNodeFirstService = Lookups.XMLDocument.documentElement.selectSingleNode("servicebranchesallswingle" & cBranchID).selectSingleNode("service[@id=""" & document.all("1ServiceID" & nCount).value & """]")
2708 <%
2709 Else
2710 %>
2711 Set oNodeFirstService = Lookups.XMLDocument.documentElement.selectSingleNode("servicesallswingle").selectSingleNode("service[@id=""" & document.all("1ServiceID" & nCount).value & """]")
2712 <%
2713 End If
2714 %>
2715 If oNodeFirstService Is Nothing Then
2716 SwingleFirstLineIsIrrigation = False
2717 Else
2718 SwingleFirstLineIsIrrigation = (oNodeFirstService.selectSingleNode("division").text = "IRRIGATION")
2719 End If
2720 Set oNodeFirstService = Nothing
2721 End Function
2722 <%
2723ElseIf lMiddleton Then
2724 %>
2725 Sub AdditionalTechsMiddleton(nRow, cOrderID)
2726 nTechShareSum = GetTechShare(nRow)
2727 cInfo = window.showModalDialog("/dialog/custom/MiddletonAdditionalTechs.asp?OrderID=" & cOrderID & "&TechShareSum=" & nTechShareSum,,"dialogHeight:550px;dialogWidth:550px")
2728 If Not Em(cInfo) Then
2729 aInfo = Split(cInfo, "|")
2730 document.all("AdditionalTechShareTotal" & nRow).value = aInfo(1)
2731
2732 If CDbl(aInfo(0)) > 0 Then
2733 document.all("AdditionalTechsMiddleton" & nRow).innerText = "View/Edit Additional Techs"
2734 Else
2735 document.all("AdditionalTechsMiddleton" & nRow).innerText = "Add Additional Techs"
2736 End If
2737 End If
2738 End Sub
2739
2740 Function GetTechShare(nRow)
2741 cTech1 = document.all("Tech" & nRow).value
2742 cTech2 = document.all("Tech2_" & nRow).value
2743
2744 nTechShareSum = 0
2745
2746 If Not Em(cTech1) Then
2747 nTechShareSum = nTechShareSum + CDbl(document.all("TechShare" & nRow).value)
2748 End If
2749 If Not Em(cTech2) Then
2750 nTechShareSum = nTechShareSum + CDbl(document.all("TechShare2_" & nRow).value)
2751 End If
2752 GetTechShare = nTechShareSum
2753 End Function
2754 <%
2755End If
2756
2757If lClark338110 Then
2758%>
2759 Sub GenerateCancellation(cOrderID, nRow)
2760
2761 cCancelReasonID = window.showModalDialog("/serviceOrder/dialog/cancelOrder.asp?Mode=New&OrderID=" & cOrderID,,"dialogHeight:350px;dialogWidth:525px")
2762
2763 If document.all("GenCancellation" & nRow).innerText = "View Cancellation" Then
2764 window.showModalDialog "/serviceOrder/dialog/cancelOrder.asp?OrderID=" & cOrderID,,"dialogHeight:300px;dialogWidth:525px"
2765 Else
2766 If Not Em(cCancelReasonID) Then
2767 window.showModalDialog "/serviceOrder/dialog/cancelOrder.asp?Mode=Save&LocationID=" & document.all("LocationID" & nRow).value & "&OrderID=" & cOrderID & "&CancelReasonID=" & cCancelReasonID,,"dialogHeight:175px;dialogWidth:475px"
2768
2769 document.all("GenCancellation" & nRow).innerText = "View Cancellation"
2770 End If
2771 End If
2772
2773 End Sub
2774<%
2775End If
2776%>
2777
2778Sub ServiceOnKeyDown(nLine, nCount, cBranchID)
2779 <%
2780 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PriceServiceByBranch") Then
2781 If lSwingle Then
2782 %>
2783 If nLine = 1 Then
2784 cDataPath = "servicebranches" & cBranchID
2785 Else
2786 If SwingleFirstLineIsIrrigation(nCount, cBranchID) Then
2787 cDataPath = "servicebranchesallswingle" & cBranchID
2788 Else
2789 cDataPath = "servicebranches" & cBranchID
2790 End If
2791 End If
2792 <%
2793 Else
2794 %>
2795 cDataPath = "servicebranches" & cBranchID
2796 <%
2797 End If
2798 Else
2799 If lSwingle Then
2800 %>
2801 If nLine = 1 Then
2802 cDataPath = "services"
2803 Else
2804 If SwingleFirstLineIsIrrigation(nCount, cBranchID) Then
2805 cDataPath = "servicesallswingle"
2806 Else
2807 cDataPath = "services"
2808 End If
2809 End If
2810 <%
2811 Else
2812 %>
2813 cDataPath = "services"
2814 <%
2815 End If
2816 End If
2817 %>
2818 Call XMLOnKeyDown(cDataPath, nLine & "ServiceCode" & nCount)
2819End Sub
2820
2821Sub ServiceOnBlur(nLine, nCount, cBranchID)
2822 If document.all("Browse").style.visibility = "visible" Then
2823 Exit Sub
2824 End If
2825 <%
2826 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PriceServiceByBranch") Then
2827 If lSwingle Then
2828 %>
2829 If nLine = 1 Then
2830 cDataPath = "/lookups/servicebranches" & cBranchID & "/service"
2831 Else
2832 If SwingleFirstLineIsIrrigation(nCount, cBranchID) Then
2833 cDataPath = "/lookups/servicebranchesallswingle" & cBranchID & "/service"
2834 Else
2835 cDataPath = "/lookups/servicebranches" & cBranchID & "/service"
2836 End If
2837 End If
2838 <%
2839 Else
2840 %>
2841 cDataPath = "/lookups/servicebranches" & cBranchID & "/service"
2842 <%
2843 End If
2844 Else
2845 If lSwingle Then
2846 %>
2847 If nLine = 1 Then
2848 cDataPath = "/lookups/services/service"
2849 Else
2850 If SwingleFirstLineIsIrrigation(nCount, cBranchID) Then
2851 cDataPath = "/lookups/servicesallswingle/service"
2852 Else
2853 cDataPath = "/lookups/services/service"
2854 End If
2855 End If
2856 <%
2857 Else
2858 %>
2859 cDataPath = "/lookups/services/service"
2860 <%
2861 End If
2862 End If
2863 %>
2864
2865 Set oNode = XMLOnBlur(document.all(nLine & "ServiceCode" & nCount), document.all(nLine & "ServiceID" & nCount), cDataPath)
2866
2867 If oNode Is Nothing Then
2868 document.all(nLine & "ServiceType" & nCount).value = ""
2869
2870 If Not document.all(nLine & "Description" & nCount) Is Nothing Then
2871 document.all(nLine & "Description" & nCount).value = ""
2872 End If
2873
2874 document.all(nLine & "HiddenDetailedDescription" & nCount).value = ""
2875 document.all(nLine & "Quantity" & nCount).value = ""
2876 document.all(nLine & "UnitPrice" & nCount).value = ""
2877
2878 <%
2879 If lUseProductionValue Then
2880 %>
2881 document.all(nLine & "ProductionValue" & nCount).value = ""
2882 <%
2883 ElseIf lNJLawn Then
2884 %>
2885 document.all(nLine & "ProductionValue" & nCount).checked = False
2886 <%
2887 End If
2888 %>
2889
2890 document.all(nLine & "Cost" & nCount).value = ""
2891 document.all(nLine & "Taxable" & nCount).checked = False
2892 document.all(nLine & "DeleteLine" & nCount).checked = False
2893 document.all(nLine & "GLCode" & nCount).value = ""
2894 document.all(nLine & "GLCodeID" & nCount).value = ""
2895
2896 If document.all(nLine & "HasDefaultAttribute" & nCount).value = "1" Then
2897 Call EditDefaultAttribute("Delete", nLine, nCount)
2898 End If
2899
2900 document.all(nLine & "OServiceCode" & nCount).value = ""
2901 document.all(nLine & "HasDefaultAttribute" & nCount).value = "0"
2902
2903 <%
2904 If lUseChemicals And lLinkChemToService Then
2905 %>
2906 document.all(nLine & "LastServiceCode" & nCount).value = ""
2907 <%
2908 End If
2909 %>
2910 Else
2911 document.all(nLine & "ServiceType" & nCount).value = oNode.selectSingleNode("type").text
2912
2913 <%
2914 If (lLockGL) Then
2915 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLSalesCodeSource") <> "C" Then
2916 If lMSC Then
2917 %>
2918 If document.all("IsInitial" & nCount).value = "1" or document.all("IsFinanced" & nCount).value = "True" Then
2919 document.all(nLine & "GLCode" & nCount).value = Coalesce(oNode.selectSingleNode("initialglcode").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCode")%>")
2920 document.all(nLine & "GLCodeID" & nCount).value = Coalesce(oNode.selectSingleNode("initialglcodeid").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCodeID")%>")
2921 Else
2922 document.all(nLine & "GLCode" & nCount).value = Coalesce(oNode.selectSingleNode("glcode").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCode")%>")
2923 document.all(nLine & "GLCodeID" & nCount).value = Coalesce(oNode.selectSingleNode("glcodeid").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCodeID")%>")
2924 End If
2925 <%
2926 Else ' Everyone else
2927 %>
2928 If document.all("IsInitial" & nCount).value = "1" Then
2929 document.all(nLine & "GLCode" & nCount).value = Coalesce(oNode.selectSingleNode("initialglcode").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCode")%>")
2930 document.all(nLine & "GLCodeID" & nCount).value = Coalesce(oNode.selectSingleNode("initialglcodeid").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCodeID")%>")
2931 Else
2932 document.all(nLine & "GLCode" & nCount).value = Coalesce(oNode.selectSingleNode("glcode").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCode")%>")
2933 document.all(nLine & "GLCodeID" & nCount).value = Coalesce(oNode.selectSingleNode("glcodeid").text,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCodeID")%>")
2934 End If
2935 <%
2936 End If
2937 Else
2938 %>
2939 document.all(nLine & "GLCode" & nCount).value = Coalesce(document.all("LocationGLCode" & nCount).value,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCode")%>")
2940 document.all(nLine & "GLCodeID" & nCount).value = Coalesce(document.all("LocationGLCodeID" & nCount).value,"<%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLCodeID")%>")
2941 <%
2942 End If
2943 ElseIf lClark Then
2944 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLSalesCodeSource") <> "C" Then
2945 %>
2946 document.all(nLine & "GLCode" & nCount).value = oNode.selectSingleNode("glcode").text
2947 document.all(nLine & "GLCodeID" & nCount).value = oNode.selectSingleNode("glcodeid").text
2948 <%
2949 Else
2950 %>
2951 document.all(nLine & "GLCode" & nCount).value = document.all("LocationGLCode" & nCount).value
2952 document.all(nLine & "GLCodeID" & nCount).value = document.all("LocationGLCodeID" & nCount).value
2953 <%
2954 End If
2955 End If
2956 %>
2957
2958 ' Updated so this code fires if they change service code (even if they don't blank it out first) -cdk 03/24/08
2959 If Em(document.all(nLine & "OServiceCode" & nCount).value) Or _
2960 document.all(nLine & "OServiceCode" & nCount).value <> document.all(nLine & "ServiceCode" & nCount).value Then
2961 document.all(nLine & "Description" & nCount).value = oNode.attributes.getNamedItem("description").text
2962 document.all(nLine & "HiddenDetailedDescription" & nCount).value = oNode.attributes.getNamedItem("description").text
2963 document.all(nLine & "Quantity" & nCount).value = FormatNumber(1,2,,False,False)
2964
2965 lTaxableByState = False
2966 Taxable.selectSingleNode("params/locationstate").text = document.all("LocationState" & nCount).value
2967 Taxable.selectSingleNode("params/serviceid").text = document.all(nLine & "ServiceID" & nCount).value
2968
2969 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
2970 oXMLHTTP.open "POST", "/xml/getTaxableStates.asp", False
2971 oXMLHTTP.send Taxable.XMLDocument
2972
2973 If CBool(oXMLHTTP.responseXML.documentElement.selectSingleNode("hasstates").text) Then
2974 lTaxableByState = CBool(oXMLHTTP.responseXML.documentElement.selectSingleNode("taxable").text)
2975 Else
2976 lTaxableByState = CBool(oNode.selectSingleNode("taxable").text)
2977 End If
2978
2979 document.all(nLine & "Taxable" & nCount).checked = lTaxableByState
2980 document.all(nLine & "DeleteLine" & nCount).checked = False
2981 document.all(nLine & "HasDefaultAttribute" & nCount).value = oNode.selectSingleNode("hasdefaultattribute").text
2982 <%
2983 If (Not lLockGL) And (Not lClark) Then
2984 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("GLSalesCodeSource") <> "C" Then
2985 %>
2986 If document.all("IsInitial" & nCount).value = "1" Then
2987 document.all(nLine & "GLCode" & nCount).value = oNode.selectSingleNode("initialglcode").text
2988 document.all(nLine & "GLCodeID" & nCount).value = oNode.selectSingleNode("initialglcodeid").text
2989 Else
2990 document.all(nLine & "GLCode" & nCount).value = oNode.selectSingleNode("glcode").text
2991 document.all(nLine & "GLCodeID" & nCount).value = oNode.selectSingleNode("glcodeid").text
2992 End If
2993 <%
2994 Else
2995 %>
2996 document.all(nLine & "GLCode" & nCount).value = document.all("LocationGLCode" & nCount).value
2997 document.all(nLine & "GLCodeID" & nCount).value = document.all("LocationGLCodeID" & nCount).value
2998 <%
2999 End If
3000 End If
3001 %>
3002 nNewPrice = CDbl(oNode.selectSingleNode("price").text)
3003 If Em(document.all(nLine & "UnitPrice" & nCount).value) Then
3004 nOldPrice = 0
3005 Else
3006 nOldPrice = CDbl(document.all(nLine & "UnitPrice" & nCount).value)
3007 End If
3008 If Not (nOldPrice <> 0 And nNewPrice = 0) Then
3009 <%
3010 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseFourDecimalUnitPrice") Then
3011 %>
3012 document.all(nLine & "UnitPrice" & nCount).value = FormatNumber(oNode.selectSingleNode("price").text,4,,False,False)
3013 <%
3014 Else
3015 %>
3016 document.all(nLine & "UnitPrice" & nCount).value = FormatNumber(oNode.selectSingleNode("price").text,2,,False,False)
3017 <%
3018 End If
3019 %>
3020
3021 <%
3022 If lUseProductionValue Then
3023 %>
3024 document.all(nLine & "ProductionValue" & nCount).value = FormatNumber(CDbl(oNode.selectSingleNode("price").text) * CDbl(oNode.selectSingleNode("defaultproductionvalue").text),2,,False,False)
3025 <%
3026 End If
3027 %>
3028
3029 End If
3030
3031 document.all(nLine & "Cost" & nCount).value = FormatNumber(oNode.selectSingleNode("cost").text,2,,False,False)
3032
3033 <%
3034 If lLinkTargetToService And lUseMultipleTargets Then
3035 %>
3036 LinkTargetToService.selectSingleNode("params/orderid").text = document.all("OrderID" & nCount).value
3037 LinkTargetToService.selectSingleNode("params/serviceid").text = document.all(nLine & "ServiceID" & nCount).value
3038
3039 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
3040 oXMLHTTP.open "POST", "/xml/linkTargetToService.asp", False
3041 oXMLHTTP.send LinkTargetToService.XMLDocument
3042
3043 If oXMLHTTP.statusText = "OK" Then
3044 Set oResponse = oXMLHTTP.responseXML.documentElement
3045
3046 document.all("MultipleTargetList" & nCount).innerHtml = oResponse.selectSingleNode("targets").text
3047 document.all("MultipleTargetList" & nCount).popuptext = oResponse.selectSingleNode("targets").text
3048 End If
3049 <%
3050 End If
3051 %>
3052 End If
3053
3054 If document.all(nLine & "HasDefaultAttribute" & nCount).value = "1" Then
3055 Call EditDefaultAttribute("Insert", nLine, nCount)
3056 End If
3057
3058 document.all(nLine & "OServiceCode" & nCount).value = document.all(nLine & "ServiceCode" & nCount).value
3059
3060 <%
3061 If lUseChemicals And lLinkChemToService Then
3062 %>
3063 If document.all(nLine & "ServiceCode" & nCount).value <> document.all(nLine & "LastServiceCode" & nCount).value Then
3064 ChemicalData.selectSingleNode("params/serviceid").text = document.all(nLine & "ServiceID" & nCount).value
3065
3066 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
3067 oXMLHTTP.open "POST", "/xml/serviceChemicals.asp", False
3068 oXMLHTTP.send ChemicalData.XMLDocument
3069
3070 Set oResponse = oXMLHTTP.responseXML.documentElement
3071 nChemicalCount = CDbl(Coalesce(oResponse.selectSingleNode("count").text,0))
3072 nChemLines = CDbl(Coalesce(document.all("ChemLines" & nCount).value,0))
3073
3074 If nChemLines = 0 And nChemicalCount <> 0 Then
3075 document.all("ChemInfoHeader1_" & nCount).className = "Visible"
3076 document.all("ChemInfoHeader2_" & nCount).className = "Visible"
3077 document.all("ChemInfoHeader3_" & nCount).className = "Visible"
3078 document.all("ChemInfoHeaderUnderline" & nCount).className = "Visible"
3079 End If
3080
3081 <%
3082 If lSingleLine Then
3083 %>
3084 'erase all chemical lines and replace with service chemicals
3085 For nI = 1 To nChemLines
3086 document.all(nI & "ChemicalID" & nCount).value = ""
3087 document.all(nI & "ChemicalCode" & nCount).value = ""
3088
3089 <!-- Fixed the call - it was only passing in 1 variable, when the function needs 2 -KM 11032011 - FB -->
3090 <!-- Call ClearChemicalFields(nLine) -->
3091 Call ClearChemicalFields(nI, nLine)
3092 Next
3093
3094 'fill in existing chemical lines
3095 For nI = 1 To Min(nChemicalCount,nChemLines)
3096
3097
3098 cDilutionCalcType = oResponse.selectSingleNode("dilutioncalctype" & nI).text
3099
3100 document.all(nI & "ChemicalCode" & nCount).value = oResponse.selectSingleNode("chemicalcode" & nI).text
3101 document.all(nI & "ChemicalID" & nCount).value = oResponse.selectSingleNode("chemicalid" & nI).text
3102 document.all(nI & "ChemGroupID" & nCount).value = oResponse.selectSingleNode("chemgroupid" & nI).text
3103
3104 <%
3105 If lSelect Then
3106 %>
3107 document.all(nI & "Qty" & nCount).value = FormatNumber(oResponse.selectSingleNode("quantity" & nI).text,4,,False,False)
3108 <%
3109 ElseIf lCableLock Then
3110 %>
3111 document.all(nI & "Qty" & nCount).value = FormatNumber(1,4,,False,False)
3112 <%
3113 Else
3114 %>
3115 document.all(nI & "Qty" & nCount).value = FormatNumber(0,4,,False,False)
3116 <%
3117 End If
3118 %>
3119
3120 document.all(nI & "UnitOfMeasure" & nCount).value = oResponse.selectSingleNode("unitofmeasure" & nI).text
3121 document.all(nI & "UnitOfMeasureID" & nCount).value = oResponse.selectSingleNode("unitofmeasureid" & nI).text
3122
3123 If Em(oResponse.selectSingleNode("acceptabledilutionfactors" & nI).text) Then
3124 document.all(nI & "DilutionInputMethod" & nCount).Value = "T"
3125
3126' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3127 If InStr("DO", cDilutionCalcType) > 0 Then
3128 If cDilutionCalcType = "O" Then
3129 document.all(nI & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nI).text,8,,False,False)
3130 document.all(nI & "UndilutedUOM" & nCount).readonly = False
3131 Else
3132 document.all(nI & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nI).text,8,,False,False)
3133 document.all(nI & "UndilutedUOM" & nCount).readonly = True
3134 End If
3135 document.all(nI & "DilutionFactorTextBox" & nCount).classname = "Visible"
3136 document.all(nI & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3137
3138 ElseIf cDilutionCalcType = "P" Then
3139 document.all(nI & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nI).text,4) & " " & oResponse.selectSingleNode("standarduom" & nI).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nI).text
3140 document.all(nI & "DilutionFactorDisplay" & nCount).className = "Visible"
3141 document.all(nI & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3142 document.all(nI & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3143 document.all(nI & "UndilutedUOM" & nCount).readonly = True
3144
3145 End If
3146 Else
3147 document.all(nI & "DilutionInputMethod" & nCount).Value = "C"
3148
3149' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3150 If InStr("DO", cDilutionCalcType) > 0 Then
3151 If cDilutionCalcType = "O" Then
3152 document.all(nI & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nI).text,8,,False,False)
3153 document.all(nI & "UndilutedUOM" & nCount).readonly = False
3154 Else
3155 document.all(nI & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nI).text,8,,False,False)
3156 document.all(nI & "UndilutedUOM" & nCount).readonly = True
3157 End If
3158 document.all(nI & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3159 document.all(nI & "DilutionFactorDropdown" & nCount).classname = "Visible"
3160
3161 ElseIf cDilutionCalcType = "P" Then
3162 document.all(nI & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nI).text,4) & " " & oResponse.selectSingleNode("standarduom" & nI).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nI).text
3163 document.all(nI & "DilutionFactorDisplay" & nCount).className = "Visible"
3164 document.all(nI & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3165 document.all(nI & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3166 document.all(nI & "UndilutedUOM" & nCount).readonly = True
3167
3168 End If
3169 End If
3170
3171 document.all(nI & "UndilutedUOM" & nCount).value = oResponse.selectSingleNode("undiluteduom" & nI).text
3172 document.all(nI & "UndilutedUOMID" & nCount).value = oResponse.selectSingleNode("undiluteduomid" & nI).text
3173 document.all(nI & "MethodOfAppl" & nCount).value = oResponse.selectSingleNode("methodofappl" & nI).text
3174 document.all(nI & "MethodID" & nCount).value = oResponse.selectSingleNode("methodid" & nI).text
3175 document.all(nI & "LotNumber" & nCount).value = oResponse.selectSingleNode("lotnumber" & nI).text
3176 document.all(nI & "DilutionCalcType" & nCount).value = oResponse.selectSingleNode("dilutioncalctype" & nI).text
3177
3178 document.all(nI & "ApplicationRateCode" & nCount).value = oResponse.selectSingleNode("applicationrate" & nI).text
3179 document.all(nI & "ApplicationRateID" & nCount).value = oResponse.selectSingleNode("applicationrateid" & nI).text
3180 document.all(nI & "ApplicationEquipmentCode" & nCount).value = oResponse.selectSingleNode("applicationequipment" & nI).text
3181 document.all(nI & "ApplicationEquipmentID" & nCount).value = oResponse.selectSingleNode("applicationequipmentid" & nI).text
3182
3183 ' FB 11378 -- so targets default on chemical -cdk 6/1/12
3184 If Em(oResponse.selectSingleNode("target" & nI).text) Then
3185 document.all(nI & "ChemTargets" & nCount).innerText = "(None)"
3186 document.all(nI & "ChemTargetIDs" & nCount).value = ""
3187 Else
3188 document.all(nI & "ChemTargets" & nCount).innerText = oResponse.selectSingleNode("target" & nI).text
3189 document.all(nI & "ChemTargetIDs" & nCount).value = oResponse.selectSingleNode("targetid" & nI).text
3190 End If
3191
3192 Call QtyOnBlur(nI, nCount)
3193 If InStr("DP", cDilutionCalcType) > 0 Then
3194 Call CalcUndilQtyLabel(nI, nCount)
3195 End If
3196 Next
3197
3198 nChemStart = nChemLines + 1
3199 <%
3200 Else
3201 %>
3202 'fill in existing chemical lines
3203 nChemCount = 1
3204 nLineCount = 1
3205
3206 Do While nChemCount <= nChemicalCount And nLineCount <= nChemLines
3207 If document.all(nLineCount & "DeleteChemLine" & nCount).checked Or _
3208 Em(document.all(nLineCount & "ChemicalID" & nCount).value) Then
3209 cDilutionCalcType = oResponse.selectSingleNode("dilutioncalctype" & nChemCount).text
3210
3211 document.all(nLineCount & "ChemicalCode" & nCount).value = oResponse.selectSingleNode("chemicalcode" & nChemCount).text
3212 document.all(nLineCount & "ChemicalID" & nCount).value = oResponse.selectSingleNode("chemicalid" & nChemCount).text
3213 document.all(nLineCount & "ChemGroupID" & nCount).value = oResponse.selectSingleNode("chemgroupid" & nChemCount).text
3214 document.all(nLineCount & "UnitOfMeasure" & nCount).value = oResponse.selectSingleNode("unitofmeasure" & nChemCount).text
3215 document.all(nLineCount & "UnitOfMeasureID" & nCount).value = oResponse.selectSingleNode("unitofmeasureid" & nChemCount).text
3216
3217 document.all(nLineCount & "ApplicationRateCode" & nCount).value = oResponse.selectSingleNode("applicationrate" & nChemCount).text
3218 document.all(nLineCount & "ApplicationRateID" & nCount).value = oResponse.selectSingleNode("applicationrateid" & nChemCount).text
3219 document.all(nLineCount & "ApplicationEquipmentCode" & nCount).value = oResponse.selectSingleNode("applicationequipment" & nChemCount).text
3220 document.all(nLineCount & "ApplicationEquipmentID" & nCount).value = oResponse.selectSingleNode("applicationequipmentid" & nChemCount).text
3221
3222 <%
3223 If lSelect Then
3224 %>
3225 document.all(nLineCount & "Qty" & nCount).value = FormatNumber(oResponse.selectSingleNode("quantity" & nChemCount).text,4,,False,False)
3226 <%
3227 ElseIf lCableLock Then
3228 %>
3229 document.all(nLineCount & "Qty" & nCount).value = FormatNumber(1,4,,False,False)
3230 <%
3231 Else
3232 %>
3233 document.all(nLineCount & "Qty" & nCount).value = FormatNumber(0,4,,False,False)
3234 <%
3235 End If
3236 %>
3237
3238 If Em(oResponse.selectSingleNode("acceptabledilutionfactors" & nChemCount).text) Then
3239 document.all(nLineCount & "DilutionInputMethod" & nCount).Value = "T"
3240
3241' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3242 If InStr("DO", cDilutionCalcType) > 0 Then
3243 If cDilutionCalcType = "O" Then
3244 document.all(nLineCount & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nChemCount).text,8,,False,False)
3245 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = False
3246 Else
3247 document.all(nLineCount & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nChemCount).text,8,,False,False)
3248 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = True
3249 End If
3250 document.all(nLineCount & "DilutionFactorTextBox" & nCount).classname = "Visible"
3251 document.all(nLineCount & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3252
3253 ElseIf cDilutionCalcType = "P" Then
3254 document.all(nLineCount & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nChemCount).text,4) & " " & oResponse.selectSingleNode("standarduom" & nChemCount).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nChemCount).text
3255 document.all(nLineCount & "DilutionFactorDisplay" & nCount).className = "Visible"
3256 document.all(nLineCount & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3257 document.all(nLineCount & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3258 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = True
3259
3260 End If
3261 Else
3262 document.all(nLineCount & "DilutionInputMethod" & nCount).Value = "C"
3263
3264' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3265 If InStr("DO", cDilutionCalcType) > 0 Then
3266 If cDilutionCalcType = "O" Then
3267 document.all(nLineCount & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nChemCount).text,8,,False,False)
3268 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = False
3269 Else
3270 document.all(nLineCount & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nChemCount).text,8,,False,False)
3271 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = True
3272 End If
3273 document.all(nLineCount & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3274 document.all(nLineCount & "DilutionFactorDropdown" & nCount).classname = "Visible"
3275 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = False
3276
3277 ElseIf cDilutionCalcType = "P" Then
3278 document.all(nLineCount & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nChemCount).text,4) & " " & oResponse.selectSingleNode("standarduom" & nChemCount).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nChemCount).text
3279 document.all(nLineCount & "DilutionFactorDisplay" & nCount).className = "Visible"
3280 document.all(nLineCount & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3281 document.all(nLineCount & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3282 document.all(nLineCount & "UndilutedUOM" & nCount).readonly = True
3283
3284 End If
3285 End If
3286
3287 document.all(nLineCount & "UndilutedUOM" & nCount).value = oResponse.selectSingleNode("undiluteduom" & nChemCount).text
3288 document.all(nLineCount & "UndilutedUOMID" & nCount).value = oResponse.selectSingleNode("undiluteduomid" & nChemCount).text
3289 document.all(nLineCount & "MethodOfAppl" & nCount).value = oResponse.selectSingleNode("methodofappl" & nChemCount).text
3290 document.all(nLineCount & "MethodID" & nCount).value = oResponse.selectSingleNode("methodid" & nChemCount).text
3291 document.all(nLineCount & "LotNumber" & nCount).value = oResponse.selectSingleNode("lotnumber" & nChemCount).text
3292 document.all(nLineCount & "DilutionCalcType" & nCount).value = oResponse.selectSingleNode("dilutioncalctype" & nChemCount).text
3293 document.all(nLineCount & "ApplicationRateCode" & nCount).value = oResponse.selectSingleNode("applicationrate" & nChemCount).text
3294 document.all(nLineCount & "ApplicationRateID" & nCount).value = oResponse.selectSingleNode("applicationrateid" & nChemCount).text
3295 document.all(nLineCount & "ApplicationEquipmentCode" & nCount).value = oResponse.selectSingleNode("applicationequipment" & nChemCount).text
3296 document.all(nLineCount & "ApplicationEquipmentID" & nCount).value = oResponse.selectSingleNode("applicationequipmentid" & nChemCount).text
3297 document.all(nLineCount & "DeleteChemLine" & nCount).checked = false
3298
3299 ' FB 11378 -- so targets default on chemical -cdk 6/1/12
3300 If Em(oResponse.selectSingleNode("target" & nChemCount).text) Then
3301 document.all(nLineCount & "ChemTargets" & nCount).innerText = "(None)"
3302 document.all(nLineCount & "ChemTargetIDs" & nCount).value = ""
3303 Else
3304 document.all(nLineCount & "ChemTargets" & nCount).innerText = oResponse.selectSingleNode("target" & nChemCount).text
3305 document.all(nLineCount & "ChemTargetIDs" & nCount).value = oResponse.selectSingleNode("targetid" & nChemCount).text
3306 End If
3307
3308 Call QtyOnBlur(nLineCount, nCount)
3309 If InStr("DP", cDilutionCalcType) > 0 Then
3310 Call CalcUndilQtyLabel(nLineCount, nCount)
3311 End If
3312
3313 nChemCount = nChemCount + 1
3314 End If
3315
3316 nLineCount = nLineCount + 1
3317 Loop
3318
3319 nChemStart = nChemCount
3320 <%
3321 End If
3322 %>
3323
3324 For nI = nChemStart To nChemicalCount
3325 nChemRowIndex = CDbl(document.all("NextChemRow" & nCount).value)
3326 nIndex = CDbl(document.all("ChemIndex" & nCount).value)
3327 document.all("ChemLines" & nCount).value = document.all("ChemLines" & nCount).value + 1
3328 nChemLine = document.all("ChemLines" & nCount).value
3329 cDilutionCalcType = oResponse.selectSingleNode("dilutioncalctype" & nI).text
3330
3331 For Each oElement in frmPost.elements
3332 If oElement.type = "text" Or oElement.type = "textarea" Or oElement.type = "checkbox" Or oElement.type = "select-one" Or oElement.type = "button" Then
3333 If CDbl(oElement.tabindex) >= nIndex Then
3334 oElement.tabindex = oElement.tabindex + <%=nChemIndexIncrement%>
3335 End If
3336 Else
3337 If oElement.type = "hidden" Then
3338 If Left(oElement.name,4) = "Rank" Then
3339 If (CDbl(oElement.value) >= CDbl(document.all("Rank" & nCount).value)) Then
3340 document.all("ChemIndex" & Mid(oElement.name,5)).value = CDbl(document.all("ChemIndex" & Mid(oElement.name,5)).value) + <%=nChemIndexIncrement%>
3341 End If
3342 End If
3343
3344 If Left(oElement.name,8) = "LineRank" Then
3345 If (CDbl(oElement.value) > CDbl(document.all("LineRank" & nCount).value)) Then
3346 document.all("LineIndex" & Mid(oElement.name,9)).value = CDbl(document.all("LineIndex" & Mid(oElement.name,9)).value) + <%=nChemIndexIncrement%>
3347 End If
3348 End If
3349 End If
3350 End If
3351 Next
3352
3353 If nChemLine Mod 2 = 0 Then
3354 cRowBgColor = "#e4e8ec"
3355 Else
3356 cRowBgColor = "#d4d8dc"
3357 End If
3358
3359 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
3360 oNewRow.bgcolor = cRowBgColor
3361 nChemRowIndex = nChemRowIndex + 1
3362
3363 Set oNewCell = oNewRow.insertCell()
3364 oNewCell.colspan = "9"
3365 oNewCell.innerHTML = "<img alt='' border=0 height=3 src='/images/blank.gif' width=1>"
3366
3367 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
3368 oNewRow.bgcolor = cRowBgColor
3369 nChemRowIndex = nChemRowIndex + 1
3370
3371 Set oNewCell = oNewRow.insertCell()
3372 oNewCell.innerHTML = "<input type=hidden name='" & nChemLine & "OrderChemLineID" & nCount & "' value='0'>" & _
3373 "<input tabindex=" & ChemicalTabOrder("ChemicalCode", nIndex, <%=lShowExtraChemInfo%>, False) & " type=text name='" & nChemLine & "ChemicalCode" & nCount & "' size=15 maxlength=15 " & _
3374 "onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ChemicalOnKeyDown(" & nChemLine & "," & nCount & "); return false;' value='" & oResponse.selectSingleNode("chemicalcode" & nI).text & "' onBlur='VBScript:Call ChemicalOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='VBScript:Call ChemicalOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3375 "<input type=hidden name='" & nChemLine & "ChemicalID" & nCount & "' value='" & oResponse.selectSingleNode("chemicalid" & nI).text & "'>" & _
3376 "<input type=hidden name='" & nChemLine & "OChemicalCode" & nCount & "' value='" & oResponse.selectSingleNode("chemicalcode" & nI).text & "'>" & _
3377 "<input type=hidden name='" & nChemLine & "ChemGroupID" & nCount & "' value='" & oResponse.selectSingleNode("chemgroupid" & nI).text & "'>" & _
3378 "<input type=hidden name='" & nChemLine & "DilutionCalcType" & nCount & "' value='" & oResponse.selectSingleNode("dilutioncalctype" & nI).text & "'>" & _
3379 "<input type=hidden name='" & nChemLine & "ChemicalLineChanged" & nCount & "' value=''>" & _
3380 "<input type=hidden name='" & nChemLine & "ChemicalCalculatedEdited" & nCount & "' value=''>"
3381
3382 Set oNewCell = oNewRow.insertCell()
3383
3384 <%
3385 If lSelect Then
3386 %>
3387 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("Qty", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "Qty" & nCount & "' value='" & FormatNumber(oResponse.selectSingleNode("quantity" & nI).text,4,,False,False) & "' size=8 maxlength=11 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: QtyOnBlur(" & nChemLine & "," & nCount & "); SetChemicalLineChangedLabel(" & nChemLine & "," & nCount & ")' onkeypress='javascript: vNumKey(this,1)'>"
3388 <%
3389 Else
3390 %>
3391 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("Qty", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "Qty" & nCount & "' value='" & FormatNumber(0,4,,False,False) & "' size=8 maxlength=11 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: QtyOnBlur(" & nChemLine & "," & nCount & "); SetChemicalLineChangedLabel(" & nChemLine & "," & nCount & ")' onkeypress='javascript: vNumKey(this,1)'>"
3392 <%
3393 End If
3394 %>
3395
3396 Set oNewCell = oNewRow.insertCell()
3397 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UnitOfMeasure", nIndex, <%=lShowExtraChemInfo%>, False) & " size=2 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; UnitOfMeasureOnKeyDown(" & nChemLine & "," & nCount & "); return false;' name='" & nChemLine & "UnitOfMeasure" & nCount & "' value='" & oResponse.selectSingleNode("unitofmeasure" & nI).text & "' onBlur='UnitOfMeasureOnBlur(" & nChemLine & "," & nCount & "); SetChemicalLineChangedLabel(" & nChemLine & "," & nCount & ")' onKeyDown='VBScript:Call UnitOfMeasureOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3398 "<input type=hidden name='" & nChemLine & "UnitOfMeasureID" & nCount & "' value='" & oResponse.selectSingleNode("unitofmeasureid" & nI).text & "'>"
3399
3400 Set oNewCell = oNewRow.insertCell()
3401 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("MethodOfAppl", nIndex, <%=lShowExtraChemInfo%>, False) & " size=12 maxlength=15 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; MethodOfApplOnKeyDown(" & nChemLine & "," & nCount & "); return false;' name='" & nChemLine & "MethodOfAppl" & nCount & "' onBlur='VBScript:Call MethodOfApplOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='VBScript:Call MethodOfApplOnKeyDown(" & nChemLine & "," & nCount & ")' value='" & oResponse.selectSingleNode("methodofappl" & nI).text & "'>" & _
3402 "<input type=hidden name='" & nChemLine & "MethodID" & nCount & "' value='" & oResponse.selectSingleNode("methodid" & nI).text & "'>"
3403
3404 Set oNewCell = oNewRow.insertCell()
3405 oNewCell.rowspan = "3"
3406 oNewCell.valign = "top"
3407 oNewCell.innerHTML = "<textarea tabindex=" & ChemicalTabOrder("ChemicalComment", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "ChemicalComment" & nCount & "' rows=5 cols=40></textarea>"
3408
3409 Set oNewCell = oNewRow.insertCell()
3410 oNewCell.innerHTML = "<select tabindex=" & ChemicalTabOrder("SkyConditions", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "SkyConditions" & nCount & "'>" & _
3411 "<option value=''></option>" & _
3412 "<option value='Clear'>Clear</option>" & _
3413 "<option value='Cloudy'>Cloudy</option>" & _
3414 "<option value='Overcast'>Overcast</option>" & _
3415 "<option value='Rain'>Rain</option>" & _
3416 "<option value='Snow'>Snow</option>" & _
3417 "</select>"
3418
3419 Set oNewCell = oNewRow.insertCell()
3420 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("LinearFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "LinearFootage" & nCount & "' size=5 maxlength=5>"
3421
3422 Set oNewCell = oNewRow.insertCell()
3423 oNewCell.innerHTML = "<input type=checkbox tabindex=" & ChemicalTabOrder("Delete", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "DeleteChemLine" & nCount & "' value='1'>"
3424
3425 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
3426 oNewRow.bgcolor = cRowBgColor
3427 nChemRowIndex = nChemRowIndex + 1
3428
3429 Set oNewCell = oNewRow.insertCell()
3430 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("LotNumber", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "LotNumber" & nCount & "' size=10 maxlength=255 value='" & oResponse.selectSingleNode("lotnumber" & nI).text & "'>"
3431
3432 Set oNewCell = oNewRow.insertCell()
3433 oNewCell.innerHTML = "<span id='" & nChemLine & "DilutionFactorTextBox" & nCount & "' class='Visible'>" & _
3434 "<input type=text tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "DilutionFactor1_" & nCount & "' size=10 maxlength=10 onblur='javascript:vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(" & nChemLine & ", " & nCount & ");' onkeypress='javascript: vNumKey(this,1)' onkeydown='SetChemicalCalculatedEdited(" & nChemLine & "," & nCount & ", 1);'>" & _
3435 "</span>" & _
3436 "<span id='" & nChemLine & "DilutionFactorDropdown" & nCount & "' class='Hidden'>" & _
3437 "<input type=text tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, <%=lShowExtraChemInfo%>, False) & " onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; DilutionFactorOnKeyDown(" & nChemLine & ", " & nCount & "); return false;' name='" & nChemLine & "DilutionFactor2_" & nCount & "' size=10 onblur='javascript:vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(" & nChemLine & ", " & nCount & ");' onKeyDown='DilutionFactorOnKeyDown(" & nChemLine & ", " & nCount & "); SetChemicalCalculatedEdited(" & nChemLine & "," & nCount & ", 1);'>" & _
3438 "</span>" & _
3439 "<span id='" & nChemLine & "DilutionFactorDisplay" & nCount & "' class='Hidden'></span>" & _
3440 "<input type=hidden name='" & nChemLine & "DilutionInputMethod" & nCount & "' value='T'>"
3441
3442 Set oNewCell = oNewRow.insertCell()
3443 oNewCell.innerHTML = " "
3444
3445 Set oNewCell = oNewRow.insertCell()
3446 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("ApplicationRate", nIndex, <%=lShowExtraChemInfo%>, False) & " size=10 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ApplicationRateOnKeyDown(" & nChemLine & "," & nCount & "); return false;' name='" & nChemLine & "ApplicationRateCode" & nCount & "' value='" & oResponse.selectSingleNode("applicationrate" & nI).text & "' onBlur='VBScript:Call ApplicationRateOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='ApplicationRateOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3447 "<input type=hidden name='" & nChemLine & "ApplicationRateID" & nCount & "' value='" & oResponse.selectSingleNode("applicationrateid" & nI).text & "'>"
3448
3449 Set oNewCell = oNewRow.insertCell()
3450 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("AirTemperature", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "AirTemperature" & nCount & "' size=3 maxlength=3>"
3451
3452 Set oNewCell = oNewRow.insertCell()
3453 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("SquareFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "BASquareFootage" & nCount & "' size=5 maxlength=5>"
3454
3455 <% If lUseOregonPesticideReport Then %>
3456 Set oNewCell = oNewRow.insertCell()
3457 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("OregonSpecificSite", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "OregonSpecificSiteDescription" & nCount & "' size=10 maxlength=70 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; OregonSpecificSiteOnKeyDown(" & nChemLine & "," & nCount & "); return false;' OnBlur='VBScript:Call OregonSpecificSiteOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='VBScript:Call OregonSpecificSiteOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3458 "<input type=hidden name='" & nChemLine & "OregonSpecificSite" & nCount & "' value=''>"
3459
3460 <%Else%>
3461 Set oNewCell = oNewRow.insertCell()
3462 oNewCell.innerHTML = " "
3463 <%End if%>
3464
3465 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
3466 oNewRow.bgcolor = cRowBgColor
3467 nChemRowIndex = nChemRowIndex + 1
3468
3469 Set oNewCell = oNewRow.insertCell()
3470 oNewCell.innerHTML = " "
3471
3472 'value of UndilutedQty is set below by call to QtyOnBlur
3473 Set oNewCell = oNewRow.insertCell()
3474 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UndilutedQty", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "UndilutedQty" & nCount & "' size=9 maxlength=9 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: UndilQtyOnBlur(" & nChemLine & "," & nCount & ");' onfocus='VBScript:Call UndilQtyOnFocus(" & nChemLine & "," & nCount & ")' onkeypress='javascript: vNumKey(this,1)' value='" & FormatNumber(0,4,,False,False) & "'>" & _
3475 " <span id='" & nChemLine & "ChemicalChangeWarning" & nCount & "'></span>"
3476
3477 Set oNewCell = oNewRow.insertCell()
3478 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UndilutedUOM", nIndex, <%=lShowExtraChemInfo%>, False) & " size=2 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; UndilutedUOMOnKeyDown(" & nChemLine & "," & nCount & "); return false;' name='" & nChemLine & "UndilutedUOM" & nCount & "' value='" & oResponse.selectSingleNode("undiluteduom" & nI).text & "' SetChemicalCalculatedEdited(" & nChemLine & "," & nCount & ", 2);'>" & _
3479 "<input type=hidden name='" & nChemLine & "UndilutedUOMID" & nCount & "' value='" & oResponse.selectSingleNode("undiluteduomid" & nI).text & "'>"
3480
3481 Set oNewCell = oNewRow.insertCell()
3482 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("ApplicationEquipment", nIndex, <%=lShowExtraChemInfo%>, False) & " size=10 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ApplicationEquipmentOnKeyDown(" & nChemLine & "," & nCount & "); return false;' name='" & nChemLine & "ApplicationEquipmentCode" & nCount & "' value='" & oResponse.selectSingleNode("applicationequipment" & nI).text & "' onBlur='VBScript:Call ApplicationEquipmentOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='ApplicationEquipmentOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3483 "<input type=hidden name='" & nChemLine & "ApplicationEquipmentID" & nCount & "' value='" & oResponse.selectSingleNode("applicationequipmentid" & nI).text & "'>"
3484
3485 Set oNewCell = oNewRow.insertCell()
3486 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("WindVelocity", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "WindVelocity" & nCount & "' size=3 maxlength=3><select tabindex=" & ChemicalTabOrder("WindDirection", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "WindDirection" & nCount & "'>" & _
3487 "<option value='' selected> </option>" & _
3488 "<option value='N'>N</option>" & _
3489 "<option value='NE'>NE</option>" & _
3490 "<option value='E'>E</option>" & _
3491 "<option value='SE'>SE</option>" & _
3492 "<option value='S'>S</option>" & _
3493 "<option value='SW'>SW</option>" & _
3494 "<option value='W'>W</option>" & _
3495 "<option value='NW'>NW</option>" & _
3496 "</select>"
3497
3498 Set oNewCell = oNewRow.insertCell()
3499 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("CubicFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "STCubicFootage" & nCount & "' size=5 maxlength=5>"
3500
3501 <% If lUseOregonPesticideReport Then %>
3502
3503 Set oNewCell = oNewRow.insertCell()
3504 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("OregonPurpose", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "OregonPurposeDescription" & nCount & "' size=13 maxlength=35 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; OregonPurposeOnKeyDown(" & nChemLine & "," & nCount & "); return false;' OnBlur='VBScript:Call OregonPurposeOnBlur(" & nChemLine & "," & nCount & ")' onKeyDown='VBScript:Call OregonPurposeOnKeyDown(" & nChemLine & "," & nCount & ")'>" & _
3505 "<input type=hidden name='" & nChemLine & "OregonPurpose" & nCount & "' value=''>"
3506 <%Else%>
3507 Set oNewCell = oNewRow.insertCell()
3508 oNewCell.innerHTML = " "
3509 <%End if%>
3510
3511
3512 If Em(oResponse.selectSingleNode("acceptabledilutionfactors" & nI).text) Then
3513 document.all(nChemLine & "DilutionInputMethod" & nCount).Value = "T"
3514
3515' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3516 If InStr("DO", cDilutionCalcType) > 0 Then
3517 If cDilutionCalcType = "O" Then
3518 document.all(nChemLine & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nI).text,8,,False,False)
3519 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = False
3520 Else
3521 document.all(nChemLine & "DilutionFactor1_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nI).text,8,,False,False)
3522 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = True
3523 End If
3524 document.all(nChemLine & "DilutionFactorTextBox" & nCount).classname = "Visible"
3525 document.all(nChemLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3526
3527 ElseIf cDilutionCalcType = "P" Then
3528 document.all(nChemLine & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nI).text,4) & " " & oResponse.selectSingleNode("standarduom" & nI).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nI).text
3529 document.all(nChemLine & "DilutionFactorDisplay" & nCount).className = "Visible"
3530 document.all(nChemLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3531 document.all(nChemLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3532 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = True
3533
3534 End If
3535 Else
3536 document.all(nChemLine & "DilutionInputMethod" & nCount).Value = "C"
3537
3538' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
3539 If InStr("DO", cDilutionCalcType) > 0 Then
3540 If cDilutionCalcType = "O" Then
3541 document.all(nChemLine & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("dilutionfactor" & nI).text,8,,False,False)
3542 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = False
3543 Else
3544 document.all(nChemLine & "DilutionFactor2_" & nCount).value = FormatNumber(oResponse.selectSingleNode("firstpreferreddilution" & nI).text,8,,False,False)
3545 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = True
3546 End If
3547 document.all(nChemLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3548 document.all(nChemLine & "DilutionFactorDropdown" & nCount).classname = "Visible"
3549
3550 ElseIf cDilutionCalcType = "P" Then
3551 document.all(nChemLine & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oResponse.selectSingleNode("standardquantity" & nI).text,4) & " " & oResponse.selectSingleNode("standarduom" & nI).text & " per " & oResponse.selectSingleNode("unitofmeasure" & nI).text
3552 document.all(nChemLine & "DilutionFactorDisplay" & nCount).className = "Visible"
3553 document.all(nChemLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
3554 document.all(nChemLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
3555 document.all(nChemLine & "UndilutedUOM" & nCount).readonly = True
3556
3557 End If
3558 End If
3559
3560
3561 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
3562 oNewRow.bgcolor = cRowBgColor
3563 nChemRowIndex = nChemRowIndex + 1
3564 oNewRow.id = nChemLine & "ExtraChemInfoAreasTargets" & nCount
3565
3566 Set oNewCell = oNewRow.insertCell()
3567 oNewCell.colspan = "4"
3568 oNewCell.innerHTML = "<input type='button' tabindex=" & ChemicalTabOrder("Areas", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "butChemAreas" & nCount & "' value='Areas' onclick='butChemAreasOnClick(""" & nChemLine & """, """ & nCount & """)'> " & _
3569 "<span id='" & nChemLine & "ChemAreas" & nCount & "' Visible=True>(None)</span>" & _
3570 "<input type='hidden' name='" & nChemLine & "ChemAreaIDs" & nCount & "' value='' />"
3571
3572 Set oNewCell = oNewRow.insertCell()
3573 oNewCell.colspan = "4"
3574 oNewCell.innerHTML = "<input type='button' tabindex=" & ChemicalTabOrder("Targets", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLine & "butChemTargets" & nCount & "' value='Targets' onclick='butChemTargetsOnClick(""" & nChemLine & """, """ & nCount & """)'> " & _
3575 "<span id='" & nChemLine & "ChemTargets" & nCount & "' Visible=True>(None)</span>" & _
3576 "<input type='hidden' name='" & nChemLine & "ChemTargetIDs" & nCount & "' value='' />"
3577
3578
3579 ' FB 11378 -- so targets default on chemical -cdk 6/1/12
3580 If Em(oResponse.selectSingleNode("target" & nI).text) Then
3581 document.all(nChemLine & "ChemTargets" & nCount).innerText = "(None)"
3582 document.all(nChemLine & "ChemTargetIDs" & nCount).value = ""
3583 Else
3584 document.all(nChemLine & "ChemTargets" & nCount).innerText = oResponse.selectSingleNode("target" & nI).text
3585 document.all(nChemLine & "ChemTargetIDs" & nCount).value = oResponse.selectSingleNode("targetid" & nI).text
3586 End If
3587
3588 Call QtyOnBlur(nChemLine, nCount)
3589
3590 If InStr("DP", cDilutionCalcType) > 0 Then
3591 Call CalcUndilQtyLabel(nChemLine, nCount)
3592 End If
3593
3594 document.all("NextChemRow" & nCount).value = nChemRowIndex
3595
3596 <%
3597 If lShowExtraChemInfo Then
3598 %>
3599 document.all("ChemIndex" & nCount).value = ChemicalTabOrder("Targets", nIndex, <%=lShowExtraChemInfo%>, False) + 1
3600 <%
3601 Else
3602 %>
3603 document.all("ChemIndex" & nCount).value = ChemicalTabOrder("ChemicalComment", nIndex, <%=lShowExtraChemInfo%>, False) + 1
3604 <%
3605 End If
3606 %>
3607 Next
3608 End If
3609
3610 document.all(nLine & "LastServiceCode" & nCount).value = document.all(nLine & "ServiceCode" & nCount).value
3611 <%
3612 End If
3613
3614 If lCentex Then
3615 %>
3616 If nLine > 1 And oNode.selectSingleNode("type").text = "S" Then
3617 Alert("Additional line items can only be products.")
3618 document.all(nLine & "ServiceCode" & nCount).value = ""
3619 document.all(nLine & "ServiceType" & nCount).value = ""
3620 document.all(nLine & "Description" & nCount).value = ""
3621 document.all(nLine & "Quantity" & nCount).value = ""
3622 document.all(nLine & "UnitPrice" & nCount).value = ""
3623
3624 <%
3625 If lUseProductionValue Then
3626 %>
3627 document.all(nLine & "ProductionValue" & nCount).value = ""
3628 <%
3629 End If
3630 %>
3631 document.all(nLine & "Cost" & nCount).value = ""
3632 document.all(nLine & "Taxable" & nCount).checked = False
3633 document.all(nLine & "DeleteLine" & nCount).checked = False
3634 document.all(nLine & "OServiceCode" & nCount).value = ""
3635 document.all(nLine & "ServiceCode" & nCount).focus
3636 End If
3637 <%
3638 End If
3639 %>
3640
3641 If oNode.selectSingleNode("pricebymeasurement").text = "1" Then
3642 Set oElement = document.all(nLine & "Quantity" & nCount)
3643 oElement.style.visibility = "hidden"
3644 oElement.style.width = "0px"
3645
3646 document.all(nLine & "UnitPrice" & nCount).readonly = True
3647 document.all(nLine & "EditMeasurementsSpan" & nCount).innerText = "Measure"
3648 document.all(nLine & "EditMeasurementsSpan" & nCount).style.width = "30px"
3649 document.all(nLine & "EditMeasurementsSpan" & nCount).style.visibility = "visible"
3650
3651 If document.all(nLine & "PriceByMeasurementLineMeasurementID" & nCount).value = "" Then
3652 EditMeasurements nLine, nCount
3653 End If
3654
3655 document.all(nLine & "PriceByMeasurementDelete" & nCount).value = "0"
3656 Else
3657 Set oElement = document.all(nLine & "Quantity" & nCount)
3658 oElement.style.visibility = "visible"
3659 oElement.style.width = ""
3660
3661 document.all(nLine & "UnitPrice" & nCount).readonly = False
3662
3663 document.all(nLine & "EditMeasurementsSpan" & nCount).innerText = ""
3664 document.all(nLine & "EditMeasurementsSpan" & nCount).style.width = "0px"
3665 document.all(nLine & "EditMeasurementsSpan" & nCount).style.visibility = "hidden"
3666
3667 document.all(nLine & "PriceByMeasurementDelete" & nCount).value = "1"
3668 End If
3669 End If
3670
3671 Call CalculateTaxTotal(nCount)
3672End Sub
3673
3674Sub EditDefaultAttribute(cMode, nLine, nCount)
3675 cServiceCode = document.all(nLine & "ServiceCode" & nCount).value
3676 cLastServiceCode = document.all(nLine & "OServiceCode" & nCount).value
3677
3678 If cServiceCode <> cLastServiceCode Then
3679 If cMode = "Delete" Then
3680 cServiceCode = cLastServiceCode
3681 End If
3682
3683 DefaultAttribute.selectSingleNode("params/orderid").text = document.all("OrderID" & nCount).value
3684 DefaultAttribute.selectSingleNode("params/servicecode").text = cServiceCode
3685 DefaultAttribute.selectSingleNode("params/mode").text = cMode
3686
3687 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
3688 oXMLHTTP.open "POST", "/serviceOrder/Attributes/ServiceOrderDefaultAttributes.asp", False
3689 oXMLHTTP.send DefaultAttribute.XMLDocument
3690
3691 Call FadeColor("ServiceOrderAttribute")
3692 End If
3693End Sub
3694
3695cFadeRed = 255
3696cFadeGreen = 253
3697cFadeBlue = 55
3698cFade_R = cFadeRed
3699cFade_G = cFadeGreen
3700cFade_B = cFadeBlue
3701
3702Sub FadeColor(cContainer)
3703 If (cFade_R + cFade_G + cFade_B <> 643) Then
3704 document.all(cContainer).style.backgroundcolor = "RGB(" & cFade_R & "," & cFade_G & "," & cFade_B & ")"
3705
3706 If (cFade_R = cFadeRed) And (cFade_G = cFadeGreen) And (cFade_B = cFadeBlue) Then
3707 cTimerID = setTimeout("FadeColor('" & cContainer & "')", 2000)
3708 Else
3709 cTimerID = setTimeout("FadeColor('" & cContainer & "')", 40)
3710 End If
3711
3712 If (cFade_R <= 207) Or ((cFade_R - 25) < 207) Then cFade_R = 207 Else cFade_R = cFade_R - 25 End If
3713 If (cFade_G <= 216) Or ((cFade_G - 25) < 216) Then cFade_G = 216 Else cFade_G = cFade_G - 25 End If
3714 If (cFade_B >= 220) Or ((cFade_B + 25) > 220) Then cFade_B = 220 Else cFade_B = cFade_B + 25 End If
3715 Else
3716 document.all(cContainer).style.backgroundcolor = "RGB(" & cFade_R & "," & cFade_G & "," & cFade_B & ")"
3717 cFade_R = cFadeRed
3718 cFade_G = cFadeGreen
3719 cFade_B = cFadeBlue
3720 End If
3721End Sub
3722
3723Sub ShowMeasurements(nLine, nCount)
3724 If document.all(nLine & "PriceByMeasurementQuantity" & nCount).value <> "" Then
3725 Set oMeasurementType = Lookups.XMLDocument.selectSingleNode("/lookups/measurementtypes/measurementtype[@id='" & document.all(nLine & "PriceByMeasurementTypeID" & nCount).value & "']")
3726 If Not oMeasurementType Is Nothing Then
3727 cMeasurementType = oMeasurementType.attributes.getNamedItem("code").text
3728 End If
3729
3730 cPriceAdjustor = document.all(nLine & "PriceByMeasurementPriceAdjustor" & nCount).value
3731 cDiscountDollars = document.all(nLine & "PriceByMeasurementCustomerDiscountDollars" & nCount).value
3732 cDiscountPercent = document.all(nLine & "PriceByMeasurementCustomerDiscountPercent" & nCount).value
3733 cDiscountExpirationDate = document.all(nLine & "PriceByMeasurementDiscountExpirationDate" & nCount).value
3734
3735 If Em(cDiscountExpirationDate) Then
3736 cDiscountExpirationDate = "(None)"
3737 Else
3738 cDiscountExpirationDate = FormatDate(CDate(cDiscountExpirationDate))
3739 End If
3740 If Em(cPriceAdjustor) Then
3741 cPriceAdjustor = "0"
3742 End If
3743
3744 cPriceAdjustor = FormatNumber(cPriceAdjustor,2,,False,False) & "%"
3745
3746 cDiscount = "0"
3747 cDiscountType = "$"
3748
3749 If Em(cDiscountDollars) Or cDiscountDollars = "0" Then
3750 If Not Em(cDiscountPercent) And cDiscountPercent <> "0" Then
3751 cDiscountType = "%"
3752 cDiscount = cDiscountPercent
3753 End If
3754 Else
3755 cDiscount = cDiscountDollars
3756 End If
3757
3758 If cDiscountType = "%" Then
3759 cDiscount = FormatNumber(cDiscount,2,,False,False) & "%"
3760 Else
3761 cDiscount = FormatCurrency(cDiscount)
3762 End If
3763
3764 cMsg = cMsg & "<table cellpadding='0' cellspacing='0' bgcolor='#181818' width='225'>"
3765 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Header' colspan='2' align='center'>Measurement Detail</td></tr>"
3766 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Measurement:</td><td class='hoverPopupStyled_Font'>" & FormatNumber(document.all(nLine & "PriceByMeasurementQuantity" & nCount).value,2) & " " & cMeasurementType & "</td></tr>"
3767 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Base Price:</td><td class='hoverPopupStyled_Font'>" & FormatCurrency(document.all(nLine & "PriceByMeasurementBasePrice" & nCount).value) & "</td></tr>"
3768 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Unit Price:</td><td class='hoverPopupStyled_Font'>" & FormatCurrency(document.all(nLine & "PriceByMeasurementUnitPrice" & nCount).value,4) & "</td></tr>"
3769 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Min Price:</td><td class='hoverPopupStyled_Font'>" & FormatCurrency(document.all(nLine & "PriceByMeasurementMinPrice" & nCount).value) & "</td></tr>"
3770 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Price Adjustor:</td><td class='hoverPopupStyled_Font'>" & cPriceAdjustor & "</td></tr>"
3771 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Discount:</td><td class='hoverPopupStyled_Font'>" & cDiscount & "</td></tr>"
3772 cMsg = cMsg & "<tr><td class='hoverPopupStyled_Font'>Exp Date:</td><td class='hoverPopupStyled_Font'>" & cDiscountExpirationDate & "</td></tr>"
3773 cMsg = cMsg & "</table>"
3774
3775 Call ShowPopupStyled(cMsg)
3776 End If
3777End Sub
3778
3779Sub Show_Popup(cMsg)
3780 x = window.event.Clientx + document.body.scrollLeft
3781 y = window.event.Clienty + document.body.scrollTop
3782
3783 If Not Em(cMsg) Then
3784 cPopHTML = "<table border=1 bordercolor=black cellpadding=2 cellspacing=0 bgcolor='FFFFE0'>"
3785 cPopHTML = cPopHTML & "<tr><td>" & cMsg & "</td></tr>"
3786 cPopHTML = cPopHTML & "</table>"
3787 Popup.innerHTML = cPopHTML
3788
3789 cClientWidth = Popup.ClientWidth
3790
3791 cBodyWidth = document.body.ClientWidth
3792 cBodyScroll = document.body.ScrollLeft
3793
3794 If x + cClientWidth >= cBodyWidth + cBodyScroll Then
3795 If x - cClientWidth - 10 >= 0 Then
3796 x = x - cClientWidth - 10
3797 Popup.style.left = x
3798 Else
3799 Popup.style.left = x + 10
3800 End If
3801 Else
3802 Popup.style.left = x + 10
3803 End If
3804
3805 cClientHeight = Popup.ClientHeight
3806
3807 cBodyHeight = document.body.ClientHeight
3808 cBodyScroll = document.body.Scrolltop
3809
3810 If y + cClientHeight >= cBodyHeight + cBodyScroll Then
3811 If y - cClientHeight - 10 >= 0 Then
3812 y = y - cClientHeight - 10
3813 Popup.style.top = y
3814 Else
3815 Popup.style.top = y + 10
3816 End If
3817 Else
3818 Popup.style.top = y + 10
3819 End If
3820
3821 Popup.style.visibility = "visible"
3822 End If
3823End Sub
3824
3825Sub Hide_Popup()
3826 Popup.style.visibility = "hidden"
3827End Sub
3828
3829Sub EditMeasurements(nLine, nCount)
3830 cMeasurementTypeID = document.all(nLine & "PriceByMeasurementTypeID" & nCount).value
3831 cMeasurement = document.all(nLine & "PriceByMeasurementQuantity" & nCount).value
3832
3833 cMeasurementLocation = document.all(nLine & "PriceByMeasurementLocation" & nCount).value
3834 cMeasurementComment = document.all(nLine & "PriceByMeasurementComment" & nCount).value
3835 cMeasurementMinPrice = document.all(nLine & "PriceByMeasurementMinPrice" & nCount).value
3836 cMeasurementUnitPrice = document.all(nLine & "PriceByMeasurementUnitPrice" & nCount).value
3837 cMeasurementBasePrice = document.all(nLine & "PriceByMeasurementBasePrice" & nCount).value
3838 cMeasurementTotalPrice = document.all(nLine & "UnitPrice" & nCount).value
3839 cMeasurementOverride = CStr(document.all(nLine & "PriceByMeasurementOverride" & nCount).value)
3840 cMeasurementPrintDetail = CStr(document.all(nLine & "PriceByMeasurementPrintDetail" & nCount).value)
3841 cMeasurementPriceDate = CStr(document.all(nLine & "PriceByMeasurementPriceDate" & nCount).value)
3842 cMeasurementPriceAdjustor = document.all(nLine & "PriceByMeasurementPriceAdjustor" & nCount).value
3843 cMeasurementPriceAdjustorReasonID = document.all(nLine & "PriceByMeasurementPriceAdjustorReasonID" & nCount).value
3844 cMeasurementCustomerDiscountDollars = document.all(nLine & "PriceByMeasurementCustomerDiscountDollars" & nCount).value
3845 cMeasurementCustomerDiscountPercent = document.all(nLine & "PriceByMeasurementCustomerDiscountPercent" & nCount).value
3846 cMeasurementDiscountExpirationDate = document.all(nLine & "PriceByMeasurementDiscountExpirationDate" & nCount).value
3847
3848 cMeasurementData = window.showModalDialog("/dialog/priceByMeasurement.asp?UseDefaults=0&ServiceID=" & document.all(nLine & "ServiceID" & nCount).value & "&BranchID=" & document.all("BranchID" & nCount).value & "&LocationID=" & document.all("LocationID" & nCount).value & "&MeasurementTypeID=" & cMeasurementTypeID & "&Measurement=" & cMeasurement & "&MeasurementLocation=" & cMeasurementLocation & "&Comment=" & escape(cMeasurementComment) & "&PrintDetail=" & cMeasurementPrintDetail & "&PriceDate=" & cMeasurementPriceDate & "&Override=" & cMeasurementOverride & "&BasePrice=" & cMeasurementBasePrice & "&MinPrice=" & cMeasurementMinPrice & "&UnitPrice=" & cMeasurementUnitPrice & "&TotalPrice=" & cMeasurementTotalPrice & "&PriceAdjustor=" & cMeasurementPriceAdjustor & "&PriceAdjustorReasonID=" & cMeasurementPriceAdjustorReasonID & "&CustomerDiscountDollars=" & cMeasurementCustomerDiscountDollars & "&CustomerDiscountPercent=" & cMeasurementCustomerDiscountPercent & "&DiscountExpirationDate=" & cMeasurementDiscountExpirationDate,,"dialogHeight:575px;dialogWidth:400px")
3849 aMeasurementData = Split(cMeasurementData, "|")
3850
3851 If UBound(aMeasurementData) = 17 Then
3852 document.all(nLine & "PriceByMeasurementTypeID" & nCount).value = aMeasurementData(1)
3853 document.all(nLine & "PriceByMeasurementQuantity" & nCount).value =aMeasurementData(2)
3854 document.all(nLine & "PriceByMeasurementLocation" & nCount).value =aMeasurementData(3)
3855 document.all(nLine & "PriceByMeasurementComment" & nCount).value =aMeasurementData(4)
3856 document.all(nLine & "PriceByMeasurementPrintDetail" & nCount).value =aMeasurementData(5)
3857 document.all(nLine & "PriceByMeasurementPriceDate" & nCount).value =aMeasurementData(6)
3858 document.all(nLine & "PriceByMeasurementBasePrice" & nCount).value = aMeasurementData(7)
3859 document.all(nLine & "PriceByMeasurementUnitPrice" & nCount).value = aMeasurementData(8)
3860 document.all(nLine & "PriceByMeasurementMinPrice" & nCount).value = aMeasurementData(9)
3861 document.all(nLine & "PriceByMeasurementOverride" & nCount).value = aMeasurementData(10)
3862 document.all(nLine & "PriceByMeasurementPriceAdjustor" & nCount).value = aMeasurementData(11)
3863 document.all(nLine & "PriceByMeasurementPriceAdjustorReasonID" & nCount).value = aMeasurementData(12)
3864 document.all(nLine & "PriceByMeasurementCustomerDiscountDollars" & nCount).value = aMeasurementData(13)
3865 document.all(nLine & "PriceByMeasurementCustomerDiscountPercent" & nCount).value = aMeasurementData(14)
3866 document.all(nLine & "PriceByMeasurementDiscountExpirationDate" & nCount).value = aMeasurementData(15)
3867 document.all(nLine & "Quantity" & nCount).value = FormatNumber("1", 2,,False,False)
3868 document.all(nLine & "UnitPrice" & nCount).value =FormatNumber(aMeasurementData(16),2,,False,False)
3869
3870 <% If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseFourDecimalUnitPrice") Then %>
3871 If document.all("OrderType" & nCount).value = "CB" Then
3872 document.all(nLine & "UnitPrice" & nCount).value = "0.0000"
3873 Else
3874 document.all(nLine & "UnitPrice" & nCount).value =FormatNumber(aMeasurementData(16),4,,False,False)
3875 End If
3876 <% Else %>
3877 If document.all("OrderType" & nCount).value = "CB" Then
3878 document.all(nLine & "UnitPrice" & nCount).value = "0.00"
3879 Else
3880 document.all(nLine & "UnitPrice" & nCount).value =FormatNumber(aMeasurementData(16),2,,False,False)
3881 End If
3882 <% End If %>
3883 Call CalculateTaxTotal(nCount)
3884 End If
3885End Sub
3886
3887Sub TechOnBlur(nTechPos, nCount, cBranchID)
3888 cFieldName = "Tech" & nTechPos & "_" & nCount
3889 cFieldNameID = "TechID" & nTechPos & "_" & nCount
3890
3891
3892 Call XMLOnBlur(document.all(cFieldName), document.all(cFieldNameID), "/lookups/techbranches" & cBranchID & "/tech")
3893
3894 If nTechPos = 1 Then
3895 <%
3896 If lCopesan Or lHolders Then
3897 %>
3898 document.all("TechProd1" & nCount).innerHTML = document.all(cFieldName).value
3899 <%
3900 ElseIf lMSC Then
3901 %>
3902 document.all("TechActive1_" & nCount).value = True
3903 <%
3904 End If
3905 %>
3906 End If
3907End Sub
3908
3909Sub TechOnKeyDown(nTechPos, nCount, cBranchID)
3910 cFieldName = "Tech" & nTechPos & "_" & nCount
3911
3912 Call XMLOnKeyDown("techbranches" & cBranchID, cFieldName)
3913End Sub
3914
3915Sub OrderTypeOnChange(nCount, lShowDiscount)
3916 <% If IsCustom("ISS128788") Then %>
3917 If jqGetVal("RunsMissed" & nCount) = "1" And jqGetVal("OrderType" & nCount) <> "NS_MISSED" Then
3918 Call jqSetVal("OrderType" & nCount, "NS_MISSED")
3919 End If
3920 <% End If %>
3921
3922 If document.all("OrderType" & nCount).value = "SO" Then
3923 document.all("Payment" & nCount).disabled = False
3924 document.all("MethodOfPayment" & nCount).disabled = False
3925 document.all("Reference" & nCount).disabled = False
3926
3927 If lShowDiscount Then
3928 document.all("Discount" & nCount).disabled = False
3929 document.all("AdjustmentReason" & nCount).disabled = False
3930 End If
3931
3932 <%
3933 If cDefaultPayment = "I" Then
3934 %>
3935 document.all("Payment" & nCount).value = FormatNumber(document.all("NewTotal" & nCount).value,2,,False,False)
3936 <%
3937 Else
3938 %>
3939 document.all("Payment" & nCount).value = FormatNumber(0,2,,False,False)
3940 <%
3941 End If
3942 %>
3943 Else
3944 document.all("Payment" & nCount).disabled = True
3945 document.all("MethodOfPayment" & nCount).disabled = True
3946 document.all("Reference" & nCount).disabled = True
3947
3948 If lShowDiscount Then
3949 document.all("Discount" & nCount).disabled = True
3950 document.all("AdjustmentReason" & nCount).disabled = True
3951 End If
3952
3953 document.all("Payment" & nCount).value = FormatNumber(0,2,,False,False)
3954 End If
3955
3956 <%
3957 If lBugOut Then
3958 %>
3959 If Left(document.all("OrderType" & nCount).value, 2) = "NS" Then
3960 document.all("CreateClone" & nCount).disabled = False
3961 Else
3962 document.all("CreateClone" & nCount).disabled = True
3963 document.all("CreateClone" & nCount).checked = False
3964 End If
3965 <%
3966 End If
3967 %>
3968End Sub
3969
3970<%
3971If lClark Then
3972 %>
3973 Sub CheckEstimateWon(nCount)
3974 If document.all("Post" & nCount).checked Then
3975 If document.all("OrderType" & nCount).value = "EW" Or document.all("IsInitial" & nCount).value = "1" Then
3976 'Clark decided they want to check against Invoice Date, not Work Date, on Estimates -dbb 5/4/06
3977 Set oInvDate = document.all("InvoiceDate" & nCount)
3978 Set oPeriodCutoffDate = document.all("PeriodCutoffDate" & nCount)
3979 <%
3980 If lUsePeriodLockDown Then
3981 %>
3982 If Not Em(oPeriodCutoffDate.value) Then
3983 If CDate(oInvDate.value) <= CDate(oPeriodCutoffDate.value) Then
3984 MsgBox("Invoice Date exists in a closed Period (Cutoff Date " & FormatDate(oPeriodCutoffDate.value) & ")")
3985 oInvDate.focus
3986 Exit Sub
3987 End If
3988 End If
3989 <%
3990 End If
3991 '-
3992 %>
3993 If document.all("EstimateSaved" & nCount).value = "" Then
3994 Call SaveEstimateDialog(nCount)
3995 Else
3996 document.all("EstimateSavedSpan" & nCount).className = "Visible"
3997 End If
3998 Else
3999 document.all("EstimateSavedSpan" & nCount).className = "Hidden"
4000 End If
4001 End If
4002 End Sub
4003
4004 Sub SaveEstimateDialog(nCount)
4005 cOrderID = document.all("OrderID" & nCount).value
4006
4007 If document.all("EstimateSaved" & nCount).value = "" Then
4008 cMode = "New"
4009 Else
4010 cMode = "Edit"
4011 End If
4012
4013 cTechID = document.all("TechID1_" & nCount).value
4014
4015 cWorkDate = document.all("WorkDate" & nCount).value
4016 cWorkTime = document.all("WorkTime" & nCount).value
4017 cWorkAmPm = document.all("WorkAmPm" & nCount).value
4018
4019 If document.all("IsInitial" & nCount).value = "1" Then
4020 cEstimateString = "/reports/custom/ViewEstimate_UpdateSetup.asp" & _
4021 "?Mode=" & cMode & _
4022 "&OrderID=" & cOrderID & _
4023 "&TechID=" & cTechID & _
4024 "&WorkDate=" & cWorkDate & _
4025 "&WorkTime=" & cWorkTime & _
4026 "&WorkAmPm=" & cWorkAmPm
4027
4028 cOK = window.showModalDialog(cEstimateString,,"dialogHeight:440px;dialogWidth:450px")
4029 Else
4030 cEstimateString = "/reports/custom/ViewEstimate.asp" & _
4031 "?Mode=" & cMode & _
4032 "&OrderID=" & cOrderID & _
4033 "&TechID=" & cTechID & _
4034 "&WorkDate=" & cWorkDate & _
4035 "&WorkTime=" & cWorkTime & _
4036 "&WorkAmPm=" & cWorkAmPm
4037
4038 cOK = window.showModalDialog(cEstimateString,,"dialogHeight:578px;dialogWidth:450px")
4039 End If
4040
4041 If cOK = "OK" Then
4042 document.all("EstimateSaved" & nCount).value = "1"
4043 document.all("EstimateSavedSpan" & nCount).className = "Visible"
4044 End If
4045 End Sub
4046 <%
4047End If
4048%>
4049
4050Sub CalculateTaxTotal(nCount)
4051 nSubTotal = 0.00
4052 nTaxable = 0.00
4053
4054 nTaxRate = CDbl(document.all("TaxRate" & nCount).value)
4055 nPST = CDbl(document.all("PST" & nCount).value)
4056 lCanadianTax = document.all("CanadianTax" & nCount).value
4057 lPSTonGST = document.all("PSTonGST" & nCount).value
4058
4059 ' FB 8065 - integrate CCH for automated tax calculations -cdk 3/25/11
4060 If document.all("TaxCode" & nCount).value = "CCH" Then
4061 If CDbl(document.all("OrigSubTotal" & nCount).value) = 0.00 Then
4062 nTaxRate = 0
4063 Else
4064 nTaxRate = CDbl(document.all("OrigTaxTotal" & nCount).value) / CDbl(document.all("OrigSubTotal" & nCount).value)
4065 End If
4066 End If
4067
4068 For nLine = 1 To document.all("Lines" & nCount).value
4069 If Not (document.all(nLine & "DeleteLine" & nCount) Is Nothing) Then
4070 If Not document.all(nLine & "DeleteLine" & nCount).checked Then
4071 If Not Em(document.all(nLine & "ServiceCode" & nCount).value) And _
4072 IsNumeric(document.all(nLine & "UnitPrice" & nCount).value) And _
4073 IsNumeric(document.all(nLine & "Quantity" & nCount).value) Then
4074 nSubTotal = nSubTotal + (CDbl(document.all(nLine & "UnitPrice" & nCount).value) * CDbl(document.all(nLine & "Quantity" & nCount).value))
4075 If document.all(nLine & "Taxable" & nCount).checked Then
4076 nTaxable = nTaxable + (CDbl(document.all(nLine & "UnitPrice" & nCount).value) * CDbl(document.all(nLine & "Quantity" & nCount).value))
4077 End If
4078 End If
4079 End If
4080 End If
4081 Next
4082
4083 If lCanadianTax = "0" Then
4084 nTax = nTaxable * nTaxRate
4085 Else
4086 If lPSTonGST = "0" Then
4087 nTax = ((nTaxable * nTaxRate) + (nTaxable * nPST))
4088 Else
4089 nTax = (nTaxable * nTaxRate) + ((nTaxable + (nTaxable * nTaxRate)) * nPST)
4090 End If
4091 End If
4092
4093 document.all("SubTotal" & nCount).value = FormatNumber(nSubTotal,2,,False,False)
4094 document.all("TaxTotal" & nCount).value = FormatNumber(nTax,2,,False,False)
4095 document.all("NewTotal" & nCount).value = FormatNumber(nSubTotal + nTax,2,,False,False)
4096
4097 ' update payment total '
4098 <%
4099 If cDefaultPayment = "I" Then
4100 %>
4101 If document.all("Payment" & nCount).disabled = False Then
4102 document.all("Payment" & nCount).value = FormatNumber(nSubTotal + nTax,2,,False,False)
4103 End If
4104 <%
4105 End If
4106 %>
4107
4108 <%
4109 If lUseProductionValue Then
4110 %>
4111 If Not window.event.srcElement Is Nothing Then
4112 If UCase(window.event.srcElement.tagname) = "INPUT" Then
4113 If InStr(window.event.srcElement.name,"UnitPrice") > 0 Then
4114 nLine = Replace(window.event.srcElement.name, "UnitPrice" & nCount, "")
4115 cBranchID = document.all("BranchID" & nCount).value
4116
4117 <%
4118 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("PriceServiceByBranch") Then
4119 %>
4120 Set oServiceNode = Lookups.selectSingleNode("/lookups/servicebranches" & cBranchID & "/service[@id=" & document.all(nLine & "ServiceID" & nCount).value & "]")
4121 <%
4122 Else
4123 %>
4124 Set oServiceNode = Lookups.selectSingleNode("/lookups/services/service[@id=" & document.all(nLine & "ServiceID" & nCount).value & "]")
4125 <%
4126 End If
4127 %>
4128 If Not oServiceNode Is Nothing Then
4129 document.all(nLine & "ProductionValue" & nCount).value = FormatNumber(CDbl(document.all(nLine & "UnitPrice" & nCount).value) * CDbl(oServiceNode.selectSingleNode("defaultproductionvalue").text),2,,False,False)
4130 End If
4131 End If
4132 End If
4133 End If
4134 <%
4135 End If
4136 %>
4137End Sub
4138
4139Sub UpdateHeaderDate(nCount)
4140 If IsDate(document.all("WorkDate" & nCount).value) Then
4141 <%
4142 If lClark Then
4143 %>
4144 If IsDate(document.all("OldWorkDate" & nCount).value) Then
4145 If DateDiff("m", document.all("OldWorkDate" & nCount).value, document.all("WorkDate" & nCount).value) > 0 Then
4146 alert "Work Date cannot be moved outside the original month"
4147 dDate = CDate(document.all("OldWorkDate" & nCount).value)
4148 cString = WeekDayName(WeekDay(dDate),1) & " - " & FormatDateShort(dDate)
4149 document.all("HeaderDate" & nCount).innerHtml = cString
4150 document.all("WorkDate" & nCount).value = document.all("OldWorkDate" & nCount).value
4151 document.all("WorkDate" & nCount).focus
4152 Else
4153 dDate = CDate(document.all("WorkDate" & nCount).value)
4154 cString = WeekDayName(WeekDay(dDate),1) & " - " & FormatDateShort(dDate)
4155 document.all("HeaderDate" & nCount).innerHtml = cString
4156 <%
4157 If cDefaultInvDate = "W" Then
4158 %>
4159 document.all("InvoiceDate" & nCount).value = FormatDate(dDate)
4160 <%
4161 End If
4162 %>
4163 End If
4164 End If
4165 <%
4166 Else
4167 %>
4168 dDate = CDate(document.all("WorkDate" & nCount).value)
4169 cString = WeekDayName(WeekDay(dDate),1) & " - " & FormatDateShort(dDate)
4170 document.all("HeaderDate" & nCount).innerHtml = cString
4171
4172 <%
4173 If cDefaultInvDate = "W" Then
4174 %>
4175 document.all("InvoiceDate" & nCount).value = FormatDate(dDate)
4176 <%
4177 End If
4178 End If
4179 %>
4180 Else
4181 document.all("HeaderDate" & nCount).innerHtml = ""
4182 End If
4183End Sub
4184
4185<%
4186If Not lLockGL Then
4187 %>
4188 Sub GLARCodeOnBlur(nCount)
4189 Call XMLOnBlur(document.all("GLARCode" & nCount), document.all("GLARCodeID" & nCount), "/lookups/glcodes/glcode")
4190 End Sub
4191
4192 Sub GLARCodeOnKeyDown(nCount)
4193 Call XMLOnKeyDown("glcodes", "GLARCode" & nCount)
4194 End Sub
4195 <%
4196End If
4197
4198If lUseChemicals And lShowChemical Then
4199 %>
4200 Function resolveAreaID(nID, nOrderIndex)
4201 resolveAreaID = ""
4202 cTotalAreas = document.getElementByID("ChemTotalAreas" & nOrderIndex).value
4203 arrAreaMap = Split(cTotalAreas, "|")
4204 For idx = 0 To UBound(arrAreaMap)
4205 aItem = Split(arrAreaMap(idx), ",")
4206 If CDbl(aItem(0)) = CDbl(nID) Then
4207 resolveAreaID = aItem(1)
4208 End If
4209 Next
4210 End Function
4211
4212 Sub butChemAreasOnClick(nChemIndex, nOrderIndex)
4213 Set oArea = document.getElementByID(nChemIndex & "ChemAreas" & nOrderIndex)
4214 cChemLineID = document.getElementByID(nChemIndex & "OrderChemLineID" & nOrderIndex).value
4215 cLocationID = document.all("LocationID" & nOrderIndex).value
4216 cSelected = Replace(document.all(nChemIndex & "ChemAreaIDs" & nOrderIndex).value, ",", "A")
4217 cAreas = window.showModalDialog("/dialog/locationAreas.asp?ChooseMult=1&LocationID=" & cLocationID & "&ChemLineID=" & cChemLineID & "&SelectedAreas=" & cSelected,,"dialogHeight:500px;dialogWidth:500px")
4218
4219 If Not Em(cAreas) Then
4220 If cAreas = "0" Then
4221 oArea.innertext = "(None)"
4222 document.all(nChemIndex & "ChemAreaIDs" & nOrderIndex).value = ""
4223 Else
4224 document.all(nChemIndex & "ChemAreaIDs" & nOrderIndex).value = cAreas & ","
4225 cAreaText = ""
4226 aAreas = Split(cAreas, ",")
4227 For idx = 0 To UBound(aAreas)
4228 If cAreaText <> "" Then
4229 cAreaText = cAreaText & ", " & resolveAreaID(aAreas(idx), nOrderIndex)
4230 Else
4231 cAreaText = resolveAreaID(aAreas(idx), nOrderIndex)
4232 End If
4233 Next
4234 oArea.innertext = cAreaText
4235 End If
4236 End If
4237 End Sub
4238
4239 Sub butChemTargetsOnClick(nChemCount, nIndex)
4240 Set oTarget = document.getElementByID(nChemCount & "ChemTargets" & CStr(nIndex))
4241 cChemLineID = document.getElementByID(nChemCount & "OrderChemLineID" & nIndex).value
4242 cChemicalID = document.getElementByID(nChemCount & "ChemicalID" & nIndex).value
4243
4244 cSelected = Replace(document.all(nChemCount & "ChemTargetIDs" & nIndex).value, ",", "A")
4245 cReturn = window.showModalDialog("/dialog/chemicalTargetChecklist.asp?ChemicalID=" & cChemicalID & "&ChemLineID=" & cChemLineID & "&SelectedTargets=" & cSelected,,"dialogHeight:500px;dialogWidth:500px")
4246 If Not Em(cReturn) Then
4247 aReturn = Split(cReturn, "|")
4248 cTargets = aReturn(0)
4249 cTargetIDs = aReturn(1)
4250 Else
4251 cTargets = ""
4252 cTargetIDs = ""
4253 End If
4254
4255 If Not Em(cTargets) Then
4256 If cTargets = "0" Or cTargets = "(None)" Then
4257 oTarget.innertext = "(None)"
4258 document.all(nChemCount & "ChemTargetIDs" & nIndex).value = ""
4259 Else
4260 document.all(nChemCount & "ChemTargetIDs" & nIndex).value = cTargetIDs & ","
4261 cTargetText = ""
4262 aTargets = Split(cTargets, ",")
4263 For idx = 0 To UBound(aTargets)
4264 If cTargetText <> "" Then
4265 cTargetText = cTargetText & ", " & aTargets(idx)
4266 Else
4267 cTargetText = aTargets(idx)
4268 End If
4269 Next
4270 oTarget.innertext = cTargetText
4271 End If
4272 End If
4273
4274 End Sub
4275
4276 Sub UnitOfMeasureOnBlur(nLine, nCount)
4277 ApprovedChemicals nLine, nCount, "units", "UnitsOfMeasure"
4278 Call XMLOnBlur(document.all(nLine & "UnitOfMeasure" & nCount), document.all(nLine & "UnitOfMeasureID" & nCount), "/lookups/units/unit")
4279 End Sub
4280
4281 Sub UnitOfMeasureOnKeyDown(nLine, nCount)
4282 ApprovedChemicals nLine, nCount, "units", "UnitsOfMeasure"
4283 Call XMLOnKeyDown("units", nLine & "UnitOfMeasure" & nCount)
4284 End Sub
4285
4286 Sub UndilutedUOMOnBlur(nLine, nCount)
4287 Call XMLOnBlur(document.all(nLine & "UndilutedUOM" & nCount), document.all(nLine & "UndilutedUOMID" & nCount), "/lookups/units/unit")
4288 End Sub
4289
4290 Sub UndilutedUOMOnKeyDown(nLine, nCount)
4291 Call XMLOnKeyDown("units", nLine & "UndilutedUOM" & nCount)
4292 End Sub
4293
4294 Sub MethodOfApplOnBlur(nLine, nCount)
4295 ApprovedChemicals nLine, nCount, "methodofappls", "ApplicationMethod"
4296 Call XMLOnBlur(document.all(nLine & "MethodOfAppl" & nCount), document.all(nLine & "MethodID" & nCount), "/lookups/methodofappls/methodofappl")
4297 End Sub
4298
4299 Sub MethodOfApplOnKeyDown(nLine, nCount)
4300 ApprovedChemicals nLine, nCount, "methodofappls", "ApplicationMethod"
4301 Call XMLOnKeyDown("methodofappls", nLine & "MethodOfAppl" & nCount)
4302 End Sub
4303
4304 Sub ApplicationEquipmentOnKeyDown(nLine, nCount)
4305 ApprovedChemicals nLine, nCount, "applicationequipment", "Equipment"
4306 Call XMLOnKeyDown("applicationequipment", nLine & "ApplicationEquipmentCode" & nCount)
4307 End Sub
4308
4309 Sub ApplicationEquipmentOnBlur(nLine, nCount)
4310 ApprovedChemicals nLine, nCount, "applicationequipment", "Equipment"
4311 Call XMLOnBlur(document.all(nLine & "ApplicationEquipmentCode" & nCount), document.all(nLine & "ApplicationEquipmentID" & nCount), "/lookups/applicationequipment/applicationequipment")
4312 End Sub
4313
4314 Sub ApplicationRateOnKeyDown(nLine, nCount)
4315 ApprovedChemicals nLine, nCount, "applicationrate", "ApplicationRate"
4316 Call XMLOnKeyDown("applicationrate", nLine & "ApplicationRateCode" & nCount)
4317 End Sub
4318
4319 Sub ApplicationRateOnBlur(nLine, nCount)
4320 ApprovedChemicals nLine, nCount, "applicationrate", "ApplicationRate"
4321 Call XMLOnBlur(document.all(nLine & "ApplicationRateCode" & nCount), document.all(nLine & "ApplicationRateID" & nCount), "/lookups/applicationrate/applicationrate")
4322 End Sub
4323
4324 Sub ClearChemicalFields(nLine, nCount)
4325 document.all(nLine & "Qty" & nCount).value = ""
4326 document.all(nLine & "UnitOfMeasureID" & nCount).value = ""
4327 document.all(nLine & "UnitOfMeasure" & nCount).value = ""
4328 document.all(nLine & "DilutionFactor1_" & nCount).value = ""
4329 document.all(nLine & "DilutionFactor2_" & nCount).value = ""
4330 document.all(nLine & "DilutionFactorDisplay" & nCount).innerText = ""
4331 document.all(nLine & "UndilutedQty" & nCount).value = ""
4332 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = ""
4333 document.all(nLine & "UndilutedUOMID" & nCount).value = ""
4334 document.all(nLine & "UndilutedUOM" & nCount).value = ""
4335 document.all(nLine & "MethodID" & nCount).value = ""
4336 document.all(nLine & "MethodOfAppl" & nCount).value = ""
4337 document.all(nLine & "LotNumber" & nCount).value = ""
4338 document.all(nLine & "DeleteChemLine" & nCount).checked = False
4339 document.all(nLine & "OChemicalCode" & nCount).value = ""
4340 document.all(nLine & "ChemGroupID" & nCount).value = ""
4341 document.all(nLine & "DilutionCalcType" & nCount).value = ""
4342 document.all(nLine & "ChemicalComment" & nCount).value = ""
4343 document.all(nLine & "ApplicationEquipmentCode" & nCount).value = ""
4344 document.all(nLine & "ApplicationRateCode" & nCount).value = ""
4345 document.all(nLine & "DilutionFactorTextBox" & nCount).classname = "Visible"
4346 document.all(nLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
4347 document.all(nLine & "UndilutedUOM" & nCount).readonly = False
4348 document.all(nLine & "ChemicalLineChanged" & nCount).value = ""
4349 ' FB 10422 - tll - 1/18/2012 - need to clear this also so it will do the auto calculate
4350 document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = ""
4351
4352 lNewChemical = False
4353 End Sub
4354
4355 Sub ChemicalOnBlur(nLine, nCount)
4356 Set oNode = XMLOnBlur(document.all(nLine & "ChemicalCode" & nCount), document.all(nLine & "ChemicalID" & nCount), "/lookups/chemicals/chemical")
4357' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4358 document.all(nLine & "UndilutedUOM" & nCount).readonly = False
4359 cUOMReadOnlyValue = False
4360
4361 If oNode Is Nothing Then
4362 Call ClearChemicalFields(nLine, nCount)
4363 Else
4364 cDilutionCalcType = oNode.selectSingleNode("dilutioncalctype").text
4365 cDilutionCalcTypeOld = document.all(nLine & "DilutionCalcType" & nCount).value
4366
4367 If cDilutionCalcType <> cDilutionCalcTypeOld Then
4368 Call ClearChemicalFields(nLine, nCount)
4369 End If
4370
4371 If Em(document.all(nLine & "OChemicalCode" & nCount).value) Then
4372 <%
4373 If lSelect Then
4374 %>
4375 document.all(nLine & "Qty" & nCount).value = FormatNumber(oNode.selectSingleNode("quantity").text,4,,False,False)
4376 <%
4377 Else
4378 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("DefaultSetupChemicalQuantityToZero") Then
4379 nDefaultChemQty = 0
4380 Else
4381 nDefaultChemQty = 1
4382 End If
4383 %>
4384 document.all(nLine & "Qty" & nCount).value = FormatNumber(<%=nDefaultChemQty%>,4,,False,False)
4385 <%
4386 End If
4387 %>
4388 document.all(nLine & "UnitOfMeasure" & nCount).value = oNode.selectSingleNode("unitofmeasure").text
4389
4390 If Em(oNode.selectSingleNode("acceptabledilutionfactors").text) Then
4391 document.all(nLine & "DilutionInputMethod" & nCount).Value = "T"
4392
4393' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4394 If InStr("DO", cDilutionCalcType) > 0 Then
4395 If cDilutionCalcType = "O" Then
4396 document.all(nLine & "DilutionFactor1_" & nCount).value = FormatNumber(oNode.selectSingleNode("dilutionfactor").text,8,,False,False)
4397 cUOMReadOnlyValue = False
4398 Else
4399 If <%=cChemicalAutoCalcOnBlur%> <> "1" Then
4400 document.all(nLine & "DilutionFactor1_" & nCount).value = FormatNumber(oNode.selectSingleNode("firstpreferreddilution").text,8,,False,False)
4401 Else
4402 document.all(nLine & "DilutionFactor1_" & nCount).value = FormatNumber("0.000",8,,False,False)
4403 End If
4404 cUOMReadOnlyValue = True
4405 End If
4406 document.all(nLine & "DilutionFactorTextBox" & nCount).classname = "Visible"
4407 document.all(nLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
4408 <%
4409 If cChemicalAutoCalcOnBlur <> "1" Then
4410 %>
4411 'document.all(nLine & "DilutionFactor1_" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 1
4412 <%
4413 Else
4414 %>
4415 'document.all(nLine & "DilutionFactor1_" & nCount).tabindex = ""
4416 <%
4417 End If
4418
4419 If cChemicalAutoCalcOnBlur <> "2" Then
4420 %>
4421 'document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 2
4422 <%
4423 Else
4424 %>
4425 'If cDilutionCalcType = "D" Then
4426 ' document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 2
4427 'Else
4428 ' document.all(nLine & "UndilutedQty" & nCount).tabindex = ""
4429 'End If
4430 <%
4431 End If
4432 %>
4433 ElseIf cDilutionCalcType = "P" Then
4434 document.all(nLine & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oNode.selectSingleNode("standardquantity").text,4) & " " & oNode.selectSingleNode("standarduom").text & " per " & oNode.selectSingleNode("unitofmeasure").text
4435 document.all(nLine & "DilutionFactorDisplay" & nCount).className = "Visible"
4436 document.all(nLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
4437 document.all(nLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
4438 <% ' FB 8024 - tll - 3/23/2011 - set the variable instead of the field. This was causing errors. %>
4439 cUOMReadOnlyValue = True
4440 'document.all(nLine & "DilutionFactor1_" & nCount).tabindex = ""
4441 'document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 1
4442 End If
4443 Else
4444 document.all(nLine & "DilutionInputMethod" & nCount).Value = "C"
4445
4446' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4447 If InStr("DO", cDilutionCalcType) > 0 Then
4448 If cDilutionCalcType = "O" Then
4449 document.all(nLine & "DilutionFactor2_" & nCount).value = FormatNumber(oNode.selectSingleNode("dilutionfactor").text,8,,False,False)
4450 cUOMReadOnlyValue = False
4451 Else
4452 If <%=cChemicalAutoCalcOnBlur%> <> "1" Then
4453 document.all(nLine & "DilutionFactor2_" & nCount).value = FormatNumber(oNode.selectSingleNode("firstpreferreddilution").text,8,,False,False)
4454 Else
4455 document.all(nLine & "DilutionFactor2_" & nCount).value = FormatNumber("0.000",8,,False,False)
4456 End If
4457 cUOMReadOnlyValue = True
4458 End If
4459 document.all(nLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
4460 document.all(nLine & "DilutionFactorDropdown" & nCount).classname = "Visible"
4461 <%
4462 If cChemicalAutoCalcOnBlur <> "1" Then
4463 %>
4464 'document.all(nLine & "DilutionFactor2_" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 1
4465 <%
4466 Else
4467 %>
4468 'document.all(nLine & "DilutionFactor2_" & nCount).tabindex = ""
4469 <%
4470 End If
4471
4472 If cChemicalAutoCalcOnBlur <> "2" Then
4473 %>
4474 'document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 2
4475 <%
4476 Else
4477 %>
4478 If cDilutionCalcType = "D" Then
4479 'document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 2
4480 Else
4481 'document.all(nLine & "UndilutedQty" & nCount).tabindex = ""
4482 End If
4483 <%
4484 End If
4485 %>
4486 ElseIf cDilutionCalcType = "P" Then
4487 document.all(nLine & "DilutionFactorDisplay" & nCount).innerText = FormatNumber(oNode.selectSingleNode("standardquantity").text,4) & " " & oNode.selectSingleNode("standarduom").text & " per " & oNode.selectSingleNode("unitofmeasure").text
4488 document.all(nLine & "DilutionFactorDisplay" & nCount).className = "Visible"
4489 document.all(nLine & "DilutionFactorTextBox" & nCount).classname = "Hidden"
4490 document.all(nLine & "DilutionFactorDropdown" & nCount).classname = "Hidden"
4491 <% ' FB 8024 - tll - 3/23/2011 - set the variable instead of the field. This was causing errors. %>
4492 cUOMReadOnlyValue = True
4493 'document.all(nLine & "DilutionFactor1_" & nCount).tabindex = ""
4494 'document.all(nLine & "UndilutedQty" & nCount).tabindex = document.all(nLine & "UnitOfMeasure" & nCount).tabindex + 1
4495 End If
4496 End If
4497
4498 document.all(nLine & "UndilutedUOM" & nCount).value = oNode.selectSingleNode("undiluteduom").text
4499 document.all(nLine & "MethodOfAppl" & nCount).value = oNode.selectSingleNode("methodofappl").text
4500 document.all(nLine & "ApplicationEquipmentCode" & nCount).value = oNode.selectSingleNode("applicationequipment").text
4501 document.all(nLine & "ApplicationRateCode" & nCount).value = oNode.selectSingleNode("applicationrate").text
4502 document.all(nLine & "LotNumber" & nCount).value = ""
4503 document.all(nLine & "DeleteChemLine" & nCount).checked = False
4504 document.all(nLine & "ChemGroupID" & nCount).value = oNode.selectSingleNode("chemgroupid").text
4505 document.all(nLine & "DilutionCalcType" & nCount).value = cDilutionCalcType
4506 End If
4507
4508 'Default the target field in. -dpr 11/09/07
4509 Set oChemTarget = document.getElementByID(CStr(nLine) & "ChemTargets" & CStr(nCount))
4510 If Em(document.getElementByID(CStr(nLine) & "ChemTargetIDs" & CStr(nCount)).value) Then
4511 If oNode.selectSingleNode("target").text = "" Then
4512 oChemTarget.innertext = "(None)"
4513 document.all(CStr(nLine) & "ChemTargetIDs" & CStr(nCount)).value = ""
4514 Else
4515 cTargetCode = oNode.selectSingleNode("target").text
4516 Set oTarget = Lookups.XMLDocument.selectSingleNode("/lookups/targets/target [@code = '" & oNode.selectSingleNode("target").text & "']")
4517 document.all(CStr(nLine) & "ChemTargetIDs" & CStr(nCount)).value = oTarget.Attributes.getNamedItem("id").Text
4518 oChemTarget.innertext = cTargetCode
4519 Set oTarget = Nothing
4520 End If
4521 End If
4522
4523 lNewChemical = (document.all(nLine & "OChemicalCode" & nCount).value <> document.all(nLine & "ChemicalCode" & nCount).value)
4524 document.all(nLine & "OChemicalCode" & nCount).value = document.all(nLine & "ChemicalCode" & nCount).value
4525 End If
4526
4527 Call QtyOnBlur(nLine, nCount)
4528
4529 Call MethodOfApplOnBlur(nLine, nCount)
4530 Call ApplicationEquipmentOnBlur(nLine, nCount)
4531 Call ApplicationRateOnBlur(nLine, nCount)
4532
4533 ' FB12399 - new tab order -- lot order comes next -cdk 7/30/12
4534 'If lNewChemical Then
4535 ' document.all(nLine & "Qty" & nCount).createTextRange().select
4536 'End If
4537' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4538 document.all(nLine & "UndilutedUOM" & nCount).readonly = cUOMReadOnlyValue
4539 End Sub
4540
4541 Sub ChemicalOnKeyDown(nLine, nCount)
4542 Call XMLOnKeyDown("chemicals", nLine & "ChemicalCode" & nCount)
4543 End Sub
4544
4545 Sub QtyOnBlur(nLine, nCount)
4546 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4547
4548 If cDilutionCalcType = "O" Then
4549 <%
4550 If cChemicalAutoCalcOnBlur = "2" Then
4551 'Undilted qty = Qty * DilFactor
4552 %>
4553 If Em(document.all(nLine & "Qty" & nCount).value) Then
4554 document.all(nLine & "UndilutedQty" & nCount).value = ""
4555 Else
4556 nQty = CDbl(document.all(nLine & "Qty" & nCount).value)
4557
4558 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4559 nDilutionFactor = CDbl(Coalesce(document.all(nLine & "DilutionFactor1_" & nCount).value,0))
4560 Else
4561 nDilutionFactor = CDbl(Coalesce(document.all(nLine & "DilutionFactor2_" & nCount).value,0))
4562 End If
4563
4564 If nQty * nDilutionFactor >= 10000 Then
4565 nDilutionFactor = 0
4566 End If
4567
4568 document.all(nLine & "UndilutedQty" & nCount).value = FormatNumber((nQty * nDilutionFactor),4,,False,False)
4569 End If
4570 <%
4571 ElseIf cChemicalAutoCalcOnBlur = "1" Then
4572 'DilFactor = UndilQty / Qty
4573 %>
4574 If Em(document.all(nLine & "Qty" & nCount).value) Or Em(document.all(nLine & "UndilutedQty" & nCount).value) Then
4575 document.all(nLine & "DilutionFactor1_" & nCount).value = ""
4576 document.all(nLine & "DilutionFactor2_" & nCount).value = ""
4577 Else
4578 nQty = CDbl(document.all(nLine & "Qty" & nCount).value)
4579 nUndilQty = CDbl(document.all(nLine & "UndilutedQty" & nCount).value)
4580
4581 If nQty > 0 Then
4582 document.all(nLine & "DilutionFactor1_" & nCount).value = FormatNumber((nUndilQty / nQty),8,,False,False)
4583 document.all(nLine & "DilutionFactor2_" & nCount).value = FormatNumber((nUndilQty / nQty),8,,False,False)
4584 End If
4585 End If
4586 <%
4587 End If
4588 %>
4589' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4590 Else
4591 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4592 cDilutionFactor = cDbl(Coalesce(document.all(nLine & "DilutionFactor1_" & nCount).value,0))
4593 Else
4594 cDilutionFactor = cDbl(Coalesce(document.all(nLine & "DilutionFactor2_" & nCount).value,0))
4595 End If
4596 ' FB 10422 - tll - 1/18/2012 - do not check if dilutionrate is zero see if the calc flag has been set.
4597 If cDilutionCalcType = "D" And <%=cChemicalAutoCalcOnBlur%> = "1" And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4598 Call CalcUndilQtyLabel(nLine, nCount)
4599 Else
4600 ' FB 10422 - tll - 1/18/2012 - do the auto calc if we should instead of showing the exclamation point
4601 If <%=cChemicalAutoCalcOnBlur%> = "2" And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) And ((cDilutionCalcType = "D" And cDilutionFactor <> 0) Or cDilutionCalcType = "P") And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4602 Call CalcUndilQtyLabel(nLine, nCount)
4603 Else
4604 Call SetChemicalLineChangedLabel(nLine, nCount)
4605 End If
4606 End If
4607 End If
4608 End Sub
4609
4610 Sub DilutionFactorOnBlur(nLine, nCount)
4611 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4612
4613 If cDilutionCalcType = "O" Then
4614 <%
4615 If cChemicalAutoCalcOnBlur = "2" Then
4616 'Undilted qty = Qty * DilFactor
4617 %>
4618 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4619 Call vNumBlur(document.all(nLine & "DilutionFactor1_" & nCount), 10,8,1,1,0,1)
4620 Call QtyOnBlur(nLine, nCount)
4621 <%
4622 ' FB 8024 - tll - 5/24/2011 - this was causing the tab order and screen to act funny when adding chemicals took out the "Not cChemicalAutoCalcOnBlur = 1" section
4623 'If Not cChemicalAutoCalcOnBlur = 1 Or lRK Or lBUGMAN Then
4624 If lRK Or lBUGMAN Then
4625 %>
4626 If lValidNum(document.all(nLine & "DilutionFactor1_" & nCount), 10,8,1,1,0,1) And Not window.event.shiftKey Then
4627 document.all(nLine & "UndilutedQty" & nCount).createTextRange().select
4628 End If
4629 <%
4630 End If
4631 %>
4632 Else
4633 Call vNumBlur(document.all(nLine & "DilutionFactor2_" & nCount), 10,8,1,1,0,1)
4634 Call QtyOnBlur(nLine, nCount)
4635 <%
4636 ' FB 8024 - tll - 5/24/2011 - this was causing the tab order and screen to act funny when adding chemicals took out the "Not cChemicalAutoCalcOnBlur = 1" section
4637 'If Not cChemicalAutoCalcOnBlur = 1 Or lRK Or lBUGMAN Then
4638 If lRK Or lBUGMAN Then
4639 %>
4640 If lValidNum(document.all(nLine & "DilutionFactor2_" & nCount), 10,8,1,1,0,1) And Not window.event.shiftKey Then
4641 document.all(nLine & "UndilutedQty" & nCount).createTextRange().select
4642 End If
4643 <%
4644 End If
4645 %>
4646 End If
4647 <%
4648 End If
4649 %>
4650 Else
4651 If cDilutionCalcType = "D" Then
4652 cChemicalCode = document.all(nLine & "ChemicalCode" & nCount).value
4653 cMinLabelDilution = CDbl(Lookups.XMLDocument.selectSingleNode("/lookups/chemicals/chemical[@code='" & cChemicalCode & "']/minlabeldilution").text)
4654 cMaxLabelDilution = CDbl(Lookups.XMLDocument.selectSingleNode("/lookups/chemicals/chemical[@code='" & cChemicalCode & "']/maxlabeldilution").text)
4655
4656 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4657 Set oDilFactor = document.all(nLine & "DilutionFactor1_" & nCount)
4658 Else
4659 Set oDilFactor = document.all(nLine & "DilutionFactor2_" & nCount)
4660 End If
4661
4662 cDilutionFactor = CDbl(oDilFactor.value)
4663
4664 If cDilutionFactor > 0 And (cDilutionFactor < cMinLabelDilution Or cDilutionFactor > cMaxLabelDilution) Then
4665 alert("Dilution must be within " & FormatNumber(cMinLabelDilution, 8) & " and " & FormatNumber(cMaxLabelDilution, 8))
4666 oDilFactor.value = ""
4667 oDilFactor.focus
4668 Exit Sub
4669 End If
4670 End If
4671
4672 ' FB 10422 - tll - 1/18/2012 - do the auto calc if we should instead of showing the exclamation point
4673 If cDilutionCalcType = "D" And <%=cChemicalAutoCalcOnBlur%> = "2" And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) _
4674 And cDilutionFactor <> 0 And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4675 Call CalcUndilQtyLabel(nLine, nCount)
4676 Else
4677 Call SetChemicalLineChangedLabel(nLine, nCount)
4678 End If
4679 End If
4680 End Sub
4681
4682 Sub UndilQtyOnBlur(nLine, nCount)
4683 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4684
4685 If cDilutionCalcType = "O" Then
4686 <%
4687 If cChemicalAutoCalcOnBlur = "1" Then
4688 'DilFactor = UndilQty / Qty
4689 %>
4690 Call vNumBlur(document.all(nLine & "UndilutedQty" & nCount), 11,4,1,1,0,1)
4691 Call QtyOnBlur(nLine, nCount)
4692 <%
4693 End If
4694 %>
4695 Else
4696' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4697 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4698 Set oDilFactor = document.all(nLine & "DilutionFactor1_" & nCount)
4699 Else
4700 Set oDilFactor = document.all(nLine & "DilutionFactor2_" & nCount)
4701 End If
4702 cDilutionFactor = CDbl(oDilFactor.value)
4703 ' FB 10422 - tll - 1/18/2012 - do the auto calc if we should instead of showing the exclamation point
4704 If cDilutionCalcType = "D" and <%=cChemicalAutoCalcOnBlur%> = "1" And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4705 Call CalcUndilQtyLabel(nLine, nCount)
4706 Else
4707 Call SetChemicalLineChangedLabel(nLine, nCount)
4708 End If
4709 End If
4710 End Sub
4711
4712 Sub UndilQtyOnFocus(nLine, nCount)
4713 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4714 cChemicalCode = document.all(nLine & "ChemicalCode" & nCount).value
4715 cUndilQty = CDbl(Coalesce(document.all(nLine & "UndilutedQty" & nCount).value,"0"))
4716
4717' FB 6748 - tll - 12/14/2010 - changes to handle calculating the dilution rate from diluted and raw quantities
4718 If Not Em(cChemicalCode) And cUndilQty = 0 Then
4719 If (cDilutionCalcType = "P") Or (cDilutionCalcType = "D" And "<%=cChemicalAutoCalcOnBlur%>" <> "1") Then
4720 Call CalcUndilQtyLabel(nLine, nCount)
4721 End If
4722 End If
4723 End Sub
4724
4725 Sub CalcUndilQtyLabel(nLine, nCount)
4726' FB 6748 - tll - 12/14/2010 - multiple changes to this routine to handle calculating the dilution rate from diluted and raw quantities in addition to keeping the other calculations intact
4727 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4728 cChemicalID = document.all(nLine & "ChemicalID" & nCount).value
4729 cQty = document.all(nLine & "Qty" & nCount).value
4730 cUOMID = document.all(nLine & "UnitOfMeasureID" & nCount).value
4731 cRawQty = document.all(nLine & "UndilutedQty" & nCount).value
4732
4733 If cDilutionCalcType = "D" Then
4734 If <%=cChemicalAutoCalcOnBlur%> = "1" Then
4735 GetChemicalUsageConversion.selectSingleNode("params/process").text = "getdilution"
4736 cRawUOMID = document.all(nLine & "UndilutedUOMID" & nCount).value
4737 cDilutionFactor = ""
4738 Else
4739 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4740 Set oDilFactor = document.all(nLine & "DilutionFactor1_" & nCount)
4741 Else
4742 Set oDilFactor = document.all(nLine & "DilutionFactor2_" & nCount)
4743 End If
4744
4745 cDilutionFactor = oDilFactor.value
4746 cRawUOMID = ""
4747 GetChemicalUsageConversion.selectSingleNode("params/process").text = "getraw"
4748 End If
4749
4750 Else
4751 cDilutionFactor = ""
4752 cRawUOMID = document.all(nLine & "UndilutedUOMID" & nCount).value
4753 GetChemicalUsageConversion.selectSingleNode("params/process").text = "getraw"
4754 End If
4755
4756 GetChemicalUsageConversion.selectSingleNode("params/chemicalid").text = cChemicalID
4757 GetChemicalUsageConversion.selectSingleNode("params/dilutedquantity").text = cQty
4758 GetChemicalUsageConversion.selectSingleNode("params/diluteduomid").text = cUOMID
4759 GetChemicalUsageConversion.selectSingleNode("params/dilutionrate").text = cDilutionFactor
4760 GetChemicalUsageConversion.selectSingleNode("params/rawuomid").text = cRawUOMID
4761 GetChemicalUsageConversion.selectSingleNode("params/rawquantity").text = cRawQty
4762
4763 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
4764 oXMLHTTP.open "POST", "/xml/getChemicalUOMConvertedValues.asp", False
4765 oXMLHTTP.send GetChemicalUsageConversion.XMLDocument
4766
4767 If oXMLHTTP.statusText = "OK" Then
4768 Set oResponse = oXMLHTTP.responseXML.documentElement
4769
4770 cUndilutedQty = FormatNumber(Coalesce(oResponse.selectSingleNode("rawquantity").text,0),4,,False,False)
4771 cDilutionRate = FormatNumber(Coalesce(oResponse.selectSingleNode("dilutionrate").text,0),4,,False,False)
4772
4773 document.all(nLine & "UndilutedUOMID" & nCount).value = oResponse.selectSingleNode("rawuomid").text
4774 document.all(nLine & "UndilutedUOM" & nCount).value = oResponse.selectSingleNode("rawuomcode").text
4775 document.all(nLine & "UndilutedQty" & nCount).value = cUndilutedQty
4776 If cDilutionRate <> cDilutionFactor Then
4777 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4778 document.all(nLine & "DilutionFactor1_" & nCount).value = cDilutionRate
4779 Else
4780 document.all(nLine & "DilutionFactor2_" & nCount).value = cDilutionRate
4781 End If
4782 End If
4783 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = ""
4784 document.all(nLine & "ChemicalLineChanged" & nCount).value = cChemicalID & FormatNumber(cQty,4,,False,False) & cUOMID & FormatNumber(Coalesce(cDilutionRate,"0"),8,,False,False) & cUndilutedQty
4785 ' FB 10422 - tll - 1/18/2012 - reset this value when calculating here so it can auto calculate again, this routine is called from the click on the red exclamation point
4786 document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = ""
4787 End If
4788 End Sub
4789
4790 Sub SetChemicalLineChangedLabel(nLine, nCount)
4791 cDilutionCalcType = document.all(nLine & "DilutionCalcType" & nCount).value
4792' FB 6748 - tll - 12/14/2010 - multiple changes to this routine to handle the label refresh due to adding the dilution rate calcuation from diluted and raw quantities
4793
4794 If InStr("DP",cDilutionCalcType) > 0 Then
4795 If window.event.keyCode <> 9 And window.event.keyCode <> 16 And Not window.event.altKey Then 'ignore tab, shift, alt
4796 If cDilutionCalcType = "D" Then
4797 If document.all(nLine & "DilutionInputMethod" & nCount).value = "T" Then
4798 Set oDilFactor = document.all(nLine & "DilutionFactor1_" & nCount)
4799 Else
4800 Set oDilFactor = document.all(nLine & "DilutionFactor2_" & nCount)
4801 End If
4802
4803 cDilutionFactor = oDilFactor.value
4804 Else
4805 cDilutionFactor = ""
4806 End If
4807
4808 cChemicalID = document.all(nLine & "ChemicalID" & nCount).value
4809 cQty = FormatNumber(Coalesce(document.all(nLine & "Qty" & nCount).value,0),4,,False,False)
4810 cUOMID = document.all(nLine & "UnitOfMeasureID" & nCount).value
4811 cDilutionFactor = FormatNumber(Coalesce(cDilutionFactor,"0"),8,,False,False)
4812 cUndilutedQty = FormatNumber(Coalesce(document.all(nLine & "UndilutedQty" & nCount).value,0),4,,False,False)
4813
4814 'FB 6748 - tll - 12/14/2010 - label should be smart and know what changed
4815 If <%=cChemicalAutoCalcOnBlur%> = 1 Then
4816 If CDbl(cDilutionFactor) > 0 And cQty > 0 And cUndilutedQty > 0 Then
4817 ' FB 10422 - tll - 01/18/2012 - do the calculation automatically instead of just setting the red ! if we can
4818 If document.all(nLine & "ChemicalLineChanged" & nCount).value <> (cChemicalID & cQty & cUOMID & cDilutionFactor & cUndilutedQty) _
4819 And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value <> "" Then
4820 cMsg = "Components of the Dilution Rate calculation have been modified. Click the exclamation mark to recalculate the Dilution Rate."
4821 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = "<img src='/images/exclamation.gif' style='cursor:hand;' title='" & cMsg & "' onclick='CalcUndilQtyLabel(" & nLine & ", " & nCount & ")' />"
4822 Else
4823 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = ""
4824 End If
4825 End If
4826 ' FB 10422 - tll - 1/18/2012 - do the calculation automatically instead of just setting the red ! if we can
4827 If document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4828 If cDilutionCalcType = "D" And CDbl(cDilutionFactor) = 0 And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) Then
4829 Call CalcUndilQtyLabel(nLine, nCount)
4830 End If
4831 End If
4832 Else
4833 If CDbl(Coalesce(document.all(nLine & "UndilutedQty" & nCount).value,"0")) > 0 Then
4834 ' FB 10422 - tll - 1/18/2012 - do the calculation automatically instead of just setting the red ! if we can
4835 If document.all(nLine & "ChemicalLineChanged" & nCount).value <> (cChemicalID & cQty & cUOMID & cDilutionFactor & cUndilutedQty) _
4836 And document.all(nLine & "ChemicalCalculatedEdited" & nCount).value <> "" Then
4837 cMsg = "Components of the Undiluted Quantity calculation have been modified. Click the exclamation mark to recalculate the Undiluted Quantity."
4838 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = "<img src='/images/exclamation.gif' style='cursor:hand;' title='" & cMsg & "' onclick='CalcUndilQtyLabel(" & nLine & ", " & nCount & ")' />"
4839 Else
4840 document.all(nLine & "ChemicalChangeWarning" & nCount).innerHTML = ""
4841 End If
4842 End If
4843 ' FB 10422 - tll - 1/18/2012 - do the calculation automatically instead of just setting the red ! if we can
4844 If document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4845 If <%=cChemicalAutoCalcOnBlur%> = 2 And (CDbl(Coalesce(document.all(nLine & "UndilutedQty" & nCount).value, "0")) = 0) And Not Em(document.all(nLine & "UndilutedUOMID" & nCount).value) Then
4846 Call CalcUndilQtyLabel(nLine, nCount)
4847 End If
4848 End if
4849 End If
4850 End If
4851 End If
4852 End Sub
4853
4854 Sub DilutionFactorOnKeyDown(nLine, nCount)
4855 Call XMLOnKeyDown("dilutionfactors" & LCase(Replace(document.all(nLine & "ChemicalID" & nCount).Value, " " ,"")), nLine & "DilutionFactor2_" & nCount)
4856 End Sub
4857
4858 ' FB 10422 - tll - 1/18/2012 - routine to set the edited property to true so we have this on a key down for certain fields
4859 Sub SetChemicalCalculatedEdited(nLine, nCount, nFromField)
4860 ' nFromField -> 1 = DilutionRate, 2 = UndilutedQty
4861 If document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "" Then
4862 'ignore tab, shift, alt
4863 If window.event.keyCode <> 9 And window.event.keyCode <> 16 And Not window.event.altKey Then
4864 If nFromField = 1 And <%=cChemicalAutoCalcOnBlur%> = 1 Then
4865 document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "1"
4866 End If
4867 If nFromField = 2 And <%=cChemicalAutoCalcOnBlur%> = 2 Then
4868 document.all(nLine & "ChemicalCalculatedEdited" & nCount).value = "1"
4869 End If
4870 End If
4871 End If
4872 End Sub
4873
4874 Sub AddChemicalOnClick(nCount)
4875 nChemLines = CDbl(document.all("ChemLines" & nCount).value) + 1
4876 nChemRowIndex = CDbl(document.all("NextChemRow" & nCount).value)
4877 nIndex = CDbl(document.all("ChemIndex" & nCount).value)
4878
4879 If nChemLines = 1 Then
4880 document.all("ChemInfoHeader1_" & nCount).className = "Visible"
4881 document.all("ChemInfoHeader2_" & nCount).className = "Visible"
4882 document.all("ChemInfoHeader3_" & nCount).className = "Visible"
4883 document.all("ChemInfoHeaderUnderline" & nCount).className = "Visible"
4884 End If
4885
4886 For Each oElement in frmPost.elements
4887 If oElement.type = "text" Or oElement.type = "textarea" Or oElement.type = "checkbox" Or oElement.type = "select-one" Or oElement.type = "button" Then
4888 If CDbl(oElement.tabindex) >= nIndex Then
4889 oElement.tabindex = oElement.tabindex + <%=nChemIndexIncrement%>
4890 End If
4891 Else
4892 If oElement.type = "hidden" Then
4893 If Left(oElement.name,4) = "Rank" Then
4894 If (CDbl(oElement.value) >= CDbl(document.all("Rank" & nCount).value)) Then
4895 document.all("ChemIndex" & Mid(oElement.name,5)).value = CDbl(document.all("ChemIndex" & Mid(oElement.name,5)).value) + <%=nChemIndexIncrement%>
4896 End If
4897 End If
4898
4899 If Left(oElement.name,8) = "LineRank" Then
4900 If (CDbl(oElement.value) > CDbl(document.all("LineRank" & nCount).value)) Then
4901 document.all("LineIndex" & Mid(oElement.name,9)).value = CDbl(document.all("LineIndex" & Mid(oElement.name,9)).value) + <%=nChemIndexIncrement%>
4902 End If
4903 End If
4904 End If
4905 End If
4906 Next
4907
4908 document.all("ChemLines" & nCount).value = nChemLines
4909
4910 If nChemLines Mod 2 = 0 Then
4911 cRowBgColor = "#e4e8ec"
4912 Else
4913 cRowBgColor = "#d4d8dc"
4914 End If
4915
4916 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
4917 oNewRow.bgcolor = cRowBgColor
4918 nChemRowIndex = nChemRowIndex + 1
4919
4920 Set oNewCell = oNewRow.insertCell()
4921 oNewCell.colspan = "8"
4922 oNewCell.innerHTML = "<img alt='' border=0 height=3 src='/images/blank.gif' width=1>"
4923
4924 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
4925 oNewRow.bgcolor = cRowBgColor
4926 nChemRowIndex = nChemRowIndex + 1
4927
4928 Set oNewCell = oNewRow.insertCell()
4929 oNewCell.innerHTML = "<input type=hidden name='" & nChemLines & "OrderChemLineID" & nCount & "' value='0'>" & _
4930 "<input tabindex=" & ChemicalTabOrder("ChemicalCode", nIndex, <%=lShowExtraChemInfo%>, False) & " type=text name='" & nChemLines & "ChemicalCode" & nCount & "' size=15 maxlength=15 " & _
4931 "onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ChemicalOnKeyDown(" & nChemLines & "," & nCount & "); return false;' value='' onBlur='VBScript:Call ChemicalOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call ChemicalOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
4932 "<input type=hidden name='" & nChemLines & "ChemicalID" & nCount & "' value=''>" & _
4933 "<input type=hidden name='" & nChemLines & "OChemicalCode" & nCount & "' value=''>" & _
4934 "<input type=hidden name='" & nChemLines & "ChemGroupID" & nCount & "' value=''>" & _
4935 "<input type=hidden name='" & nChemLines & "DilutionCalcType" & nCount & "' value=''>" & _
4936 "<input type=hidden name='" & nChemLines & "ChemicalLineChanged" & nCount & "' value=''>" & _
4937 "<input type=hidden name='" & nChemLines & "ChemicalCalculatedEdited" & nCount & "' value=''>"
4938
4939 Set oNewCell = oNewRow.insertCell()
4940 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("Qty", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "Qty" & nCount & "' size=8 maxlength=11 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: QtyOnBlur(" & nChemLines & "," & nCount & "); SetChemicalLineChangedLabel(" & nChemLines & "," & nCount & ")' onkeypress='javascript: vNumKey(this,1)' <% If lSwingle Then %>onkeydown='VBScript:Call QtyOnKeyDown(" & nChemLines & "," & nCount & ")'<%End If %>>"
4941
4942 Set oNewCell = oNewRow.insertCell()
4943 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UnitOfMeasure", nIndex, <%=lShowExtraChemInfo%>, False) & " size=2 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; UnitOfMeasureOnKeyDown(" & nChemLines & "," & nCount & "); return false;' name='" & nChemLines & "UnitOfMeasure" & nCount & "' onBlur='UnitOfMeasureOnBlur(" & nChemLines & "," & nCount & "); SetChemicalLineChangedLabel(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call UnitOfMeasureOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
4944 "<input type=hidden name='" & nChemLines & "UnitOfMeasureID" & nCount & "' value=''>"
4945
4946 Set oNewCell = oNewRow.insertCell()
4947 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("MethodOfAppl", nIndex, <%=lShowExtraChemInfo%>, False) & " size=12 maxlength=15 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; MethodOfApplOnKeyDown(" & nChemLines & "," & nCount & "); return false;' name='" & nChemLines & "MethodOfAppl" & nCount & "' onBlur='VBScript:Call MethodOfApplOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call MethodOfApplOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
4948 "<input type=hidden name='" & nChemLines & "MethodID" & nCount & "' value=''>"
4949
4950 Set oNewCell = oNewRow.insertCell()
4951 oNewCell.rowspan = "3"
4952 oNewCell.innerHTML = "<textarea tabindex=" & ChemicalTabOrder("ChemicalComment", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "ChemicalComment" & nCount & "' rows=5 cols=40></textarea>"
4953
4954 Set oNewCell = oNewRow.insertCell()
4955 oNewCell.innerHTML = "<select tabindex=" & ChemicalTabOrder("SkyConditions", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "SkyConditions" & nCount & "'>" & _
4956 "<option value=''> </option>" & _
4957 "<option value='Clear'>Clear</option>" & _
4958 "<option value='Cloudy'>Cloudy</option>" & _
4959 "<option value='Overcast'>Overcast</option>" & _
4960 "<option value='Rain'>Rain</option>" & _
4961 "<option value='Snow'>Snow</option>" & _
4962 "</select>"
4963
4964 Set oNewCell = oNewRow.insertCell()
4965 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("LinearFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "LinearFootage" & nCount & "' size=5 maxlength=5>"
4966
4967 Set oNewCell = oNewRow.insertCell()
4968 oNewCell.innerHTML = "<input type=checkbox tabindex=" & ChemicalTabOrder("Delete", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "DeleteChemLine" & nCount & "' value='1'>"
4969
4970 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
4971 oNewRow.bgcolor = cRowBgColor
4972 nChemRowIndex = nChemRowIndex + 1
4973
4974 Set oNewCell = oNewRow.insertCell()
4975 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("LotNumber", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "LotNumber" & nCount & "' size=10 maxlength=255>"
4976
4977 Set oNewCell = oNewRow.insertCell()
4978 oNewCell.innerHTML = "<span id='" & nChemLines & "DilutionFactorTextBox" & nCount & "' class='Visible'>" & _
4979 "<input type=text tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "DilutionFactor1_" & nCount & "' size=10 maxlength=10 onblur='javascript: vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(" & nChemLines & ", " & nCount & ");' onkeypress='javascript: vNumKey(this,1)' onkeydown='SetChemicalCalculatedEdited(" & nChemLines & "," & nCount & ", 1);'>" & _
4980 "</span>" & _
4981 "<span id='" & nChemLines & "DilutionFactorDropdown" & nCount & "' class='Hidden'>" & _
4982 "<input type=text tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, <%=lShowExtraChemInfo%>, False) & " onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; DilutionFactorOnKeyDown(" & nChemLines & ", " & nCount & "); return false;' name='" & nChemLines & "DilutionFactor2_" & nCount & "' size=10 onblur='javascript: vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(" & nChemLines & ", " & nCount & ");' onKeyDown='DilutionFactorOnKeyDown(" & nChemLines & ", " & nCount & "); SetChemicalCalculatedEdited(" & nChemLines & "," & nCount & ", 1);'>" & _
4983 "</span>" & _
4984 "<span id='" & nChemLines & "DilutionFactorDisplay" & nCount & "' class='Hidden'></span>" & _
4985 "<input type=hidden name='" & nChemLines & "DilutionInputMethod" & nCount & "' value='T'>"
4986
4987
4988 Set oNewCell = oNewRow.insertCell()
4989 oNewCell.innerHTML = " "
4990
4991 Set oNewCell = oNewRow.insertCell()
4992 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("ApplicationRate", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "ApplicationRateCode" & nCount & "' size=10 maxlength=10 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ApplicationRateOnKeyDown(" & nChemLines & "," & nCount & "); return false;' OnBlur='VBScript:Call ApplicationRateOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call ApplicationRateOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
4993 "<input type=hidden name='" & nChemLines & "ApplicationRateID" & nCount & "' value=''>"
4994
4995 Set oNewCell = oNewRow.insertCell()
4996 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("AirTemperature", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "AirTemperature" & nCount & "' size=3 maxlength=3>"
4997
4998 Set oNewCell = oNewRow.insertCell()
4999 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("SquareFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "BASquareFootage" & nCount & "' size=5 maxlength=5>"
5000
5001 <% If lUseOregonPesticideReport Then %>
5002 Set oNewCell = oNewRow.insertCell()
5003 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("OregonSpecificSite", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "OregonSpecificSiteDescription" & nCount & "' size=10 maxlength=70 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; OregonSpecificSiteOnKeyDown(" & nChemLines & "," & nCount & "); return false;' OnBlur='VBScript:Call OregonSpecificSiteOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call OregonSpecificSiteOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
5004 "<input type=hidden name='" & nChemLines & "OregonSpecificSite" & nCount & "' value=''>"
5005
5006 <%Else%>
5007 Set oNewCell = oNewRow.insertCell()
5008 oNewCell.innerHTML = " "
5009 <%End if%>
5010
5011 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
5012 oNewRow.bgcolor = cRowBgColor
5013 nChemRowIndex = nChemRowIndex + 1
5014
5015 Set oNewCell = oNewRow.insertCell()
5016 oNewCell.innerHTML = " "
5017
5018 Set oNewCell = oNewRow.insertCell()
5019 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UndilutedQty", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "UndilutedQty" & nCount & "' size=9 maxlength=9 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript:UndilQtyOnBlur(" & nChemLines & "," & nCount & ");' onFocus='VBScript:Call UndilQtyOnFocus(" & nChemLines & "," & nCount & ")' onkeypress='javascript: vNumKey(this,1)' onkeydown='SetChemicalCalculatedEdited(" & nChemLines & "," & nCount & ", 2);'>" & _
5020 " <span id='" & nChemLines & "ChemicalChangeWarning" & nCount & "'></span>"
5021
5022 Set oNewCell = oNewRow.insertCell()
5023 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("UndilutedUOM", nIndex, <%=lShowExtraChemInfo%>, False) & " size=2 maxlength=2 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; UndilutedUOMOnKeyDown(" & nChemLines & "," & nCount & "); return false;' name='" & nChemLines & "UndilutedUOM" & nCount & "' >" & _
5024 "<input type=hidden name='" & nChemLines & "UndilutedUOMID" & nCount & "' value=''>"
5025
5026
5027 Set oNewCell = oNewRow.insertCell()
5028 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("ApplicationEquipment", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "ApplicationEquipmentCode" & nCount & "' size=10 maxlength=10 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ApplicationEquipmentOnKeyDown(" & nChemLines & "," & nCount & "); return false;' OnBlur='VBScript:Call ApplicationEquipmentOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call ApplicationEquipmentOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
5029 "<input type=hidden name='" & nChemLines & "ApplicationEquipmentID" & nCount & "' value=''>"
5030
5031 Set oNewCell = oNewRow.insertCell()
5032 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("WindVelocity", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "WindVelocity" & nCount & "' size=3 maxlength=3><select tabindex=" & ChemicalTabOrder("WindDirection", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "WindDirection" & nCount & "'>" & _
5033 "<option value='' selected> </option>" & _
5034 "<option value='N'>N</option>" & _
5035 "<option value='NE'>NE</option>" & _
5036 "<option value='E'>E</option>" & _
5037 "<option value='SE'>SE</option>" & _
5038 "<option value='S'>S</option>" & _
5039 "<option value='SW'>SW</option>" & _
5040 "<option value='W'>W</option>" & _
5041 "<option value='NW'>NW</option>" & _
5042 "</select>"
5043
5044 Set oNewCell = oNewRow.insertCell()
5045 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("CubicFootage", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "STCubicFootage" & nCount & "' size=5 maxlength=5>"
5046
5047 <% If lUseOregonPesticideReport Then %>
5048 Set oNewCell = oNewRow.insertCell()
5049 oNewCell.innerHTML = "<input type=text tabindex=" & ChemicalTabOrder("OregonPurpose", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "OregonPurposeDescription" & nCount & "' size=13 maxlength=35 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; OregonPurposeOnKeyDown(" & nChemLines & "," & nCount & "); return false;' OnBlur='VBScript:Call OregonPurposeOnBlur(" & nChemLines & "," & nCount & ")' onKeyDown='VBScript:Call OregonPurposeOnKeyDown(" & nChemLines & "," & nCount & ")'>" & _
5050 "<input type=hidden name='" & nChemLines & "OregonPurpose" & nCount & "' value=''>"
5051 <%Else%>
5052 Set oNewCell = oNewRow.insertCell()
5053 oNewCell.innerHTML = " "
5054 <%End if%>
5055
5056 Set oNewRow = document.all("Chem" & nCount).insertRow(nChemRowIndex)
5057 oNewRow.bgcolor = cRowBgColor
5058 nChemRowIndex = nChemRowIndex + 1
5059 oNewRow.id = nChemLines & "ExtraChemInfoAreasTargets" & nCount
5060
5061 Set oNewCell = oNewRow.insertCell()
5062 oNewCell.colspan = "4"
5063 oNewCell.innerHTML = "<input type='button' tabindex=" & ChemicalTabOrder("Areas", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "butChemAreas" & nCount & "' value='Areas' onclick='butChemAreasOnClick(""" & nChemLines & """, """ & nCount & """)'> " & _
5064 "<span id='" & nChemLines & "ChemAreas" & nCount & "' Visible=True>(None)</span>" & _
5065 "<input type='hidden' name='" & nChemLines & "ChemAreaIDs" & nCount & "' value='' />"
5066
5067 Set oNewCell = oNewRow.insertCell()
5068 oNewCell.colspan = "4"
5069 oNewCell.innerHTML = "<input type='button' tabindex=" & ChemicalTabOrder("Targets", nIndex, <%=lShowExtraChemInfo%>, False) & " name='" & nChemLines & "butChemTargets" & nCount & "' value='Targets' onclick='butChemTargetsOnClick(""" & nChemLines & """, """ & nCount & """)'> " & _
5070 "<span id='" & nChemLines & "ChemTargets" & nCount & "' Visible=True>(None)</span>" & _
5071 "<input type='hidden' name='" & nChemLines & "ChemTargetIDs" & nCount & "' value='' />"
5072
5073 <%
5074 If lShowExtraChemInfo Then
5075 %>
5076 document.all("ChemIndex" & nCount).value = ChemicalTabOrder("Targets", nIndex, <%=lShowExtraChemInfo%>, False) + 1
5077 <%
5078 Else
5079 %>
5080 document.all("ChemIndex" & nCount).value = ChemicalTabOrder("ChemicalComment", nIndex, <%=lShowExtraChemInfo%>, False) + 1
5081 <%
5082 End If
5083 %>
5084
5085 document.all("NextChemRow" & nCount).value = nChemRowIndex
5086
5087 If lNewChemFocus Then
5088 document.all(nChemLines & "ChemicalCode" & nCount).focus()
5089 End If
5090 End Sub
5091
5092 <%
5093End If
5094%>
5095
5096Sub CommentCodeOnBlur(cField, nCount)
5097 If cField = "Comment" Then
5098 cCommentCode = "CommentCode"
5099 cCommentID = "CommentID"
5100 cComment = "Comment"
5101 Else
5102 cCommentCode = "FieldCommentCode"
5103 cCommentID = "FieldCommentID"
5104 cComment = "FieldComment"
5105 End If
5106
5107 Set oNode = XMLOnBlur(document.all(cCommentCode & nCount), document.all(cCommentID & nCount), "/lookups/comments/comment")
5108 If oNode Is Nothing Then
5109 document.all(cCommentCode & nCount).value = "MISC"
5110 document.all(cCommentID & nCount).value = "0"
5111 document.all(cComment & nCount).value = ""
5112 Else
5113 If oNode.attributes.getNamedItem("code").text = "MISC" Then
5114
5115 document.all(cCommentID & nCount).value = "0"
5116 document.all(cComment & nCount).disabled = False
5117 document.all(cComment & nCount).readonly = False
5118
5119 If lDiscount And cField = "Comment" Then
5120 document.all("Discount" & nDiscountCount).focus
5121 Else
5122 document.all(cComment & nCount).focus
5123 End If
5124 Else
5125 <%
5126 If lGriffin Then
5127 %>
5128 document.all(cCommentCode & nCount).value = "MISC"
5129 document.all(cCommentID & nCount).value = "0"
5130 cCurrentComment = document.all(cComment & nCount).value
5131 document.all(cComment & nCount).value = cCurrentComment & vbCrLf & oNode.attributes.getNamedItem("description").text
5132 document.all(cComment & nCount).disabled = False
5133 document.all(cComment & nCount).readonly = False
5134
5135 If lDiscount And cField = "Comment" Then
5136 document.all("Discount" & nDiscountCount).focus
5137 Else
5138 document.all(cComment & nCount).focus
5139 End If
5140 <%
5141 Else
5142 %>
5143 document.all(cComment & nCount).value = oNode.attributes.getNamedItem("description").text
5144 document.all(cComment & nCount).disabled = True
5145 <%
5146 End If
5147 %>
5148 End If
5149 End If
5150End Sub
5151
5152Sub CommentCodeOnKeyDown(cField, nCount)
5153 Call XMLOnKeyDown("comments", cField & nCount)
5154End Sub
5155
5156Sub BeforeUnload()
5157 window.event.returnValue = "NOTE: Use of the Back and Refresh buttons from this page is STRONGLY DISCOURAGED"
5158End Sub
5159
5160Sub AddServiceOnClick(nCount, cBranchID)
5161 nLines = CDbl(document.all("Lines" & nCount).value) + 1
5162 nIndex = CDbl(document.all("LineIndex" & nCount).value)
5163
5164 If nLines <= <%=nOrderShowLines%> Or <%=lOrderShowMore%> Then
5165 If nLines = 1 Then
5166 For nSpanCount = 0 To 7
5167 document.all("LineSpan" & nCount)(nSpanCount).className = "Visible"
5168 Next
5169 End If
5170
5171 For Each oElement in frmPost.elements
5172 If oElement.type = "text" Or oElement.type = "textarea" Or oElement.type = "checkbox" Or oElement.type = "select-one" Or oElement.type = "button" Then
5173 If CDbl(oElement.tabindex) >= nIndex Then
5174 oElement.tabindex = oElement.tabindex + 8
5175 End If
5176 Else
5177 If oElement.type = "hidden" Then
5178 If Left(oElement.name,8) = "LineRank" Then
5179 If (CDbl(oElement.value) >= CDbl(document.all("LineRank" & nCount).value)) Then
5180 document.all("LineIndex" & Mid(oElement.name,9)).value = CDbl(document.all("LineIndex" & Mid(oElement.name,9)).value) + 8
5181 End If
5182 End If
5183
5184 If Left(oElement.name,4) = "Rank" Then
5185 If (CDbl(oElement.value) >= CDbl(document.all("Rank" & nCount).value)) Then
5186 document.all("ChemIndex" & Mid(oElement.name,5)).value = CDbl(document.all("ChemIndex" & Mid(oElement.name,5)).value) + 8
5187 End If
5188 End If
5189 End If
5190 End If
5191 Next
5192
5193 Set oNewRow = document.all("ServiceLine" & nCount).insertRow(nLines)
5194
5195 document.all("Lines" & nCount).value = nLines
5196
5197 cInnerHTML = ""
5198
5199 Set oNewCell = oNewRow.insertCell()
5200 oNewCell.vAlign = "top"
5201 cInnerHTML = "<input type=hidden name='" & nLines & "OrderLineID" & nCount & "' value='0'>" & _
5202 "<input tabindex=" & nIndex & " type=text name='" & nLines & "ServiceCode" & nCount & "' size=15 maxlength=15 " & _
5203 "onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; ServiceOnKeyDown(" & nLines & "," & nCount & "," & cBranchID & "); return false;' value='' onBlur='VBScript:Call ServiceOnBlur(" & nLines & "," & nCount & "," & cBranchID & ")' onKeyDown='VBScript:Call ServiceOnKeyDown(" & nLines & "," & nCount & "," & cBranchID & ")'>" & _
5204 "<input type=hidden name='" & nLines & "ServiceID" & nCount & "' value=''>" & _
5205 "<input type=hidden name='" & nLines & "ServiceType" & nCount & "' value=''>" & _
5206 "<input type=hidden name='" & nLines & "OServiceCode" & nCount & "' value=''>" & _
5207 "<input type=hidden name='" & nLines & "PriceByMeasurementDelete" & nCount & "' value='0'>" & _
5208 "<input type=hidden name='" & nLines & "PriceByMeasurementBasePrice" & nCount & "' value=''>" & _
5209 "<input type=hidden name='" & nLines & "PriceByMeasurementUnitPrice" & nCount & "' value=''>" & _
5210 "<input type=hidden name='" & nLines & "PriceByMeasurementMinPrice" & nCount & "' value=''>" & _
5211 "<input type=hidden name='" & nLines & "PriceByMeasurementQuantity" & nCount & "' value=''>" & _
5212 "<input type=hidden name='" & nLines & "PriceByMeasurementLocation" & nCount & "' value=''>" & _
5213 "<input type=hidden name='" & nLines & "PriceByMeasurementComment" & nCount & "' value=''>" & _
5214 "<input type=hidden name='" & nLines & "PriceByMeasurementPrintDetail" & nCount & "' value=''>" & _
5215 "<input type=hidden name='" & nLines & "PriceByMeasurementPriceDate" & nCount & "' value=''>" & _
5216 "<input type=hidden name='" & nLines & "PriceByMeasurementOverride" & nCount & "' value=''>" & _
5217 "<input type=hidden name='" & nLines & "PriceByMeasurementPriceAdjustor" & nCount & "' value=''>" & _
5218 "<input type=hidden name='" & nLines & "PriceByMeasurementPriceAdjustorReasonID" & nCount & "' value=''>" & _
5219 "<input type=hidden name='" & nLines & "PriceByMeasurementCustomerDiscountDollars" & nCount & "' value=''>" & _
5220 "<input type=hidden name='" & nLines & "PriceByMeasurementCustomerDiscountPercent" & nCount & "' value=''>" & _
5221 "<input type=hidden name='" & nLines & "PriceByMeasurementDiscountExpirationDate" & nCount & "' value=''>" & _
5222 "<input type=hidden name='" & nLines & "PriceByMeasurementTypeID" & nCount & "' value=''>" & _
5223 "<input type=hidden name='" & nLines & "PriceByMeasurementLineMeasurementID" & nCount & "' value=''>" & _
5224 "<input type=hidden name='" & nLines & "HasDefaultAttribute" & nCount & "' value='0'>"
5225
5226 <%
5227 If lUseChemicals And lLinkChemToService Then
5228 %>
5229 cInnerHTML = cInnerHTML & "<input type=hidden name='" & nLines & "LastServiceCode" & nCount & "' value=''>"
5230 <%
5231 End If
5232 %>
5233
5234 oNewCell.innerHTML = cInnerHTML
5235
5236 Set oNewCell = oNewRow.insertCell()
5237 oNewCell.vAlign = "top"
5238 oNewCell.innerHTML = "<span id='" & nLines & "DescriptionSpan" & nCount & "'>" & _
5239 "<input tabindex=" & nIndex + 1 & " type=hidden name='" & nLines & "HiddenDescription" & nCount & "' value='' onfocus='VBScript:Call DescriptionOnFocus()' onblur='VBScript: Call DescriptionOnBlur()'>" & _
5240 "<input tabindex=" & nIndex + 1 & " type=hidden name='" & nLines & "HiddenDetailedDescription" & nCount & "' value='' onblur='VBScript: Call DescriptionOnBlur()'>" & _
5241 "<input tabindex=" & nIndex + 1 & " type=text name='" & nLines & "Description" & nCount & "' size=30 maxlength=50 value='' onfocus='VBScript:Call DescriptionOnFocus()' onblur='VBScript:Call DescriptionOnBlur()'>" & _
5242 "</span>"
5243
5244 Set oNewCell = oNewRow.insertCell()
5245 oNewCell.vAlign = "top"
5246 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 2 & " name='" & nLines & "Quantity" & nCount & "' size=8 maxlength=8 onBlur='javascript: vNumBlur(this,9,2,1,1,0,1); VBScript: CalculateTaxTotal(" & nCount & ")' onKeyPress='vNumKey(this,1)' value=''>" & _
5247 " <span id='" & nLines & "EditMeasurementsSpan" & nCount & "' style='visibility: hidden; width: 0px' class='Link' onClick='EditMeasurements(" & nLines & "," & nCount & ")' onMouseOut='Hide_Popup()' onMouseOver='ShowMeasurements(" & nLines & "," & nCount & ")'></span>"
5248
5249 Set oNewCell = oNewRow.insertCell()
5250 oNewCell.vAlign = "top"
5251 <%
5252 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseFourDecimalUnitPrice") Then
5253 %>
5254 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 3 & " name='" & nLines & "UnitPrice" & nCount & "' size=11 maxlength=11 onblur='javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: CalculateTaxTotal(" & nCount & ");' onkeypress='javascript: vNumKey(this,1)' value=''>"
5255 <%
5256 Else
5257 %>
5258 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 3 & " name='" & nLines & "UnitPrice" & nCount & "' size=9 maxlength=9 onblur='javascript: vNumBlur(this, 9,2,1,1,0,1); VBScript: CalculateTaxTotal(" & nCount & ");' onkeypress='javascript: vNumKey(this,1)' value=''>"
5259 <%
5260 End If
5261
5262 If lUseProductionValue Then
5263 %>
5264 Set oNewCell = oNewRow.insertCell()
5265 oNewCell.vAlign ="top"
5266 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 4 & " name='" & nLines & "ProductionValue" & nCount & "' size=9 maxlength=9 onblur='javascript: vNumBlur(this, 9,2,1,1,0,1);' onkeypress='javascript: vNumKey(this,1)' value=''>"
5267 <%
5268 End If
5269
5270 If lShowCost Then
5271 %>
5272 Set oNewCell = oNewRow.insertCell()
5273 oNewCell.vAlign = "top"
5274 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 4 & " name='" & nLines & "Cost" & nCount & "' size=9 maxlength=9 <%=VClass("Num","9|2|1|1|0|1")%> value=''>"
5275 <%
5276 Else
5277 %>
5278 Call oNewCell.insertAdjacentHTML("beforeEnd","<input type=hidden name='" & nLines & "Cost" & nCount & "' value='0'>")
5279 <%
5280 End If
5281 %>
5282
5283 Set oNewCell = oNewRow.insertCell()
5284 oNewCell.vAlign = "top"
5285 oNewCell.innerHTML = "<input type=checkbox tabindex=" & nIndex + 5 & " name='" & nLines & "Taxable" & nCount & "' value='1' OnClick='CalculateTaxTotal(" & nCount & ")'>"
5286
5287 Set oNewCell = oNewRow.insertCell()
5288 oNewCell.vAlign = "top"
5289 oNewCell.innerHTML = "<input type=checkbox tabindex=" & nIndex + 6 & " name='" & nLines & "DeleteLine" & nCount & "' value='1' OnClick='CalculateTaxTotal(" & nCount & ")'>"
5290
5291 <%
5292 If lShowGL Then
5293 If lLockGL Then
5294 %>
5295 Set oNewCell = oNewRow.insertCell()
5296 oNewCell.vAlign = "top"
5297 oNewCell.innerHTML = "<input type=text readonly name='" & nLines & "GLCode" & nCount & "' size=10 maxlength=10 <%=VClass("UCase","")%> value=''>" & _
5298 "<input type=hidden name='" & nLines & "GLCodeID" & nCount & "' value=''>"
5299 <%
5300 Else
5301 %>
5302 Set oNewCell = oNewRow.insertCell()
5303 oNewCell.vAlign = "top"
5304 oNewCell.innerHTML = "<input type=text tabindex=" & nIndex + 7 & " name='" & nLines & "GLCode" & nCount & "' size=10 maxlength=10 onkeypress='javascript: vUCaseKey(this)' class='input-lookup' oncontextmenu='javascript: window.event.keyCode = 34; GLCodeLineOnKeyDown(" & nLines & "," & nCount & "); return false;' value='' onBlur='VBScript:Call GLCodeLineOnBlur(" & nLines & "," & nCount & ")' onKeyDown='VBScript:Call GLCodeLineOnKeyDown(" & nLines & "," & nCount & ")'>" & _
5305 "<input type=hidden name='" & nLines & "GLCodeID" & nCount & "' value=''>"
5306 <%
5307 End If
5308 Else
5309 %>
5310 Set oNewCell = oNewRow.insertCell()
5311 oNewCell.vAlign = "top"
5312 oNewCell.innerHTML = " " & _
5313 "<input type=hidden name='" & nLines & "GLCode" & nCount & "' value=''>" & _
5314 "<input type=hidden name='" & nLines & "GLCodeID" & nCount & "' value=''>"
5315 <%
5316 End If
5317
5318 If Not lShowCost Then
5319 %>
5320 Set oNewCell = oNewRow.insertCell()
5321 oNewCell.vAlign = "top"
5322 oNewCell.innerHTML = " "
5323 <%
5324 End If
5325
5326 If lNJLawn And Not lUseProductionValue Then
5327 %>
5328 Set oNewCell = oNewRow.insertCell()
5329 oNewCell.vAlign = "top"
5330 oNewCell.innerHTML = "<input type=checkbox tabindex=" & nIndex + 8 & " name='" & nLines & "ProductionValue" & nCount & "' value='-54321' />"
5331 <%
5332 End If
5333 %>
5334
5335 If nLines = <%=nOrderShowLines%> And Not <%=lOrderShowMore%> Then
5336 document.all("AddService" & nCount).className = "Hidden"
5337 End If
5338
5339 document.all(nLines & "ServiceCode" & nCount).focus()
5340 End If
5341End Sub
5342
5343<%
5344If Not lLockGL Then
5345 %>
5346 Sub GLCodeLineOnBlur(nLine, nCount)
5347 Call XMLOnBlur(document.all(nLine & "GLCode" & nCount), document.all(nLine & "GLCodeID" & nCount), "/lookups/glcodes/glcode")
5348 End Sub
5349
5350 Sub GLCodeLineOnKeyDown(nLine, nCount)
5351 Call XMLOnKeyDown("glcodes", nLine & "GLCode" & nCount)
5352 End Sub
5353 <%
5354End If
5355%>
5356
5357Sub PaymentOnFocus(nCount)
5358 document.all("Payment" & nCount).select
5359End Sub
5360
5361Sub DiscountOnFocus(nCount)
5362 document.all("Discount" & nCount).select
5363End Sub
5364
5365lDiscount = False
5366nDiscountCount = 0
5367
5368Sub DiscountOnBlur(nCount)
5369 nDiscount = CDbl(Coalesce(document.all("Discount" & nCount).value,0))
5370 nNewTotal = CDbl(Coalesce(document.all("NewTotal" & nCount).value,0))
5371
5372 nDiscountCount = nCount
5373
5374 If nDiscount > nNewTotal Then
5375 alert ("Discount cannot be greater than Total")
5376 document.all("Discount" & nCount).value = "0.00"
5377 Call SetSelect(document.all("AdjustmentReason" & nCount), "")
5378 lDiscount = True
5379 document.all("Discount" & nCount).focus
5380 Else
5381 lDiscount = False
5382 End If
5383End Sub
5384
5385' added viewinstructions. no longer allowing editing of order instructions from posting screen. -fgd 12/23/2010 FB 6694
5386Sub ViewInstructions(nCount)
5387 cOrderID = document.all("OrderID" & nCount).value
5388
5389 cStatus = window.showModalDialog("/dialog/viewOrderInstructions.asp?OrderID=" & cOrderID,,"dialogHeight:280px;dialogWidth:640px;resizable: yes;")
5390
5391End Sub
5392
5393<%
5394If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LocationNote") = "Y" Then
5395 %>
5396 Sub NoteOnClick(nCount)
5397 cLocationID = document.all("LocationID" & nCount).value
5398 cOrderID = document.all("OrderID" & nCount).value
5399
5400 <% If lPestrite Then %>
5401 cStatus = window.showModalDialog("/dialog/PostNote.asp?LocationID=" & cLocationID & "&OrderID=" & cOrderID,,"dialogHeight:430px;dialogWidth:740px")
5402 <% Else %>
5403 cStatus = window.showModalDialog("/dialog/PostNote.asp?LocationID=" & cLocationID & "&OrderID=" & cOrderID,,"dialogHeight:240px;dialogWidth:640px")
5404 <% End If %>
5405 End Sub
5406 <%
5407End If
5408
5409If lPioneer338376 Then
5410 %>
5411 Sub CopyTechNoteOnClick(nCount)
5412 cLocationID = document.all("LocationID" & nCount).value
5413 cOrderID = document.all("OrderID" & nCount).value
5414 cStatus = window.showModalDialog("/dialog/PostNote.asp?LocationID=" & cLocationID & "&OrderID=" & cOrderID & "&TechNote=" & URLEncode(document.all("FieldComment" & nCount).value) & "&CopyTechNote=1",,"dialogHeight:240px;dialogWidth:640px")
5415 End Sub
5416 <%
5417End If
5418
5419If lSuburban Then
5420 %>
5421 Sub TaskOnClick(nCount)
5422 cLocationID = document.all("LocationID" & nCount).value
5423 window.Open("/task/detail.asp?Mode=New&LocationID=" & cLocationID & "&NextPage=Location")
5424 End Sub
5425 <%
5426End If
5427
5428If lSwingle Then
5429 %>
5430 Sub UnprintOnClick(nRow)
5431 If document.all("Unprint" & nRow).checked Then
5432 document.all("Post" & nRow).checked = False
5433 End If
5434 End Sub
5435
5436 Sub PostOnClick(nRow)
5437 If document.all("Post" & nRow).checked Then
5438 document.all("Unprint" & nRow).checked = False
5439 End If
5440 End Sub
5441
5442 Sub ServiceOrderAttributeOnKeyDown(nRow, nItem)
5443 If window.event.keycode = 13 Then
5444 If nItem = 6 Then
5445 If Not document.all("1Qty" & nRow) Is Nothing Then
5446 If Em(document.all("1Qty" & nRow).value) Then
5447 document.all("1Qty" & nRow).focus()
5448 Else
5449 document.all("1Qty" & nRow).createTextRange().select
5450 End If
5451 Else
5452 If Not document.all("WorkTime" & (nRow + 1)) Is Nothing Then
5453 document.all("WorkTime" & (nRow + 1)).focus
5454 End If
5455 End If
5456 Else
5457 If Em(document.all("ServiceOrderAttribute" & nRow & "_" & (nItem + 1)).value) Then
5458 document.all("ServiceOrderAttribute" & nRow & "_" & (nItem + 1)).focus()
5459 Else
5460 document.all("ServiceOrderAttribute" & nRow & "_" & (nItem + 1)).createTextRange().select
5461 End If
5462 End If
5463 End If
5464 End Sub
5465
5466 nCurrAttrib = ""
5467
5468 Sub ServiceOrderAttributeOnBlur(nRow, nItem)
5469 If nCurrAttrib <> "" And nCurrAttrib <> nItem Then
5470 Exit Sub
5471 End If
5472
5473 nCurrAttrib = nItem
5474
5475 cAttribDesc = Left(document.all("ServiceOrderAttribute" & nRow & "_" & nItem).value, 3)
5476 If Em(cAttribDesc) Then
5477 document.all("ServiceOrderAttributeID" & nRow & "_" & nItem).value = ""
5478 nCurrAttrib = ""
5479 Exit Sub
5480 End If
5481
5482 Set oAttribute = Lookups.XMLDocument.selectSingleNode("/lookups/attributes/attribute[@description='" & cAttribDesc & "']")
5483 If Not oAttribute Is Nothing Then
5484 document.all("ServiceOrderAttributeID" & nRow & "_" & nItem).value = oAttribute.attributes.getNamedItem("id").text
5485 Else
5486 alert("Invalid Attribute Code")
5487 document.all("ServiceOrderAttribute" & nRow & "_" & nItem).createTextRange().select
5488 End If
5489 nCurrAttrib = ""
5490 End Sub
5491
5492 Sub QtyOnKeyDown(nItem, nRow)
5493 If window.event.keycode = 13 Then
5494 If document.all((nItem + 1) & "Qty" & nRow) Is Nothing Then
5495 If Not document.all("WorkTime" & (nRow + 1)) Is Nothing Then
5496 If Em(document.all("WorkTime" & (nRow + 1)).value) Then
5497 document.all("WorkTime" & (nRow + 1)).focus
5498 Else
5499 document.all("WorkTime" & (nRow + 1)).createTextRange().select
5500 End If
5501 End If
5502 Else
5503 If Em(document.all((nItem + 1) & "Qty" & nRow).value) Then
5504 document.all((nItem + 1) & "Qty" & nRow).focus()
5505 Else
5506 document.all((nItem + 1) & "Qty" & nRow).createTextRange().select
5507 End If
5508 End If
5509 End If
5510 End Sub
5511 <%
5512End If
5513
5514If oOrders.Count <> 0 Then
5515 %>
5516 window.onBeforeUnload = GetRef("BeforeUnload")
5517 <%
5518End If
5519%>
5520
5521Sub WorkTimeOnKeyDown(nCount, nmode)
5522 If window.event.keycode = 13 Then
5523 If nMode = 0 Then
5524 'skip to endtime
5525 document.all("EndTime" & nCount).createTextRange().select
5526 Else
5527 If nCount < <%=oOrders.Count%> Then
5528 'skip to duration of next SO
5529 document.all("Duration" & nCount + 1).createTextRange().select
5530 Else
5531 <%
5532 If Not (CDbl(cEnd) = CDbl(cHits) Or CDbl(cHits) = 0) Then
5533 %>
5534 Call butNext_OnClick()
5535 <%
5536 ElseIf (CDbl(cHits) <> 0) Or (CDbl(cHits) = 0 And cDoneStart <> 1) Then
5537 %>
5538 Call butPostHandler_OnClick()
5539 <%
5540 End If
5541 %>
5542 End If
5543 End If
5544 End If
5545End Sub
5546
5547nIgnoreFocus = False
5548
5549Sub DescriptionOnFocus()
5550 If nIgnoreFocus Then
5551 Exit Sub
5552 End If
5553
5554 window.event.srcElement.createTextRange().select
5555
5556 <%
5557 If lUseDetailedDescription Then
5558 %>
5559 nIgnoreFocus = True
5560 ToggleDetailedDescription window.event.srcElement
5561 nIgnoreFocus = False
5562 <%
5563 End If
5564 %>
5565End Sub
5566
5567Sub DescriptionOnBlur()
5568 Set srcElement = window.event.srcElement
5569
5570 cDescriptionName = Replace(srcElement.name, "Detailed", "")
5571 cHiddenDescriptionName = Replace(cDescriptionName, "Description", "HiddenDescription")
5572 cDetailedDescriptionName = Replace(cDescriptionName, "Description", "DetailedDescription")
5573 cHiddenDetailedDescriptionName = Replace(cDescriptionName, "Description", "HiddenDetailedDescription")
5574
5575 If InStr(srcElement.name, "Detailed") > 0 Then
5576 document.all(cHiddenDetailedDescriptionName).value = srcElement.value
5577 End If
5578
5579 <% If lUseDetailedDescription Then %>
5580 nIgnoreFocus = True
5581 ToggleDetailedDescription window.event.srcElement
5582 nIgnoreFocus = False
5583 <% End If %>
5584End Sub
5585
5586Sub ToggleDetailedDescription(srcElement)
5587 cDescriptionName = Replace(srcElement.name, "Detailed", "")
5588 cHiddenDescriptionName = Replace(cDescriptionName, "Description", "HiddenDescription")
5589 cDetailedDescriptionName = Replace(cDescriptionName, "Description", "DetailedDescription")
5590 cHiddenDetailedDescriptionName = Replace(cDescriptionName, "Description", "HiddenDetailedDescription")
5591
5592 If InStr(srcElement.name, "Detailed") > 0 Then
5593 document.all(cHiddenDetailedDescriptionName).value = srcElement.value
5594 End If
5595
5596 Set oParent = srcElement.parentElement
5597
5598 If InStr(srcElement.name, "Detailed") > 0 Then
5599 Set oDescription = document.createElement("<input type='text' name='" & cDescriptionName & "'/>")
5600 oDescription.onkeydown = document.all(cHiddenDescriptionName).onkeydown
5601 oDescription.onfocus = document.all(cHiddenDescriptionName).onfocus
5602 oDescription.onblur = document.all(cHiddenDescriptionName).onblur
5603 oDescription.tabindex = document.all(cHiddenDescriptionName).tabindex
5604 oDescription.type = "text"
5605 oDescription.size = "30"
5606 oDescription.maxlength = "50"
5607
5608 cDescription = document.all(cHiddenDetailedDescriptionName).value
5609 aDescription = WordWrap(cDescription, 25)
5610 cDescription = aDescription(0)
5611
5612 If cDescription <> document.all(cHiddenDetailedDescriptionName).value Then
5613 oDescription.className = "input-expand"
5614 End If
5615
5616 oDescription.value = cDescription
5617
5618 oParent.appendChild(oDescription)
5619 Else
5620 Set oDetailedDescription = document.createElement("<textarea name='" & cDetailedDescriptionName & "'></textarea>")
5621 oDetailedDescription.onkeydown = document.all(cHiddenDetailedDescriptionName).onkeydown
5622 oDetailedDescription.onblur = document.all(cHiddenDetailedDescriptionName).onblur
5623 oDetailedDescription.rows = "3"
5624 oDetailedDescription.cols = "29"
5625 oDetailedDescription.tabindex = document.all(cHiddenDetailedDescriptionName).tabindex
5626 oDetailedDescription.value = document.all(cHiddenDetailedDescriptionName).value
5627 oParent.appendChild(oDetailedDescription)
5628 oDetailedDescription.focus()
5629 Set oRange = oDetailedDescription.createTextRange()
5630 oRange.collapse(False)
5631 oRange.select()
5632 End If
5633
5634 srcElement.removeNode(True)
5635End Sub
5636
5637Sub EndTimeOnKeyDown(nCount)
5638 If window.event.keycode = 13 Then
5639 If nCount < <%=oOrders.Count%> Or <%=lSwingle%> Then
5640 <% If lSwingle Then %>
5641 If Em(document.all("ServiceOrderAttribute" & nCount & "_1").value) Then
5642 document.all("ServiceOrderAttribute" & nCount & "_1").focus()
5643 Else
5644 document.all("ServiceOrderAttribute" & nCount & "_1").createTextRange().select
5645 End If
5646 <% Else %>
5647 'skip to worktime of next SO'
5648 document.all("WorkTime" & nCount + 1).createTextRange().select
5649 <% End If %>
5650 Else
5651 <%
5652 If Not (CDbl(cEnd) = CDbl(cHits) Or CDbl(cHits) = 0) Then
5653 %>
5654 Call butNext_OnClick()
5655 <%
5656 ElseIf (CDbl(cHits) <> 0) Or (CDbl(cHits) = 0 And cDoneStart <> 1) Then
5657 %>
5658 Call butPostHandler_OnClick()
5659 <%
5660 End If
5661 %>
5662 End If
5663 End If
5664End Sub
5665
5666Sub WorkTimeOnBlur(nLine, nCount)
5667 Call UpdateHourlyRate(nLine, nCount)
5668End Sub
5669
5670Sub EndTimeOnBlur(nLine, nCount)
5671 Call UpdateHourlyRate(nLine, nCount)
5672End Sub
5673
5674Function UpdateHourlyRate(nLine, nCount)
5675 <%
5676 If lAmerican Then
5677 %>
5678 'check that start time, end time, and price/hr fields not empty
5679 If Not document.all("WorkTime" & nCount) Is Nothing And Not document.all("EndTime" & nCount) Is Nothing And Not document.all("UserDef14" & nCount) Is Nothing Then
5680 If Not Em(document.all("WorkTime" & nCount).value) And Not Em(document.all("EndTime" & nCount).value) And Not Em(document.all("UserDef14" & nCount).value) Then
5681 ' multiply duration by hourly rate
5682 CalcDuration(nCount)
5683 nDurationMinutes = DurationToMinutes(document.all("Duration" & nCount).value)
5684 nHourBasedPrice = nDurationMinutes* cDbl(document.all("UserDef14" & nCount).value)/60.0
5685
5686 ' make this value the new price for first service on order if greater than the original price
5687 If nHourBasedPrice > cDbl(document.all("OrigUnitPrice" & nCount).value) Then
5688 document.all("1UnitPrice" & nCount).value = FormatNumber(nHourBasedPrice,2,,False,False)
5689 Else
5690 document.all("1UnitPrice" & nCount).value = document.all("OrigUnitPrice" & nCount).value
5691 End If
5692
5693 CalculateTaxTotal(nCount)
5694 End If
5695 End If
5696 <%
5697 End If
5698 %>
5699End Function
5700
5701Sub DurationOnKeyDown(nCount)
5702 If window.event.keycode = 13 Then
5703 'skip to worktime'
5704 document.all("WorkTime" & nCount).createTextRange().select
5705 End If
5706End Sub
5707
5708<%
5709If lUserDefService Then
5710 %>
5711 Sub UserDefChoiceOnBlur(nLine, cBranchID, nCount)
5712 If lExecUDCOnBlur Then
5713 <%
5714 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDefByBranch") Then
5715 %>
5716 Call XMLOnBlur(document.all("UserDef" & nLine & nCount), document.all("UserDefID" & nLine & nCount), "/lookups/userdefchoicebranches" & cBranchID & "/fieldnum" & nLine & "/userdefchoice")
5717 <%
5718 Else
5719 %>
5720 Call XMLOnBlur(document.all("UserDef" & nLine & nCount), document.all("UserDefID" & nLine & nCount), "/lookups/userdefchoices" & nLine & "/userdefchoice" & nLine)
5721 <%
5722 End If
5723 %>
5724 Else
5725 lExecUDCOnBlur = True
5726 End If
5727 End Sub
5728
5729 Sub UserDefChoiceOnKeyDown(nLine, cBranchID, nCount)
5730 <%
5731 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDefByBranch") Then
5732 %>
5733 Set oFieldNum = Lookups.XMLDocument.selectSingleNode("/lookups/userdefchoicebranches" & cBranchID & "/fieldnum" & nLine)
5734
5735 If Not (oFieldNum Is Nothing) Then
5736 Call XMLOnKeyDown("userdefchoicebranches" & cBranchID & "/fieldnum" & nLine, "UserDef" & nLine & nCount)
5737 End If
5738 <%
5739 Else
5740 %>
5741 Call XMLOnKeyDown("userdefchoices" & nLine, "UserDef" & nLine & nCount)
5742 <%
5743 End If
5744 %>
5745 End Sub
5746 <%
5747End If
5748%>
5749
5750lNewChemFocus = False
5751
5752Sub window_OnLoad()
5753 <%
5754 For nI = 1 To oOrders.Count
5755 %>
5756 Call UpdateHourlyRate(1,<%=nI%>)
5757 <%
5758 If lMiddleton Then
5759 %>
5760 For zI = 1 To 6
5761 Call AddChemicalOnClick(<%=nI%>)
5762 Next
5763 <%
5764 End If
5765
5766 If IsCustom("ISS128788") Then
5767 %>
5768 Call OrderTypeOnChange(<%=nI%>, (jqGetVal("RunsShowDiscount<%=nI%>") = "1"))
5769 <%
5770 End If
5771 Next
5772 %>
5773 window.location = "#Top"
5774 lNewChemFocus = True
5775 <%
5776 If oOrders.Count <> 0 Then
5777 If lShowWorkDate Then
5778 If lEndTime Then
5779 %>
5780 If Not document.all("WorkTime1") Is Nothing Then
5781 frmPost.WorkTime1.createTextRange().select
5782 frmPost.WorkTime1.focus()
5783 End If
5784 <%
5785 Else
5786 %>
5787 If Not document.all("Duration1") Is Nothing Then
5788 frmPost.Duration1.createTextRange().select
5789 frmPost.Duration1.focus()
5790 End If
5791 <%
5792 End If
5793 Else
5794 %>
5795 If Not document.all("Tech1") Is Nothing Then
5796 frmPost.Tech1.createTextRange().select
5797 frmPost.Tech1.focus()
5798 End If
5799 <%
5800 End If
5801 End If
5802 %>
5803
5804 Call window_OnResize()
5805End Sub
5806
5807Sub window_OnResize()
5808 'window will still work for 800x600 but will use more space on a larger resolution
5809 If document.body.clientWidth > 830 Then
5810 document.all("PageTable").style.width = 700
5811 Else
5812 document.all("PageTable").style.width = Max(document.body.clientWidth - 140, 645)
5813 End If
5814End Sub
5815
5816Sub document_onkeydown()
5817 If window.event.keyCode = 27 Then
5818 window.event.ReturnValue = false
5819 End If
5820 <%
5821 If lSteritech Then
5822 %>
5823 If window.event.altKey And window.event.keycode = 82 Then
5824 If Typename(window.event.srcElement) = "HTMLInputElement" Or _
5825 Typename(window.event.srcElement) = "HTMLSelectElement" Then
5826 cObjName = window.event.srcElement.name
5827 cCurPos = Len(cObjName)
5828 'Loop backwards through caller name to get sequence #, then order id to pass to modal dialog window
5829 Do While IsNumeric(Mid(cObjName,cCurPos,1))
5830 cSequence = Mid(cObjName,cCurPos,1) & cSequence
5831 cCurPos = cCurPos - 1
5832 Loop
5833 If Instr(cObjName, "UserDef") > 0 Then
5834 'If UserDef, trim off first 2 characters
5835 cSequence = Right(cSequence, Len(cSequence)-2)
5836 End If
5837 cOrderID = document.all("OrderID" & cSequence).value
5838 If Not Em(cOrderID) And Not IsNull(cOrderID) Then
5839 cResult = window.showModalDialog("/dialog/PestRecommendations.asp?OrderID=" & cOrderID,,"dialogHeight:475px;dialogWidth:500px")
5840 End If
5841 End If
5842 End If
5843 <%
5844 End If
5845%>
5846End Sub
5847
5848<%
5849If lMcCall Then
5850 %>
5851 Sub ChangeOrderNum(nCount)
5852 nOrderID = document.all("OrderID" & nCount).value
5853 nOrderNum = document.all("OrderNum" & nCount).value
5854
5855 nNewOrderNum = window.showModalDialog("/dialog/ChangeOrderNumber.asp?OrderNum=" & nOrderNum,,"dialogHeight:160px;dialogWidth:300px")
5856 If Not Em(nNewOrderNum) Then
5857 cChangeOrderNumber = window.showModalDialog("/dialog/CheckOrderNumber.asp?OrderID=" & nOrderID & "&OrderNum=" & nNewOrderNum,,"dialogHeight:210px;dialogWidth:400px")
5858
5859 If cChangeOrderNumber = "Continue" Then
5860 document.all("OrderNum" & nCount).value = nNewOrderNum
5861 cSpot = "NewNum" & nCount
5862 document.getElementById(cSpot).innerHTML = nNewOrderNum
5863 End If
5864 End If
5865 End Sub
5866 <%
5867End If
5868
5869If lShowTarget Then
5870 If lUseMultipleTargets Then
5871 %>
5872 Sub MultipleTargetSpan_OnClick(nCount, cOrderID)
5873 cTargets = window.showModalDialog("/dialog/OrderTargets.asp?OrderID=" & cOrderID,"","dialogwidth:590px;dialogHeight:680px;toolbar=0;menubar=0;resizable=0;scrollbars=1")
5874 If Not Em(cTargets) Then
5875 document.all("MultipleTargetList" & nCount).innerHtml = cTargets
5876 document.all("MultipleTargetList" & nCount).popuptext = cTargets
5877 End If
5878 End Sub
5879
5880 Sub MultipleTargetListOnClick(nCount)
5881 If document.selection.type = "Text" And Not Em(document.selection.createRange().text) Then Exit Sub
5882 If Len(document.all("MultipleTargetList" & nCount).innerText) < 25 Then Exit Sub
5883
5884 Set oListStyle = document.all("MultipleTargetList" & nCount).style
5885
5886 If oListStyle.getAttribute("overflow") = "hidden" Then
5887 Call oListStyle.setAttribute("height", "")
5888 Call oListStyle.setAttribute("overflow", "")
5889 Else
5890 Call oListStyle.setAttribute("height", "14px")
5891 Call oListStyle.setAttribute("overflow", "hidden")
5892 End If
5893 End Sub
5894 <%
5895 Else
5896 %>
5897 Sub TargetPest_OnBlur(nOrder)
5898 Call XMLOnBlur(document.all("TargetPest" & nOrder), document.all("TargetID" & nOrder), "/lookups/targets/target")
5899 End Sub
5900
5901 Sub TargetPest_OnKeyDown(nOrder)
5902 Call XMLOnKeyDown("targets", "TargetPest" & nOrder)
5903 End Sub
5904 <%
5905 End If
5906End If
5907%>
5908
5909Sub TarfOnClick(cFormID, cOrderID, cLocationID, nCount)
5910
5911 If Not document.all("TechID1_" & nCount) Is Nothing Then
5912 cTechID = document.all("TechID1_" & nCount).value
5913 End If
5914
5915 If Not document.all("WorkDate" & nCount) Is Nothing Then
5916 cWorkDate = document.all("WorkDate" & nCount).value
5917 End If
5918
5919 If Not document.all("1ServiceID" & nCount) Is Nothing Then
5920 cServiceID = document.all("1ServiceID" & nCount).value
5921 End If
5922
5923 If Not document.all("1ChemicalID" & nCount) Is Nothing Then
5924 cChemicalID = document.all("1ChemicalID" & nCount).value
5925 End If
5926
5927 If Not document.all("1Qty" & nCount) Is Nothing Then
5928 cQty = document.all("1Qty" & nCount).value
5929 End If
5930
5931 If Not document.all("1DilutionFactor1_" & nCount) Is Nothing Then
5932 cPercent = document.all("1DilutionFactor1_" & nCount).value
5933 End If
5934
5935 If Not document.all("1BASquareFootage" & nCount) Is Nothing Then
5936 cSquareFootage = document.all("1BASquareFootage" & nCount).value
5937 End If
5938
5939 If Not document.all("1STCubicFootage" & nCount) Is Nothing Then
5940 cLinearFootage = document.all("1STCubicFootage" & nCount).value
5941 End If
5942
5943 window.open "/forms/edit.asp?TARFData=" & cTechID & "|" & cWorkDate & "|" & cServiceID & "|" & cChemicalID & "|" & cQty & "|" & cPercent & "|" & cOrderID & "|" & cSquareFootage & "|" & cLinearFootage & "&AutoCloseWin=1&FormID=" & cFormID & "&LocationID=" & cLocationID & "&OrderID=" & cOrderID & "&Form=AZTARF", "", "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=no"
5944End Sub
5945
5946Sub CheckForm(cFormID, cLocationID, cFormType, nCount)
5947 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
5948
5949 If cFormType = "NPMA99A" Then
5950 cDBFormType = "BuildersCert"
5951 ElseIf cFormType = "NPMA99B" Then
5952 cDBFormType = "NewConstruction"
5953 End If
5954
5955 oXMLHTTP.open "POST", "/xml/SextonCheckForm.asp?FormID=" & cFormID & "&LocationID=" & cLocationID & "&FormType=" & cFormType, False
5956 oXMLHTTP.send
5957
5958 If oXMLHTTP.statusText = "OK" Then
5959 Set oResponse = oXMLHTTP.responseXML.documentElement
5960 cNewFormID = oResponse.selectSingleNode("formid").text
5961
5962 ' Form deleted
5963 If cNewFormID = "-1" Then
5964 document.all("Add" & cDBFormType & nCount).style.visibility = "visible"
5965 document.all("Add" & cDBFormType & nCount).style.display = ""
5966 document.all("Edit" & cDBFormType & nCount).style.visibility = "hidden"
5967 document.all("Edit" & cDBFormType & nCount).style.display = "none"
5968 document.all("Edit" & cDBFormType & nCount).formid = ""
5969 Else 'Form added or edited
5970 document.all("Add" & cDBFormType & nCount).style.visibility = "hidden"
5971 document.all("Add" & cDBFormType & nCount).style.display = "none"
5972 document.all("Edit" & cDBFormType & nCount).style.visibility = "visible"
5973 document.all("Edit" & cDBFormType & nCount).style.display = ""
5974 document.all("Edit" & cDBFormType & nCount).formid = cNewFormID
5975 End If
5976 End If
5977End Sub
5978
5979Sub NewConstructionOnClick()
5980 cFormID = window.event.srcElement.formid
5981 cLocationID = window.event.srcElement.locationid
5982 nCount = Replace(window.event.srcElement.id, "EditNewConstruction", "")
5983 cOrderID = window.event.srcElement.orderid
5984
5985 cTechID = document.all("TechID" & nCount).value
5986 cWorkDate = document.all("WorkDate" & nCount).value
5987
5988 If Not document.all("1ChemicalID" & nCount) Is Nothing Then
5989 cChemicalID = document.all("1ChemicalID" & nCount).value
5990 cQuantity = document.all("1Qty" & nCount).value
5991 cDosage = document.all("1DilutionFactor1_" & nCount).value
5992 cBASquareFootage = document.all("1BASquareFootage" & nCount).value
5993 cLinearFootage = document.all("1STCubicFootage" & nCount).value
5994 Else
5995 cChemicalID = ""
5996 cQuantity = ""
5997 cDosage = ""
5998 cBASquareFootage = ""
5999 cLinearFootage = ""
6000 End If
6001
6002 cPostingData = cWorkDate & "|" & cTechID & "|" & cChemicalID & "|" & cQuantity & "|" & cBASquareFootage & "|" & cLinearFootage & "|" & cDosage
6003
6004 window.open "/forms/edit.asp?AutoCloseWin=1&From=Posting&PostingLine=" & nCount & "&PostingData=" & cPostingData & "&SextonOrderID=" & cOrderID & "&FormID=" & cFormID & "&LocationID=" & cLocationID & "&Form=npma99b", "", "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=no"
6005End Sub
6006
6007Sub AddNewConstructionOnClick()
6008
6009 cFormID = window.event.srcElement.formid
6010 cLocationID = window.event.srcElement.locationid
6011 cOrderID = window.event.srcElement.orderid
6012 nCount = Replace(window.event.srcElement.id, "AddNewConstruction", "")
6013
6014 cTechID = document.all("TechID" & nCount).value
6015 cWorkDate = document.all("WorkDate" & nCount).value
6016
6017 If Not document.all("1ChemicalID" & nCount) Is Nothing Then
6018 cChemicalID = document.all("1ChemicalID" & nCount).value
6019 cQuantity = document.all("1Qty" & nCount).value
6020 cDosage = document.all("1DilutionFactor1_" & nCount).value
6021 cBASquareFootage = document.all("1BASquareFootage" & nCount).value
6022 cLinearFootage = document.all("1STCubicFootage" & nCount).value
6023 Else
6024 cChemicalID = ""
6025 cQuantity = ""
6026 cDosage = ""
6027 cBASquareFootage = ""
6028 cLinearFootage = ""
6029 End If
6030
6031 cPostingData = cWorkDate & "|" & cTechID & "|" & cChemicalID & "|" & cQuantity & "|" & cBASquareFootage & "|" & cLinearFootage & "|" & cDosage
6032
6033 window.open "/forms/edit.asp?Mode=New&From=Posting&PostingData=" & cPostingData & "&AutoCloseWin=1&PostingLine=" & nCount & "&SextonOrderID=" & cOrderID & "&LocationID=" & cLocationID & "&Form=npma99b", "", "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=no"
6034End Sub
6035
6036Sub BuildersCertOnClick()
6037
6038 cFormID = window.event.srcElement.formid
6039 cLocationID = window.event.srcElement.locationid
6040 nCount = Replace(window.event.srcElement.id, "EditBuildersCert", "")
6041
6042 window.open "/forms/edit.asp?AutoCloseWin=1&From=Posting&FormID=" & cFormID & "&PostingLine=" & nCount & "&LocationID=" & cLocationID & "&Form=npma99a", "", "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=no"
6043End Sub
6044
6045Sub AddBuildersCertOnClick()
6046
6047 cFormID = window.event.srcElement.formid
6048 cLocationID = window.event.srcElement.locationid
6049 nCount = Replace(window.event.srcElement.id, "AddBuildersCert", "")
6050
6051 window.open "/forms/edit.asp?Mode=New&From=Posting&AutoCloseWin=1&PostingLine=" & nCount & "&LocationID=" & cLocationID & "&Form=npma99a", "", "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=no"
6052End Sub
6053
6054Sub ServiceOrderAttributeClick(cOrderID, cOrderNum, cBranchID)
6055 cLeft = (screen.width - 742)/2
6056 cTop = (screen.height - 610)/2 - 40
6057
6058 window.showModalDialog "/serviceOrder/Attributes/ServiceOrderAttributes.asp?OrderID=" & cOrderID & "&OrderNum=" & cOrderNum & "&BranchID=" & cBranchID & "&Mode=Edit", "", "dialogHeight:610px;dialogWidth=742px,toolbar=0,menubar=0,resizable=0,scrollbars=0,status=no,cTop=" & cTop & ", cLeft = " &cLeft
6059End Sub
6060
6061Sub ServiceOrderTechsClick(cOrderID, cOrderNum)
6062 cLeft = (screen.width - 590)/2
6063 cTop = (screen.height - 470)/2 - 40
6064
6065 window.open "/dialog/AdditionalTechs.asp?OrderID=" & cOrderID & "&OrderNum=" & cOrderNum, "", "height=470,width=590,toolbar=0,menubar=0,resizable=0,scrollbars=0,status=no,top=" & cTop & ",left=" & cLeft
6066End Sub
6067
6068Sub IVRInfoClick(cOrderID)
6069 cLeft = (screen.width - 590)/2
6070 cTop = (screen.height - 470)/2 - 40
6071
6072 window.open "/dialog/IVRInfo.asp?OrderID=" & cOrderID & "&IsOrder=Y", "", "height=270,width=590,toolbar=0,menubar=0,resizable=0,scrollbars=0,status=no,top=" & cTop & ",left=" & cLeft
6073End Sub
6074
6075'Added for Oregon Report - 2007-11-08 - mja
6076Sub OregonSpecificSiteOnKeyDown(nLine, nCount)
6077 Call XMLOnKeyDown("oregonspecificsite", nLine & "OregonSpecificSiteDescription" & nCount)
6078End Sub
6079
6080Sub OregonSpecificSiteOnBlur(nLine, nCount)
6081 Call XMLOnBlur(document.all(nLine & "OregonSpecificSiteDescription" & nCount), document.all(nLine & "OregonSpecificSite" & nCount), "/lookups/oregonspecificsite/oregonspecificsite")
6082End Sub
6083
6084Sub OregonPurposeOnKeyDown(nLine, nCount)
6085 Call XMLOnKeyDown("oregonpurpose", nLine & "OregonPurposeDescription" & nCount)
6086End Sub
6087
6088Sub OregonPurposeOnBlur(nLine, nCount)
6089 Call XMLOnBlur(document.all(nLine & "OregonPurposeDescription" & nCount), document.all(nLine & "OregonPurpose" & nCount), "/lookups/oregonpurpose/oregonpurpose")
6090End Sub
6091
6092Sub SwingleInvoicePrintOnClick(nCount, lDefaultChecked)
6093 If CBool(lDefaultChecked) Then
6094 document.all("PostingSwingleBatchPrint" & nCount).checked = True
6095 End If
6096End Sub
6097</script>
6098</head>
6099<body>
6100<a name="Top"></a>
6101<div id="Popup" style="position:absolute;visibility:hidden;z-index:500;"></div>
6102<!-- #INCLUDE VIRTUAL="/includes/preserveSession.inc" -->
6103<!-- #INCLUDE VIRTUAL="/includes/header.inc" -->
6104<form name="frmPost" method=post action="post.asp">
6105<input type=hidden name="Mode" value="<%=cMode%>">
6106<input type=hidden name="SearchMode" value="<%=cSearchMode%>">
6107<input type=hidden name="OrderCount" value=<%=oOrders.Count%>>
6108<input type=hidden name="Start" value="<%=cStart%>">
6109<input type=hidden name="BatchID" value="<%=cBatchID%>">
6110<input type=hidden name="OrderID" value="<%=oFields("OrderID")%>">
6111<input type=hidden name="Posted" value="<%=oFields("Posted")%>">
6112<input type=hidden name="InvoiceBatchID" value="<%=oFields("InvoiceBatchID")%>">
6113<input type=hidden name="OrderNum" value="<%=oFields("OrderNum")%>">
6114<input type=hidden name="LocationCode" value="<%=oFields("LocationCode")%>">
6115<input type=hidden name="BillToCode" value="<%=oFields("BillToCode")%>">
6116<input type=hidden name="TechCode" value="<%=oFields("TechCode")%>">
6117<input type=hidden name="Route" value="<%=oFields("Route")%>">
6118<input type=hidden name="Company" value="<%=oFields("Company")%>">
6119<input type=hidden name="LName" value="<%=oFields("LName")%>">
6120<input type=hidden name="BWorkDate" value="<%=oFields("BWorkDate")%>">
6121<input type=hidden name="EWorkDate" value="<%=oFields("EWorkDate")%>">
6122<input type=hidden name="Unscheduled" value="<%=oFields("Unscheduled")%>">
6123<input type=hidden name="Recurring" value="<%=oFields("Recurring")%>">
6124<input type=hidden name="Complete" value="<%=oFields("Complete")%>">
6125<input type=hidden name="Sort" value="<%=oFields("Sort")%>">
6126<input type=hidden name="Sort2" value="<%=oFields("Sort2")%>">
6127<input type=hidden name="OrderNumList" value="<%=oFields("OrderNumList")%>">
6128<input type=hidden name="BranchID" value="<%=oFields("BranchID")%>">
6129<input type=hidden name="PreFillTech" value="<%=cPreFillTech%>">
6130<input type=hidden name="PreFillTechID" value="<%=cPreFillTechID%>">
6131<input type=hidden name="PreFillWorkDate" value="<%=cPreFillWorkDate%>">
6132<input type=hidden name="PreFillOrderType" value="<%=cPreFillOrderType%>">
6133<input type=hidden name="PreFillChemLines" value="<%=nPreFillChemLines%>">
6134<%
6135nCount = 1
6136For Each oItem In oPreFillChemLines
6137 Set oPreFillChem = oPreFillChemLines.Item(oItem)
6138
6139 For Each oItem2 In oPreFillChem
6140 %>
6141 <input type=hidden name="<%=oItem2 & nCount%>" value="<%=oPreFillChem(oItem2)%>">
6142 <%
6143 Next
6144
6145 nCount = nCount + 1
6146Next
6147
6148Set oFields = Nothing
6149%>
6150<table width="100%" border="0" cellspacing="0" cellpadding="0">
6151<tr>
6152<td rowspan="2" width="1%"><img alt="" border=0 height=1 src="/images/blank.gif" width=118 ></td>
6153<td height="40" width="1%"><img alt="" border=0 height=40 src="/images/corner_top-outside.gif" width=12 ></td>
6154<td width="96%" bgcolor="#5d6d7d"><span class="font-title">Post Service Orders
6155<%
6156If (Not Em(cBatchID)) And (cSearchMode = "Add" Or cSearchMode = "Edit") Then
6157%>
6158 (Batch <%=cBatchID%>)
6159<%
6160End If
6161%>
6162</span>
6163<span style="COLOR: #cfd8dc; FONT-WEIGHT: BOLD;">
6164<%=cHits%> Order<%If CDbl(cHits) <> 1 Then Response.Write "s"%>
6165</span>
6166</td>
6167<td width="1%" bgcolor="#5d6d7d" nowrap align="right">
6168<%
6169If CDbl(cHits) <> 0 Then
6170 %>
6171 <button name="butSelAll" class="input-nav" onClick="VBScript:butSelAll_OnClick" accesskey="a">Select <u>A</u>ll</button> <button name="butSelNone" class="input-nav" onClick="VBScript:butSelNone_OnClick" accesskey="o">Select N<u>o</u>ne</button>
6172 <%
6173End If
6174
6175If Not (CDbl(cEnd) = CDbl(cHits) Or CDbl(cHits) = 0) Then
6176 %>
6177 <button name="butNext" class="input-nav" onClick="VBScript:butNext_OnClick" accesskey="n"><u>N</u>ext Page</button>
6178 <%
6179End If
6180
6181If (CDbl(cHits) <> 0) Or (CDbl(cHits) = 0 And cDoneStart <> 1) Then
6182 If lPostBatchInv Then
6183 %>
6184 <button name="butPost" class="input-nav" accesskey="e" onClick="VBScript:butPostHandler_OnClick">Don<u>e</u></button>
6185 <%
6186 Else
6187 %>
6188 <button name="butPost" class="input-nav" accesskey="p" onClick="VBScript:butPostHandler_OnClick"><u>P</u>ost</button>
6189 <%
6190 End If
6191
6192 If IsCustom("ASSURED") Then
6193 %>
6194 <button name="butMove" id="butMove" type="button" class="input-nav" accesskey="m"><u>M</u>ove</button>
6195 <%
6196 End If
6197End If
6198
6199If CDbl(cHits) <> 0 Then
6200 %>
6201 <button name="butCancel" class="input-nav" onClick="VBScript:butCancelHandler_OnClick" accesskey="c"><u>C</u>ancel</button>
6202 <%
6203End If
6204%>
6205</td>
6206<td width="1%" bgcolor="#5d6d7d" ><img alt="" border=0 height=1 src="/images/blank.gif" width=10 ></td>
6207</tr>
6208
6209<tr>
6210<td bgcolor="#cfd8dc" colspan="5"><img alt="" border=0 height=9 src="/images/corner_top-inside.gif" width=12></td>
6211</tr>
6212</table>
6213
6214<table width="100%" border=0 cellspacing=0 cellpadding=0>
6215<tr>
6216<td width="1%" align="middle" valign="top">
6217<!-- #INCLUDE VIRTUAL="/includes/favorites.inc" -->
6218</td>
6219<td bgcolor="#5d6d7d" width="1%"><img alt="" border=0 height=1 src="/images/blank.gif" width=3></td>
6220<td bgcolor="#cfd8dc" width="98%" valign="top">
6221
6222<!-- Begin Workspace -->
6223<%
6224If oOrders.Count = 0 Then
6225 %>
6226 <center><b>No orders matched your search criteria</b></center>
6227 <%
6228End If
6229%>
6230<table id="PageTable" border=0 cellspacing=0 cellpadding=0 width="645" style="position:relative; left:10px;">
6231<tr>
6232<td>
6233<%
6234nIndex = 1
6235nRank = 0
6236nCount = 0
6237
6238' -added pre-fill technician -aw 03/19/02
6239cTechBranchXML = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("TechnicianBranch")
6240' -aw 03/19/02
6241
6242cNotServicedString = ""
6243cNotServicedDefault = ""
6244nRow = 1
6245
6246Set objNotServiced = Server.CreateObject("PestPacLookup.NotServicedReason")
6247Set oNotServiced = objNotServiced.GetActive(oGlobals("Database"), oGlobals("CompanyID"))
6248Set objNotServiced = Nothing
6249Call CheckRSError(oNotServiced)
6250
6251Do Until oNotServiced.EOF
6252 If nRow = 1 Then
6253 cNotServicedDefault = "NS_" & oNotServiced("Code")
6254 End If
6255
6256 cNotServicedString = cNotServicedString & "NS_" & oNotServiced("Code") & " "
6257
6258 nRow = nRow + 1
6259
6260 If oNotServiced.AbsolutePosition Mod 50 = 0 Then Response.Flush
6261 oNotServiced.MoveNext
6262Loop
6263
6264For Each oRow in oOrders
6265 nRank = nRank + 1
6266 nCount = nCount + 1
6267 Set oData = oOrders.Item(oRow)
6268
6269 cTargets = ""
6270
6271 If lUseMultipleTargets Then
6272 Set objOrderTarget = Server.CreateObject("PestPacService.OrderTarget")
6273 Set oTargets = objOrderTarget.GetAllTargets(oGlobals("Database"), oGlobals("CompanyID"), oData("OrderID"))
6274 Set objOrderTarget = Nothing
6275 Call CheckRSError(oTargets)
6276
6277 cTargets = ""
6278 Do Until oTargets.EOF
6279
6280 If Coalesce(oTargets("ServiceOrderTargetID"), 0) <> 0 Then
6281 cTargets = cTargets & oTargets("Code") & ", "
6282 End If
6283
6284 If oTargets.AbsolutePosition Mod 50 = 0 Then Response.Flush
6285 oTargets.MoveNext
6286 Loop
6287
6288 If cTargets = "" Then
6289 If oData("TargetPest") = "" Then
6290 cTargets = "(None)"
6291 Else
6292 cTargets = oData("TargetPest")
6293 End If
6294 Else
6295 cTargets = Left(cTargets, Len(cTargets) - 2)
6296 End If
6297 End If
6298
6299 cOrderID = CStr(oData("OrderID"))
6300 cBranchID = CStr(oData("BranchID"))
6301
6302 cLocationGLCode = oData("LocationGLCode")
6303 cLocationGLCodeID = oData("LocationGLCodeID")
6304 cLocationCode = oData("LocationCode")
6305
6306 lCreditMemoRequired = CBool(Coalesce(oData("ISS_CreditMemoRequired"), "False"))
6307 lRunsMissed = CBool(Coalesce(oData("ISS_RunsMissed"), "False"))
6308 lRunsPosted = oData("Posted")
6309
6310 Set objOrderChemical = Server.CreateObject("PestPacService.OrderChemical")
6311 Set oOrderChemical = objOrderChemical.GetAll(oGlobals("Database"), cOrderID)
6312 Set objOrderChemical = Nothing
6313 Call CheckDictError(oOrderChemical)
6314
6315 nOldChemLines = oOrderChemical.Count
6316
6317 nPreFillChem = 1
6318 For Each oItem In oPreFillChemLines
6319 oOrderChemical.Add "PreFill" & nPreFillChem, oPreFillChemLines.Item(oItem)
6320 nPreFillChem = nPreFillChem + 1
6321 Next
6322
6323 If lCentex Then
6324 If (oGlobals("DefaultBranchID") = 200222 Or _
6325 oGlobals("DefaultBranchID") = 260223 Or _
6326 oGlobals("DefaultBranchID") = 260224 Or _
6327 oGlobals("DefaultBranchID") = 260226 Or _
6328 oGlobals("DefaultBranchID") = 260227 Or _
6329 oGlobals("DefaultBranchID") = 260228 Or _
6330 oGlobals("DefaultBranchID") = 260225) Then
6331
6332 ' Create two dummy chemicals, so two blank sets of chemical fields show up by default -jek 06/18/04
6333 Set oChem1 = Server.CreateObject("Scripting.Dictionary")
6334 oChem1.Add "ChemLineID", "0"
6335 Set oChem2 = Server.CreateObject("Scripting.Dictionary")
6336 oChem2.Add "ChemLineID", "0"
6337 oOrderChemical.Add "A", oChem1
6338 oOrderChemical.Add "B", oChem2
6339 End If
6340 ElseIf lMiddleton Then
6341 Set objCustom = Server.CreateObject("PestPacCustom.Order")
6342 cAdditionalTechShareTotal = objCustom.MiddletonShareTotal(oGlobals("Database"), oGlobals("CompanyID"), oGlobals("UserID"), "", cOrderID, "")
6343 Set objCustom = Nothing
6344 Call CheckError(cAdditionalTechShareTotal)
6345
6346 cAdditionalTechShareTotal = CDbl(cAdditionalTechShareTotal)
6347
6348 If cAdditionalTechShareTotal < 0 Then
6349 cAdditionalTechShareTotal = 0
6350 lAdditionalTechExists = False
6351 Else
6352 lAdditionalTechExists = True
6353 End If
6354 End If
6355
6356 Set objOrderLine = Server.CreateObject("PestPacService.OrderLine")
6357 Set oOrderLines = objOrderLine.GetOrderLineRecordSet(oGlobals("Database"), cOrderID)
6358 Set objOrderLine = Nothing
6359 Call CheckRSError(oOrderLines)
6360
6361 If Not (oData("Posted")) Then
6362 If Not Em(oData("WorkDateFromTechDurations")) Then
6363 If Year(oData("WorkDateFromTechDurations")) > 1902 Then
6364 oData("WorkDate") = oData("WorkDateFromTechDurations")
6365 End If
6366 End If
6367 If oData("DurationFromTechDurations") > 0 Then
6368 oData("Duration") = oData("DurationFromTechDurations")
6369 End If
6370
6371 If lClark Then
6372 Set objOrder1 = Server.CreateObject("PestPacService.Order")
6373 Set oOrder1 = objOrder1.Load(oGlobals("Database"), cOrderID)
6374 CheckDictError(oOrder1)
6375 Set objOrder1 = Nothing
6376 If Not Em(oOrder1("WorkDate")) Then
6377 cOrigWorkDate = FormatDate(oOrder1("WorkDate"))
6378 Else
6379 cOrigWorkDate = Coalesce(FormatDate(oOrder1("OriginalWorkDate")), FormatDate(oData("WorkDate")))
6380 End If
6381 End If
6382
6383 cWorkDate = FormatDate(oData("WorkDate"))
6384 If Em(cWorkDate) Then
6385 If cDefaultInvDate = "T" Then
6386 cWorkDate = FormatDate(Coalesce(cDefaultPostingDate,oGlobals("Date")))
6387 Else
6388 cWorkDate = FormatDate(oGlobals("Date"))
6389 End If
6390 End If
6391
6392 If Not Em(cPreFillWorkDate) Then
6393 cWorkDate = FormatDate(cPreFillWorkDate)
6394 End If
6395
6396 If lClark Then
6397 cOrigWorkDate = Coalesce(cOrigWorkDate, cWorkDate)
6398 End If
6399
6400 ' -added for PestMaster system-wide invoice date -aw 08/29/01'
6401 Select Case cDefaultInvDate
6402 Case "W"
6403 cInvoiceDate = cWorkDate
6404 Case "S"
6405 cInvoiceDate = FormatDate(oGlobals("Date"))
6406 Case "T"
6407 cInvoiceDate = FormatDate(Coalesce(cDefaultPostingDate,oGlobals("Date")))
6408 Case Else
6409 cInvoiceDate = FormatDate(oGlobals("Date"))
6410 End Select
6411
6412 cWorkTime = FormatTime(oData("WorkDate"))
6413 cWorkAmPm = FormatAmPm(oData("WorkDate"))
6414 'Removed this since it's not necessary. If defaultworktime = B, endTime should be blank, not calculated off duration - KM 10062011 - FB 9690
6415 'If cDefaultWorkTime = "B" Then oData("Duration") = 0
6416
6417 cDuration = FormatMinToDur(oData("Duration"))
6418
6419 'changed code to show an empty time if Default Work Duration was set to Blank in setup - KM 10062011 - FB 9690
6420 If (Hour(oData("WorkDate")) = 0 And Minute(oData("WorkDate")) = 0) OR cDefaultWorkTime = "B" Then
6421 cEndDate = ""
6422 cEndAmPm = ""
6423 Else
6424 cEndDate = FormatTime(DateAdd("n", oData("Duration"), oData("WorkDate")))
6425 cEndAmPm = FormatAmPm(DateAdd("n", oData("Duration"), oData("WorkDate")))
6426 End If
6427
6428 If lGuardian Then
6429 oData("Tech1") = ""
6430 oData("TechID1") = Null
6431 End If
6432
6433 '-- Prefill Tech --
6434 If Not Em(cPreFillTech) Then
6435 nStart = InStr(cTechBranchXML, "<techbranches" & cBranchID & ">")
6436 nEnd = InStr(cTechBranchXML, "</techbranches" & cBranchID & ">")
6437
6438 cTechBranchString = Mid(cTechBranchXML, nStart, nEnd-nStart)
6439
6440 If InStr(cTechBranchString,"<tech id=""" & cPreFillTechID & """") <> 0 Then
6441 oData("Tech1") = cPreFillTech
6442 oData("TechID1") = cPreFillTechID
6443 Else
6444 oData("Tech1") = ""
6445 oData("TechID1") = Null
6446 End If
6447 End If
6448
6449 '-- Prefill TechShare --
6450 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseTechShare") Then
6451 If Em(oData("TechID1")) Then
6452 If Not lGuardian Then
6453 oData("TechShare1") = "1"
6454 End If
6455 End If
6456 Else
6457 oData("TechShare1") = "1"
6458 End If
6459
6460 ' added Copesan tech production -aw 04/12/01'
6461 ' changed to pre-assign by tech share, rather than defaulting all to Tech 1 -jek 4/23/09
6462 If lCopesan Or lHolders Then
6463 ReDim aTechProd(5,3)
6464 'aTechProd(0,0) = oData("Tech1")
6465 'aTechProd(0,1) = oData("TechID1")
6466 'aTechProd(0,2) = oData("SubTotal")
6467
6468 'For nI = 1 to 4
6469 For nI = 0 to 4
6470 aTechProd(nI,0) = oData("Tech" & nI+1)
6471 aTechProd(nI,1) = oData("TechID" & nI+1)
6472 'aTechProd(nI,2) = 0.00
6473 aTechProd(nI,2) = Round(CDbl(oData("SubTotal")) * CDbl(oData("TechShare" & nI+1)),2)
6474 Next
6475 End If
6476
6477 cOrderType = Coalesce(oData("OrderType"),"SO")
6478
6479 If (lClark) And (cOrderType = "ES") Then
6480 cOrderType = "EW"
6481 End If
6482
6483 If cOrderType = "NS" Then
6484 cOrderType = "NS_" & oData("PostingNSReason")
6485 End If
6486
6487 cServiceType = Coalesce(oData("ServiceType"),"")
6488 cTaxRate = FormatNumber(oData("TaxRate"),5,,False,False)
6489 cPST = FormatNumber(oData("PST"),5,,False,False)
6490 cCanadianTax = oData("CanadianTax")
6491 cPSTonGST = oData("PSTonGST")
6492
6493 cTotal = FormatNumber(oData("Total"),2,,False,False)
6494 cSubTotal = FormatNumber(oData("SubTotal"),2,,False,False)
6495 cTaxTotal = FormatNumber(oData("Tax"),2,,False,False)
6496 cTaxCode = oData("TaxCode")
6497
6498 ' load GL fields
6499 cGLARCode = oData("GLCode")
6500 cGLARCodeID = oData("GLCodeID")
6501
6502 ' load payment fields
6503 If cOrderType = "SO" And cDefaultPayment = "I" Then
6504 cPayment = FormatNumber(oData("Total"),2,,False,False)
6505 cPaymentDisable = ""
6506 ElseIf cOrderType = "SO" And cDefaultPayment = "Z" Then
6507 cPayment = FormatNumber(0,2,,False,False)
6508 cPaymentDisable = ""
6509 Else
6510 cPayment = FormatNumber(0,2,,False,False)
6511 cPaymentDisable = "disabled"
6512 End If
6513 cReference = ""
6514 cMethodOfPayment = ""
6515 cMethodOfPaymentID = ""
6516 cBillToID = oData("BillToID")
6517
6518 lPostRenewalAdvance = false
6519
6520 cCommentText = oData("CommentText")
6521 cCommentCode = oData("CommentCode")
6522 cCommentID = oData("CommentID")
6523
6524 'Updated so bring in the tech comment incase it was previously filled in - DL 01-25-11 FB 7411
6525 'cFieldCommentText = ""
6526 cFieldCommentText = oData("PostingFieldCommentText")
6527 cFieldCommentCode = "MISC"
6528 cFieldCommentID = ""
6529
6530 cUserDef14 = oData("UserDef14")
6531 cUserDef15 = oData("UserDef15")
6532 cUserDef16 = oData("UserDef16")
6533 cUserDef17 = oData("UserDef17")
6534 cUserDef18 = oData("UserDef18")
6535 cUserDef19 = oData("UserDef19")
6536 cUserDef20 = oData("UserDef20")
6537 cUserDef21 = oData("UserDef21")
6538 cUserDef22 = oData("UserDef22")
6539 cUserDef23 = oData("UserDef23")
6540 cUserDef56 = oData("UserDef56")
6541 cUserDef57 = oData("UserDef57")
6542
6543 cTargetPest = oData("TargetPest")
6544 cTargetID = oData("TargetID")
6545
6546 ReDim aUserDef(12)
6547
6548 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
6549 nI = aServiceUserDefKeys(nUDFIndex)
6550
6551 aUserDef(nUDFIndex) = oData("UserDef" & nI)
6552 Next
6553
6554 lIsScannerData = oData("IsScannerData")
6555 lIsScannerException = oData("IsScannerException")
6556
6557 'CLARK
6558 lEstimateSaved = false
6559 Else
6560 cInvoiceDate = FormatDate(oData("PostingInvoiceDate"))
6561 cWorkDate = FormatDate(oData("PostingWorkDate"))
6562 cWorkTime = FormatTime(oData("PostingWorkDate"))
6563 cWorkAmPm = FormatAmPm(oData("PostingWorkDate"))
6564 If lClark Then
6565 cOrigWorkDate = FormatDate(oData("PostingWorkDate"))
6566 End If
6567
6568 cDuration = FormatMinToDur(oData("PostingDuration"))
6569 If lAaron And Not (Hour(oData("TimeDepart")) = 0 And Minute(oData("TimeDepart")) = 0) Then
6570 cEndDate = FormatTime(oData("TimeDepart"))
6571 cEndAmPm = FormatAmPm(oData("TimeDepart"))
6572 ElseIf Hour(oData("PostingWorkDate")) = 0 And Minute(oData("PostingWorkDate")) = 0 Then
6573 cEndDate = ""
6574 Else
6575 cEndDate = FormatTime(DateAdd("n", oData("PostingDuration"), oData("PostingWorkDate")))
6576 cEndAmPm = FormatAmPm(DateAdd("n", oData("PostingDuration"), oData("PostingWorkDate")))
6577 End If
6578
6579 oData("TechActive1") = oData("PostingTechActive")
6580 oData("Tech1") = oData("PostingTech")
6581 oData("Tech2") = oData("PostingTech2")
6582 oData("Tech3") = oData("PostingTech3")
6583 oData("Tech4") = oData("PostingTech4")
6584 oData("Tech5") = oData("PostingTech5")
6585 oData("TechID1") = oData("PostingTechID")
6586 oData("TechID2") = oData("PostingTechID2")
6587 oData("TechID3") = oData("PostingTechID3")
6588 oData("TechID4") = oData("PostingTechID4")
6589 oData("TechID5") = oData("PostingTechID5")
6590 oData("TechShare1") = oData("PostingTechShare")
6591 oData("TechShare2") = oData("PostingTechShare2")
6592 oData("TechShare3") = oData("PostingTechShare3")
6593 oData("TechShare4") = oData("PostingTechShare4")
6594 oData("TechShare5") = oData("PostingTechShare5")
6595 oData("TechBonus1") = oData("PostingTechBonus1")
6596 oData("TechBonus2") = oData("PostingTechBonus2")
6597 oData("TechBonus3") = oData("PostingTechBonus3")
6598 oData("TechBonus4") = oData("PostingTechBonus4")
6599 oData("TechBonus5") = oData("PostingTechBonus5")
6600
6601
6602 If lCopesan Or lHolders Then
6603 ReDim aTechProd(5,3)
6604 aTechProd(0,0) = oData("PostingTech")
6605 aTechProd(0,1) = oData("PostingTechID")
6606 aTechProd(0,2) = Coalesce(oData("PostingTechProd1"),0.00)
6607
6608 For nI = 1 to 4
6609 aTechProd(nI,0)= oData("PostingTech" & nI+1)
6610 aTechProd(nI,1) = oData("PostingTechID" & nI+1)
6611 aTechProd(nI,2) = Coalesce(oData("PostingTechProd" & nI+1),0.00)
6612 Next
6613 End If
6614
6615 cOrderType = Coalesce(oData("PostingOrderType"),"SO")
6616
6617 If cOrderType = "NS" Then
6618 cOrderType = "NS_" & oData("PostingNSReason")
6619 End If
6620
6621 cServiceType = Coalesce(oData("ServiceType"),"")
6622
6623 cTaxRate = FormatNumber(oData("TaxRate"),5,,False,False)
6624 cPST = FormatNumber(oData("PST"),5,,False,False)
6625 cCanadianTax = oData("CanadianTax")
6626 cPSTonGST = oData("PSTonGST")
6627
6628 cTotal = FormatNumber(oData("PostingTotal"),2,,False,False)
6629 cSubTotal = FormatNumber(oData("SubTotal"),2,,False,False)
6630 cTaxTotal = FormatNumber(oData("Tax"),2,,False,False)
6631 cTaxCode = oData("TaxCode")
6632
6633 cGLARCode = oData("PostingARCode")
6634 cGLARCodeID = oData("PostingARCodeID")
6635
6636 ' load payment fields
6637 If cOrderType = "SO" Then
6638 cPayment = FormatNumber(oData("PostingPayment"),2,,False,False)
6639 cDiscount = FormatNumber(oData("PostingDiscount"),2,,False,False)
6640 cAdjustmentReason = oData("PostingAdjustmentReason")
6641 cPaymentDisable = ""
6642 Else
6643 cPayment = FormatNumber(0,2,,False,False)
6644 cDiscount = FormatNumber(0,2,,False,False)
6645 cAdjustmentReason = ""
6646 cPaymentDisable = "disabled"
6647 End If
6648
6649 cReference = Trim(oData("PostingReference"))
6650 cMethodOfPayment = oData("PostingMethodOfPayment")
6651 cMethodOfPaymentID = oData("PostingMethodOfPaymentID")
6652 cBillToID = oData("BillToID")
6653
6654 lPostRenewalAdvance = oData("PostingRenewalAdvance")
6655
6656 cCommentText = oData("PostingCommentText")
6657 cCommentCode = oData("PostingCommentCode")
6658 cCommentID = oData("PostingCommentID")
6659
6660 cFieldCommentText = oData("PostingFieldCommentText")
6661 cFieldCommentCode = oData("PostingFieldCommentCode")
6662 cFieldCommentID = oData("PostingFieldCommentID")
6663
6664 cUserDef14 = oData("PostingUserDef14")
6665 cUserDef15 = oData("PostingUserDef15")
6666 cUserDef16 = oData("PostingUserDef16")
6667 cUserDef17 = oData("PostingUserDef17")
6668 cUserDef18 = oData("PostingUserDef18")
6669 cUserDef19 = oData("PostingUserDef19")
6670 cUserDef20 = oData("PostingUserDef20")
6671 cUserDef21 = oData("PostingUserDef21")
6672 cUserDef22 = oData("PostingUserDef22")
6673 cUserDef23 = oData("PostingUserDef23")
6674 cUserDef56 = oData("PostingUserDef56")
6675 cUserDef57 = oData("PostingUserDef57")
6676
6677 cTargetPest = oData("TargetPest")
6678 cTargetID = oData("TargetID")
6679
6680 ReDim aUserDef(12)
6681
6682 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
6683 nI = aServiceUserDefKeys(nUDFIndex)
6684
6685 aUserDef(nUDFIndex) = oData("PostingUserDef" & nI)
6686 Next
6687
6688 'lIsScannerData = False
6689 lIsScannerData = oData("IsScannerData")
6690
6691 lIsScannerException = False
6692
6693 If lClark Then
6694 lEstimateSaved = (oData("EstimateSaved") = 1)
6695 End If
6696 End If
6697
6698 lShowDiscount = CheckAccessRight("PAYMENTDISCOUNT", "R", oData("BranchID"))
6699
6700 Set objPeriod = Server.CreateObject("PestPac.Period")
6701 Set oPeriod = objPeriod.GetLast(oGlobals("Database"), oGlobals("CompanyID"), oData("BranchID"))
6702 Set objPeriod = Nothing
6703 Call CheckDictError(oPeriod)
6704
6705 'check if user has access to post this type of order
6706 If cOrderType = "SO" Or cOrderType = "CB" Or cOrderType = "PR" Then
6707 lPostAccess = CheckAccessRight("POST","R",oData("BranchID"))
6708 ElseIf cOrderType = "ES" Or cOrderType = "EW" Or cOrderType = "EL" Then
6709 lPostAccess = CheckAccessRight("POSTEST","R",oData("BranchID"))
6710 ElseIf cOrderType = "CE" Then
6711 lPostAccess = CheckAccessRight("POSTCE","R",oData("BranchID"))
6712 ElseIf cOrderType = "NS" Then
6713 lPostAccess = CheckAccessRight("POSTNS","R",oData("BranchID"))
6714 Else
6715 lPostAccess = True
6716 End If
6717 '-
6718
6719 dEndOfCurrentPeriod = ""
6720 If Not Em(oPeriod("CutoffDate")) Then
6721 dEndOfCurrentPeriod = DateAdd("d", 5, oPeriod("CutoffDate"))
6722 dEndOfCurrentPeriod = DateSerial(Year(dEndOfCurrentPeriod), Month(dEndOfCurrentPeriod) + 1, 0)
6723 End If
6724
6725 If lClark Then
6726 If oData("Initial") Or Left(cOrderType, 1) = "E" Then
6727 cHeaderBGColor = "#AEF3AE"
6728 Else
6729 cHeaderBGColor = "#FFFFE5"
6730 End If
6731 Else
6732 cHeaderBGColor = "#FFFFE5"
6733 End If
6734 %>
6735 <table cellspacing="0" cellpadding="2" width="100%">
6736 <tr>
6737 <td colspan=4 bgcolor="<%=cHeaderBGColor%>" class="T L B"><span style="height: 13px;width: 450;overflow: hidden;">
6738 <%If lCopesanPart Then%>
6739 <input type=hidden name="CopesanTicketNum<%=nCount%>" value="<%=oData("CopesanTicketNum")%>">
6740 <input type=hidden name="CopesanSANum<%=nCount%>" value="<%=oData("CopesanSANum")%>">
6741 <%
6742 Set oOverrideFields = Server.CreateObject("Scripting.Dictionary")
6743 oOverrideFields("TableType") = "O"
6744 oOverrideFields("TableID") = cOrderID
6745 lOverRideExists = CBool(ExecuteNonQuery("CopesanSAPROverrideExists", oOverrideFields))
6746 Set oOverrideFields = Nothing
6747 %>
6748 <input type=hidden name="CopesanSAPROverride<%=nCount%>" value="<% If lOverRideExists Then Response.Write "1" Else Response.Write "0" End If %>">
6749 <%End If%>
6750 <input type=hidden name="OldPost<%=nCount%>" value="<%If oData("Posted") Then Response.Write "1"%>">
6751 <input type=hidden name="OrderID<%=nCount%>" value="<%=cOrderID%>">
6752 <input type=hidden name="ParentOrderID<%=nCount%>" value="<%=Coalesce(oData("ParentOrderID"), "0")%>">
6753 <input type=hidden name="AuthTransactionID<%=nCount%>" value="<%=Coalesce(oData("AuthTransactionID"),"")%>">
6754 <input type=hidden name="AuthAmount<%=nCount%>" value="<%=Coalesce(oData("AuthAmount"), "0")%>">
6755 <input type=hidden name="SetupID<%=nCount%>" value="<%=oData("SetupID")%>">
6756 <input type=hidden name="GenerateID<%=nCount%>" value="<%=oData("GenerateID")%>">
6757 <input type=hidden name="PeriodCutoffDate<%=nCount%>" value="<%=oPeriod("CutoffDate")%>">
6758 <input type=hidden name="EndOfCurrentPeriodDate<%=nCount%>" value="<%=dEndOfCurrentPeriod%>">
6759 <input type=hidden name="OrderNum<%=nCount%>" value="<%=oData("OrderNum")%>">
6760 <input type=hidden name="LocationID<%=nCount%>" value="<%=oData("LocationID")%>">
6761 <input type=hidden name="TimeOut<%=nCount%>" value="<%=oData("PostingTimeOut")%>">
6762 <input type=hidden name="FirstTechSignatureID<%=nCount%>" value="<%=oData("FirstTechSignatureID")%>"> <!-- FB 8909-->
6763 <input type=hidden name="LocationState<%=nCount%>" value="<%=oData("State")%>">
6764 <input type=hidden name="IsFinanced<%=nCount%>" value="<%=oData("IsFinanced")%>">
6765 <% cLocID = oData("LocationID") %>
6766 <input type=hidden name="PostAccess<%=nCount%>" value="<%If lPostAccess Then Response.Write "1"%>">
6767 <%If Not lBugOut Then%><input type=hidden name="BranchID<%=nCount%>" value="<%=oData("BranchID")%>"><%End If%>
6768 <%If lClark Then%><input type=hidden name="OldWorkDate<%=nCount%>" value="<%=cOrigWorkDate%>"><%End If%>
6769 <%If lAmerican And Not oOrderLines.EOF Then%><input type=hidden name="OrigUnitPrice<%=nCount%>" value="<%=FormatNumber(oOrderLines("UnitPrice"),2,,False,False)%>"><%End If%>
6770 <b>Order</b>
6771 <%
6772 If lMcCall Then
6773 %>
6774 <b><span id="NewNum<%=nCount%>" class="Link" style="text-decoration:none;color:black;" OnClick="ChangeOrderNum('<%=nCount%>')"><%=oData("OrderNum")%></span></b>
6775 <%
6776 Else
6777 %>
6778 <b><%=oData("OrderNum")%></b> -
6779 <%
6780 End If
6781
6782 If Em(oData("Company")) Then
6783 Response.Write oData("FName") & " " & oData("LName")
6784 'ElseIf len(oData("Company")) >= 25 Then
6785 'Reliable found an issue where if the company + lname + fname was too long it would cut off the location link. To fix
6786 'this I have changed the logic to add in the lenghts of all these fields instead of just the company. - DS 01/08/2010 callid 206544
6787 ElseIf ( len(oData("Company")) + len(oData("LName")) + len(oData("FName")) ) >= 30 Then
6788 Response.Write oData("Company")
6789 Else
6790 Response.Write oData("Company") & "/" & oData("LName") & ", " & oData("FName")
6791 End If
6792
6793 Response.Write " (<a target='_blank' href=/location/detail.asp?LocationID=" & oData("LocationID") & ">" & cLocationCode & "</a>)"
6794 %>
6795 </span></td>
6796 <td align="right" bgcolor="<%=cHeaderBGColor%>" class="T B" style="color:red;" <%If lABCAustin Then%>width=130<%End If%>><span id="HeaderDate<%=nCount%>"><% If Not Em(cWorkDate) Then %><%=WeekDayName(WeekDay(cWorkDate),1)%> - <%=FormatDateShort(cWorkDate)%><% End If %></span> </td>
6797 <td nowrap align="right" bgcolor="<%=cHeaderBGColor%>" class="T B R">
6798 <%
6799 ' - moved below Tech Comment. -fgd
6800 'If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LocationNote") = "Y" And _
6801 ' CheckAccessRight("NOTE","A",oData("BranchID")) Then
6802 ' %>
6803 <!-- <span id="Note<%=nCount%>" class="Link" OnClick="VBScript:Call NoteOnClick(<%=nCount%>)">Add Note</span> -->
6804 <%
6805 'End If
6806
6807 If lSOS Or lSexton Or lAtomic Or lInsectek Or lPermaguard Then
6808 Set objForm = Server.CreateObject("PestPacUtility.Form")
6809 Set oForm = objForm.GetOrder(oGlobals("Database"), oData("OrderID"))
6810 Call CheckDictError(oForm)
6811 Set objForm = Nothing
6812
6813 If oForm("FormType") = "AZ TARF" Then
6814 %>
6815 <span id="TARF<%=nCount%>" class="Link" OnClick="VBScript:Call TarfOnClick('<%=oForm("FormID")%>','<%=oData("OrderID")%>','<%=oData("LocationID")%>','<%=nCount%>')">TARF</span>
6816 <%
6817 End If
6818 Set oForm = Nothing
6819 End If
6820
6821 ' Look for New Construction forms added to this location in the
6822 ' last 7 days. If one exists display a link to edit, otherwise, link to add
6823 If lSexton Then
6824 Set objForm = Server.CreateObject("PestPacUtility.Form")
6825 Set oForm = objForm.GetByLocationID(oGlobals("Database"), oData("LocationID"), "NPMA99B", "", "")
6826 Set oFormOld = objForm.GetByLocationID(oGlobals("Database"), oData("LocationID"), "New Construction", "", "")
6827 Set oForm2 = objForm.GetByLocationID(oGlobals("Database"), oData("LocationID"), "NPMA99A", "", "")
6828 Call CheckRSError(oForm)
6829 Call CheckRSError(oForm2)
6830 Set objForm = Nothing
6831
6832 If oForm2.RecordCount = 0 Then
6833 %>
6834 <span id="AddBuildersCert<%=nCount%>" class="Link" OnClick="VBScript:Call AddBuildersCertOnClick()" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>" formid="">Add 99a</span>
6835 <span id="EditBuildersCert<%=nCount%>" style="visibility: hidden; display: none" class="Link" OnClick="VBScript:Call BuildersCertOnClick()" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>" formid="">Edit 99a</span>
6836 <%
6837 ' -- Sexton Wantsz this link to show regardless of the date difference MH 7-28-08
6838 'ElseIf oForm2("DateCreated") > DateAdd("d", -90, Coalesce(Coalesce(oData("PostingWorkDate"), oData("WorkDate")), Date)) Then
6839 Else
6840 %>
6841 <span id="AddBuildersCert<%=nCount%>" style="visibility: hidden; display: none" class="Link" OnClick="VBScript:Call AddBuildersCertOnClick()" orderid="<%=oData("OrderID")%>" formid="" locationid="<%=oData("LocationID")%>">Add 99a</span>
6842 <span id="EditBuildersCert<%=nCount%>" class="Link" OnClick="VBScript:Call BuildersCertOnClick()" formid="<%=oForm2("FormID")%>" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>">Edit 99a</span>
6843 <%
6844 End If
6845 Set oForm2 = Nothing
6846
6847 If oForm.RecordCount = 0 And oFormOld.RecordCount = 0 Then
6848 %>
6849 <span id="AddNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call AddNewConstructionOnClick()" locationid="<%=oData("LocationID")%>" orderid="<%=oData("OrderID")%>" formid="">Add 99b</span>
6850 <span style="visibility: hidden; display: none" id="EditNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call NewConstructionOnClick()" orderid="<%=oData("OrderID")%>" formid="" locationid="<%=oData("LocationID")%>">Edit 99b</span>
6851 <%
6852 ' -- Sexton Wantsz this link to show regardless of the date difference MH 7-28-08
6853 'ElseIf oForm2("DateCreated") > DateAdd("d", -90, Coalesce(Coalesce(oData("PostingWorkDate"), oData("WorkDate")), Date)) Then
6854 Else
6855 If oFormOld.RecordCount > 0 Then
6856 %>
6857 <span style="visibility:hidden; display: none" id="AddNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call AddNewConstructionOnClick()" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>" formid="">Add 99b</span>
6858 <span id="EditNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call NewConstructionOnClick()" formid="<%=oFormOld("FormID")%>" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>">Edit 99b</span>
6859 <%
6860 Else
6861 %>
6862 <span style="visibility:hidden; display: none" id="AddNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call AddNewConstructionOnClick()" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>" formid="">Add 99b</span>
6863 <span id="EditNewConstruction<%=nCount%>" class="Link" OnClick="VBScript:Call NewConstructionOnClick()" formid="<%=oForm("FormID")%>" orderid="<%=oData("OrderID")%>" locationid="<%=oData("LocationID")%>">Edit 99b</span>
6864 <%
6865 End If
6866 End If
6867 Set oForm = Nothing
6868
6869 End If
6870
6871 'user might change the order type before saving -dbb 5/21/07
6872 'If lPostAccess Then
6873 If lClark Then
6874 %>
6875 Post <input tabindex=<%=nIndex%> type=checkbox name="Post<%=nCount%>" value="1" <%If oData("Posted") Then Response.Write "checked"%> OnClick="VBScript: CheckEstimateWon(<%=nCount%>)">
6876 <%
6877 Else
6878 %>
6879 Post <input tabindex=<%=nIndex%> <% If lSwingle Then %> onclick="PostOnClick(<%=nCount%>)" <% End If %> type=checkbox name="Post<%=nCount%>" value="1" <%If oData("Posted") Then Response.Write "checked"%>>
6880 <%
6881 End If
6882
6883 nIndex = nIndex + 1
6884
6885 If lSwingle Then
6886 %>
6887 <br>Unprint <input tabindex=<%=nIndex%> type=checkbox name="Unprint<%=nCount%>" onClick="UnprintOnClick(<%=nCount%>)" value="1">
6888 <%
6889 nIndex = nIndex + 1
6890 End If
6891
6892 If lBugOut Then
6893 If Left(cOrderType, 2) = "NS" Then
6894 %>
6895 <br>Clone <input tabindex="<%=nIndex%>" type=checkbox name="CreateClone<%=nCount%>" value="1">
6896 <%
6897 Else
6898 %>
6899 <br>Clone <input tabindex="<%=nIndex%>" type=checkbox name="CreateClone<%=nCount%>" value="1" disabled>
6900 <%
6901 End If
6902 nIndex = nIndex + 1
6903 End If
6904 %>
6905 </td>
6906 </tr>
6907<%
6908
6909
6910If oData("OnHH") <> 0 Then
6911 cHHOrders = oData("OrderNum")
6912
6913 If Len(cHHOrders) > 0 And Not lTerminator Then
6914 %>
6915 <script language="VBScript">
6916 window.alert("Order # " & <%=cHHOrders%> & " is downloaded to the handheld.")
6917 </script>
6918 <%
6919 End If
6920End If
6921
6922
6923 'added to show credit status -jek 9/7/06
6924 If oData("CreditStatus") <> "N" Then
6925 %>
6926 <tr bgcolor="#fff4f4">
6927 <td colspan=6 align="center" class="L B R">
6928 <span style="color: red">
6929 <%
6930 Select Case oData("CreditStatus")
6931 Case "A":
6932 Response.Write "Credit Alert"
6933 Case "H":
6934 Response.Write "Credit Hold"
6935 Case "C":
6936 Response.Write "Collection"
6937 End Select
6938 %>
6939 </span>
6940 </td>
6941 </tr>
6942 <%
6943 End If
6944
6945 'user might change the order type before saving -dbb 5/21/07
6946 'If Not lPostAccess Then
6947 If False Then
6948 '-
6949 %>
6950 <tr>
6951 <td colspan=6>You do not have access to post this type of order.</td>
6952 </tr>
6953
6954 <tr>
6955 <td colspan=6> </td>
6956 </tr>
6957 </table>
6958 <%
6959 Else
6960 If lShowWorkDate Then
6961 If lEndTime Then
6962 %>
6963 <tr>
6964 <%
6965 If lIsScannerException Then
6966 %>
6967 <td style="color: red;"><span title="Scanner Exception">Start Time:</span></td>
6968 <%
6969 ElseIf lIsScannerData Then
6970 %>
6971 <td style="color: blue;"><span title="Scanner Data">Start Time:</span></td>
6972 <%
6973 Else
6974 %>
6975 <td>Start Time:</td>
6976 <%
6977 End If
6978 %>
6979 <td>
6980 <%
6981 'if work time exists, don't change AmPm field on blur -dbb 8/1/02
6982 If Len(cWorkTime) = 0 Then
6983 cAmPmField = "WorkAmPm" & nCount
6984 Else
6985 cAmPmField = ""
6986 End If
6987 '-
6988 %>
6989 <input tabindex=<%=nIndex%> type=text name="WorkTime<%=nCount%>" onkeydown="VBScript:Call WorkTimeOnKeyDown(<%=nCount%>,0)" size=5 maxlength=5 onblur="javascript: vTimeBlur(this, '<%=cAmPmField%>'); vbscript: WorkTimeOnBlur('<%=nLine%>', '<%=nCount%>');" onkeypress="javascript: vTimeKey(this, '<%=cAmPmField%>')" onkeydown="javascript: vTimeKeyDown(this, '<%=cAmPmField%>')" value="<%=cWorkTime%>">
6990 <select tabindex=<%=nIndex+1%> name="WorkAmPm<%=nCount%>">
6991 <% Call AmPmList(cWorkAmPm) %>
6992 </select>
6993 </td>
6994 <%
6995 If lIsScannerException Then
6996 %>
6997 <td style="color: red;"><span title="Scanner Exception">End Time:</span></td>
6998 <%
6999 ElseIf lIsScannerData Then
7000 %>
7001 <td style="color: blue;"><span title="Scanner Data">End Time:</span></td>
7002 <%
7003 Else
7004 %>
7005 <td>End Time:</td>
7006 <%
7007 End If
7008 %>
7009 <td>
7010 <%
7011 'if work time exists, don't change AmPm field on blur -dbb 8/1/02
7012 If Len(cEndDate) = 0 Then
7013 cEndAmPmField = "EndAmPm" & nCount
7014 Else
7015 cEndAmPmField = ""
7016 End If
7017 '-
7018 %>
7019 <input tabindex=<%=nIndex+2%> type=text name="EndTime<%=nCount%>" size=5 maxlength=5 onblur="javascript: vTimeBlur(this, '<%=cEndAmPmField%>'); vbscript: EndTimeOnBlur('<%=nLine%>', '<%=nCount%>');" onkeypress="javascript: vTimeKey(this, '<%=cEndAmPmField%>')" onkeydown="javascript: vTimeKeyDown(this, '<%=cEndAmPmField%>');VBScript:EndTimeOnKeyDown(<%=nCount%>)" value="<%=cEndDate%>">
7020 <select tabindex=<%=nIndex+3%> name="EndAmPm<%=nCount%>">
7021 <% Call AmPmList(cEndAmPm) %>
7022 </select>
7023 <input type=hidden name="Duration<%=nCount%>" value="">
7024 </td>
7025 <%
7026 If lIsScannerException Then
7027 %>
7028 <td style="color: red;"><span title="Scanner Exception">Work Date:</span></td>
7029 <%
7030 ElseIf lIsScannerData Then
7031 %>
7032 <td style="color: blue;"><span title="Scanner Data">Work Date:</span></td>
7033 <%
7034 Else
7035 %>
7036 <td>Work Date:</td>
7037 <%
7038 End If
7039 %>
7040 <td>
7041 <input tabindex=<%=nIndex+4%> type=text name="WorkDate<%=nCount%>" size=10 maxlength=10 onkeypress='javascript: vDateKey(this)' onkeydown='javascript: vDateKeyDown(this)' value="<%=cWorkDate%>" onBlur="javascript: vDateBlur(this); vbscript: UpdateHeaderDate(<%=nCount%>);" oncontextmenu="javascript: return vDateContextMenu(this)" class="input-date">
7042 <%
7043 If lClark Then
7044 %>
7045 <input type=hidden name="OriginalWorkDate<%=nCount%>" value="<%=cOrigWorkDate%>">
7046 <%
7047 Else
7048 %>
7049 <input type=hidden name="OriginalWorkDate<%=nCount%>" value="<%=cWorkDate%>">
7050 <%
7051 End If
7052 %>
7053 </td>
7054 </tr>
7055 <%
7056 nIndex = nIndex + 5
7057 Else
7058 %>
7059 <tr>
7060 <%
7061 If lIsScannerException Then
7062 %>
7063 <td style="color: red;"><span title="Scanner Exception">Duration:</span></td>
7064 <%
7065 ElseIf lIsScannerData Then
7066 %>
7067 <td style="color: blue;"><span title="Scanner Data">Duration:</span></td>
7068 <%
7069 Else
7070 %>
7071 <td>Duration:</td>
7072 <%
7073 End If
7074 %>
7075 <td><input tabindex=<%=nIndex%> type=text name="Duration<%=nCount%>" onkeydown="VBScript:DurationOnKeyDown(<%=nCount%>)" size=5 maxlength=5 <%=VClass("Dur","")%> value="<%=cDuration%>"></td>
7076 <%
7077 If lIsScannerException Then
7078 %>
7079 <td style="color: red;"><span title="Scanner Exception">Start Time:</span></td>
7080 <%
7081 ElseIf lIsScannerData Then
7082 %>
7083 <td style="color: blue;"><span title="Scanner Data">Start Time:</span></td>
7084 <%
7085 Else
7086 %>
7087 <td>Start Time:</td>
7088 <%
7089 End If
7090 %>
7091 <td>
7092 <%
7093 'if work time exists, don't change AmPm field on blur -dbb 8/1/02
7094 If Len(cWorkTime) = 0 Then
7095 cAmPmField = "WorkAmPm" & nCount
7096 Else
7097 cAmPmField = "|"
7098 End If
7099 '-
7100 %>
7101 <input tabindex=<%=nIndex+1%> type=text name="WorkTime<%=nCount%>" onkeydown="VBScript:Call WorkTimeOnKeyDown(<%=nCount%>,1)" size=5 maxlength=5 <%=VClass("Time",cAmPmField)%> value="<%=cWorkTime%>">
7102 <select tabindex=<%=nIndex+2%> name="WorkAmPm<%=nCount%>">
7103 <% Call AmPmList(cWorkAmPm) %>
7104 </select>
7105 </td>
7106 <%
7107 If lIsScannerException Then
7108 %>
7109 <td style="color: red;"><span title="Scanner Exception">Work Date:</span></td>
7110 <%
7111 ElseIf lIsScannerData Then
7112 %>
7113 <td style="color: blue;"><span title="Scanner Data">Work Date:</span></td>
7114 <%
7115 Else
7116 %>
7117 <td>Work Date:</td>
7118 <%
7119 End If
7120 %>
7121 <td>
7122 <input tabindex=<%=nIndex+3%> type=text name="WorkDate<%=nCount%>" size=10 maxlength=10 onkeypress='javascript: vDateKey(this)' onkeydown='javascript: vDateKeyDown(this)' value="<%=cWorkDate%>" onblur="javascript: vDateBlur(this); vbscript: UpdateHeaderDate(<%=nCount%>);" oncontextmenu="javascript: return vDateContextMenu(this)"></td>
7123 <input type=hidden name="OriginalWorkDate<%=nCount%>" value="<%=cWorkDate%>"></td>
7124 </tr>
7125 <%
7126 nIndex = nIndex + 4
7127 End If
7128 Else
7129 %>
7130 <input type=hidden name="WorkDate<%=nCount%>" value="<%=cWorkDate%>">
7131 <input type=hidden name="OriginalWorkDate<%=nCount%>" value="<%=cWorkDate%>">
7132 <input type=hidden name="WorkTime<%=nCount%>" value="<%=cWorkTime%>">
7133 <input type=hidden name="WorkAmPm<%=nCount%>" value="<%=cWorkAmPm%>">
7134 <input type=hidden name="Duration<%=nCount%>" value="<%=cDuration%>">
7135 <%
7136 End If
7137
7138 If lSteritech Then
7139 %>
7140 <input type=hidden name="EndDate<%=nCount%>" value="<%=FormatDate(DateAdd("n", oData("PostingDuration"), oData("PostingWorkDate")))%>">
7141 <%
7142 End If
7143 %>
7144
7145 <tr>
7146 <td> </td>
7147 <td> </td>
7148 <%
7149 If lHumphreys And cReview = "Y" Then
7150 cOrderType = "NS_MS"
7151 End If
7152 %>
7153 <td width=85>Order Type:</td>
7154 <td width=155>
7155 <input type="hidden" name="OrigOrderType<%=nCount%>" value="<%=cOrderType%>">
7156 <%
7157 'Changed to always include the current order type value, whether or not user has access to post
7158 'that type of order. Validation is done on page save. -dbb 5/21/07
7159
7160 If lGriffin And cOrderType = "ES" Then
7161 %>
7162 <select tabindex=<%=nIndex+1%> name="OrderType<%=nCount%>" OnChange="VBScript:Call OrderTypeOnChange(<%=nCount%>, <%=lShowDiscount%>)">
7163 <option value="EW" <% If cOrderType = "EW" Then Response.Write "selected"%>>Estimate - Won
7164 <option value="EL" <% If cOrderType = "EL" Then Response.Write "selected"%>>Estimate - Lost
7165 </select>
7166 <%
7167 Else
7168 If lClark Then
7169 %>
7170 <input type=hidden name="IsInitial<%=nCount%>" value="<%=FormatBoolToCheckbox(oData("Initial"))%>">
7171 <select tabindex=<%=nIndex+1%> name="OrderType<%=nCount%>" OnChange="VBScript:Call OrderTypeOnChange(<%=nCount%>, <%=lShowDiscount%>)" OnBlur="VBScript:Call CheckEstimateWon(<%=nCount%>)">
7172 <%
7173 Else
7174 %>
7175 <input type=hidden name="IsInitial<%=nCount%>" value="<%=FormatBoolToCheckbox(oData("Initial"))%>">
7176 <select style="width:155px;" tabindex=<%=nIndex+1%> name="OrderType<%=nCount%>" OnChange="VBScript:Call OrderTypeOnChange(<%=nCount%>, <%=lShowDiscount%>)">
7177 <%
7178 End If
7179
7180 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
7181 If lCentex or lJNJ Then
7182 If Not Em(cPrefillOrderType) Then
7183 If CheckAccessRight("POST","R",oData("BranchID")) Or cPrefillOrderType = "SO" Then
7184 %>
7185 <option value="SO" <% If cPrefillOrderType = "SO" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ServiceOrderCaption")%>
7186 <%
7187 End If
7188 Else
7189 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "SO" Then
7190 %>
7191 <option value="SO" <% If cOrderType = "SO" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ServiceOrderCaption")%>
7192 <%
7193 End If
7194 End If
7195 Else
7196 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "SO" Then
7197 %>
7198 <option value="SO" <% If cOrderType = "SO" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ServiceOrderCaption")%>
7199 <%
7200 End If
7201 End If
7202
7203 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
7204 If lCentex or lJNJ Then
7205 If Not Em(cPrefillOrderType) Then
7206 If CheckAccessRight("POST","R",oData("BranchID")) Or cPrefillOrderType = "ES" OR cPrefillOrderType = "EW" OR cPrefillOrderType = "EL" Then
7207 %>
7208 <option value="ES" <% If cPrefillOrderType = "ES" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate
7209 <option value="EW" <% If cPrefillOrderType = "EW" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Won
7210 <option value="EL" <% If cPrefillOrderType = "EL" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Lost
7211 <%
7212 End If
7213 Else
7214 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "ES" OR cOrderType = "EW" OR cOrderType = "EL" Then
7215 %>
7216 <option value="ES" <% If cOrderType = "ES" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate
7217 <option value="EW" <% If cOrderType = "EW" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Won
7218 <option value="EL" <% If cOrderType = "EL" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Lost
7219 <%
7220 End If
7221 End If
7222 Else
7223 If CheckAccessRight("POSTEST","R",oData("BranchID")) Or cOrderType = "ES" Or cOrderType = "EW" Or cOrderType = "EL" Then
7224 If lClark Then
7225 If Not oData("Initial") Then
7226 %>
7227 <!-- Added Estimate - DL 05-16-12 FB 11709-->
7228 <option value="ES" <% If cOrderType = "ES" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate
7229 <option value="EW" <% If cOrderType = "EW" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Won
7230 <option value="EL" <% If cOrderType = "EL" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Lost
7231 <%
7232 End If
7233 Else
7234 %>
7235 <option value="ES" <% If cOrderType = "ES" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate
7236 <option value="EW" <% If cOrderType = "EW" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Won
7237 <option value="EL" <% If cOrderType = "EL" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>*<%End If%>Estimate - Lost
7238 <%
7239 End If
7240 End If
7241 End If
7242
7243 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
7244 If lCentex or lJNJ Then
7245 If Not Em(cPrefillOrderType) Then
7246 If CheckAccessRight("POST","R",oData("BranchID")) Or cPrefillOrderType = "CB" Then
7247 %>
7248 <option value="CB" <% If cPrefillOrderType = "CB" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("CallBackCaption")%>
7249 <%
7250 End If
7251 Else
7252 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "CB" Then
7253 %>
7254 <option value="CB" <% If cOrderType = "CB" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("CallBackCaption")%>
7255 <%
7256 End If
7257 End If
7258 Else
7259 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "CB" Then
7260 %>
7261 <option value="CB" <% If cOrderType = "CB" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("CallBackCaption")%>
7262 <%
7263 End If
7264 End If
7265
7266 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
7267 If lCentex or lJNJ Then
7268 If Not Em(cPrefillOrderType) Then
7269 If CheckAccessRight("POST","R",oData("BranchID")) Or cPrefillOrderType = "PR" Then
7270 %>
7271 <option value="PR" <% If cPrefillOrderType = "PR" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ProductionCaption")%>
7272 <%
7273 End If
7274 Else
7275 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "PR" Then
7276 %>
7277 <option value="PR" <% If cOrderType = "PR" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ProductionCaption")%>
7278 <%
7279 End If
7280 End If
7281 Else
7282 If CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "PR" Then
7283 %>
7284 <option value="PR" <% If cOrderType = "PR" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%><%=oGlobals("ProductionCaption")%>
7285 <%
7286 End If
7287 End If
7288
7289 'FB 10566 BY RRN 1/19/2011 HomeTeam Pest Quote(187)
7290 If lCentex or lJNJ Then
7291 If Not Em(cPrefillOrderType) Then
7292 If CheckAccessRight("POSTCE","R",oData("BranchID")) Or cPrefillOrderType = "CE" Then
7293 %>
7294 <option value="CE" <% If cPrefillOrderType = "CE" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTCE","R",oData("BranchID")) Then%>*<%End If%>Commission
7295 <%
7296 End If
7297 Else
7298 If CheckAccessRight("POSTCE","R",oData("BranchID")) Or cOrderType = "CE" Then
7299 %>
7300 <option value="CE" <% If cOrderType = "CE" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTCE","R",oData("BranchID")) Then%>*<%End If%>Commission
7301 <%
7302 End If
7303 End If
7304 Else
7305 If (Not lPestPacLite) And (CheckAccessRight("POSTCE","R",oData("BranchID")) Or cOrderType = "CE") Then
7306 %>
7307 <option value="CE" <% If cOrderType = "CE" Then Response.Write "selected"%>><%If Not CheckAccessRight("POSTCE","R",oData("BranchID")) Then%>*<%End If%>Commission
7308 <%
7309 End If
7310 End If
7311
7312 ' Removing option per FB case 3066 -cdk 3/1/10
7313 If False And CheckAccessRight("POST","R",oData("BranchID")) Or cOrderType = "PI" Then
7314 %>
7315 <option value="PI" <% If cOrderType = "PI" Then Response.Write "selected"%>><%If Not CheckAccessRight("POST","R",oData("BranchID")) Then%>*<%End If%>Prebill
7316 <%
7317 End If
7318
7319 ' FB 4082 -cdk 6/4/10
7320 If oData("IsCopesan") Then
7321 cNSReasons = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("SELECT_NotServicedCopesan")
7322 Else
7323 cNSReasons = oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("SELECT_NotServiced")
7324 End If
7325
7326
7327 If lCentex or lJNJ Then
7328 If Not Em(cPrefillOrderType) Then
7329 If CheckAccessRight("POSTNS","R",oData("BranchID")) Or Left(cPrefillOrderType, 2) = "NS" Then
7330 'Call FastSelectList("NotServiced", cOrderType)
7331 If CheckAccessRight("POSTNS","R",oData("BranchID")) Then
7332 Response.Write Replace(cNSReasons, "value=""" & cPrefillOrderType & """", "value=""" & cPrefillOrderType & """ selected")
7333 End If
7334 End If
7335 Else
7336 If CheckAccessRight("POSTNS","R",oData("BranchID")) Or Left(cOrderType, 2) = "NS" Then
7337 'Call FastSelectList("NotServiced", cOrderType)
7338 If CheckAccessRight("POSTNS","R",oData("BranchID")) Then
7339 Response.Write Replace(cNSReasons, "value=""" & cOrderType & """", "value=""" & cOrderType & """ selected")
7340 End If
7341 End If
7342 End If
7343 Else
7344 If CheckAccessRight("POSTNS","R",oData("BranchID")) Or Left(cOrderType, 2) = "NS" Then
7345 'Call FastSelectList("NotServiced", cOrderType)
7346 If CheckAccessRight("POSTNS","R",oData("BranchID")) Then
7347 Response.Write Replace(cNSReasons, "value=""" & cOrderType & """", "value=""" & cOrderType & """ selected")
7348 Else
7349 'show option for selected NS reason only, prepended with a *
7350 If InStr(cNSReasons, "<option value=""" & cOrderType & """>") <> 0 Then
7351 cStartWithSelected = Mid(cNSReasons, InStr(cNSReasons, "<option value=""" & cOrderType & """>"))
7352 cReplaceSelected = Replace(Replace(cStartWithSelected, "value=""" & cOrderType & """>", "value=""" & cOrderType & """ selected>"), ">", ">*")
7353 End If
7354 Response.Write Left(cReplaceSelected, InStr(cReplaceSelected, vbCrLf))
7355 End If
7356 End If
7357 End If
7358 End If
7359 %>
7360 <input type=hidden name="OriginalPostingOrderType<%=nCount%>" value="<%If oData("Posted") Then%><%=cOrderType%><%End If%>">
7361 <input type=hidden name="POSTAccessRight<%=nCount%>" value="<%If CheckAccessRight("POST","R",oData("BranchID")) Then%>1<%End If%>">
7362 <input type=hidden name="POSTESTAccessRight<%=nCount%>" value="<%If CheckAccessRight("POSTEST","R",oData("BranchID")) Then%>1<%End If%>">
7363 <input type=hidden name="POSTCEAccessRight<%=nCount%>" value="<%If CheckAccessRight("POSTCE","R",oData("BranchID")) Then%>1<%End If%>">
7364 <input type=hidden name="POSTNSAccessRight<%=nCount%>" value="<%If CheckAccessRight("POSTNS","R",oData("BranchID")) Then%>1<%End If%>">
7365 </select>
7366 <%
7367 'end dbb 5/21/07
7368
7369 If lClark Then
7370 %>
7371 <span id="EstimateSavedSpan<%=nCount%>" class="<%If lEstimateSaved Then Response.Write "Visible" Else Response.Write "Hidden"%>"><span id="EstimateSavedLinkSpan<%=nCount%>" class="Link" onClick="SaveEstimateDialog(<%=nCount%>)"><img src="/images/exclamation.gif"></span></span>
7372 <input type=hidden name="EstimateSaved<%=nCount%>" value="<%If lEstimateSaved Then Response.Write "1"%>">
7373 <%
7374 End If
7375 %>
7376 </td>
7377 <td width=125>Invoice Date:</td>
7378 <td width=100><input tabindex=<%=nIndex+2%> type=text name="InvoiceDate<%=nCount%>" size=10 maxlength=10 <%=VClass("Date","")%> value="<%=cInvoiceDate%>" <%If Not lEditInvDate Then Response.Write "readonly"%>></td>
7379 </tr>
7380
7381 <% If IsCustom("ISS128788") Then %>
7382 <tr>
7383 <td colspan="5" align="right">Credit Memo Required:</td>
7384 <td>
7385 <input type="checkbox" name="CreditMemoRequired<%=nCount%>" id="CreditMemoRequired<%=nCount%>" value="1" <% If (lRunsPosted And lCreditMemoRequired) Or (Not lRunsPosted And lRunsMissed) Then %>checked<% End If %>>
7386 <input type="hidden" name="RunsMissed<%=nCount%>" id="RunsMissed<%=nCount%>" value="<% If lRunsMissed Then %>1<% Else %>0<% End If %>">
7387 <input type="hidden" name="RunsShowDiscount<%=nCount%>" id="RunsShowDiscount<%=nCount%>" value="<% If lShowDiscount Then %>1<% Else %>0<% End If %>">
7388 </td>
7389 </tr>
7390 <% End If %>
7391
7392 <%
7393 If lMagical Then
7394 %>
7395 <tr>
7396 <td>PO #:</td>
7397 <td><input tabindex="<%=nIndex%>" type="text" name="PONumber<%=nCount%>" size=20 maxlength="30" value="<%=oData("PONumber")%>"></td>
7398 </tr>
7399 <%
7400 End If
7401 %>
7402
7403 <tr valign="top">
7404 <%
7405 nIndex = nIndex + 3
7406 If lShowTarget Then
7407 nColSpan = 2
7408 If lUseMultipleTargets Then
7409 %>
7410 <td><span id="MultipleTargetSpan" onClick="MultipleTargetSpan_onClick(<%=nCount%>, <%=oData("OrderID")%>)" class="Link">Targets</span>:</td>
7411 <td><span id="MultipleTargetList<%=nCount%>" popuptext="<%=cTargets%>" OnMouseOver="VBScript:Show_Popup(me.popuptext)" OnMouseOut="VBScript:Hide_Popup()" OnClick="VBScript:MultipleTargetListOnClick(<%=nCount%>)" style="cursor: default; width:180px; <%If Not lReliable Then%>height:14px; overflow:hidden;<%End If%>"><%=cTargets%></span></td>
7412 <%
7413 Else
7414 %>
7415 <td>Target:</td>
7416 <td>
7417 <input type="text" tabindex=<%=nIndex%> name="TargetPest<%=nCount%>" size="10" maxlength="10" <%=VClass("lookup","TargetPest_onKeyDown(" & nCount & ")|1")%> value="<%=oData("TargetPest")%>" onBlur="VBScript:TargetPest_onBlur(<%=nCount%>)" onKeyDown="VBScript:TargetPest_onKeyDown(<%=nCount%>)">
7418 <input type=hidden name="TargetID<%=nCount%>" value="<%=oData("TargetID")%>">
7419 </td>
7420 <%
7421 End If
7422 Else
7423 nColSpan = 4
7424 %>
7425 <input type=hidden name="TargetID<%=nCount%>" value="<%=cTargetID%>">
7426 <%
7427 End If
7428
7429 If Not lSwingle Then
7430 nColSpan = nColspan + 2
7431 End If
7432 %>
7433 <td colspan="<%=nColSpan%>">
7434 <% If lSwingle Then
7435
7436 Set objOrderAttributes = Server.CreateObject("PestPacService.OrderAttributes")
7437 Set oOrderAttributes = objOrderAttributes.GetAll(oGlobals("Database"), cOrderID, "")
7438 Set objOrderAttributes = Nothing
7439 Call CheckRSError(oOrderAttributes)
7440
7441 nAttribCount = 1
7442 Set oOrderAttributeDict = Server.CreateObject("Scripting.Dictionary")
7443 Set oOrderAttributeIDDict = Server.CreateObject("Scripting.Dictionary")
7444 cExistingAssignmentIDs = ""
7445 Do Until oOrderAttributes.EOF Or nAttribCount > 6
7446 If Len(oOrderAttributes("Description")) <= 3 Then
7447 oOrderAttributeDict(CStr(nAttribCount)) = Left(oOrderAttributes("Description"),3)
7448 oOrderAttributeIDDict(CStr(nAttribCount)) = oOrderAttributes("AttributeID")
7449 nAttribCount = nAttribCount + 1
7450 cExistingAssignmentIDs = cExistingAssignmentIDs & oOrderAttributes("AssignmentID") & "|"
7451 End If
7452
7453 If oOrderAttributes.AbsolutePosition Mod 50 = 0 Then Response.Flush
7454 oOrderAttributes.MoveNext
7455
7456 Loop
7457 %>
7458
7459 Attributes:
7460 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_1" value="<%=oOrderAttributeDict("1")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,1)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,1)">
7461 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_1" value="<%=oOrderAttributeIDDict("1")%>">
7462 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_2" value="<%=oOrderAttributeDict("2")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,2)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,2)">
7463 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_2" value="<%=oOrderAttributeIDDict("2")%>">
7464 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_3" value="<%=oOrderAttributeDict("3")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,3)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,3)">
7465 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_3" value="<%=oOrderAttributeIDDict("3")%>">
7466 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_4" value="<%=oOrderAttributeDict("4")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,4)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,4)">
7467 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_4" value="<%=oOrderAttributeIDDict("4")%>">
7468 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_5" value="<%=oOrderAttributeDict("5")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,5)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,5)">
7469 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_5" value="<%=oOrderAttributeIDDict("5")%>">
7470 <input type="text" size="3" maxlength="5" name="ServiceOrderAttribute<%=nCount%>_6" value="<%=oOrderAttributeDict("6")%>" onkeypress='javascript: vUCaseKey(this)' onkeydown="VBScript:Call ServiceOrderAttributeOnKeyDown(<%=nCount%>,6)" onblur="VBScript:Call ServiceOrderAttributeOnBlur(<%=nCount%>,6)">
7471 <input type=hidden name="ServiceOrderAttributeID<%=nCount%>_6" value="<%=oOrderAttributeIDDict("6")%>">
7472 <input type=hidden name="ServiceOrderExistingAssignmentIDs<%=nCount%>" value="<%=cExistingAssignmentIDs%>">
7473
7474 <%Else %>
7475 <span id="ServiceOrderAttribute" class="link" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'" onclick="VBScript:Call ServiceOrderAttributeClick('<%=cOrderID%>', '<%=oData("OrderNum")%>', '<%=cBranchID%>')">Attributes</span>
7476 <% End If
7477
7478 If lCopesanPart Or lSwingle Then
7479 %>
7480 <span id="ServiceOrderTechs" class="link" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'" onclick="VBScript:Call ServiceOrderTechsClick('<%=cOrderID%>', '<%=oData("OrderNum")%>')">Tech Production</span>
7481 <%
7482 If Not oData("ParentOrderID") = 0 Then
7483 %>
7484 <b> Has associated orders</b>
7485 <%
7486 End If
7487
7488 If lCopesanPart Then
7489 Set oIVRFields = Server.CreateObject("Scripting.Dictionary")
7490 oIVRFields("OrderID") = cOrderID
7491 lHasOverride = CBool(ExecuteNonQuery("IVRConfirmationIsOverride", oIVRFields))
7492 Set oIVRFields = Nothing
7493 %>
7494 <span id="IVRInfo" class="link" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'" onclick="VBScript: IVRInfoClick('<%=cOrderID%>')">IVR</span><span style="color: red; font-weight: bold;" <% If Not lHasOverride Then %>class="Hidden"<% End If %>> !</span>
7495 <%
7496 End If
7497 End If
7498 %>
7499 </td>
7500 <%
7501 If lSwingle Then
7502 %>
7503 <td>Invoice Print:</td>
7504 <td><input tabindex=<%=nIndex + 2%> type="checkbox" name="PostingSwingleBatchPrint<%=nCount%>" value="1" <%If oData("SwingleBatchPrint") Then%> checked <%End If%> onClick="VBScript:SwingleInvoicePrintOnClick <%=nCount%>, '<%=oData("SwingleBatchPrint")%>'"></td>
7505 <%
7506 Else
7507 %>
7508 <input type=hidden name="PostingSwingleBatchPrint<%=nCount%>" value="0">
7509 <%
7510 End If
7511 nIndex = nIndex + 3
7512 %>
7513 </tr>
7514
7515 <% 'FB 19485'
7516 For nI = 1 to 5
7517 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Tech" & nI & "Show") And (nI = 1 Or oSysDefaults("ShowPostingTech")) Then
7518 %>
7519 <tr>
7520 <td><%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Tech" & nI & "Caption")%>:</td>
7521 <td width=190>
7522 <input tabindex=<%=nIndex%> type=text name="Tech<%=nI & "_" & nCount%>" value="<%=oData("Tech" & nI)%>" size=10 maxlength=10 <%=VClass("lookup","TechOnKeyDown(" & nI & "," & nCount & "," & cBranchID & ")|1")%> OnKeyDown="TechOnKeyDown(<%=nI%>,<%=nCount%>,<%=cBranchID%>)" OnBlur="TechOnBlur(<%=nI%>,<%=nCount%>,<%=cBranchID%>)">
7523 <input type=hidden name="TechID<%=nI & "_" & nCount%>" value="<%=oData("TechID" & nI)%>">
7524 <input type=hidden name="OldTechID<%=nI & "_" & nCount%>" value="<%=oData("TechID" & nI)%>">
7525 <input type=hidden name="TechActive<%=nI & "_" & nCount%>" value="<%=oData("TechActive" & nI)%>">
7526 </td>
7527 <%If CheckAccessRight("COMMISSION_VIEW","R",oData("BranchID")) Then %>
7528 <td width=100>
7529 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Tech" & nI & "Caption")%> Bonus:
7530 </td>
7531 <td>
7532 <input tabindex=<%=nIndex%> type=text name="TechBonus<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechBonus" & nI),2,,False,False)%>" size=10 maxlength=10 <%=VClass("Num","9|2|1|1|0|1")%>>
7533 </td>
7534 <td>
7535 <%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Tech" & nI & "Caption")%> Share:
7536 </td>
7537 <td>
7538 <input tabindex=<%=nIndex%> type=text name="TechShare<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechShare" & nI),3,,False,False)%>" size=10 maxlength=10 <%=VClass("SharePercentage","3")%>>
7539 </td>
7540 <%
7541 Else
7542 %>
7543 <input type=hidden name="TechBonus<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechBonus" & nI),2,,False,False)%>">
7544 <input type=hidden name="TechShare<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechShare" & nI),3,,False,False)%>">
7545 <%
7546 End If
7547 Else
7548 %>
7549 <input type=hidden name="Tech<%=nI & "_" & nCount%>" value="<%=oData("Tech" & nI)%>">
7550 <input type=hidden name="TechBonus<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechBonus" & nI),2,,False,False)%>">
7551 <input type=hidden name="TechShare<%=nI & "_" & nCount%>" value="<%=FormatNumber(oData("TechShare" & nI),3,,False,False)%>">
7552 <input type=hidden name="TechID<%=nI & "_" & nCount%>" value="<%=oData("TechID" & nI)%>">
7553 <input type=hidden name="OldTechID<%=nI & "_" & nCount%>" value="<%=oData("TechID" & nI)%>">
7554 <input type=hidden name="TechActive<%=nI & "_" & nCount%>" value="<%=oData("TechActive" & nI)%>">
7555 <%
7556 End If
7557 Next
7558
7559 If lBugOut Then
7560 %>
7561 <tr>
7562 <td colspan="3">Order Branch: <select name="BranchID<%=nCount%>"><%Call FastSelectList("Branch", oData("BranchID"))%></select></td>
7563 <td colspan="3">Location Branch: <select disabled name="LocationBranchID<%=nCount%>"><%Call FastSelectList("Branch", oData("LocationBranchID"))%></select></td>
7564 </tr>
7565 <%
7566 ElseIf lCopesan Or lHolders Then
7567 %>
7568 <input type=hidden name="TechProdSubTotal<%=nCount%>" value="<%=cSubTotal%>">
7569 <%
7570 <!-- removed per quote 22 - KM 01312011 - FB 7381 -->
7571 ElseIf lRosePest And False And Not Em(oData("SetupID")) Then
7572 %>
7573 <tr><td height=1 colspan=6 bgcolor="#ffffff"></td></tr>
7574 <tr>
7575 <td colspan="3">Next Service Date: <input tabindex=<%=nIndex%> type=text name="NextServiceDate<%=nCount%>" size=10 maxlength=10 <%=VClass("Date","")%> value="<%=FormatDate(oData("PostingNextServiceDate"))%>"></td>
7576 <%
7577 'if next service time exists, don't change AmPm field on blur
7578 If Len(FormatTime(oData("PostingNextServiceDate"))) = 0 Then
7579 cAmPmField = "NextServiceAmPm" & nCount
7580 Else
7581 cAmPmField = "|"
7582 End If
7583 '-
7584 %>
7585 <td colspan="3">
7586 Next Service Time: <input type=text tabindex=<%=nIndex+1%> name="NextServiceTime<%=nCount%>" size=5 maxlength=5 <%=VClass("Time", cAmPmField)%> value="<%=FormatTime(oData("PostingNextServiceDate"))%>">
7587 <select tabindex=<%=nIndex+2%> name="NextServiceAmPm<%=nCount%>">
7588 <% Call AmPmList(FormatAmPm(oData("PostingNextServiceDate"))) %>
7589 </select>
7590 </td>
7591 </tr>
7592 <%
7593 nIndex = nIndex + 3
7594 End If
7595 %>
7596 <tr><td height=1 colspan=6 bgcolor="#ffffff"></td></tr>
7597 </table>
7598 <%
7599 If lShowService Then
7600 %>
7601 <table id="ServiceLine<%=nCount%>" border=0 cellspacing=0 cellpadding=0 width="100%">
7602 <%
7603 If oOrderLines.RecordCount = 0 Then
7604 cVisible = "Hidden"
7605 Else
7606 cVisible = "Visible"
7607 End If
7608 %>
7609
7610 <tr>
7611 <input type=hidden name="TaxRate<%=nCount%>" value="<%=cTaxRate%>">
7612 <input type=hidden name="PST<%=nCount%>" value="<%=cPST%>">
7613 <input type=hidden name="CanadianTax<%=nCount%>" value="<%=cCanadianTax%>">
7614 <input type=hidden name="PSTonGST<%=nCount%>" value="<%=cPSTonGST%>">
7615 <input type=hidden name="ServiceType<%=nCount%>" value="<%=cServiceType%>">
7616
7617 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>"><input type=hidden name="Lines<%=nCount%>" value="<%=oOrderLines.RecordCount%>">Service</span></td>
7618 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Description</span></td>
7619 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Qty</span></td>
7620 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Price</span></td>
7621 <%
7622 If lUseProductionValue Then
7623 %>
7624 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Prod. Value</span></td>
7625 <%
7626 End If
7627
7628 If lShowCost Then
7629 %>
7630 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Cost</span></td>
7631 <%
7632 End If
7633 %>
7634 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Tax<br />
7635 <img src="/images/blank.gif" height="1" width="22" alt="" border="0" /></span></td>
7636 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Del<br />
7637 <img src="/images/blank.gif" height="1" width="22" alt="" border="0" /></span></td>
7638 <%
7639 If lShowGL Then
7640 %>
7641 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">GL Code</span></td>
7642 <%
7643 Else
7644 %>
7645 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>"> </span></td>
7646 <%
7647 End If
7648
7649 If Not lShowCost Then
7650 %>
7651 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>"> </span></td>
7652 <%
7653 End If
7654
7655 If lNJLawn And Not lUseProductionValue Then
7656 %>
7657 <td><span id="LineSpan<%=nCount%>" class="<%=cVisible%>">Production</span></td>
7658 <%
7659 End If
7660 %>
7661 </tr>
7662
7663 <%
7664 nLineNumber = 1
7665
7666 '--Added for Russell to default check Advance Renewal - MC 9/7/07
7667 lAdvanceRenewal = False
7668 '--End MC
7669
7670 Do Until oOrderLines.EOF
7671 If Not oOrderLines("PriceByMeasurement") Then
7672 cStyle = "Visibility: hidden; width: 0px"
7673 cQuantityStyle = ""
7674 Else
7675 cStyle = "Visibility: visible;"
7676 cQuantityStyle = "Visibility: hidden; display:none; width:0px"
7677 cSpanText = "Measure"
7678 End If
7679
7680 '--Added for Russell to default check Advance Renewal - MC 9/7/07
7681 If lRussell And (oOrderLines("ServiceCode") = "SENTR" Or oOrderLines("ServiceCode") = "LIQR") And Not lAdvanceRenewal then
7682 lAdvanceRenewal = True
7683 End If
7684 '--End MC
7685 %>
7686 <tr>
7687 <td valign="top">
7688 <input type=hidden name="<%=nLineNumber%>OrderLineID<%=nCount%>" value="<%=oOrderLines("LineID")%>">
7689 <input tabindex=<%=nIndex%> type=text name="<%=nLineNumber%>ServiceCode<%=nCount%>" size=15 maxlength=15
7690 <%=VClass("lookup","ServiceOnKeyDown(" & nLineNumber & "," & nCount & "," & cBranchID & ")|1")%> value="<%=Trim(oOrderLines("ServiceCode"))%>" onBlur="VBScript:Call ServiceOnBlur(<%=nLineNumber%>,<%=nCount%>,<%=cBranchID%>)" onKeyDown="VBScript:Call ServiceOnKeyDown(<%=nLineNumber%>,<%=nCount%>,<%=cBranchID%>)">
7691 <input type=hidden name="<%=nLineNumber%>ServiceID<%=nCount%>" value="<%=oOrderLines("ServiceID")%>">
7692 <input type=hidden name="<%=nLineNumber%>ServiceType<%=nCount%>" value="<%=oOrderLines("ServiceType")%>">
7693 <input type=hidden name="<%=nLineNumber%>OServiceCode<%=nCount%>" value="<%=Trim(oOrderLines("ServiceCode"))%>">
7694 <%
7695 If lUseChemicals And lLinkChemToService Then
7696 %>
7697 <input type=hidden name="<%=nLineNumber%>LastServiceCode<%=nCount%>" value="<%=Trim(oOrderLines("ServiceCode"))%>">
7698 <%
7699 End If
7700 %>
7701 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementDelete<%=nCount%>" value="0">
7702 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementBasePrice<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementBasePrice")%>">
7703 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementUnitPrice<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementUnitPrice")%>">
7704 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementMinPrice<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementMinPrice")%>">
7705 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementQuantity<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementQuantity")%>">
7706 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementLocation<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementLocation")%>">
7707 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementComment<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementComment")%>">
7708 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementPrintDetail<%=nCount%>" value="<% If oOrderLines("PriceByMeasurementPrintDetail") Then %>1<%Else%>0<%End If%>">
7709 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementPriceDate<%=nCount%>" value="<%=Coalesce(oOrderLines("PriceByMeasurementPriceDate"),"")%>">
7710 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementOverride<%=nCount%>" value="<% If oOrderLines("PriceByMeasurementOverride") Then %>1<%Else%>0<%End If %>">
7711 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementPriceAdjustor<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementPriceAdjustor")%>">
7712 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementPriceAdjustorReasonID<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementPriceAdjustorReasonID")%>">
7713 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementCustomerDiscountDollars<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementCustomerDiscountDollars")%>">
7714 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementCustomerDiscountPercent<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementCustomerDiscountPercent")%>">
7715 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementDiscountExpirationDate<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementDiscountExpirationDate")%>">
7716 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementTypeID<%=nCount%>" value="<%=oOrderLines("PriceByMeasurementTypeID")%>">
7717 <input type=hidden name="<%=nLineNumber%>PriceByMeasurementLineMeasurementID<%=nCount%>" value=<%=oOrderLines("PriceByMeasurementLineMeasurementID")%>>
7718 <input type=hidden name="<%=nLineNumber%>HasDefaultAttribute<%=nCount%>" value="<%=oOrderLines("HasDefaultAttribute")%>">
7719 </td>
7720
7721 <td valign="top">
7722 <span id="<%=nLineNumber%>DescriptionSpan<%=nCount%>">
7723 <input tabindex=<%=(nIndex+1)%> type=hidden name="<%=nLineNumber%>HiddenDescription<%=nCount%>" value="<%=Server.HTMLEncode(oOrderLines("Description"))%>" onfocus="VBScript:Call DescriptionOnFocus()" onblur="VBScript: Call DescriptionOnBlur()">
7724 <input tabindex=<%=(nIndex+1)%> type=hidden name="<%=nLineNumber%>HiddenDetailedDescription<%=nCount%>" value="<%=Server.HTMLEncode(Coalesce(oOrderLines("DetailedDescription"),""))%>" onblur="VBScript: Call DescriptionOnBlur()">
7725 <%
7726 If lUseDetailedDescription Then
7727 cDescription = Coalesce(oOrderLines("DetailedDescription"),"")
7728 aDescription = WordWrap(cDescription, 25)
7729 cDescription = aDescription(0)
7730
7731 If Server.HTMLEncode(cDescription) <> Server.HTMLEncode(Coalesce(oOrderLines("DetailedDescription"), "")) Then
7732 cDescriptionStyle = "class='input-expand'"
7733 Else
7734 cDescriptionStyle = ""
7735 End If
7736 %>
7737 <input <%=cDescriptionStyle%> tabindex=<%=(nIndex+1)%> type=text name="<%=nLineNumber%>Description<%=nCount%>" size=30 maxlength=50 value="<%=Server.HTMLEncode(cDescription)%>" onfocus="VBScript:Call DescriptionOnFocus()" onblur="VBScript:Call DescriptionOnBlur()">
7738 <%
7739 Else
7740 %>
7741 <input tabindex=<%=(nIndex+1)%> type=text name="<%=nLineNumber%>Description<%=nCount%>" size=30 maxlength=50 value="<%=Server.HTMLEncode(oOrderLines("Description"))%>" onfocus="VBScript:Call DescriptionOnFocus()" onblur="VBScript:Call DescriptionOnBlur()">
7742 <%
7743 End If
7744 %>
7745 </span>
7746
7747 </td>
7748
7749 <td valign="top">
7750 <input tabindex=<%=nIndex + 2%> type=text name="<%=nLineNumber%>Quantity<%=nCount%>" size=8 maxlength=8 onblur="javascript: vNumBlur(this, 9,2,1,1,0,1); VBScript: CalculateTaxTotal(<%=nCount%>);" onkeypress="javascript: vNumKey(this,1)" value="<%=FormatNumber(oOrderLines("Quantity"),2,,False,False)%>" style="<%=cQuantityStyle%>">
7751 <span id="<%=nLineNumber%>EditMeasurementsSpan<%=nCount%>" style="<%=cStyle%>" class="Link" onClick="EditMeasurements('<%=nLineNumber%>', '<%=nCount%>')" onMouseOut="Hide_Popup()" onMouseOver="ShowMeasurements('<%=nLineNumber%>', '<%=nCount%>')"><%=cSpanText%></span>
7752 </td>
7753 <%
7754 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UseFourDecimalUnitPrice") Then
7755 %>
7756 <td valign="top"><input <% If Not Em(Coalesce(oOrderLines("PriceByMeasurementLineMeasurementID"),"")) Then Response.Write "readonly" End If %> tabindex=<%=nIndex + 3%> type=text name="<%=nLineNumber%>UnitPrice<%=nCount%>" size=11 maxlength=11 onblur="javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: CalculateTaxTotal(<%=nCount%>);" onkeypress="javascript: vNumKey(this,1)" value="<%=FormatNumber(oOrderLines("UnitPrice"),4,,False,False)%>"></td>
7757 <%
7758 Else
7759 %>
7760 <td valign="top"><input <% If Not Em(Coalesce(oOrderLines("PriceByMeasurementLineMeasurementID"),"")) Then Response.Write "readonly" End If %> tabindex=<%=nIndex + 3%> type=text name="<%=nLineNumber%>UnitPrice<%=nCount%>" size=9 maxlength=9 onblur="javascript: vNumBlur(this, 9,2,1,1,0,1); VBScript: CalculateTaxTotal(<%=nCount%>);" onkeypress="javascript: vNumKey(this,1)" value="<%=FormatNumber(oOrderLines("UnitPrice"),2,,False,False)%>"></td>
7761 <%
7762 End If
7763
7764 If lUseProductionValue Then
7765 %>
7766 <td valign="top"><input tabindex=<%=nIndex + 4%> type=text name="<%=nLineNumber%>ProductionValue<%=nCount%>" size=9 maxlength=9 onblur="javascript: vNumBlur(this, 9,2,1,1,0,1);" onkeypress="javascript: vNumKey(this,1)" value="<%=FormatNumber(oOrderLines("ProductionValue"),2,,False,False)%>"></td>
7767 <%
7768 End If
7769
7770 If lShowCost Then
7771 %>
7772 <td valign="top"><input tabindex=<%=nIndex + 4%> type=text name="<%=nLineNumber%>Cost<%=nCount%>" size=9 maxlength=9 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=FormatNumber(oOrderLines("Cost"),2,,False,False)%>"></td>
7773 <%
7774 Else
7775 %>
7776 <input type=hidden name="<%=nLineNumber%>Cost<%=nCount%>" value="<%=oOrderLines("Cost")%>">
7777 <%
7778 End If
7779 %>
7780 <td valign="top"><input tabindex=<%=nIndex + 5%> type=checkbox name="<%=nLineNumber%>Taxable<%=nCount%>" value="1" <%If oOrderLines("Taxable") Then Response.Write "checked"%> OnClick="CalculateTaxTotal(<%=nCount%>)"></td>
7781 <td valign="top"><input tabindex=<%=nIndex + 6%> type=checkbox name="<%=nLineNumber%>DeleteLine<%=nCount%>" value="1" OnClick="CalculateTaxTotal(<%=nCount%>)"></td>
7782 <%
7783 If lShowGL Then
7784 If lLockGL Then
7785 %>
7786 <td valign="top"><input type=text readonly name="<%=nLineNumber%>GLCode<%=nCount%>" size=10 maxlength=10 <%=VClass("UCase","")%> value="<%=oOrderLines("GLCode")%>">
7787 <input type=hidden name="<%=nLineNumber%>GLCodeID<%=nCount%>" value="<%=oOrderLines("GLCodeID")%>">
7788 </td>
7789 <%
7790 Else
7791 %>
7792 <td valign="top"><input tabindex=<%=nIndex + 7%> type=text name="<%=nLineNumber%>GLCode<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","GLCodeLineOnKeyDown(" & nLineNumber & "," & nCount & ")|1")%> value="<%=oOrderLines("GLCode")%>" onBlur="VBScript:Call GLCodeLineOnBlur(<%=nLineNumber%>,<%=nCount%>)" onKeyDown="VBScript:Call GLCodeLineOnKeyDown(<%=nLineNumber%>,<%=nCount%>)">
7793 <input type=hidden name="<%=nLineNumber%>GLCodeID<%=nCount%>" value="<%=oOrderLines("GLCodeID")%>">
7794 </td>
7795 <%
7796 End If
7797 Else
7798 %>
7799 <td valign="top"> </td>
7800 <input type=hidden name="<%=nLineNumber%>GLCode<%=nCount%>" value="<%=oOrderLines("GLCode")%>">
7801 <input type=hidden name="<%=nLineNumber%>GLCodeID<%=nCount%>" value="<%=oOrderLines("GLCodeID")%>">
7802 <%
7803 End If
7804
7805 If Not lShowCost Then
7806 %>
7807 <td valign="top"> </td>
7808 <%
7809 End If
7810
7811 If lNJLawn And Not lUseProductionValue Then
7812 %>
7813 <td valign="top"><input tabindex=<%=nIndex + 8%> type=checkbox name="<%=nLineNumber%>ProductionValue<%=nCount%>" value="-54321" <%If CDbl(oOrderLines("ProductionValue")) = -54321 Then Response.Write "checked"%> /></td>
7814 <%
7815 End If
7816 %>
7817 </tr>
7818 <%
7819 nIndex = nIndex + 9
7820 nLineNumber = nLineNumber + 1
7821
7822 If oOrderLines.AbsolutePosition Mod 50 = 0 Then Response.Flush
7823 oOrderLines.MoveNext
7824 Loop
7825 %>
7826
7827 <tr>
7828 <td colspan=8 width=100%>
7829 <table border="0" cellpadding="0" cellpadding="3" width="100%">
7830 <tr>
7831 <td>
7832 <%
7833 If oOrderLines.RecordCount < nOrderShowLines Or lOrderShowMore Then
7834 cSpanClass = "Link"
7835 Else
7836 cSpanClass = "Hidden"
7837 End If
7838 %>
7839 <span id="AddService<%=nCount%>" class=<%=cSpanClass%> OnClick="VBScript:Call AddServiceOnClick(<%=nCount%>,<%=cBranchID%>)">Add New Service</span>
7840 </td>
7841 </tr>
7842 </table>
7843 </td>
7844 </tr>
7845
7846 <tr><td height=1 colspan=10 bgcolor="#ffffff"></td></tr>
7847 </table>
7848
7849 <input type=hidden name="LineIndex<%=nCount%>" value="<%=nIndex%>">
7850 <input type=hidden name="LineRank<%=nCount%>" value="<%=nRank%>">
7851 <%
7852 Else
7853 %>
7854 <input type=hidden name="ServiceType<%=nCount%>" value="<%=cServiceType%>">
7855 <%
7856 End If
7857 %>
7858
7859 <table border=0 cellspacing=0 cellpadding=2 width="100%">
7860 <tr>
7861 <%
7862 If lShowGL Then
7863 %>
7864 <td width=90>AR GL Code:</td>
7865 <%
7866 If lLockGL Then
7867 %>
7868 <td width=90><input type=text readonly name="GLARCode<%=nCount%>" size=10 maxlength=10 <%=VClass("UCase","")%> value="<%=cGLARCode%>">
7869 <input type=hidden name="GLARCodeID<%=nCount%>" value="<%=cGLARCodeID%>">
7870 <input type=hidden name="LocationGLCode<%=nCount%>" value="<%=cLocationGLCode%>">
7871 <input type=hidden name="LocationGLCodeID<%=nCount%>" value="<%=cLocationGLCodeID%>">
7872 </td>
7873 <%
7874 Else
7875 %>
7876 <td width=90><input tabindex=<%=nIndex%> type=text name="GLARCode<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","GLARCodeOnKeyDown(" & nCount & ")|1")%> value="<%=cGLARCode%>" onBlur="VBScript:GLARCodeOnBlur(<%=nCount%>)" onKeyDown="VBScript:GLARCodeOnKeyDown(<%=nCount%>)">
7877 <input type=hidden name="GLARCodeID<%=nCount%>" value="<%=cGLARCodeID%>">
7878 <input type=hidden name="LocationGLCode<%=nCount%>" value="<%=cLocationGLCode%>">
7879 <input type=hidden name="LocationGLCodeID<%=nCount%>" value="<%=cLocationGLCodeID%>">
7880 </td>
7881 <%
7882 nIndex = nIndex + 1
7883 End If
7884 Else
7885 %>
7886 <input type=hidden name="GLARCode<%=nCount%>" value="<%=cGLARCode%>">
7887 <input type=hidden name="GLARCodeID<%=nCount%>" value="<%=cGLARCodeID%>">
7888 <input type=hidden name="LocationGLCode<%=nCount%>" value="<%=cLocationGLCode%>">
7889 <input type=hidden name="LocationGLCodeID<%=nCount%>" value="<%=cLocationGLCodeID%>">
7890 <%
7891 End If
7892 %>
7893 <td width=70>Subtotal:
7894 <input type=hidden readonly name="OrigSubTotal<%=nCount%>" size=10 value="<%=cSubTotal%>">
7895 <input type=hidden readonly name="OrigTaxTotal<%=nCount%>" size=10 value="<%=cTaxTotal%>">
7896 <input type=hidden readonly name="TaxCode<%=nCount%>" size=10 value="<%=cTaxCode%>">
7897 </td>
7898 <td width=100><input type=text readonly name="SubTotal<%=nCount%>" size=10 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=cSubTotal%>"></td>
7899 <td width=40>Tax:</td>
7900 <td width=100><input type=text readonly name="TaxTotal<%=nCount%>" size=10 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=cTaxTotal%>"></td>
7901 <td width=55>Total:</td>
7902 <td width=100><input type=text readonly name="NewTotal<%=nCount%>" size=10 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=cTotal%>"></td>
7903 <%
7904 If Not lShowGL Then
7905 %>
7906 <td width=180> </td>
7907 <%
7908 End If
7909 %>
7910 </tr>
7911 <%
7912 If Not IsNull(oData("AuthTransactionID")) Then
7913 %>
7914 <tr>
7915 <td colspan="6" style="color: red; font-weight: bold">Credit Card Authorized for <%=FormatNumber(oData("AuthAmount"),2)%></td>
7916 </tr>
7917 <%
7918 End If
7919 %>
7920 <tr><td height=1 colspan=8 bgcolor="#ffffff"></td></tr>
7921 </table>
7922
7923 <table border=0 cellspacing=0 cellpadding=2 width="100%">
7924 <%
7925 If lShowPayment Then
7926 If lPaymentDiscount Then
7927 %>
7928 <tr>
7929 <td width=90 nowrap>Amount Paid:</td>
7930 <td width=90><input tabindex=<%=nIndex%> type=text <%=cPaymentDisable%> name="Payment<%=nCount%>" size=9 maxlength=9 <%=VClass("Num","9|2|1|0|0|1")%> value="<%=cPayment%>" onFocus="PaymentOnFocus(<%=nCount%>)"></td>
7931 <td width=50>MOP:</td>
7932 <td width=95>
7933 <input tabindex=<%=nIndex+1%> type=text <%=cPaymentDisable%> name="MethodOfPayment<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","MethodOfPaymentOnKeyDown(" & nCount & ")|1")%> value="<%=cMethodOfPayment%>" OnKeyDown=MethodOfPaymentOnKeyDown(<%=nCount%>) OnBlur=MethodOfPaymentOnBlur(<%=nCount%>)>
7934 <input type=hidden name="MethodOfPaymentID<%=nCount%>" value="<%=cMethodOfPaymentID%>">
7935 </td>
7936 <td width=80>Reference:</td>
7937 <td width=95>
7938 <input tabindex=<%=nIndex+2%> type=text <%=cPaymentDisable%> name="Reference<%=nCount%>" size=10 maxlength=16 <%=VClass("UCase","")%> value="<%=cReference%>" OnBlur="ReferenceOnBlur(<%=nCount%>)">
7939 <input type=hidden name="BillToID<%=nCount%>" value="<%=cBillToID%>">
7940 </td>
7941 <td width=65>Discount:</td>
7942 <%
7943 If lShowDiscount Then
7944 %>
7945 <td width=80><input tabindex=<%=nIndex+3%> type=text <%=cPaymentDisable%> name="Discount<%=nCount%>" size=6 maxlength=9 value="<%=cDiscount%>" onFocus="DiscountOnFocus(<%=nCount%>)" onBlur="javascript:vNumBlur(this,9,2,1,0,0,1);VBScript:DiscountOnBlur(<%=nCount%>)" onKeyPress="javascript: vNumKey(this,0)"></td>
7946 <%
7947 Else
7948 %>
7949 <td width=80>
7950 <input tabindex=<%=nIndex+3%> type=text disabled name="DisabledDiscount<%=nCount%>" size=6 maxlength=9 value="<%=Coalesce(cDiscount,"0.00")%>">
7951 <input type=hidden name="Discount<%=nCount%>" value="<%=cDiscount%>">
7952 </td>
7953 <%
7954 End If
7955 %>
7956 <td>Adjust.</td>
7957 <%
7958 If lShowDiscount Then
7959 %>
7960 <td>
7961 <select <%=cPaymentDisable%> tabindex=<%=nIndex+4%> name="AdjustmentReason<%=nCount%>">
7962 <option value="">
7963 <%Call FastSelectList("Adjustment", cAdjustmentReason) %>
7964 </select>
7965 </td>
7966 <%
7967 Else
7968 %>
7969 <td>
7970 <select tabindex=<%=nIndex+4%> disabled name="AdjustmentReason<%=nCount%>">
7971 <option value="">
7972 <%Call FastSelectList("Adjustment", cAdjustmentReason) %>
7973 </select>
7974 </td>
7975 <%
7976 End If
7977 %>
7978
7979 </tr>
7980 <%
7981 nIndex = nIndex + 5
7982 Else
7983 %>
7984 <tr>
7985 <td width=90 nowrap>Amount Paid:</td>
7986 <td width=90><input tabindex=<%=nIndex%> type=text <%=cPaymentDisable%> name="Payment<%=nCount%>" size=9 maxlength=9 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=cPayment%>" onFocus="PaymentOnFocus(<%=nCount%>)"></td>
7987 <td width=130>Method of Payment:</td>
7988 <td width=100>
7989 <input tabindex=<%=nIndex+1%> type=text <%=cPaymentDisable%> name="MethodOfPayment<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","MethodOfPaymentOnKeyDown(" & nCount & ")|1")%> value="<%=cMethodOfPayment%>" OnKeyDown=MethodOfPaymentOnKeyDown(<%=nCount%>) OnBlur=MethodOfPaymentOnBlur(<%=nCount%>)>
7990 <input type=hidden name="MethodOfPaymentID<%=nCount%>" value="<%=cMethodOfPaymentID%>">
7991 </td>
7992 <td width=90>Reference:</td>
7993 <td width=100>
7994 <input tabindex=<%=nIndex+2%> type=text <%=cPaymentDisable%> name="Reference<%=nCount%>" size=10 maxlength=16 <%=VClass("UCase","")%> value="<%=cReference%>" OnBlur="ReferenceOnBlur(<%=nCount%>)">
7995 <input type=hidden name="BillToID<%=nCount%>" value="<%=cBillToID%>">
7996 </td>
7997 <td width=45>
7998 <input type=hidden name="Discount<%=nCount%>" value="<%=cDiscount%>">
7999 <input type=hidden name="AdjustmentReason<%=nCount%>" value="<%=cAdjustmentReason%>">
8000 </td>
8001 </tr>
8002 <%
8003 nIndex = nIndex + 3
8004 End If
8005 Else
8006 %>
8007 <input type=hidden name="Payment<%=nCount%>" value="<%=cPayment%>">
8008 <input type=hidden name="Reference<%=nCount%>" value="<%=cReference%>">
8009 <input type=hidden name="MethodOfPayment<%=nCount%>" value="<%=cMethodOfPayment%>">
8010 <input type=hidden name="MethodOfPaymentID<%=nCount%>" value="<%=cMethodOfPaymentID%>">
8011 <input type=hidden name="Discount<%=nCount%>" value="<%=cDiscount%>">
8012 <input type=hidden name="AdjustmentReason<%=nCount%>" value="<%=cAdjustmentReason%>">
8013 <%
8014 End If
8015 %>
8016 </table>
8017
8018 <table cellspacing="0" cellpadding="2" width="600">
8019 <col width="105">
8020 <col width="495">
8021 <%
8022 If lShowComment Then
8023 %>
8024 <!-- Added the old order instructions back based on a company config option. DS 02/02/2011 FB 7482 -->
8025 <% If lPostEditInst Then %>
8026 <tr>
8027 <td>
8028 Order Instructions:<br> <input style="margin-top:5px;" tabindex=<%=nIndex%> type=text name="CommentCode<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","CommentCodeOnKeyDown(""CommentCode""," & nCount & ")|1")%> value="<%=cCommentCode%>" OnKeyDown="CommentCodeOnKeyDown('CommentCode', <%=nCount%>)" OnBlur="CommentCodeOnBlur('Comment', <%=nCount%>)">
8029 <input type=hidden name="CommentID<%=nCount%>" value="<%=Coalesce(cCommentID,"0")%>">
8030 </td>
8031 <td><textarea tabindex=<%=nIndex+1%> name="Comment<%=nCount%>" <%If cCommentCode <> "MISC" Then Response.Write "readonly "%> <%=VClass("Limited", "8000|-1")%> cols=60 rows=4><%=Server.HTMLEncode(Coalesce(cCommentText,""))%></textarea></td>
8032 </tr>
8033
8034 <% Else %>
8035
8036 <input type=hidden name="CommentID<%=nCount%>" value="<%=Coalesce(cCommentID,"0")%>">
8037 <input type=hidden name="Comment<%=nCount%>" value="<%=Server.HTMLEncode(Coalesce(cCommentText,""))%>">
8038
8039 <% End If %>
8040 <!-- End FB 7482 -->
8041
8042 <tr>
8043 <td>
8044 <!-- Modified to only allow user to view order instructions by clicking the View Instructions Link below. -fgd 12/23/2010. -->
8045 Tech Comment:<br> <input style="margin-top:5px;" tabindex=<%=nIndex+2%> type=text name="FieldCommentCode<%=nCount%>" size=10 maxlength=10 <%=VClass("lookup","CommentCodeOnKeyDown(""FieldCommentCode""," & nCount & ")|1")%> value="<%=cFieldCommentCode%>" OnKeyDown="CommentCodeOnKeyDown('FieldCommentCode', <%=nCount%>)" OnBlur="CommentCodeOnBlur('FieldComment', <%=nCount%>)">
8046 <input type=hidden name="FieldCommentID<%=nCount%>" value="<%=Coalesce(cFieldCommentID,"0")%>">
8047 </td>
8048 <td><textarea tabindex=<%=nIndex+3%> name="FieldComment<%=nCount%>" <%If cFieldCommentCode <> "MISC" Then Response.Write "readonly "%> <%=VClass("Limited", "8000|-1")%> cols=60 rows=4><%=Server.HTMLEncode(Coalesce(cFieldCommentText,""))%></textarea></td>
8049 </tr>
8050 <tr>
8051 <td colspan="2">
8052 <span id="ViewInstructions<%=nCount%>" class="Link" OnClick="VBScript:Call ViewInstructions(<%=nCount%>)">View Instructions</span>
8053 <%
8054 ' Moved Add Note link here (from above). -fgd 12/23/2010 FB 6694
8055 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LocationNote") = "Y" And _
8056 CheckAccessRight("NOTE","A",oData("BranchID")) Then
8057 %>
8058 <span id="Note<%=nCount%>" class="Link" OnClick="VBScript:Call NoteOnClick(<%=nCount%>)">Add Note</span>
8059 <%
8060 End If
8061
8062 If lPioneer338376 Then
8063 %>
8064 <span id="TechNoteCopy<%=nCount%>" class="Link" OnClick="VBScript:Call CopyTechNoteOnClick(<%=nCount%>)">Copy Tech Comment to Location Notes</span>
8065 <%
8066 End If
8067
8068 If lClark338110 Then
8069 %>
8070 <span id="GenCancellation<%=nCount%>" class="Link" OnClick="VBScript:Call GenerateCancellation('<%=oData("OrderID")%>','<%=nCount%>')">Generate Cancellation</span>
8071 <%
8072 End If
8073
8074 If lClark338110 Then
8075 %>
8076 <span id="GenCancellation<%=nCount%>" class="Link" OnClick="VBScript:Call GenerateCancellation('<%=oData("OrderID")%>','<%=nCount%>')">Generate Cancellation</span>
8077 <%
8078 End If
8079 %>
8080 </td>
8081 </tr>
8082 <%
8083 nIndex = nIndex + 5
8084 Else
8085 %>
8086 <%
8087 ' Moved Add Note link here (from above). -fgd 12/23/2010 FB 6694
8088 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("LocationNote") = "Y" And _
8089 CheckAccessRight("NOTE","A",oData("BranchID")) Then
8090 %>
8091 <span id="Note<%=nCount%>" class="Link" OnClick="VBScript:Call NoteOnClick(<%=nCount%>)">Add Note</span>
8092 <%
8093 End If
8094
8095 If lPioneer338376 Then
8096 %>
8097 <span id="TechNoteCopy<%=nCount%>" class="Link" OnClick="VBScript:Call CopyTechNoteOnClick(<%=nCount%>)">Copy Tech Comment to Location Notes</span>
8098 <%
8099 End If
8100
8101 If lSuburban Then
8102 %>
8103 <span id="Task<%=nCount%>" class="Link" OnClick="VBScript:Call TaskOnClick(<%=nCount%>)">Add Task</span>
8104 <%
8105 End If
8106 %>
8107 <input type=hidden name="Comment<%=nCount%>" value="<%=Server.HTMLEncode(Coalesce(cCommentText,""))%>">
8108 <input type=hidden name="CommentID<%=nCount%>" value="<%=Coalesce(cCommentID,"0")%>">
8109 <input type=hidden name="FieldComment<%=nCount%>" value="<%=Server.HTMLEncode(Coalesce(cFieldCommentText,""))%>">
8110 <input type=hidden name="FieldCommentID<%=nCount%>" value="<%=Coalesce(cFieldCommentID,"0")%>">
8111 <%
8112 End If
8113 %>
8114 </table>
8115
8116 <table border=0 cellspacing=0 cellpadding=2 width="100%">
8117 <%
8118 If lCopesan Or lHolders Then
8119 %>
8120 <tr><td height=1 colspan=6 bgcolor="#ffffff"></td></tr>
8121 <tr>
8122 <%
8123 ' # of Techs
8124 nTechCount = 1
8125 For nI = 1 To 4
8126 If Not IsNull(aTechProd(nI, 1)) Then
8127 nTechCount = nTechCount + 1
8128 End If
8129 Next
8130
8131 For nI = 0 to 4
8132 If nI = 3 Then 'wrap to a new row
8133 %>
8134 </tr><tr>
8135 <%
8136 End If
8137 If (Not IsNull(aTechProd(nI,1))) Or (nI = 0) Then
8138 %>
8139 <td nowrap width=115><%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Tech" & nI+1 & "Caption")%>: <span id="TechProd<%=nI+1%><%=nCount%>"><%=aTechProd(nI, 0)%></span></td>
8140 <td width=100>
8141 <input readonly tabindex=<%=nIndex%> type=text name="ProdAmount<%=nI+1%><%=nCount%>" size=10 <%=VClass("Num","9|2|1|1|0|1")%> value="<%=FormatNumber(aTechProd(nI,2),2,,False,False)%>">
8142 </td>
8143 <%
8144 Else
8145 %>
8146 <td colspan=2 width=215>
8147 <input type=hidden name="ProdAmount<%=nI+1%><%=nCount%>" value="0">
8148 </td>
8149 <%
8150 End If
8151 Next
8152
8153 nIndex = nIndex + 5
8154 %>
8155 </tr>
8156 <%
8157 Else
8158 For nI = 0 To 4
8159 %>
8160 <input type=hidden name="ProdAmount<%=nI+1%><%=nCount%>" value="0">
8161 <%
8162 Next
8163 End If
8164 %>
8165 </table>
8166
8167 <table border=0 cellspacing=0 cellpadding=2 width="100%">
8168 <%
8169 If lShowRenewal Then
8170 %>
8171 <tr>
8172 <td>
8173 <%
8174 ' -- Added Bizzy Bees MH 12-19-08
8175 '--Added to always check Advance Renewal Date for Falcon - MC 2/7/06
8176 'If lFalcon Then
8177 '--Added Russell to default Advance Renewal Date for 2 services - MC 9/7/07
8178 If lFalcon Or (lRussell And lAdvanceRenewal) Or lJHI126824 Or lBizzyBees336794 Then
8179 %>
8180 <input tabindex="<%=nIndex%>" type=checkbox name="RenewalAdvance<%=nCount%>" value="1" <%Response.Write "checked"%>>Advance Renewal Date
8181 <%
8182 Else
8183 %>
8184 <input tabindex="<%=nIndex%>" type=checkbox name="RenewalAdvance<%=nCount%>" value="1" <%If lPostRenewalAdvance Then Response.Write "checked"%>>Advance Renewal Date
8185 <%
8186 End If
8187 '--End Add
8188 %>
8189 </td>
8190 </tr>
8191 <%
8192 nIndex = nIndex + 1
8193 Else
8194 %>
8195 <input type=hidden name="RenewalAdvance<%=nCount%>" value="">
8196 <%
8197 End If
8198 %>
8199 <tr><td height=1 bgcolor="#ffffff"></td></tr>
8200 </table>
8201
8202 <table class="Visible" STYLE="table-layout:fixed" border=0 cellspacing=0 cellpadding=0 width="630" style="position:relative; left:2px;">
8203 <COL WIDTH=630>
8204 <tr>
8205 <td>
8206 <%
8207 If lUserDefService Then
8208 nUserDef = 0
8209
8210 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
8211 nI = aServiceUserDefKeys(nUDFIndex)
8212
8213 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Show") Then
8214 nUserDef = nUserDef + 1
8215 End If
8216 Next
8217
8218 If nUserDef = 0 Then
8219 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
8220 nI = aServiceUserDefKeys(nUDFIndex)
8221 %>
8222 <input type=hidden name="UserDef<%=nI%><%=nCount%>" value="<%=aUserDef(nUDFIndex)%>">
8223 <%
8224 Next
8225 Else
8226 %>
8227 <table cellspacing=0 cellpadding=0 border=0>
8228 <tr>
8229 <td>
8230 <table cellspacing=1 cellpadding=0 border=0>
8231 <%
8232 nUDFRowNum = 1
8233 nUDFColNum = 1
8234
8235 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
8236 nI = aServiceUserDefKeys(nUDFIndex)
8237
8238 If oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Show") Then
8239 %>
8240 <tr>
8241 <td width=100><%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("UserDef" & nI & "Caption")%>:</td>
8242 <td width=100>
8243 <%Call DisplayUDFPost(nI, 0, nIndex, aUserDef(nUDFIndex), cBranchID, nCount)%>
8244 </td>
8245 </tr>
8246
8247 <%
8248 If nUserDef = 1 Then Exit For
8249
8250 If nUDFRowNum >= (nUserDef/3) Then
8251 nUDFColNum = nUDFColNum + 1
8252 nUDFRowNum = 0
8253 %>
8254 </table>
8255 </td>
8256 <td colspan="33%" valign="top">
8257 <table cellspacing=1 cellpadding=0 border=0>
8258 <%
8259 End If
8260
8261 nUDFRowNum = nUDFRowNum + 1
8262 Else
8263 %>
8264 <input type=hidden name="UserDef<%=nI%><%=nCount%>" value="<%=aUserDef(nUDFIndex)%>">
8265 <%
8266 End If
8267
8268 nIndex = nIndex + 1
8269 Next
8270 %>
8271 </table>
8272 </td>
8273 </tr>
8274 </table>
8275 <%
8276 End If
8277 Else
8278 For nUDFIndex = 0 To UBound(aServiceUserDefKeys)
8279 nI = aServiceUserDefKeys(nUDFIndex)
8280 %>
8281 <input type=hidden name="UserDef<%=nI%><%=nCount%>" value="<%=aUserDef(nUDFIndex)%>">
8282 <%
8283 Next
8284 End If
8285 %>
8286 </td>
8287 </tr>
8288 </table>
8289
8290 <table class="Visible" border="0" cellspacing="0" cellpadding="0" width="100%">
8291 <tr><td height=1></td></tr>
8292 <tr><td height=1 bgcolor="#ffffff"></td></tr>
8293 </table>
8294
8295 <%
8296 If lUseChemicals And lShowChemical Then
8297 %>
8298 <!--begin chemicals-->
8299 <table id="Chem<%=nCount%>" border=0 cellspacing=0 cellpadding=0 width="100%" style="padding-left: 5px;">
8300 <%
8301 If oOrderChemical.Count = 0 Then
8302 cVisible = "Hidden"
8303 Else
8304 cVisible = "Visible"
8305 End If
8306 %>
8307 <input type=hidden name="ChemLines<%=nCount%>" value="<%=oOrderChemical.Count%>">
8308
8309 <tr id="ChemInfoHeader1_<%=nCount%>" class="<%=cVisible%>">
8310 <td>Material</td>
8311 <td>Quantity</td>
8312 <td>UOM</td>
8313 <td>App Method</td>
8314 <td valign="bottom" rowspan="3">Comment</td>
8315 <td>Conditions</td>
8316 <td>Linear Ft.</td>
8317 <td>Delete</td>
8318 </tr>
8319 <%
8320 nChemRows = 3
8321 %>
8322 <tr id="ChemInfoHeader2_<%=nCount%>" class="<%=cVisible%>">
8323 <td nowrap>Lot Number</td>
8324 <td nowrap>Dilution</td>
8325 <td rowspan="2" valign="bottom" nowrap>UOM</td>
8326 <td nowrap>App Rate</td>
8327 <td nowrap>Air Temp</td>
8328 <td nowrap>Square Ft.</td>
8329 <td nowrap><% If lUseOregonPesticideReport Then%>Oregon Site<%End If%></td>
8330 <td></td>
8331 </tr>
8332
8333 <tr id="ChemInfoHeader3_<%=nCount%>" class="<%=cVisible%>">
8334 <td nowrap> </td>
8335 <td nowrap><%If lAmericaChoice Then%>Apt. #<%Else%>Undiluted Qty<%End If%></td>
8336 <td nowrap>App Equipment</td>
8337 <td nowrap>Wind Dir/Vel</td>
8338 <td nowrap>Cubic Ft.</td>
8339 <td nowrap><% If lUseOregonPesticideReport Then%>Oregon Purpose<%End If%></td>
8340 <td></td>
8341 </tr>
8342 <tr id="ChemInfoHeaderUnderline<%=nCount%>" class="<%=cVisible%>" bgcolor="#000000">
8343 <td colspan="8"><img alt="" border=0 height=1 src="/images/blank.gif" width=1></td>
8344 </tr>
8345 <%
8346 nChemRows = nChemRows + 1
8347
8348 Set objAreas = Server.CreateObject("PestPacPocket.Areas")
8349 Set oAreas = objAreas.GetAreas(oGlobals("Database"), cCustom, cLocID)
8350 Set oTemplateAreas = objAreas.GetTemplateAreas(oGlobals("Database"), cCustom, oGlobals("CompanyID"))
8351 Set objAreas = Nothing
8352 Call CheckDictError(oAreas)
8353
8354 cTotalAreas = ""
8355 For idx = 0 To oAreas.Count - 1
8356 Set oRow = oAreas(idx)
8357 If idx <> 0 Then
8358 cTotalAreas = cTotalAreas & "|" & oRow("AreaID") & "," & oRow("FullName")
8359 Else
8360 If Em(cTotalAreas) Then
8361 cTotalAreas = cTotalAreas & oRow("AreaID") & "," & oRow("FullName")
8362 Else
8363 cTotalAreas = cTotalAreas & "|" & oRow("AreaID") & "," & oRow("FullName")
8364 End If
8365 End If
8366 Next
8367 For idx = 0 To oTemplateAreas.Count - 1
8368 Set oRow = oTemplateAreas(idx)
8369 'Added check for Em cTotalAreas because if areas is populated up top there was no pipe between areas and template areas - DL 06-24-09
8370 'If idx <> 0 Then
8371 If idx <> 0 Or Not Em(cTotalAreas) Then
8372 cTotalAreas = cTotalAreas & "|" & oRow("AreaID") & "," & oRow("FullName")
8373 Else
8374 cTotalAreas = cTotalAreas & oRow("AreaID") & "," & oRow("FullName")
8375 End If
8376 Next
8377 %>
8378 <input type=hidden name="ChemTotalAreas<%=nCount%>" value="<%=Server.HTMLEncode(cTotalAreas)%>" />
8379 <%
8380
8381 Set objXML = Server.CreateObject("Microsoft.XMLDOM")
8382 objXML.LoadXML(oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("XML")("OregonSpecificSite"))
8383
8384 nChemLineNumber = 1
8385 For Each oLine In oOrderChemical
8386 Set oData = oOrderChemical.Item(oLine)
8387
8388 If nChemLineNumber Mod 2 = 0 Then
8389 cRowBgColor = "#e4e8ec"
8390 Else
8391 cRowBgColor = "#d4d8dc"
8392 End If
8393
8394 If Len(oData("AcceptableDilutionFactors")) > 0 Then
8395 lShowDilFactorList = True
8396 Else
8397 lShowDilFactorList = False
8398 End If
8399
8400 cDilutionCalcType = oData("DilutionCalcType")
8401 If cDilutionCalcType <> "O" Then
8402 If cDilutionCalcType = "D" Then
8403 cCLCTempDilution = FormatNumber(oData("SODilutionFactor"),8,,False,False)
8404 Else
8405 cCLCTempDilution = "0.00000000"
8406 End If
8407
8408 'Added coalesce incase the user doesn't fill in Undiluted Qty. DJ 9-21-10, FB 6069
8409 cChemicalLineChanged = oData("ChemicalID") & FormatNumber(oData("Quantity"),4,,False,False) & oData("UnitOfMeasureID") & cCLCTempDilution & FormatNumber(Coalesce(oData("UndilutedQty"), "0"),4,,False,False)
8410 Else
8411 cChemicalLineChanged = ""
8412 End If
8413
8414 cTargetPest = oData("TargetPest")
8415 cTargetID = oData("TargetID")
8416 %>
8417 <tr bgcolor="<%=cRowBgColor%>"><td colspan="8"><img alt="" border=0 height=3 src="/images/blank.gif" width=1></td></tr>
8418
8419 <tr bgcolor="<%=cRowBgColor%>">
8420 <td>
8421 <input type=hidden name="<%=nChemLineNumber%>OrderChemLineID<%=nCount%>" value="<%=oData("ChemLineID")%>">
8422 <input tabindex=<%=ChemicalTabOrder("ChemicalCode", nIndex, lShowExtraChemInfo, False)%> type=text name="<%=nChemLineNumber%>ChemicalCode<%=nCount%>" size=15 maxlength=15
8423 <%=VClass("lookup","ChemicalOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> value="<%=Trim(oData("ChemicalCode"))%>" onBlur="VBScript:Call ChemicalOnBlur(<%=nChemLineNumber%>,<%=nCount%>)" onKeyDown="VBScript:Call ChemicalOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>)">
8424 <input type=hidden name="<%=nChemLineNumber%>ChemicalID<%=nCount%>" value="<%=oData("ChemicalID")%>">
8425 <input type=hidden name="<%=nChemLineNumber%>OChemicalCode<%=nCount%>" value="<%=oData("ChemicalCode")%>">
8426 <input type=hidden name="<%=nChemLineNumber%>ChemGroupID<%=nCount%>" value="<%=oData("ChemGroupID")%>">
8427 <input type=hidden name="<%=nChemLineNumber%>DilutionCalcType<%=nCount%>" value="<%=cDilutionCalcType%>">
8428 <input type=hidden name="<%=nChemLineNumber%>ChemicalLineChanged<%=nCount%>" value="<%=cChemicalLineChanged%>">
8429 <input type=hidden name="<%=nChemLineNumber%>ChemicalCalculatedEdited<%=nCount%>" value="">
8430 </td>
8431 <td><input type=text tabindex=<%=ChemicalTabOrder("Qty", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>Qty<%=nCount%>" size=8 maxlength=11 onblur="javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: QtyOnBlur(<%=nChemLineNumber%>,<%=nCount%>);SetChemicalLineChangedLabel(<%=nChemLineNumber%>,<%=nCount%>)" onkeypress="javascript: vNumKey(this,1)" value="<%=FormatNumber(oData("Quantity"),4,,False,False)%>" <% If lSwingle Then %> onkeydown="VBScript:Call QtyOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>)"<%End If %>></td>
8432 <td>
8433 <input type=text tabindex=<%=ChemicalTabOrder("UnitOfMeasure", nIndex, lShowExtraChemInfo, False)%> size=2 maxlength=2 <%=VClass("lookup","UnitOfMeasureOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> name="<%=nChemLineNumber%>UnitOfMeasure<%=nCount%>" value="<%=oData("UnitOfMeasure")%>" onBlur="UnitOfMeasureOnBlur(<%=nChemLineNumber%>,<%=nCount%>);SetChemicalLineChangedLabel(<%=nChemLineNumber%>,<%=nCount%>)" onKeyDown="VBScript:Call UnitOfMeasureOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>)">
8434 <input type=hidden name="<%=nChemLineNumber%>UnitOfMeasureID<%=nCount%>" value="<%=oData("UnitOfMeasureID")%>">
8435 </td>
8436 <td>
8437 <input type=text tabindex=<%=ChemicalTabOrder("MethodOfAppl", nIndex, lShowExtraChemInfo, False)%> size=12 maxlength=15 <%=VClass("lookup","MethodOfApplOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> name="<%=nChemLineNumber%>MethodOfAppl<%=nCount%>" value="<%=oData("MethodOfAppl")%>" onBlur="VBScript:Call MethodOfApplOnBlur(<%=nChemLineNumber%>, <%=nCount%>)" onKeyDown="VBScript:Call MethodOfApplOnKeyDown(<%=nChemLineNumber%>, <%=nCount%>)">
8438 <input type=hidden name="<%=nChemLineNumber%>MethodID<%=nCount%>" value="<%=oData("MethodID")%>">
8439 </td>
8440
8441 <td valign="top" rowspan="3"><textarea tabindex=<%=ChemicalTabOrder("ChemicalComment", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>ChemicalComment<%=nCount%>" rows="5" cols="40"><%=oData("Comment")%></textarea></td>
8442
8443 <td>
8444 <select tabindex=<%=ChemicalTabOrder("SkyConditions", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>SkyConditions<%=nCount%>">
8445 <option value=""> </option>
8446 <option value="Clear" <%If oData("SkyConditions") = "Clear" Then Response.Write "selected"%>>Clear</option>
8447 <option value="Cloudy" <%If oData("SkyConditions") = "Cloudy" Then Response.Write "selected"%>>Cloudy</option>
8448 <option value="Overcast" <%If oData("SkyConditions") = "Overcast" Then Response.Write "selected"%>>Overcast</option>
8449 <option value="Rain" <%If oData("SkyConditions") = "Rain" Then Response.Write "selected"%>>Rain</option>
8450 <option value="Snow" <%If oData("SkyConditions") = "Snow" Then Response.Write "selected"%>>Snow</option>
8451 </select>
8452 </td>
8453
8454 <td><input type=text tabindex=<%=ChemicalTabOrder("LinearFootage", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>LinearFootage<%=nCount%>" size="5" value="<%=Trim(oData("LinearFootage"))%>"></td>
8455
8456 <td><input type=checkbox tabindex=<%=ChemicalTabOrder("Delete", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>DeleteChemLine<%=nCount%>" value="1"></td>
8457 </tr>
8458 <tr bgcolor="<%=cRowBgColor%>">
8459 <td><input type=text tabindex=<%=ChemicalTabOrder("LotNumber", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>LotNumber<%=nCount%>" size=10 maxlength=255 value="<%=oData("LotNumber")%>"></td>
8460
8461 <td>
8462 <span id="<%=nChemLineNumber%>DilutionFactorTextBox<%=nCount%>" class="<%If lShowDilFactorList Or cDilutionCalcType = "P" Then Response.Write "Hidden" Else Response.Write "Visible"%>">
8463 <input type=text <%If cDilutionCalcType = "D" Or Not cChemicalAutoCalcOnBlur = 1 Then Response.Write "tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, lShowExtraChemInfo, False) End If%> name="<%=nChemLineNumber%>DilutionFactor1_<%=nCount%>" size=10 maxlength=10 onblur="javascript: vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(<%=nChemLineNumber%>,<%=nCount%>);" onkeypress="javascript: vNumKey(this,1)" onKeyDown="SetChemicalCalculatedEdited(<%=nChemLineNumber%>,<%=nCount%>, 1);" value="<%=FormatNumber(oData("SODilutionFactor"),8,,False,False)%>">
8464 </span>
8465 <span id="<%=nChemLineNumber%>DilutionFactorDropdown<%=nCount%>" class="<%If lShowDilFactorList And cDilutionCalcType <> "P" Then Response.Write "Visible" Else Response.Write "Hidden"%>">
8466 <input type=text <%If cDilutionCalcType = "D" Or Not cChemicalAutoCalcOnBlur = 1 Then Response.Write "tabindex=" & ChemicalTabOrder("DilutionFactor", nIndex, lShowExtraChemInfo, False) End If%> name="<%=nChemLineNumber%>DilutionFactor2_<%=nCount%>" <%=VClass("lookup","DilutionFactorOnKeyDown(" & nChemLineNumber & "," & nCount & ")|0")%> size=10 onblur="javascript: vNumBlur(this, 10,8,1,1,0,1); VBScript: DilutionFactorOnBlur(<%=nChemLineNumber%>,<%=nCount%>);" onKeyDown="DilutionFactorOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>); SetChemicalCalculatedEdited(<%=nChemLineNumber%>,<%=nCount%>, 1);" value="<%=FormatNumber(oData("SODilutionFactor"),8,,False,False)%>">
8467 </span>
8468 <span id="<%=nChemLineNumber%>DilutionFactorDisplay<%=nCount%>" class="<%If cDilutionCalcType = "P" Then Response.Write "Visible" Else Response.Write "Hidden"%>">
8469 <%=FormatNumber(oData("StandardQuantity"),4) & " " & oData("StandardUOM") & " per " & oData("UnitOfMeasure")%>
8470 </span>
8471 <input type=hidden name="<%=nChemLineNumber%>DilutionInputMethod<%=nCount%>" value="<%If lShowDilFactorList Then%>C<%Else%>T<%End If%>">
8472 </td>
8473 <td> </td>
8474
8475 <td>
8476 <input type=text size=10 maxlength=10 tabindex='<%=ChemicalTabOrder("ApplicationRate", nIndex, lShowExtraChemInfo, False)%>' <%=VClass("lookup","ApplicationRateOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> name="<%=nChemLineNumber%>ApplicationRateCode<%=nCount%>" value="<%=oData("ApplicationRateCode")%>" onBlur="VBScript:Call ApplicationRateOnBlur(<%=nChemLineNumber%>,<%=nCount%>)" onKeyDown="VBScript:Call ApplicationRateOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>)">
8477 <input type=hidden name="<%=nChemLineNumber%>ApplicationRateID<%=nCount%>" value="<%=oData("ApplicationRateID")%>">
8478 </td>
8479
8480 <td><input type=text tabindex=<%=ChemicalTabOrder("AirTemperature", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>AirTemperature<%=nCount%>" size="3" value="<%=Trim(oData("AirTemperature"))%>"></td>
8481 <td><input type=text tabindex=<%=ChemicalTabOrder("SquareFootage", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>BASquareFootage<%=nCount%>" size="5" value="<%=Trim(oData("BASquareFootage"))%>"></td>
8482
8483 <%
8484 If lUseOregonPesticideReport Then
8485 cOregonSite = ""
8486 If Not Em(Coalesce(oData("OregonSpecificSite"), "")) Then
8487 cOregonSite = objXML.documentElement.selectSingleNode("oregonspecificsite [@id = '" & oData("OregonSpecificSite") & "']").attributes.getnameditem("code").text
8488 End If
8489 %>
8490 <td>
8491 <input type="text" tabindex="<%=ChemicalTabOrder("OregonSpecificSite", nIndex, lShowExtraChemInfo, False)%>" name="<%=nChemLineNumber%>OregonSpecificSiteDescription<%=nCount%>" size="10" <%=VClass("lookup","OregonSpecificSiteOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> onBlur="VBScript:Call OregonSpecificSiteOnBlur(<%=nChemLineNumber%>, <%=nCount%>)" onKeyDown="VBScript:Call OregonSpecificSiteOnKeyDown(<%=nChemLineNumber%>, <%=nCount%>)" value="<%=cOregonSite%>">
8492 <input type=hidden name="<%=nChemLineNumber%>OregonSpecificSite<%=nCount%>" value="<%=oData("OregonSpecificSite")%>">
8493 </td>
8494
8495 <%
8496 Else
8497 %>
8498 <td> </td>
8499 <%
8500 End If
8501 %>
8502 </tr>
8503 <tr bgcolor="<%=cRowBgColor%>">
8504 <td> </td>
8505 <td>
8506 <!-- Added coalesce incase the user doesn't fill in Undiluted Qty. DJ 9-21-10, FB 6069 -->
8507 <input type=text <%If (cDilutionCalcType = "P" Or cDilutionCalcType = "D") Or Not cChemicalAutoCalcOnBlur = 2 Or lRK Or lBUGMAN or lPacwest Then Response.Write "tabindex=" & ChemicalTabOrder("UndilutedQty", nIndex, lShowExtraChemInfo, False) End If%> name="<%=nChemLineNumber%>UndilutedQty<%=nCount%>" size=9 maxlength=9 onblur="javascript: vNumBlur(this, 11,4,1,1,0,1); VBScript: UndilQtyOnBlur(<%=nChemLineNumber%>,<%=nCount%>);" onfocus="VBScript:Call UndilQtyOnFocus(<%=nChemLineNumber%>,<%=nCount%>)" onkeypress="javascript: vNumKey(this,1)" onKeyDown="SetChemicalCalculatedEdited(<%=nChemLineNumber%>,<%=nCount%>, 2);" value="<%=FormatNumber(Coalesce(oData("UndilutedQty"), "0"), 4,,False,False)%>">
8508 <span id="<%=nChemLineNumber%>ChemicalChangeWarning<%=nCount%>"></span>
8509 </td>
8510 <td>
8511 <input type=text tabindex=<%=ChemicalTabOrder("UndilutedUOM", nIndex, lShowExtraChemInfo, False)%> size=2 maxlength=2 <%=VClass("lookup","UndilutedUOMOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> name="<%=nChemLineNumber%>UndilutedUOM<%=nCount%>" value="<%=oData("UndilutedUOM")%>" ">
8512 <input type=hidden name="<%=nChemLineNumber%>UndilutedUOMID<%=nCount%>" value="<%=oData("UndilutedUOMID")%>">
8513 </td>
8514 <td>
8515 <input type=text size=10 maxlength=10 tabindex='<%=ChemicalTabOrder("ApplicationEquipment", nIndex, lShowExtraChemInfo, False)%>' <%=VClass("lookup","ApplicationEquipmentOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> name="<%=nChemLineNumber%>ApplicationEquipmentCode<%=nCount%>" value="<%=oData("ApplicationEquipmentCode")%>" onBlur="VBScript:Call ApplicationEquipmentOnBlur(<%=nChemLineNumber%>,<%=nCount%>)" onKeyDown="VBScript:Call ApplicationEquipmentOnKeyDown(<%=nChemLineNumber%>,<%=nCount%>)">
8516 <input type=hidden name="<%=nChemLineNumber%>ApplicationEquipmentID<%=nCount%>" value="<%=oData("ApplicationEquipmentID")%>">
8517 </td>
8518 <td>
8519 <input type=text tabindex=<%=ChemicalTabOrder("WindVelocity", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>WindVelocity<%=nCount%>" size="3" value="<%=Trim(oData("WindVelocity"))%>"><select tabindex='<%=ChemicalTabOrder("WindDirection", nIndex, lShowExtraChemInfo, False)%>' name="<%=nChemLineNumber%>WindDirection<%=nCount%>">
8520 <option value="" <% If Em(oData("WindDirection")) Then %>selected<% End If %>> </option>
8521 <option value="N" <%If oData("WindDirection") = "N" Then%>selected<% End If %>>N</option>
8522 <option value="NE" <%If oData("WindDirection") = "NE" Then%>selected<% End If %>>NE</option>
8523 <option value="E" <%If oData("WindDirection") = "E" Then%>selected<% End If %>>E</option>
8524 <option value="SE" <%If oData("WindDirection") = "SE" Then%>selected<% End If %>>SE</option>
8525 <option value="S" <%If oData("WindDirection") = "S" Then%>selected<% End If %>>S</option>
8526 <option value="SW" <%If oData("WindDirection") = "SW" Then%>selected<% End If %>>SW</option>
8527 <option value="W" <%If oData("WindDirection") = "W" Then%>selected<% End If %>>W</option>
8528 <option value="NW" <%If oData("WindDirection") = "NW" Then%>selected<% End If %>>NW</option>
8529 </select>
8530 </td>
8531
8532 <td><input type=text tabindex=<%=ChemicalTabOrder("CubicFootage", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>STCubicFootage<%=nCount%>" size="5" value="<%=Trim(oData("STCubicFootage"))%>"></td>
8533
8534 <%
8535 If lUseOregonPesticideReport Then
8536 cOregonSite = ""
8537 If Not Em(Coalesce(oData("OregonSpecificSite"), "")) Then
8538 cOregonSite = objXML.documentElement.selectSingleNode("oregonspecificsite [@id = '" & oData("OregonSpecificSite") & "']").attributes.getnameditem("code").text
8539 End If
8540 %>
8541 <td>
8542 <input type="text" tabindex="<%=ChemicalTabOrder("OregonPurpose", nIndex, lShowExtraChemInfo, False)%>" name="<%=nChemLineNumber%>OregonPurposeDescription<%=nCount%>" size="13" <%=VClass("lookup","OregonPurposeOnKeyDown(" & nChemLineNumber & "," & nCount & ")|1")%> value="<%=Trim(oData("OregonPurpose"))%>" onBlur="VBScript:Call OregonPurposeOnBlur(<%=nChemLineNumber%>, <%=nCount%>)" onKeyDown="VBScript:Call OregonPurposeOnKeyDown(<%=nChemLineNumber%>, <%=nCount%>)" value="<%=Trim(oData("OregonPurpose"))%>">
8543 <input type=hidden name="<%=nChemLineNumber%>OregonPurpose<%=nCount%>" value="<%=oData("OregonPurpose")%>">
8544 </td>
8545 <%
8546 Else
8547 %>
8548 <td> </td>
8549 <%
8550 End If
8551 %>
8552
8553 </tr>
8554 <%
8555 nChemRows = nChemRows + 4
8556 %>
8557 <tr id="<%=nChemLineNumber%>ExtraChemInfoAreasTargets<%=nCount%>" bgcolor="<%=cRowBgColor%>" class="Visible">
8558 <td colspan="4">
8559 <input type="button" tabindex=<%=ChemicalTabOrder("Areas", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>butChemAreas<%=nCount%>" value="Areas" onclick="butChemAreasOnClick(<%=nChemLineNumber%>, <%=nCount%>)">
8560 <span id="<%=nChemLineNumber%>ChemAreas<%=nCount%>" Visible=True>
8561 <%
8562 Set objChemAreas = Server.CreateObject("PestPacPocket.Order")
8563 Set oChemAreas = objChemAreas.ChemicalAreaSelectSpecific(oGlobals("Database"), oGlobals("CompanyID"), oData("ChemLineID"))
8564 Set objChemAreas = Nothing
8565 Call CheckDictError(oChemAreas)
8566
8567 cChemAreas = ""
8568 cChemAreaIDs = ""
8569 For Each cKey In oChemAreas
8570 Set oItem = oChemAreas(cKey)
8571 If Em(cChemAreas) Then
8572 cChemAreas = oItem("FullName")
8573 cChemAreaIDs = oItem("LocAreaID")
8574 Else
8575 cChemAreas = cChemAreas & ", " & oItem("FullName")
8576 cChemAreaIDs = cChemAreaIDs & "," & oItem("LocAreaID")
8577 End If
8578 Next
8579 If Em(cChemAreas) Then
8580 cChemAreas = "(None)"
8581 End If
8582 Set oChemAreas = Nothing
8583
8584 Response.Write cChemAreas
8585 %>
8586 </span>
8587 <input type=hidden name="<%=nChemLineNumber%>ChemAreaIDs<%=nCount%>" value="<%=cChemAreaIDs%>" />
8588 </td>
8589 <td colspan="4">
8590 <input type="button" tabindex=<%=ChemicalTabOrder("Targets", nIndex, lShowExtraChemInfo, False)%> name="<%=nChemLineNumber%>butChemTargets<%=nCount%>" value="Targets" onclick="butChemTargetsOnClick(<%=nChemLineNumber%>, <%=nCount%>)">
8591 <span id="<%=nChemLineNumber%>ChemTargets<%=nCount%>" Visible=True>
8592 <%
8593 Set objChemTargets = Server.CreateObject("PestPacPocket.Order")
8594 Set oChemTargets = objChemTargets.ChemicalTargetSelect(oGlobals("Database"), oGlobals("CompanyID"), oData("ChemLineID"))
8595 CheckDictError(oChemTargets)
8596 Set objChemTargets = Nothing
8597
8598 cChemTargets = ""
8599 cChemTargetIDs = ""
8600 For Each cKey In oChemTargets
8601 Set oItem = oChemTargets(cKey)
8602 If CDbl(oItem("ChemicalTargetID")) > 0 Then
8603 cChemTargets = cChemTargets & oItem("Code") & ", "
8604 If cChemTargetIDs = "" Then
8605 cChemTargetIDs = oItem("TargetID")
8606 Else
8607 cChemTargetIDs = cChemTargetIDs & "," & oItem("TargetID")
8608 End If
8609 End If
8610 Next
8611 If cChemTargets = "" Then
8612 cChemTargets = "(None)"
8613 Else
8614 cChemTargets = Left(cChemTargets, Len(cChemTargets) - 2)
8615 End If
8616 Set oChemTargets = Nothing
8617 Response.Write cChemTargets
8618 %>
8619 </span>
8620 <input type=hidden name="<%=nChemLineNumber%>ChemTargetIDs<%=nCount%>" value="<%=cChemTargetIDs%>" />
8621 </td>
8622 </tr>
8623 <%
8624 nChemRows = nChemRows + 1
8625 %>
8626 <tr bgcolor="<%=cRowBgColor%>">
8627 <td colspan="8"><img alt="" border=0 height=3 src="/images/blank.gif" width=1></td>
8628 </tr>
8629 <%
8630 nChemRows = nChemRows + 1
8631
8632 If lShowExtraChemInfo Then
8633 nIndex = ChemicalTabOrder("Targets", nIndex, lShowExtraChemInfo, False) + 1
8634 Else
8635 nIndex = ChemicalTabOrder("ChemicalComment", nIndex, lShowExtraChemInfo, False) + 1
8636 End If
8637
8638 nChemLineNumber = nChemLineNumber + 1
8639
8640 If nChemLineNumber Mod 50 = 0 Then Response.Flush
8641
8642 Next
8643
8644 Set objXML = Nothing
8645 %>
8646 <input type=hidden name="NumOldChemicals<%=nCount%>" value="<%=nOldChemLines%>">
8647 <input type=hidden name="ChemIndex<%=nCount%>" value="<%=nIndex%>">
8648 <input type=hidden name="NextChemRow<%=nCount%>" value="<%=nChemRows%>">
8649 <input type=hidden name="Rank<%=nCount%>" value="<%=nRank%>">
8650
8651 <tr>
8652 <td colspan="8">
8653 <span id="AddChemical<%=nCount%>" class="link" OnClick="VBScript:Call AddChemicalOnClick(<%=nCount%>)">Add New Material</span>
8654 </td>
8655 </tr>
8656 </table>
8657 <br>
8658 <!--end chemicals-->
8659 <%
8660 Else
8661 %>
8662 <input type=hidden name="ChemLines<%=nCount%>" value="0">
8663 <br>
8664 <%
8665 End If
8666 End If
8667Next
8668%>
8669</td>
8670</tr>
8671</table>
8672</div>
8673</td>
8674</tr>
8675</table>
8676<div id="Browse" class="Browse"></div>
8677
8678<!-- Begin Page Footer -->
8679<table width="100%" border="0" cellspacing="0" cellpadding="0">
8680<tr>
8681<td rowspan="3" width="1%"><img alt="" border=0 height=1 src="/images/blank.gif" width=118 ></td>
8682<td bgcolor="#cfd8dc" colspan="4"><img alt="" border=0 height=9 src="/images/corner_bottom-inside.gif" width=12 ></td>
8683</tr>
8684
8685<tr>
8686<td height="40" width="1%"><img alt="" border=0 height=40 id=IMG1 src="/images/corner_bottom-outside.gif" width=12 ></td>
8687<td width="96%" bgcolor="#5d6d7d"></td>
8688<td width="1%" bgcolor="#5d6d7d" nowrap align="right">
8689<%
8690If CDbl(cHits) <> 0 Then
8691 %>
8692 <button name="butSelAll_bot" onClick="VBScript:butSelAll_OnClick" class="input-nav">Select <u>A</u>ll</button> <button name="butSelNone_bot" onClick="VBScript:butSelNone_OnClick" class="input-nav">Select N<u>o</u>ne</button>
8693 <%
8694End If
8695
8696If Not (CDbl(cEnd) = CDbl(cHits) Or CDbl(cHits) = 0) Then
8697 %>
8698 <button name="butNext_bot" class="input-nav" onClick="VBScript:butNext_OnClick"><u>N</u>ext Page</button>
8699 <%
8700End If
8701
8702If (CDbl(cHits) <> 0) Or (CDbl(cHits) = 0 And cDoneStart <> 1) Then
8703 If lPostBatchInv Then
8704 %>
8705 <button name="butPost_bot" class="input-nav" onClick="VBScript:butPostHandler_OnClick">Don<u>e</u></button>
8706 <%
8707 Else
8708 %>
8709 <button name="butPost_bot" class="input-nav" onClick="VBScript:butPostHandler_OnClick"><u>P</u>ost</button>
8710 <%
8711 End If
8712
8713 If IsCustom("ASSURED") Then
8714 %>
8715 <button name="butMove_bot" id="butMove_bot" type="button" class="input-nav" accesskey="m" onClick="VBScript:butMove_OnClick()"><u>M</u>ove</button>
8716 <%
8717 End If
8718End If
8719
8720If CDbl(cHits) <> 0 Then
8721 %>
8722 <button name="butCancel_bot" class="input-nav" onClick="VBScript:butCancelHandler_OnClick"><u>C</u>ancel</button>
8723 <%
8724End If
8725%>
8726</td>
8727
8728<td width="1%" bgcolor="#5d6d7d" ><img alt="" border=0 height=1 src="/images/blank.gif" width=10 ></td>
8729</tr>
8730
8731<tr>
8732<td height="25" colspan="3" align="right"><%=oCompanyGlobals(oGlobals("DBName") & "|" & oGlobals("CompanyID"))("Copyright")%></td>
8733<td><img alt="" border=0 height=1 src="/images/blank.gif" width=10></td>
8734<td></td>
8735</tr>
8736</table>
8737<!-- End Page Footer -->
8738</form>
8739</body>
8740</html>