Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFSHIP

ACRFSHIP.m

Go to the documentation of this file.
ACRFSHIP ;IHS/OIRM/DSD/THL,AEF - SHIPPING INSTRUCTIONS; [ 09/23/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;TO REVIEW AND EDIT SHIPPING INSTRUCTIONS
EN ;EP;TO REVIEW AND EDIT SHIPPING INSTRUCTIONS
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRQUIT,ACRST,ACRRA,ACRSSDA,ACRY,ACRRA,ACRITEMS,ACRDPTDA,ACRSIDA,ACRQUAN,ACRSSI,ACRSS,ACRSI,ACRDMAX,ACRIMAX
 Q
EN1 D DISPLAY,CHOOSE
 Q
DISPLAY ;EP;TO DISPLAY CURRENT SHIPPING INSTRUCTIONS
 D HEAD
 S ACRST=$G(^ACRDOC(ACRDOCDA,"POST"))
 I $E(IOST,1,2)'="P-",+ACRST,'$D(^ACRSI("AB",ACRDOCDA,+ACRST)) D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S (ACRDPTDA,D0)=+ACRST,ACRDMAX=""
 .W !!,"Primary Ship To Location:"
 .W !
 .D DISP
 .S DIR(0)="YO"
 .S DIR("A")="Include Primary Ship To Location in Instrutions"
 .S DIR("B")="YES"
 .W !
 .D DIR^ACRFDIC
 .Q:+Y'=1
 .D FILE
 S (ACRDMAX,ACRSIDA)=0
 F  S ACRSIDA=$O(^ACRSI("B",ACRDOCDA,ACRSIDA)) Q:'ACRSIDA  D
 .S ACRST=$P($G(^ACRSI(ACRSIDA,0)),U,2)
 .S ACRRA=$P($G(^ACRSI(ACRSIDA,0)),U,3)
 .Q:'ACRST
 .S D0=+ACRST
 .S ACRDMAX=ACRDMAX+1
 .S ACRSI(ACRDMAX)=ACRSIDA
 .D DISP
 .I $D(ACRSIDA) D IDISP^ACRFSHI1
 Q
CHOOSE ;EP;TO CHOOSE SHIPPING INSTRUCTION FUNCTION
 S DIR(0)="SO^1:ADD a Shipping Location"_$S($D(^ACRSI("B",ACRDOCDA)):";2:EDIT a Shipping Location;3:DELETE a Shipping Location",1:"")
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'$G(Y)
 I Y=1 D ADD Q
 I Y=2 D EDIT Q
 I Y=3 D DELETE Q
 Q
SELECT ;SELECT SHIPPING INSTRUCTION TO EDIT
 Q
ADD ;
 D DEPT
 Q:$D(ACRQUIT)!$D(ACROUT)
 I $D(^ACRSI("AC",ACRDOCDA,ACRDPTDA)) D  Q
 .W !!,"This DEPARTMENT is already identified as a SHIPPING location for this document."
 .W !,"Use the EDIT mode to add or delete items to be shipped to this DEPARTMENT."
 .D PAUSE^ACRFWARN
 D FILE
 D ITEM
 Q:$D(ACRQUIT)!$D(ACROUT)
 D RECEIVER
 Q:$D(ACROUT)
 S:'$D(^ACRSI(ACRSIDA,1,0)) ^ACRSI(ACRSIDA,1,0)="^9003010.01P"
 S ACRSS=0
 F  S ACRSS=$O(ACRSS(ACRSS)) Q:'ACRSS
 Q
FILE S X=ACRDOCDA
 S DIC="^ACRSI("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRDPTDA_";.03////"_$G(ACRRA)
 D FILE^ACRFDIC
 S ACRSIDA=+Y
 Q
EDIT ;EDIT EXISTING SHIPPING INSTRUTIONS
 I ACRDMAX=1 S Y=1 D EDIT1 Q
 S DIR(0)="NO^1:"_ACRDMAX
 S DIR("A")="Which Shipping Location"
 W !
 D DIR^ACRFDIC
 I +Y<1!'$D(ACRSI(+Y)) S ACRQUIT="" Q
EDIT1 S (ACRSIDA,DA)=ACRSI(+Y)
 D EI
 Q
EI W !
 S DIE="^ACRSI("
 S DR="[ACR SHIPPING INSTRUCTION]"
 D DDS^ACRFDIC
 I $D(ACRSCREN) K ACRSCREN D DIE^ACRFDIC
 D ITEMS^ACRFSHI1
 Q
DELETE ;DELETE EXISTING SHIPPING INSTRUTIONS
 I ACRDMAX=1 S Y=1 D D1 Q
 S DIR(0)="NO^1:"_ACRDMAX
 S DIR("A")="Which Location do you want to DELETE"
 W !
 D DIR^ACRFDIC
 I +Y<1!'$D(ACRSI(+Y)) S ACRQUIT="" Q
D1 S DA=ACRSI(+Y)
 S DIK="^ACRSI("
 S DIR(0)="YO"
 S DIR("A")="Are you certain you want to DELETE Location NO. "_+Y
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:+Y'=1
 D DIK^ACRFDIC
 Q
 Q
DISP ;EP;TO DISPLAY SHIPPING LOCATION
 ;REQUIRES THAT 'D0' BE SET TO THE INTERNAL ENTRY NUMBER OF THE
 ;OF THE 'FMS DEPARTMENT/PROGRAM' FILE
 N DXS,DIP
 W !!?5,$G(ACRDMAX)
 D ^ACRPDA
 I $G(ACRRA) D
 .;S X=$P($G(^VA(200,ACRRA,0)),U)  ;ACR*2.1*19.02 IM16848
 .S X=$$NAME2^ACRFUTL1(ACRRA)  ;ACR*2.1*19.02 IM16848
 .S X=$P($P(X,",",2)," ")_" "_$P(X,",")
 .W !?9,"ATTN.: ",X
 Q
DEPT ;SELECT DEPARTMENT TO SHIP TO
 S DIC="^AUTTPRG("
 S DIC(0)="AEMQZ"
 S DIC("A")="Ship to DEPARTMENT..: "
 W !
 D DIC^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 Q:$D(ACROUT)
 S (D0,ACRSIDA,ACRDPTDA)=+Y
 D DISP
 Q
ITEM ;CREATE LIST OF ITEMS TO BE SHIPPED TO SELECTED DEPARTMENT
 I '$O(^ACRSS("J",ACRDOCDA,0)) S ACRQUIT="" Q
 D IARRAY^ACRFSHI1
 I ACRJ=1 S ACRITEMS=1 Q
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Which ITEM(S)......."
 W !
 D DIR^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S ACRITEMS=Y
 Q
RECEIVER ;SELECT NAME OF RECEIVING OFFICIAL
 S DIC="^VA(200,"
 S DIC(0)="AEMQZ"
 S DIC("A")="RECEIVING AGENT.....: "
 S DIC("S")="I $D(^ACRAPL(""AC"",+Y,7))"
 W !
 D DIC^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S ACRRA=+Y
 Q
 W:$E(IOST,1,2)="C-" @IOF
 W !?5,"***************************************************************"
 W !?5,"SHIPPING INSTRUCTIONS FOR ORDER NO:"
 W !?5,$P(^ACRDOC(ACRDOCDA,0),U,2)
 W ?$X+2,"(",$P(^ACRDOC(ACRDOCDA,0),U),")"
 W !?5,"***************************************************************"
 Q
PRINT ;EP;TO PRINT CALL FOR PRINT OF SHIPPING INSTRUCTIONS
 Q:'$D(^ACRSI("B",ACRDOCDA))
 K ACRSHIP
 S DIR(0)="YO"
 S DIR("A")="Include Shipping Instructions"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 S:Y=1 ACRSHIP=""
 Q