Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
62 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          Bom_Home			 			 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_bom_common.asp"-->
17
<!--#include file="controls/ERGFormComponent/classFormComponent.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim rsQry
25
Dim aProductList
26
Dim parProd_id_select
27
Dim parShowall
28
Dim numOfRows
29
Dim rowNum, Numrow, maxnumOfRows
30
Dim objFormCollector
31
Dim objFormComponent
32
Dim sMessage
33
Dim ProdId, PkgId, OldProdId, OsId
34
Dim ChangeType
35
Dim IsPatch
36
Dim rsTemp
37
Dim PkgVersion, CurrentPkgVersion, IsDisplay, Comments
38
'------------ CONSTANTS DECLARATION -----------
39
Const LIMG_UPDATED = "<img src='icons/i_updated.gif' width='11' height='11' hspace='2' vspace='2' border='0' align='absmiddle' title='Updated'>"
40
Const LIMG_ADDED = "<img src='icons/i_added.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Added'>"
41
Const LIMG_REMOVED = "<img src='icons/i_removed.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Removed'>"
42
Const LIMG_NOTE_NEW = "<img src='icons/i_note_new.gif' width='18' height='18' border='0' align='absmiddle'>"
43
Const LIMG_NOTE_EDIT = "<img src='icons/i_note_edit.gif' width='18' height='18' border='0' align='absmiddle'>"
44
'------------ VARIABLE INIT -------------------
45
Set objFormCollector = CreateObject("Scripting.Dictionary")
46
Set objFormComponent = New FormComponent
47
'------------ CONDITIONS ----------------------
48
'----------------------------------------------
49
%>
50
<%
51
'--------------------------------------------------------------------------------------------------------------------------
52
Function CheckProduction (ProductionBOM, ComparisonBOM)
53
 
54
	CheckProduction = False 'Setting it initially to be false
55
 
56
	OraDatabase.Parameters.Remove	"PRODUCTION_BOM"
57
	OraDatabase.Parameters.Add "PRODUCTION_BOM", 	 	 ProductionBOM,		 ORAPARM_INPUT, ORATYPE_NUMBER
58
	OraDatabase.Parameters.Add "CURRENT_BOM", ComparisonBOM, ORAPARM_INPUT, ORATYPE_NUMBER
59
 
60
	Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery ("BomCheck.sql"), ORADYN_DEFAULT )
61
 
62
	While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
63
		PkgId = rsTemp("pkg_id")
64
		PkgVersion = rsTemp("pkg_version")
65
 
66
 
67
 
68
 
69
		OraDatabase.Parameters.Add "PKG_ID", PkgId, ORAPARM_INPUT, ORATYPE_NUMBER
70
 
71
		Set rsQry = OraDatabase.DbCreateDynaset(GetQuery("ProdVersion.sql"), ORADYN_DEFAULT)
72
 
73
		CurrentPkgVersion = rsQry("pkg_version")
74
 
75
 
76
 
77
		Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, pos
78
				MajorA = NULL
79
				MajorB = NULL
80
				MinorA = NULL
81
				MinorB = NULL
82
				PatchA = NULL
83
				PatchB = NULL
84
 
85
		' Find the first occurence of the dot in package version A
86
				pos = InStr(PkgVersion, ".")
87
				If pos <> 0 Then
88
					' Extract the Major Version for A
89
					MajorA = Mid(PkgVersion, 1, pos - 1)
90
					' Delete the Major Version Value from the string to get the minor and patch version
91
					PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
92
					' Find the second occurence of the dot in package version A
93
					pos = InStr(PkgVersion, ".")
94
					' Extract the Minor Version for A
95
					If pos <> 0 Then
96
						MinorA = Mid(PkgVersion, 1, pos - 1)
97
						' Delete the Minor Version value from the string to get the patch version
98
						PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
99
						' Find the last occurence of the dot in package version A
100
						pos = InStr(PkgVersion, ".")
101
						If pos <> 0 Then
102
							' Extract the Patch Version for A
103
							PatchA = Mid(PkgVersion, 1, pos - 1)
104
						End If	
105
					End If	
106
				End If	
107
 
108
				' Find the first occurence of the dot in package version B
109
				pos = InStr(CurrentPkgVersion, ".")
110
				If pos <> 0 Then
111
					' Extract the Major Version for B
112
					MajorB = Mid(CurrentPkgVersion, 1, pos - 1)
113
					' Delete the Major Version Value from the string to get the minor and patch version
114
					CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
115
					' Find the second occurence of the dot in package version B
116
					pos = InStr(CurrentPkgVersion, ".")
117
					' Extract the Minor Version for B
118
					If pos <> 0 Then
119
						MinorB = Mid(CurrentPkgVersion, 1, pos - 1)
