;==File=================================================================;
; PO4000R.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=============================================================;
;	po4000r		Purchase Order remarks entry.
;==Changes==============================================================;
;=======================================================================;
.subroutine po4000r

	a_poline	,a	; IN  - Order line item record
	a_initem	,a	; IN  - Inventory item record

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

.include "UTS:utcomm.gbl"
.include "POS:pocomm.gbl"
.include "POS:poline.rec"
.include "INS:initem.rec"

static record
	rem_id		,i4
	rem_name	,a*,	'po4000r'
.start nopage,list

.proc
	xcall status
	poline = a_poline
	initem = a_initem
	xcall lodwin ('LPL',rem_name,rem_id)

	if (pol_remark1.eq.UT_BLANKS)
	    begin
	        clear pol_remark2
		pol_rem1prt = 'P'
		pol_rem2prt = 'P'
		clear g_setsts, g_select
            end
	xcall i_display (rem_id,'set1',poline)
	xcall i_next (rem_id,'set1','*FRST*')
	do begin
	  xcall i_input (rem_id,'set1',poline,,ut_col_sel,,1)
	  if g_select
	    begin
	      case g_entnam of
		begincase
		'END': exitloop
		'@':   call process_signal
		endcase
	    end
	end until (.not.g_setsts) .and. (.not.g_select)

	a_poline = poline
	xcall lodwin ('D',,rem_id)
	xreturn		; to calling program

	;	Process any break signals
process_signal,
	case g_entnam of
	  begincase
	  '@PLREM1': if (pol_remark1.eq.UT_BLANKS)
		      begin
		        clear pol_remark2
			pol_rem1prt = 'N'
			pol_rem2prt = 'N'
			clear g_setsts, g_select
		      end
		     else
		      if (.not.ut_windows)
			xcall i_next (rem_id,'set1','*NEXT*')
	  endcase
	return

.end

