source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPRCOS.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1PRCPRCOS ;WISC/RFJ-unit costing report (whse) ;28 Jan 92
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 D ^PRCPUSEL Q:'$G(PRCP("I")) I PRCP("DPTYPE")'="W" W !,"THIS OPTION CAN ONLY BE USED BY THE WAREHOUSE INVENTORY POINT." Q
5 N WHSESRCE,X,Y
6 S WHSESRCE=+$O(^PRC(440,"AC","S",0)) I 'WHSESRCE W !!,"THERE IS NOT A VENDOR IN THE VENDOR FILE (#440) DESIGNATED AS A SUPPLY WHSE." Q
7 W !! F %=1:1 S X=$P($T(TEXT+%),";",3,99) Q:X="" W !,X
8 S %ZIS="Q" D ^%ZIS Q:POP I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK Q
9 . S ZTDESC="Inventory Unit Cost Report",ZTRTN="DQ^PRCPRCOS"
10 . S ZTSAVE("PRCP*")="",ZTSAVE("WHSE*")="",ZTSAVE("ZTREQ")="@"
11 W !!,"<*> please wait <*>"
12DQ ;queue comes here
13 N %,%I,DATA,ITEMDA,NOW,NSN,PAGE,PRCPFLAG,SCREEN,SKU,UNITCOST
14 K ^TMP($J,"COST") D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
15 S ITEMDA=0 F S ITEMDA=$O(^PRCP(445,PRCP("I"),1,ITEMDA)) Q:'ITEMDA D
16 . S DATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0)),NSN=$$NSN^PRCPUX1(ITEMDA) S:NSN="" NSN=" "
17 . S UNITCOST=" NOT REQ" I $$MANDSRCE^PRCPU441(ITEMDA)=WHSESRCE S UNITCOST=$J($P($G(^PRC(441,ITEMDA,2,WHSESRCE,0)),"^",2),10,3)
18 . S SKU=$$SKU^PRCPUX1(PRCP("I"),ITEMDA)
19 . S ^TMP($J,"COST",NSN,ITEMDA)=$$DESCR^PRCPUX1(PRCP("I"),ITEMDA)_"^"_$$UNITVAL^PRCPUX1($P(DATA,"^",14),$P(DATA,"^",5),"")_"^"_SKU_"^"_$J($P(DATA,"^",22),10,3)_"^"_$J($P(DATA,"^",15),10,3)_"^"_UNITCOST
20 S NSN="" F S NSN=$O(^TMP($J,"COST",NSN)) Q:NSN=""!($D(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"COST",NSN,ITEMDA)) Q:'ITEMDA!($D(PRCPFLAG)) S DATA=^(ITEMDA) D
21 . W !!,$TR(NSN,"-"),?14,$E($P(DATA,"^"),1,14),?29,$J(ITEMDA,6),$J($P(DATA,"^",2),8),?48,$P(DATA,"^",3),?50,$P(DATA,"^",4),$P(DATA,"^",5),$P(DATA,"^",6)
22 . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
23 . I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>"
24 I $O(^TMP($J,"COST",""))="" W !!?20,">> NO ITEMS FOUND <<"
25 E I '$D(PRCPFLAG) W ! F %=1:1 S X=$P($T(TEXTEND+%),";",3,99) Q:X="" W !?6,X I $Y>(IOSL-4) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
26 I '$D(PRCPFLAG) D END^PRCPUREP
27 D ^%ZISC K ^TMP($J,"COST") Q
28 ;
29H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
30 W $C(13),"UNIT COSTING REPORT FOR: ",$E(PRCP("IN"),1,12),?(80-$L(%)),%
31 S %="",$P(%,"-",81)="" W !,"NSN",?15,"DESCRIPTION",?33,"MI",?37,"UNIT/ISS",?47,"SKU",?53,"AVGCOST",?62,"LASTCOST",?72,"UNITCOST",!,%
32 Q
33 ;
34TEXT ;;display info text
35 ;;This option will print a report showing the unit costing for each item
36 ;;stored in the warehouse inventory point. You can use this report to
37 ;;verify the current costing values stored.
38 ;;
39TEXTEND ;;display help at end of report
40 ;;The average cost and last cost are defined in the inventory point
41 ;;for each item. The unit cost is defined in the item master file
42 ;;for the warehouse vendor. If the mandatory source in the item master
43 ;;file is not the warehouse, the unit cost will print NOT REQ (for
44 ;;not required). Otherwise, the unit cost will be displayed.
Note: See TracBrowser for help on using the repository browser.