120
						' Delete the Minor Version value from the string to get the patch version
121
						CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
122
						' Find the last occurence of the dot in package version B
123
						pos = InStr(CurrentPkgVersion, ".")
124
							If pos <> 0 Then
125
							' Extract the Patch Version for B
126
							PatchB = Mid(CurrentPkgVersion, 1, pos - 1)
127
						End If
128
					End If
129
				End If
130
 
131
				If NOT isNull(PatchA) AND NOT isNull(PatchB) Then
132
					If isNumeric(PatchA) AND isNumeric(PatchB) Then
133
						If CLng(PatchA) < 1000 Then
134
							PatchA = CLng(PatchA) * 1000 
135
						End If
136
						If CLng(PatchB) < 1000 Then
137
							PatchB = CLng(PatchB) * 1000
138
						End If	
139
					End If	
140
				End If 
141
 
142
				If MajorA = MajorB Then
143
					If MinorA = MinorB Then
144
						If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
145
 
146
							If CDbl(PatchB) > CDbl(PatchA) Then
147
							Else										
148
								CheckProduction = True
149
							End If
150
						End If
151
					Else
152
						If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
153
							If CInt(MinorB) > CInt(MinorA) Then
154
							Else
155
								CheckProduction = True								
156
							End If									
157
						End If
158
					End If
159
				Else
160
					If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
161
						If 	CInt(MajorB) > CInt(MajorA) Then
162
						Else
163
							CheckProduction = True
164
						End If	
165
					End If
166
				End If		
167
 
168
 
169
 
170
		rsQry.Close()
171
		Set rsQry = Nothing
172
 
173
		OraDatabase.Parameters.Remove "PKG_ID"		
174
 
175
	rsTemp.MoveNext()
176
	Wend
177
 
178
	OraDatabase.Parameters.Remove "CURRENT_BOM"
179
	OraDatabase.Parameters.Remove "PRODUCTION_BOM"
180
 
181
 
182
	rsTemp.Close()
183
	Set	rsTemp = Nothing
184
 
185
 
186
End Function
187
'--------------------------------------------------------------------------------------------------------------------------
188
Function AddTrailingZeros(byval n, byval count)
189
	if len(n) >= count then
190
		AddTrailingZeros = n
191
		exit function
192
	end if
193
 
194
	dim c, s, i
195
	c = count - len(n)
196
 
197
	for i = 1 to c
198
		s = s & "0"
199
	next
200
	s = cstr(n) & s
201
 
202
	AddTrailingZeros = s
203
End function
204
'--------------------------------------------------------------------------------------------------------------
205
Sub GetProductList ( nBom_id, nComparedBomId, outProductList, Flag )
206
	Dim rsQry, query, showAll
207
 
208
	'' Use SHOWALL parameter is BOM has old bom
209
	'showAll = "Y"
210
	'If nBom_id <> nComparedBomId Then
211
	'	showAll = parShowall
212
	'End If
213
	OraDatabase.Parameters.Add "BOM_ID", 	 	 nBom_id,		 ORAPARM_INPUT, ORATYPE_NUMBER 
214
	OraDatabase.Parameters.Add "COMPARE_BOM_ID", nComparedBomId, ORAPARM_INPUT, ORATYPE_NUMBER 
215
	OraDatabase.Parameters.Add "CURRENT_BOM", dbPARbom_id, ORAPARM_INPUT, ORATYPE_NUMBER
216
 
217
	If Flag = TRUE Then
218
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomCompare.sql"), ORADYN_DEFAULT )
219
	Else
220
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomCompare_BaseConfig.sql"), ORADYN_DEFAULT )
221
	End If
222
 
223
	If rsQry.RecordCount > 0 Then
224
		outProductList = rsQry.GetRows()
225
	Else
226
		outProductList = NULL
227
	End If
228
 
229
 
230
	OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
231
	OraDatabase.Parameters.Remove "BOM_ID"
232
	OraDatabase.Parameters.Remove "CURRENT_BOM"
233
End Sub
234
'--------------------------------------------------------------------------------------------------------------------------
235
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
236
 
237
	Call GetBomDetails ( nBom_id, outobjDetails )
238
 
239
	outobjDetails.Item("root_version") = GetRootVersion ( outobjDetails.Item("bom_version") )
240
 
241
	'-- Set compare_bom_id 
242
	If Request("compare_bom_id") <> "" Then
243
		outobjDetails.Item("compare_bom_id") =  Request("compare_bom_id")
244
	Else
245
		outobjDetails.Item("compare_bom_id") = outobjDetails.Item("parent_bom_id")
246
	End If
247
 
