45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
compile function update_cust_bag_req()
|
|
begin condition
|
|
pre:
|
|
post:
|
|
end condition
|
|
declare subroutine rlist
|
|
declare function msg, fieldcount, send_info, next_key
|
|
$insert logical
|
|
$insert rlist_equates
|
|
$insert names_equ
|
|
$insert company_equ
|
|
open 'COMPANY' to CompanyTable else
|
|
void = msg( '', 'Unable to open Company...' )
|
|
return 0
|
|
end
|
|
DoneCusts = '639/533/555/511/406/562/685/504/620/408/615/622/647/542/401/409/696'
|
|
convert '/' to @vm in DoneCusts
|
|
Cnt = 0
|
|
rlist( 'SELECT COMPANY WITH CO_TYPE = "C"', TARGET_ACTIVELIST$, '', '', '' )
|
|
done = 0
|
|
if @reccount then
|
|
NumKeys = @reccount
|
|
loop
|
|
readnext TheKey else done = 1
|
|
until done
|
|
locate TheKey in DoneCusts using @vm setting Dum else
|
|
lock CompanyTable, TheKey then
|
|
writev "Tape and Bag" on CompanyTable, TheKey, company_cust_ship_req$ else
|
|
Void = msg( '', 'Unable to write ':TheKey:' on Company Table...' )
|
|
return 0
|
|
end
|
|
unlock CompanyTable, TheKey else
|
|
Void = msg( '', 'Unable to unlock ':TheKey:' in the Company Table...' )
|
|
end
|
|
end else
|
|
Void = msg( '', 'You will have to manually update customer ':TheKey )
|
|
end
|
|
end
|
|
Cnt += 1
|
|
Percent = oconv( iconv(Cnt/NumKeys, 'MD2'), 'MD0' ):'%'
|
|
Void = send_info( Percent:' Complete updating Customers...')
|
|
repeat
|
|
end
|
|
return 0
|