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

PRCPRLDO.m

Go to the documentation of this file.
  1. PRCPRLDO ;WISC/RFJ-list distribution orders ;7/24/00 23:29
  1. ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. D ^PRCPUSEL Q:'$D(PRCP("I"))
  1. N %,ORDERDA,PRCPFITM,PRCPFLAG,PRCPFPIC,X
  1. K X S X(1)="The List Distribution Orders To/From Inventory Point option will display distribution orders which have been entered but not posted to the secondary."
  1. D DISPLAY^PRCPUX2(40,79,.X)
  1. I PRCP("DPTYPE")="P" D Q:$G(PRCPFLAG)
  1. . K X S X(1)="You have the option to release all orders which have been placed to "_PRCP("IN")_", but not released for filling." D DISPLAY^PRCPUX2(2,40,.X)
  1. . S XP="Do you want to release the orders now",XH="Enter YES to release the orders."
  1. . S %=$$YN^PRCPUYN(2) I '% S PRCPFLAG=1 Q
  1. . I %=1 D
  1. . . K ^TMP($J,"PRCPBAL3")
  1. . . S ORDERDA=0 F S ORDERDA=$O(^PRCP(445.3,ORDERDA)) Q:'ORDERDA S DATA=$G(^(ORDERDA,0)) I $P(DATA,"^",2)=PRCP("I"),$P(DATA,"^",6)="" S ^TMP($J,"PRCPBAL3",ORDERDA)=""
  1. . . I '$O(^TMP($J,"PRCPBAL3",0)) W !,"NO ORDERS READY FOR RELEASING." Q
  1. . . D RELEASE^PRCPBAL3
  1. . . K ^TMP($J,"PRCPBAL3")
  1. . ;
  1. . K X S X(1)="You have the option to print the picking tickets for all orders which have been released for filling to "_PRCP("IN")_". Only the picking tickets which have never been printed (no reprints) will be selected."
  1. . W ! D DISPLAY^PRCPUX2(2,40,.X)
  1. . S XP="Do you want to print picking tickets for released orders",XH="Enter YES to print the picking tickets for all released orders,",XH(1)="Enter NO to skip printing the picking tickets."
  1. . S %=$$YN^PRCPUYN(2) I '% S PRCPFLAG=1 Q
  1. . S PRCPFPIC=$S(%=1:1,1:0)
  1. I $G(PRCPFPIC) D DEVICE Q
  1. ;
  1. K X S X(1)="You have the option to print the list of items for each order or to print each order just displaying the status." W ! D DISPLAY^PRCPUX2(2,40,.X)
  1. S XP="Do you want to breakout a list of items on each order",XH="Enter YES to display a list of all items on the order,",XH(1)="Enter NO to only print the status of each order."
  1. S %=$$YN^PRCPUYN(2) I '% Q
  1. S PRCPFITM=$S(%=1:1,1:0)
  1. DEVICE ;
  1. W ! S %ZIS="Q" D ^%ZIS Q:POP
  1. I $G(PRCPFPIC),IO=IO(0) W !,"YOU CANNOT SELECT YOUR CURRENT DEVICE FOR PRINTING PICKING TICKETS." G DEVICE
  1. I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK Q
  1. . S ZTDESC="List Distribution Orders",ZTRTN="DQ^PRCPRLDO"
  1. . S ZTSAVE("PRCP*")="",ZTSAVE("ZTREQ")="@"
  1. W !!,"<*> please wait <*>"
  1. DQ ; queue starts here
  1. I $G(PRCPFPIC) D PICKTICK Q
  1. ;
  1. N DATA,ITEMDA,ITEMDATA,NOW,ORDERDA,PAGE,PRCPFLAG,SCREEN,UNITCOST,X,Y
  1. D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
  1. S ORDERDA=0 F S ORDERDA=$O(^PRCP(445.3,ORDERDA)) Q:'ORDERDA!($G(PRCPFLAG)) S DATA=$G(^(ORDERDA,0)) I DATA'="" D
  1. . I $P(DATA,"^",6)="P" Q
  1. . I PRCP("DPTYPE")="P",$P(DATA,"^",2)'=PRCP("I") Q
  1. . I PRCP("DPTYPE")="S",$P(DATA,"^",3)'=PRCP("I") Q
  1. . S Y=$P(DATA,"^",4) D DD^%DT
  1. . W !,$P(DATA,"^"),?8,$P(Y,"@"),?22,$P($$TYPE^PRCPOPU(ORDERDA),"ORDER"),?32,$$STATUS^PRCPOPU(ORDERDA)
  1. . I PRCP("DPTYPE")="P" W ?54,$E($$INVNAME^PRCPUX1(+$P(DATA,"^",3)),1,25)
  1. . I PRCP("DPTYPE")="S" W ?54,$E($$INVNAME^PRCPUX1(+$P(DATA,"^",2)),1,25)
  1. . I $Y>(IOSL-5) D:SCREEN P^PRCPUREP Q:$G(PRCPFLAG) D H
  1. . I '$G(PRCPFITM) Q
  1. . S ITEMDA=0 F S ITEMDA=$O(^PRCP(445.3,ORDERDA,1,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) S ITEMDATA=$G(^(ITEMDA,0)) I ITEMDATA'="" D
  1. . . S UNITCOST=$P($G(^PRCP(445,+$P(DATA,"^",2),1,ITEMDA,0)),"^",22)
  1. . . W !?10,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,29),?40,ITEMDA,?50,$J(+$P(ITEMDATA,"^",2),15),$J(UNITCOST,15)
  1. . . I $Y>(IOSL-5) D:SCREEN P^PRCPUREP Q:$G(PRCPFLAG) D H
  1. D END^PRCPUREP
  1. D ^%ZISC
  1. Q
  1. ;
  1. ;
  1. H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
  1. W $C(13),"LIST DISTRIBUTION ORDER REPORT FOR ",PRCP("IN"),?(80-$L(%)),%
  1. W !,"ORDER#",?8,"DATE",?22,"TYPE",?32,"STATUS",?54,"DELIVER ",$S(PRCP("DPTYPE")="P":"TO",1:"FROM")," INVENTORY POINT"
  1. I $G(PRCPFITM) W !?10,"ITEM",?40,"MI#",?50,$J("QUANTITY",15),$J("EST. UNIT COST",15)
  1. S %="",$P(%,"-",81)="" W !,%
  1. Q
  1. ;
  1. ;
  1. PICKTICK ; print orders which have been released but the picking ticket
  1. ; has not been printed
  1. N DATA,ORDERDA,PRCPORD,PRCPPAT,PRCPPRIM,PRCPSECO
  1. S ORDERDA=0 F S ORDERDA=$O(^PRCP(445.3,ORDERDA)) Q:'ORDERDA S DATA=$G(^(ORDERDA,0)) I DATA'="" D
  1. . I PRCP("DPTYPE")="P",$P(DATA,"^",2)'=PRCP("I") Q
  1. . I $P(DATA,"^",7)="Y" Q
  1. . I $P(DATA,"^",6)'="R" Q
  1. . D VARIABLE^PRCPOPU
  1. . D BUILD^PRCPOPT(ORDERDA)
  1. . D DQ^PRCPOPT1
  1. D Q^PRCPOPT
  1. Q