Purchase Order Fax Log



The Purchase Order Fax Log produces a report by comparing the purchase order printed information from OCS against data extracted from the external faxing program. To do this the OCS system executes a program on the server (called pofaxlog on Linux/Unix or pofaxlog.bat on windows) which must extract, format and sort data from the faxing program. The pofaxlog program must reside in the users PATH and must be written specifically for the purchase order faxing program being used.

Requirements of pofaxlog program

The pofaxlog program is passed the start date and filename for the extracted fax data. All purchase orders faxed on or after the start date should be extracted. The fax data should be extracted to the filename passed from OCS, this file is a variable length ascii file with the following format :-

Field Length Comments
company 2  
department 2  
order type 2  
order no 8  
date faxed 8 format CCYYMMDD
time faxed 8 format HH:MM:SS
faxed by 20  
status 24  
fax no 14  
failed 1 Y - Failed, N - Succeeded

The extracted fax data must be sorted by company, department, order type, order no, date faxed (descending) & time faxed (descending).

Example of pofaxlog

The following is an example of the pofaxlog unix script which extracts the faxing data from UXforms using a new UXforms formatting script usageOCS :-

	startdate=`echo $1 | cut -c7-8`"/"`echo $1 | cut -c5-6`"/"`echo $1 | cut -c3-4`
	faxcmd run usageOCS $startdate | awk '
	substr($0,34,10) == " " {next}
	{ faxdate="20" substr($1,7,2) substr($1,4,2) substr($1,1,2)
	faxno = $5$6$7$8
	if ( $3 == "Success" )
	printf "%-14s%-8s%-8s%-20s%-24s%-14s%-1s\n",\
	$4,faxdate, $2, "", $3, faxno, failed
	}'| sort -o $output +0 -0.14 +0.14r -0.30r

Changes to usageOCS

The pofaxlog linux/unix script extracts data from UXforms using a formatting script usageOCS, this file is a copy of the script usage that is supplied with UXforms. The following changes were made to usageOCS after copying it from usage :-




    local p, fmt, min, sec;

    fmt = " %s %-10s %14s %16s\n";

    p = date("%d/%m/%y %H:%M:%S",rec[6]);

    p = format(fmt,p,TxResult[rec[7]],rec[14],rec[15]);





The main section had the following lines commented out :-

	. # glosdump(stdout,"ReportHeader");
	. # footer(dur);