;==File=================================================================;
; POCTRL.DBL
;=======================================================================;
; Copyright 2001 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=============================================================;
;	poctrl		Load company information for PO
;==Changes==============================================================;
;=======================================================================;
.subroutine poctrl

	a_cmcomp	,a	; IN  - Company code to load.

.start nopage,nolist
.include "UTS:dteut.def"
.include "UTS:utcomm.gbl"
.include "POS:pocomm.gbl"

external function
	smctrl		,a
.start nopage,list

.proc
	;	Load the PO control parameters

	po_cmkphs = %smctrl(a_cmcomp,'PO','KEEPHISTORY')
	ut_dummy = %smctrl(a_cmcomp,'PO','PURCHFORM')
	po_cmform = %d(ut_dummy(1:1))
	po_cmoato = %smctrl(a_cmcomp,'PO','AUTOORDERNO')
	po_cmpurg = %smctrl(a_cmcomp,'PO','PURGEWHEN')
	po_cmmloc = %smctrl(a_cmcomp,'PO','MULTILOCS')
	po_cmacls = %smctrl(a_cmcomp,'PO','AUTOCLOSE')
	ut_dummy = %smctrl(a_cmcomp,'PO','RECVGSTYPE')
	po_cmrectyp = %d(ut_dummy(1:1))

	pohedr_log = %smctrl(a_cmcomp,'PO','POHEDR-LOG',1)
	if (.not.pohedr_log) pohedr_log = 'N'
	pohist_log = %smctrl(a_cmcomp,'PO','POHIST-LOG',1)
	if (.not.pohist_log) pohist_log = 'N'
	pohsln_log = %smctrl(a_cmcomp,'PO','POHSLN-LOG',1)
	if (.not.pohsln_log) pohsln_log = 'N'
	poline_log = %smctrl(a_cmcomp,'PO','POLINE-LOG',1)
	if (.not.poline_log) poline_log = 'N'
	pomail_log = %smctrl(a_cmcomp,'PO','POMAIL-LOG',1)
	if (.not.pomail_log) pomail_log = 'N'
	porecv_log = %smctrl(a_cmcomp,'PO','PORECV-LOG',1)
	if (.not.porecv_log) porecv_log = 'N'
	posnlt_log = %smctrl(a_cmcomp,'PO','POSNLT-LOG',1)
	if (.not.posnlt_log) posnlt_log = 'N'
	xreturn	; to calling program
.end