248
End Sub
249
'--------------------------------------------------------------------------------------------------------------
250
Function GetBomTreeList ()
251
	Dim rsQry, query
252
 
253
	OraDatabase.Parameters.Add "BRANCH_ID", 	objFormCollector.Item("rtag_id_fk"),	ORAPARM_INPUT, ORATYPE_NUMBER 
254
 
255
	OraDatabase.Parameters.Add "BOM_NAME", 	objFormCollector.Item("bom_name"),	ORAPARM_INPUT, ORATYPE_NUMBER 
256
 
257
	If objFormCollector.Item("rtag_id_fk") = 542 Then'This is because SFO uses Front Office and Back Office
258
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeComboSFO.sql"), ORADYN_DEFAULT )
259
	Else
260
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeCombo.sql"), ORADYN_DEFAULT )
261
	End If
262
 
263
	If rsQry.RecordCount > 0 Then
264
		GetBomTreeList = rsQry.GetRows()
265
 
266
	Else
267
		GetBomTreeList = NULL
268
 
269
	End If
270
 
271
 
272
	OraDatabase.Parameters.Remove "BRANCH_ID"
273
	OraDatabase.Parameters.Remove "BOM_NAME"
274
 
275
 
276
	rsQry.Close
277
	Set rsQry = Nothing
278
End Function
279
 
280
'--------------------------------------------------------------------------------------------------------------
281
Function GetCompareBomDetails ( nBomId )
282
	Dim rsQry, query
283
	OraDatabase.Parameters.Add "BOM_ID", 	nBomId,	ORAPARM_INPUT, ORATYPE_NUMBER 
284
 
285
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomLocationDetails.sql"), ORADYN_DEFAULT )
286
 
287
	If rsQry.RecordCount > 0 Then
288
		GetCompareBomDetails = rsQry("proj_name") &"&nbsp;/&nbsp;"& rsQry("branch_name") &"&nbsp;/&nbsp;"& rsQry("bom_name") &"&nbsp;"& rsQry("bom_version") &"."& rsQry("bom_lifecycle")
289
 
290
	Else
291
		GetBomTreeList = NULL
292
 
293
	End If
294
 
295
	OraDatabase.Parameters.Remove "BOM_ID"
296
 
297
	rsQry.Close
298
	Set rsQry = Nothing
299
End Function
300
'--------------------------------------------------------------------------------------------------------------
301
%>
302
<%
303
'------------ RUN BEFORE PAGE RENDER ----------
304
objPMod.PersistInQryString ( Array("compare_bom_id") )
305
 
306
Call GetFormDetails ( dbPARbom_id, objFormCollector )
307
'----------------------------------------------
308
%>
309
<html>
310
<head>
311
<title>Production Manager</title>
312
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
313
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
314
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
315
<script language="JavaScript" src="scripts/common.js"></script>
316
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
317
<script language="JavaScript" type="text/javascript">
318
<!--
319
 
320
function RequestProductLocation( paramString, rowId ){
321
	var requestURL;
322
 
323
	// Product is changes, hence can be found in current bom
324
	requestURL = 'RequestBomDiffProductLocation.asp';
325
 
326
 
327
	// Show div
328
	ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
329
 
330
	// Set ajax divname
331
	ajaxdivname = 'PRODUCT_'+ rowId;
332
 
333
	if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>') 
334
	{
335
 
336
		//Append the name to search for to the requestURL
337
		var url = requestURL + paramString;
338
 
339
		//Create the xmlHttp object to use in the request
340
		//stateChangeHandler will fire when the state has changed, i.e. data is received back
341
		// This is non-blocking (asynchronous)
342
		xmlHttp = GetXmlHttpObject(stateChangeHandler);
343
 
344
		//Send the xmlHttp get to the specified url
345
		xmlHttp_Get(xmlHttp, url);
346
 
347
	}
348
 
349
 
350
}
351
 
352
function RequestPatches( paramString, rowId ){
353
	var requestURL; 
354
 
355
	// Product is changes, hence can be found in current bom
356
	requestURL = 'RequestBomDiffPatches.asp';
357
 
358
 
359
	// Show div
360
	ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
361
 
362
	// Set ajax divname
363
	ajaxdivname = 'PRODUCT_'+ rowId;
364
 
365
	if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>') 
366
	{
367
 
368
		//Append the name to search for to the requestURL
369
		var url = requestURL + paramString;
370
 
371
		//Create the xmlHttp object to use in the request
372
		//stateChangeHandler will fire when the state has changed, i.e. data is received back
373
		// This is non-blocking (asynchronous)
374
		xmlHttp = GetXmlHttpObject(stateChangeHandler);
375
 
376
		//Send the xmlHttp get to the specified url
377
		xmlHttp_Get(xmlHttp, url);
378
 
379
	}
380
 
381
 
382
}
383
 
