;==File=================================================================;
; POSNLTF.DBL	Contains code for serial/lot find.
;=======================================================================;
; Copyright 2000 by TAH Software Systems (TAH), Oklahoma City, Oklahoma ;
;									;
;	TAH provides this software under a license and may only be	;
;	used in accordance with the terms and conditions of such	;
;	license and with the inclusion of the above Copyright notice.	;
;==Function=============================================================;
;	posnlt_find	Find routine for serial/lot file.
;	posnlt_hyper	Hyperlink routines for serial/lot number.
;==Changes==============================================================;
;=======================================================================;
.subroutine posnlt_find

.include "WND:inpinf.def"
	a_inp_record	,a		; input record

.start nopage,nolist
.include "WND:tools.def"
.include "UTS:utcomm.gbl"
.include "POS:pocomm.gbl"
.include "POS:posnlt.rec"

record	posnlt_find			; record for posnlt lookup
	scr_slno	,a20		; Serial/Lot number
	scr_qty		,d6		; Lot quantity
	key_find_data	,a11
	 key0_comp	,a2	@key_find_data
	 key0_order	,d6	@key_find_data+2
	 key0_lineno	,d3	@key_find_data+8

record
	signal_name	,a31
	  fldnam	,a30	@signal_name+1
	setnam		,a30
	wind_id		,i4
.start nopage,list

.proc
	xcall e_enter
	signal_name = '@'
	wind_id = inp_wndid
	fldnam = %i_getstring(wind_id,inp_fldnam)
	setnam = %i_getstring(wind_id,inp_setnam)

	posnlt_find = a_inp_record
	xcall ut_find ('posnlt',posnlt_chan,posnlt,key_find_data,0,1)
	if (posnlt)
	  begin
	    xcall i_putfld (wind_id,setnam,a_inp_record,fldnam,pos_snlt)
	    if (ut_windows.eq.TRUE) xcall i_next (wind_id,'*CURR*','*NEXT*')
	    xcall m_signal (signal_name)
	  end
	xcall e_exit
	xreturn
.end
;=======================================================================;
.subroutine posnlt_hyper

.include "WND:inpinf.def"
	a_inp_record	,a		; input record

external function
	field_exists	,^val

.start nopage,nolist
.include "WND:tools.def"
.include "UTS:dteut.def"
.include "UTS:utcomm.gbl"

record
	signal_name	,a31
	  fldnam	,a30	@signal_name+1
	setnam		,a30
	serial_lot_no	,a20
	wind_id		,i4
.start nopage,list

.proc
	signal_name = '@'
	wind_id = inp_wndid
	fldnam = %i_getstring(inp_wndid,inp_fldnam)
	setnam = %i_getstring(inp_wndid,inp_setnam)

	xcall get_slno (serial_lot_no)
	xcall i_putfld (wind_id,setnam,a_inp_record,fldnam,serial_lot_no)
	xcall m_signal (signal_name)

	xreturn 			; To calling program
.end
;=======================================================================;

