source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPRPK2.m@ 1800

Last change on this file since 1800 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.8 KB
Line 
1PRCPRPK2 ;WISC/RFJ-packaging discrepancy report (print errors) ;04 Oct 91
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7 ; ^tmp($j,"prcprpkg",nsn,itemda,error)=data where error=1-6
8 ; ^tmp($j,"prcprpkg",nsn,itemda,7,vendor,suberror)=data
9 ; ^tmp($j,"prcprpkg",nsn,itemda,8,transaction,suberror)=data
10PRINT ; print errors
11 N %,%H,%I,D,ERROR,ITEMDA,NOW,NSN,PAGE,PRCPFLAG,PSDATA,SCREEN,SUBERROR,TRANDA,VENDA,VENDATA,X,Y
12 D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
13 S NSN="" F S NSN=$O(^TMP($J,"PRCPRPKG",NSN)) Q:NSN=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) D
14 . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
15 . W !!,NSN,?19,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,25),?47,"[#",ITEMDA,"]",?55,$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA," per "),11)
16 . S ERROR=0 F S ERROR=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA,ERROR)) Q:'ERROR!($G(PRCPFLAG)) D
17 . . I $Y>(IOSL-7) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
18 . . I ERROR<7!(ERROR>14) D DISPLAY(ERROR,^TMP($J,"PRCPRPKG",NSN,ITEMDA,ERROR)) Q
19 . . I ERROR=7 D Q
20 . . . W !?3,"VENDOR (m=MAND)",?20,"[#V]",?27,"UNIT per PUR",?41,"UNIT per REC",?55,"CONV FACT",?71,"LAST COST"
21 . . . S VENDA=0 F S VENDA=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA,ERROR,VENDA)) Q:'VENDA!($D(PRCPFLAG)) D
22 . . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
23 . . . . S VENDATA=$G(^PRC(441,ITEMDA,2,VENDA,0))
24 . . . . S PSDATA=$$GETVEN^PRCPUVEN(PRCP("I"),ITEMDA,VENDA_";PRC(440,",1)
25 . . . . W ! W:$P($G(^PRCP(445,PRCP("I"),1,ITEMDA,0)),"^",12)=VENDA ?1,"m" W ?3,$E($P($G(^PRC(440,VENDA,0)),"^"),1,15),?20,"[#",+VENDA,"]",?27,$J($$UNITVAL^PRCPUX1($P(VENDATA,"^",8),$P(VENDATA,"^",7)," per "),11)
26 . . . . W ?41,$J($$UNITVAL^PRCPUX1($P(PSDATA,"^",3),$P(PSDATA,"^",2)," per "),11),?55,$J($P(PSDATA,"^",4),9),?71,$J($P(VENDATA,"^",2),9)
27 . . . . S SUBERROR="" F S SUBERROR=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA,7,VENDA,SUBERROR)) Q:SUBERROR=""!($G(PRCPFLAG)) D
28 . . . . . D DISPLAY(7+SUBERROR,^TMP($J,"PRCPRPKG",NSN,ITEMDA,7,VENDA,SUBERROR))
29 . . . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
30 . . I ERROR=8 D
31 . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
32 . . . W !?3,"TRANSACTION",?28,"VENDOR",?50,"UNIT per REC",?65,"CF",?71,"QTY OUTST"
33 . . . S TRANDA=0 F S TRANDA=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA,8,TRANDA)) Q:'TRANDA!($G(PRCPFLAG)) S D=$G(^PRCP(445,PRCP("I"),1,ITEMDA,7,TRANDA,0)) I D'="" D
34 . . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
35 . . . . W !?3,$P($G(^PRCS(410,+TRANDA,0)),"^"),?28,$E($P($G(^PRC(440,+$P($G(^PRCS(410,+TRANDA,3)),"^",4),0)),"^"),1,20)
36 . . . . W ?50,$J($$UNITVAL^PRCPUX1($P(D,"^",4),$P(D,"^",3)," per "),11),?65,$J($P(D,"^",5),2),?70,$J($P(D,"^",2),10)
37 . . . . S SUBERROR="" F S SUBERROR=$O(^TMP($J,"PRCPRPKG",NSN,ITEMDA,8,TRANDA,SUBERROR)) Q:SUBERROR=""!($G(PRCPFLAG)) D
38 . . . . . D DISPLAY(8+SUBERROR,^TMP($J,"PRCPRPKG",NSN,ITEMDA,8,TRANDA,SUBERROR))
39 . . . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
40 I '$G(PRCPFLAG) D END^PRCPUREP
41 Q
42 ;
43 ;
44DISPLAY(V1,V2) ; process and display error message
45 N P1,P2,P3,X
46 S P1=$P(V2,"^"),P2=$P(V2,"^",2),P3=$P(V2,"^",3)
47 S X=$P($TEXT(ERRORS+V1),";",4,9)
48 I X["P1" S X=$P(X,"P1")_P1_$P(X,"P1",2)
49 I X["P2" S X=$P(X,"P2")_P2_$P(X,"P2",2)
50 I X["P3" S X=$P(X,"P3")_P3_$P(X,"P3",2)
51 S X(1)=X D DISPLAY^PRCPUX2(4,80,.X)
52 Q
53 ;
54 ;
55H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
56 W $C(13),"PACKAGING DISCREPANCY REPORT FOR ",PRCP("IN"),?(80-$L(%)),%,!,"NSN",?19,"DESCRIPTION",?47,"[#MI]",?55,"UNIT per ISSUE",! S %="",$P(%,"-",81)="" W %
57 Q
58 ;
59 ;
60ERRORS ;; error codes
61 ;;1;Mandatory Source P1 not defined as a vendor in the item master file.
62 ;;2;Unit of Purchase (P1) for mandatory source vendor P2 in item master file needs to be correctly entered.
63 ;;3;Whse inventory point unit of issue (P1) should equal unit of purchase (P2) for mandatory source vendor P3 in the item master file.
64 ;;4;Primary inventory point mandatory source P1 should equal mandatory source P2 from the item master file.
65 ;;5;Primary inventory point mandatory source P1 needs to be added as a procurement source in the inventory point.
66 ;;6;Primary inventory point unit of receipt (P1) for mandatory source P2 should equal the unit of purchase (P3) from the item master file.
67 ;;7;Unit of purchase (P1) in item master file needs to be correctly entered.
68 ;;8;Vendor needs to be added as a procurement source in the inventory point.
69 ;;9;Unit of receipt (P1) should equal the unit of purchase (P2) from the item master file.
70 ;;10;Vendor needs to be removed as a procurement source.
71 ;;11;P1
72 ;;12;Outstanding transaction unit of receipt (P1) should equal unit of purchase (P2).
73 ;;13;
74 ;;14;
75 ;;15;NSN needs to be defined.
76 ;;16;SKU (P1) should equal warehouse unit of issue (P2).
Note: See TracBrowser for help on using the repository browser.