384
 
385
 
386
 
387
//-->
388
</script>
389
</head>
390
<body leftmargin="0" topmargin="0">
391
<!-- HEADER ++++++++++++++++ -->
392
<!--#include file="_header.asp"-->
393
<!-- +++++++++++++++++++++++ -->
394
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
395
<!--#include file="_main_menu.asp"-->
396
<!-- +++++++++++++++++++++++++++++++++++++ -->
397
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
398
  <tr>
399
    <td width="1%" valign="top" background="images/bg_bage_0.gif">
400
	<!-- NODE BROWSER ++++++++++++++++++++++ -->
401
	<!--#include file="_bom_browser.asp"-->
402
	<!-- END OF NODE BROWSER +++++++++++++++ -->
403
	</td>
404
    <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
405
    <td width="100%" valign="top" bgcolor="#FFFFFF">
406
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
407
	  <tr>
408
        <td valign="top" background="images/bg_green.gif"></td>
409
        <td align="right" valign="bottom" background="images/bg_green.gif" class="body_txtw"><%Call RenderTitle( objBomCollector )%></td>
410
        <td background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="20"></td>
411
      </tr>
412
      <tr>
413
        <td width="1%" valign="top" background="images/bg_green.gif"></td>
414
        <td width="100%" valign="bottom" background="images/bg_green.gif">
415
		<!-- TAB CONTROLS ++++++++++++++++++++++ -->
416
		<!--#include file="_tabs_definition.asp"-->
417
		<%
418
		Set objTabControl = New TabControl
419
		objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
420
		objTabControl.TabStyle = "StyleWinXP"
421
		objTabControl.AddTabDefnition ( arrBomTabDef )
422
		objTabControl.Render ()
423
		%>
424
		<!-- END OF TAB CONTROLS +++++++++++++++ -->
425
		</td>
426
        <td width="1%" background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
427
        </tr>
428
      <tr>
429
        <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
430
        <td background="images/bg_bage_0.gif">
431
		<!-- BUTTONS CONTROL +++++++++++++++++++ -->
432
		<%
433
		'-- Define Action buttons on this tab
434
		aTabBtnsDef = Array("abtnAddPatches")
435
 
436
		Call LoadTabActionButtons ( aTabBtnsDef, objBtnControl )
437
 
438
		' -- Tell control if buttons need to be readonly actions 
439
		objBtnControl.IsReadonlyAction = objBomCollector.Item("is_readonly")
440
 
441
		' -- Render Buttons
442
		Call objBtnControl.Render  ( aTabBtnsDef )
443
		%>
444
		<!-- +++++++++++++++++++++++++++++++++++ -->
445
		</td>
446
        <td background="images/bg_green.gif"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
447
        </tr>
448
      <tr>
449
        <td>&nbsp;</td>
450
        <td>&nbsp;</td>
451
        <td valign="top"><%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) = "hide" Then%><a href="<%=SCRIPT_NAME%>?user_bar=<%=enumDEFAULT%>&<%=objPMod.ComposeURL()%>"><img src="icons/b_left.gif" title="Maximize favourits" width="13" height="13" vspace="5" border="0"></a><%End If%></td>
452
        </tr>
453
    </table>
454
 
455
<!-- PRODUCT REJECTED ------------------------------------------------------------------------------------------ -->	
456
	<%If objBomCollector.Item ("is_rejected") = enumDB_YES Then%>
457
	<table width="100%"  border="0" cellspacing="10" cellpadding="0">
458
      <tr>
459
        <td>
460
		<%
461
			OraDatabase.Parameters.Add "ENTITY_ID", 		dbPARbom_id,	ORAPARM_INPUT, ORATYPE_NUMBER
462
			OraDatabase.Parameters.Add "ENUM_ENTITY_TYPE", 	"enumENTITY_TYPE_BOM",	ORAPARM_INPUT, ORATYPE_VARCHAR2
463
 
464
			Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RejectionTrail.sql"), ORADYN_DEFAULT )
465
 
466
 
467
			sMessage = "<table width='100%'  border='0' cellspacing='3' cellpadding='0'>"
468
			sMessage = sMessage &"<tr>"
469
			sMessage = sMessage &"<td width='100%' class='body_txt'><b>BOM is REJECTED!</b><br><br><br></td>"
470
			sMessage = sMessage &"<td width='1%' nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');""  class='body_smllink' title='Create new note'>Create Note"& LIMG_NOTE_NEW &"</a></td>"
471
			sMessage = sMessage &"</tr>"
472
 
473
			While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
474
				sMessage = sMessage & "<tr><td colspan='2' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
475
				sMessage = sMessage &"<tr>"
