;==File=================================================================;
; PO2700.DBL
;=======================================================================;
; Copyright 1999 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=============================================================;
;	po2700		Order status inquiry.
;==Changes==============================================================;
;=======================================================================;
.subroutine po2700

.start nopage,nolist
.include "UTL:tools.def"
.include "UTS:dteut.def"
.include "POS:dtepo.def"

.include "UTS:utcomm.gbl"
.include "POS:pocomm.gbl"
.include "NAS:nacomm.gbl"

record	scr_rec1		; input set 1
	scr_strorder	,d6		; beginning order number

record
	abort		,d1
	key_start	,a8		; beginning key for call
	  key_comp	,a2	@key_start
	  key_order	,a6	@key_start+2
	selected	,d1		; selection window flag
	wdone		,d1
	wind_name	,a*,	'po2700'
	wind_no		,d2		; input window id
	wind_signal	,a31
.start nopage,list

.proc
	;>>>>>	Main processing  <<<<<;
	call do_setup
	call open_files
	if (abort.eq.FALSE)
	  begin
	    call get_parameters
	    if (abort.eq.FALSE) call process_data
	  end
	call close_files
	call do_shutdown
	xreturn		; to calling program

	;>>>>>	End of main processing  <<<<<;

	;	Set up environment
do_setup,
	xcall e_enter
	xcall lodcol ('RL')		; remove local columns
	xcall lodtoolbar ('AB',8)
	return

	;	Shut down environment
do_shutdown,
	xcall lodtoolbar ('RB',8)
	xcall e_exit
	return

	;	Open the needed data files
open_files,
	abort = FALSE
	xcall open (pohedr_chan,'I:I',pohedr_name)
	xcall open (namast_chan,'I:I',namast_name)
	return

	;	Close the data files opened for the report
close_files,
	xcall close (pohedr_chan,DTE_CLOSE)
	xcall close (namast_chan,DTE_CLOSE)
	return

	;	Get the report selection parameters
get_parameters,
	repeat
	  begin
	    xcall get_parameters (wind_no,wind_name,'set1',scr_rec1,abort,wind_signal)
	    if (abort.eq.TRUE) exitloop
	    if (wind_signal)
	     then call process_signal
	     else
	      begin
		call verify_input_parameters
		if (wdone.eq.TRUE) exitloop
	      end
	  end
	return

	;	Process any break signals
process_signal,
	case g_entnam of
	  begincase
	  '@': nop
	  endcase
	return

verify_input_parameters,
	wdone = TRUE
	return

	;	Process the data
process_data,
	abort = FALSE
	clear key_start
	key_comp = ut_cmcomp
	key_order = scr_strorder, 'XXXXXX'
	xcall po_inq_order (key_start,0,selected)
	return
.end