476
				sMessage = sMessage &"<td class='body_txt'>"
477
				If rsQry("is_rejected") = enumDB_YES Then
478
					sMessage = sMessage &"BOM is REJECTED!<br>"
479
				Else
480
					sMessage = sMessage &"BOM is Accepted!<br>"
481
				End If
482
				sMessage = sMessage & objFormater.TextToHTML( rsQry("comments") ) &"<br><SPAN class='body_smltxtg'>"& rsQry("creator") &"</SPAN></td>"
483
				sMessage = sMessage &"<td nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?reject_seq="& rsQry("reject_seq") &"&rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');"" class='body_smllink' title='Edit note'>Edit Note"& LIMG_NOTE_EDIT &"</a></td>"
484
				sMessage = sMessage &"</tr>"
485
 
486
				rsQry.MoveNext
487
			WEnd
488
			rsQry.Close
489
 
490
			sMessage = sMessage &"</table>"
491
 
492
			Call Messenger ( sMessage, "bi_rejected.gif", "100%" )
493
 
494
			Response.write "<br>"
495
 
496
 
497
			OraDatabase.Parameters.Remove "ENTITY_ID"
498
			OraDatabase.Parameters.Remove "ENUM_ENTITY_TYPE"
499
		%>
500
 
501
		</td>
502
        </tr>
503
    </table>
504
	<%End If%>	
505
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
506
 
507
 
508
	<table width="100%"  border="0" cellspacing="10" cellpadding="0">
509
 
510
	  <tr>
511
        <td width="1"><img src="images/spacer.gif" width="1" height="1"></td>
512
        <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
513
      </tr>
514
 
515
	  <!-- BOM Comments +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
516
	  <%If (objBomCollector.Item("bom_comments") <> "") Then%>
517
      <tr>
518
        <td align="right" valign="top"><img src="icons/i_bom_properties.gif" width="30" height="30" hspace="3"></td>
519
        <td valign="top" class="body_txt">
520
 
521
 
522
			<SPAN class="body_colb">BOM Comments</SPAN>
523
			<hr width="100%" size="1px" noshade color="#808080">
524
			<SPAN class="body_txt"><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%></SPAN><br><br><br><br>
525
        </td>
526
      </tr>
527
	  <%End If%>
528
 
529
 
530
	  <!-- COMPARE BOM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
531
      <tr>
532
        <td align="right" valign="top"><img src="icons/i_bom_diff.gif" width="37" height="33" hspace="3"></td>
533
        <td valign="top" class="body_txt">
534
 
535
		<%
536
		'-- FROM START --------------------------------------------------------------------------------------------------------------
537
		objFormComponent.FormName = "OldVersion"
538
		objFormComponent.Action = SCRIPT_NAME
539
		objFormComponent.Method = "get"
540
		Call objFormComponent.FormStart()
541
 
542
		numOfRows = UBound( GetBomTreeList(), 2 )
543
		maxnumOfRows	=	numOfRows
544
		For  Numrow = 0 To numOfRows 
545
		Call GetFormDetails ( (GetBomTreeList()( 0, Numrow  )), objBomCollector )
546
		%> 	
547
		<SPAN class="body_colb">Products/Patches Introduced in <%Call RenderTitle( objBomCollector )%> but not yet deployed in Production BOM<br></SPAN>
548
            <hr width="100%" size="1px" noshade color="#808080">		
549
		<table width="100%"  border="0" cellspacing="2" cellpadding="0">
550
          <tr>
551
 
552
		  	<td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
553
              <tr>
554
                <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
555
              </tr>
556
            </table></td>
557
			<td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
558
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Reason For This Version</td>
559
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Approval</td>
560
          </tr>
561
		  <%
562
 
563
	If NOT CheckProduction( Request("bom_id"), (GetBomTreeList()( 0, Numrow  ))) Then 
564
	%>
565
		<tr>
566
		<td colspan="4" class="body_txtr"><b>Found Matching BOM or Older Versions...Exiting Comparison</b></td></tr>
567
	<%
568
	Exit For
569
	End If	  
570
		If Numrow = maxnumOfRows Then
571
			Call GetProductList ( (GetBomTreeList()( 0, Numrow  )), 0, aProductList, TRUE )
572
		Else
573
			Call GetProductList ( (GetBomTreeList()( 0, Numrow  )), (GetBomTreeList()( 0, Numrow + 1 )), aProductList, TRUE )	
574
		End	If  
575
		  If NOT IsNull( aProductList ) Then
576
		  	numOfRows = UBound( aProductList, 2 )
577
		  Dim currentpkgId
578
	  	  currentpkgId = -1
579
 
580
			For rowNum = 0 To numOfRows'For Next Loop Begins
581
 
582
				ProdId = aProductList( 0, rowNum )
583
				PkgVersion = aProductList( 2, rowNum )
584
				'ChangeType = aProductList( 3, rowNum )
585
				IsPatch = aProductList( 3, rowNum )
586
				PkgId = aProductList( 5, rowNum )
587
				'Response.Write(PkgId)
588
 
589
				OraDatabase.Parameters.Remove	"PRODUCTION_BOM"
590
				OraDatabase.Parameters.Add "PRODUCTION_BOM", dbPARbom_id, ORAPARM_INPUT, ORATYPE_NUMBER
591
				OraDatabase.Parameters.Add "PKG_ID", PkgId, ORAPARM_INPUT, ORATYPE_NUMBER
592
 
593
					Set rsQry = OraDatabase.DbCreateDynaset(GetQuery("ProdVersion.sql"), ORADYN_DEFAULT)
594
 
595
				OldProdId = rsQry("prod_id")
596
				CurrentPkgVersion = rsQry("pkg_version")
597
				Comments = rsQry("comments")
598
 
599
				OraDatabase.Parameters.Remove "CURRENT_BOM"
600
				OraDatabase.Parameters.Remove "PKG_ID"
601
 
602
				IsDisplay = True
603
 
604
				If IsNull(IsPatch) Then
605
				Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, pos
606
						MajorA = NULL
607
						MajorB = NULL
608
						MinorA = NULL
609
						MinorB = NULL
610
						PatchA = NULL
611
						PatchB = NULL
612
 
613
				' Find the first occurence of the dot in package version A
614
						pos = InStr(PkgVersion, ".")
615
						If pos <> 0 Then
616
							' Extract the Major Version for A
617
							MajorA = Mid(PkgVersion, 1, pos - 1)
618
							' Delete the Major Version Value from the string to get the minor and patch version
619
							PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
620
							' Find the second occurence of the dot in package version A
621
							pos = InStr(PkgVersion, ".")
622
							' Extract the Minor Version for A
623
							If pos <> 0 Then
624
								MinorA = Mid(PkgVersion, 1, pos - 1)
625
								' Delete the Minor Version value from the string to get the patch version
626
								PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
627
								' Find the last occurence of the dot in package version A
628
								pos = InStr(PkgVersion, ".")
629
								If pos <> 0 Then
630
									' Extract the Patch Version for A
631
									PatchA = Mid(PkgVersion, 1, pos - 1)
632
								End If	
633
							End If	
634
						End If	
635
 
636
						' Find the first occurence of the dot in package version B
637
						pos = InStr(CurrentPkgVersion, ".")
638
						If pos <> 0 Then
639
							' Extract the Major Version for B
640
							MajorB = Mid(CurrentPkgVersion, 1, pos - 1)
641
							' Delete the Major Version Value from the string to get the minor and patch version
642
							CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
643
							' Find the second occurence of the dot in package version B
644
							pos = InStr(CurrentPkgVersion, ".")
645
							' Extract the Minor Version for B
646
							If pos <> 0 Then
647
								MinorB = Mid(CurrentPkgVersion, 1, pos - 1)
648
								' Delete the Minor Version value from the string to get the patch version
649
								CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
650
								' Find the last occurence of the dot in package version B
651
								pos = InStr(CurrentPkgVersion, ".")
652
									If pos <> 0 Then
653
									' Extract the Patch Version for B
654
									PatchB = Mid(CurrentPkgVersion, 1, pos - 1)
655
								End If
656
							End If
657
						End If
658
 
659
						If NOT isNull(PatchA) AND NOT isNull(PatchB) Then
660
							If isNumeric(PatchA) AND isNumeric(PatchB) Then
661
								If CLng(PatchA) < 1000 Then
662
									PatchA = CLng(PatchA) * 1000 
663
								End If
664
								If CLng(PatchB) < 1000 Then
665
									PatchB = CLng(PatchB) * 1000
666
								End If	
667
							End If	
668
						End If 
669
 
670
						If MajorA = MajorB Then
671
							If MinorA = MinorB Then
672
								If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
673
 
674
									If CDbl(PatchB) > CDbl(PatchA) Then
675
										IsDisplay = False
676
									Else										
677
										IsDisplay = True
678
									End If
679
								End If
680
							Else
681
								If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
682
									If CInt(MinorB) > CInt(MinorA) Then
683
										IsDisplay = False
684
									Else
685
										IsDisplay = True								
686
									End If									
687
								End If
688
							End If
689
						Else
690
							If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
691
								If 	CInt(MajorB) > CInt(MajorA) Then
692
									IsDisplay = False
693
								Else
694
									IsDisplay = True
695
								End If	
696
							End If
697
						End If		
698
					End If					
699
 
700
 
701
 
702
 
703
 
704
 
705
 
706
 
707
 
708
 
709
			'If ProdId > NewProdId Then
710
			If IsDisplay Then
711
			Set rsTemp = OraDatabase.DbCreateDynaset("SELECT * FROM PACKAGE_VERSIONS PV, PRODUCT_DETAILS PD WHERE PD.PROD_ID(+) = PV.PV_ID AND PV.PV_ID ="&ProdId, ORADYN_DEFAULT )
712
		  %>
713
		  <%If IsNull(IsPatch) Then
714
		  	If CDbl(currentpkgId) <> CDbl(pkgId) Then%>
715
		  <tr>
716
            <td nowrap valign="top">
717
			<SPAN id="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" style="display:block;"><a href="javascript:;" class="menu_link" onClick="RequestProductLocation('?new_version=<%=aProductList( 2, rowNum )%>&new_prod_id=<%=ProdId%>&prod_id=<%=OldProdId%>&bom_id=<%=dbPARbom_id%>&compare_bom_id=<%=(GetBomTreeList()( 0, Numrow  ))%>&pkg_id=<%=PkgId%>&change_type=<%=ChangeType%>', '<%=ProdId & ChangeType%>');"><%=LIMG_EXPAND & GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%></a></SPAN>
718
			<SPAN id="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=ProdId & ChangeType%>', 'IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>', 'IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>');"><%=LIMG_COLLAPSE & GetProductIcon( aProductList( 4, rowNum ) ) &  aProductList( 1, rowNum )%></a></SPAN>
719
			</td>
720
            <td nowrap class="body_row" valign="top">
721
				<%=aProductList( 2, rowNum )%>			</td>
722
			<td class="body_rowlite"><%=rsTemp("comments")%> <!-- <a href="download_version.asp?prod_id=<%=ProdId%>&bom_id=<%=Request("bom_id")%>&os_id=" class="body_link">Download</a> --></td>
723
			<%
724
			Dim rsForm, Tester, Manager
725
			Tester = False
726
			Manager = False
727
			If objAccessControl.IsActive("ApprovedByManager") Then
728
				Manager = True
729
			ElseIf objAccessControl.IsActive("ApprovedByTester") Then
730
				Tester = True
731
			End If
732
 
733
 
734
			Set rsForm = OraDatabase.DbCreateDynaset("SELECT * FROM RELEASE_AUTHORISATION WHERE PV_ID="&ProdId&" AND BOM_ID="&Request("bom_id"), ORADYN_DEFAULT)
735
 
736
			%>
737
			<%If rsForm.RecordCount = 0 Then%>
738
				<%If Tester Then%>
739
					<td class="body_rowlite"><a href="_wform_approval.asp?pv_id=<%=ProdId%>&bom_id=<%=Request("bom_id")%>" onClick="popup = window.open('_wform_approval.asp?pv_id=<%=ProdId%>&bom_id=<%=Request("bom_id")%>', 'Approval Form', 'height=220,width=600,scrollbars=yes,resizable=yes'); return false" target="_blank" style="text-decoration:none" class="body_txtr">Approve</a></td>
740
				<%ElseIf Manager Then%>
741
					<td class="body_txto">Awaiting Tester</td>
742
				<%Else%>
743
					<td class="body_txto"></td>
744
				<%End If%>	
745
			<%ElseIf IsNull(rsForm("is_official")) Then%>
746
				<%If NOT IsNull(rsForm("tester_id")) And Tester	Then %>
747
					<td class="body_txto">Awaiting</td>
748
				<%ElseIf NOT IsNull(rsForm("tester_id")) And Manager Then%>
749
					<td class="body_rowlite"><a href="_wform_approval.asp?pv_id=<%=ProdId%>&bom_id=<%=Request("bom_id")%>" onClick="popup = window.open('_wform_approval.asp?pv_id=<%=ProdId%>&bom_id=<%=Request("bom_id")%>', 'Approval Form', 'height=440,width=600,scrollbars=yes,resizable=yes'); return false" target="_blank" style="text-decoration:none" class="body_txtr">Approve</a></td>
750
				<%Else%>
751
					<td class="body_rowlite"></td>
752
				<%End If%>
753
			<%Else%>
754
				<td class="body_txtg">Approved</td>
755
			<%End If
756
 
757
			rsForm.Close()
758
			Set rsForm = nothing
759
			%>
760
          </tr>
761
		  <tr>
762
	            <td nowrap valign="top" class="body_row" colspan="3">
763
				<DIV id="PRODUCT_<%=ProdId & ChangeType%>" name="PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><%=enumLOADING%></DIV>
764
				</td>
765
	          </tr>
766
 
767
		  <%If rowNum <> numOfRows Then%>
768
		  <tr>
769
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
770
          </tr>
771
		  <%End If%>
772
		  <%End If%>
773
		  <%Else
774
		  %>
775
 
776
		  <%
777
		  	  If CDbl(currentpkgId) <> CDbl(pkgId) Then
778
		  %>
779
	  <tr>
780
		  	<%If Numrow <> maxnumOfRows Then%>
781
            <td nowrap valign="top">
782
			<SPAN id="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" style="display:block;"><a href="javascript:;" class="menu_link" onClick="RequestPatches('?pkg_id=<%=pkgId%>&bom_id=<%=(GetBomTreeList()( 0, Numrow  ))%>&compare_bom_id=<%=(GetBomTreeList()( 0, Numrow + 1  ))%>&current_bom_id=<%=dbPARbom_id%>', '<%=ProdId & ChangeType%>');"><%=LIMG_EXPAND & GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%></a></SPAN>
783
			<SPAN id="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=ProdId & ChangeType%>', 'IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>', 'IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>');"><%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%></a></SPAN>
784
			</td>
785
			<%Else%>
786
            <td nowrap valign="top">
787
			<SPAN id="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>" style="display:block;"><a href="javascript:;" class="menu_link" onClick="RequestPatches('?pkg_id=<%=pkgId%>&bom_id=<%=(GetBomTreeList()( 0, Numrow  ))%>&compare_bom_id=<%=(GetBomTreeList()( 0, Numrow   ))%>&current_bom_id=<%=dbPARbom_id%>', '<%=ProdId & ChangeType%>');"><%=LIMG_EXPAND & GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%></a></SPAN>
788
			<SPAN id="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" name="IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODUCT_<%=ProdId & ChangeType%>', 'IMG_EXPAND_PRODUCT_<%=ProdId & ChangeType%>', 'IMG_COLLAPSE_PRODUCT_<%=ProdId & ChangeType%>');"><%=LIMG_COLLAPSE & GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%></a></SPAN>
789
			</td>			
790
			<%End If%>
791
            <td nowrap class="body_row" valign="top"></td>
792
			<td class="body_rowlite"></td>
793
          </tr>
794
 
795
 
796
		  <tr>
797
	            <td nowrap valign="top" class="body_row" colspan="3">
798
				<DIV id="PRODUCT_<%=ProdId & ChangeType%>" name="PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><%=enumLOADING%></DIV>
799
				</td>
800
	          </tr>
801
		  <%If rowNum <> numOfRows Then%>
802
		  <tr>
803
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
804
          </tr>
805
		  <%End If%>			  
806
 
807
      <%
808
		  	currentpkgId = CDbl(pkgId)
809
		  End If
810
		  ' -------- END GROUP ------------------------
811
 
812
 
813
 
814
		  End If%>
815
 
816
		  <%
817
		 ' End If
818
		  rsTemp.Close()
819
		  Set rsTemp = nothing
820
		  End If
821
		  	Next'For Next Loop End
822
 
823
		  Else%>
824
 
825
		  <tr>
826
            <td colspan="4" class="body_txtr"><b>No Changes Detected In Comparison</b></td>
827
          </tr>
828
		  <%'Exit For%>
829
		  <%End If%>	
830
 
831
 
832
 
833
 
834
          <tr>
835
            <td colspan="4" background="images/bg_table_border.gif">
836
			 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
837
              <tr>
838
                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
839
              </tr>
840
             </table>
841
			</td>
842
          </tr>
843
         </table>	
844
		<br>
845
		<%
846
 
847
		Next
848
		Call objFormComponent.FormEnd()
849
		'-- FROM END ----------------------------------------------------------------------------------------------------------------
850
		%>
851
 
852
	    </td>
853
      </tr>
854
    </table></td>
855
    <td width="1%" valign="top" background="images/bg_favourits.gif">
856
	<%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) <> "hide" Then%>
857
 
858
	<%End If%>
859
   </td>
860
  </tr>
861
  <tr>
862
    <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="1" height="15"></td>
863
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
864
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
865
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
866
  </tr>
867
  <tr>
868
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
869
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
870
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
871
    <td bgcolor="#FFFFFF">&nbsp;</td>
872
  </tr>
873
</table>
874
<!-- FOOTER ++++++++++++++++ -->
875
<!--#include file="_footer.asp"-->
876
<!-- +++++++++++++++++++++++ -->
877
</body>
878
</html>
879
<%
880
'------------ RUN AFTER PAGE RENDER -----------
881
Set objPMod = Nothing
882
Set objCrumbs = Nothing
883
Set objTabControl = Nothing
884
'----------------------------------------------
885
%><!--#include file="common/globals_destructor.asp"-->