source: FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHLO1.m@ 1120

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

initial load of FOIAVistA 6/30/08 version

File size: 5.1 KB
Line 
1PRCHLO1 ;WOIFO/RLL-EXTRACT ROUTINE (cont.)CLO REPORT SERVER ; 12/19/05 10:56am
2V ;;5.1;IFCAP;**83**;; Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ; Continuation of PRCHLO1. This program builds the extracts for
5 ; the Master PO Table and the associated multiples
6POMAST ; PoMaster Table
7 Q
8PODISCW ; Write PO Discount table data
9 N GPOID,GPOND
10 S GPOID=0,GPOND=""
11 F S GPOID=$O(^TMP($J,"PODISC",GPOID)) Q:GPOID="" D
12 . F S GPOND=$O(^TMP($J,"PODISC",GPOID,GPOND)) Q:GPOND="" D
13 . . W $G(^TMP($J,"PODISC",GPOID,GPOND))
14 . . W !
15 . . Q
16 . Q
17 Q
18GPOMAST ; get PO Master record
19 S U="^"
20 N N0,N1,N7,N12,N16,N23,PONUMB,STNUMB,PODAT,PPOKEY
21 N PAPAB,PAPAB1,AGAPO,AGAPO1,PCHDR,PCHDR1,PCUSR,PCUSR1
22 N VL6,VL7,VL8,VL9,VL10,VL11,VL12,VL13,VL14,VL15,VL16,VL17,VL18
23 N VL19,VL20,VL21,VL22,VL23,VL24,VL25,VL26,VL27,VL28,VL29,VL30,VL31
24 N VL32,VL33,VL34,VL35,VL36,VL37,VL38,VL39,VL40,VL41
25 N GN0,GN0A,GN0B,GN1,GN1A,GN2,VN,VN1,VN2
26 N VL6E,VL6E1,VL6E2,VL7E,VL7E1,VL7E2,VL8E,VL8E1,VL8E2,VL10E,VL10E1
27 N VL10E2,VL21E,VL21E1,VL21E2,VL25E,VL25E1,VL25E2,VL35E,VL35E1,VL35E2
28 N VL16E,VL16E1,VL16E2,VL18E,VL18E1,VL18E2,VL33E,VL33E1,VL33E2
29 N VL34E,VL34E1,VL34E2,PC2237V,PC2237V1,EXDT,EXDT1,EXDT2
30 S N0=$G(^PRC(442,POID,0))
31 S N1=$G(^PRC(442,POID,1))
32 S N7=$G(^PRC(442,POID,7))
33 S N12=$G(^PRC(442,POID,12))
34 S N16=$G(^PRC(442,POID,16))
35 S N23=$G(^PRC(442,POID,23))
36 S PONUMB=$P(N0,U,1),STNUMB=$P(PONUMB,"-",1)
37 S EXDT=$P(N1,U,15)
38 I EXDT="" S EXDT=POCRDAT ; if PO Date "" use x-ref date value for PO
39 S EXDT1=$P(EXDT,".",1)
40 S EXDT2=$$FMTE^XLFDT(EXDT1)
41 S PODAT=EXDT2 ; needed for key
42 S PPOKEY=POID_U_PONUMB_U_PODAT_U_MNTHYR_U_STNUMB
43 ;
44 ; The 1st 5 values in PPOKEY above are included in each record
45 ;
46 S VL6E=$P(N0,U,12),VL6E1=$G(^PRCS(410,+VL6E,0)),VL6E2=$P(VL6E1,U,1)
47 S VL6=VL6E2 ; Prim2237
48 S VL7E=$P(N0,U,2),VL7E1=$G(^PRCD(442.5,+VL7E,0)),VL7E2=$P(VL7E1,U,1)
49 S VL7=VL7E2 ; meth.of proc
50 S VL8E=$P(N1,U,19),VL8E1=$G(^PRC(443.8,+VL8E,0)),VL8E2=$P(VL8E1,U,2)
51 S VL8=VL8E2 ; locProcRsnCode
52 S VL9=$P(N1,U,18) ; exp/non-exp
53 S VL10E=$P(N7,U,1),VL10E1=$G(^PRCD(442.3,+VL10E,0))
54 S VL10E2=$P(VL10E1,U,1)
55 S VL10=VL10E2 ; Supply status
56 S VL11=$P(N7,U,2) ; Sup Stat Order
57 S VL12=$P(N7,U,4) ;Fis Stat Order
58 S VL13=$P(N0,U,3) ;FCP
59 S VL14=$P(N0,U,4) ;Appropriation
60 S VL15=$P(N0,U,5) ;CostCenter
61 S VL16E=$P(N0,U,6),VL16E1=$G(^PRCD(420.2,+VL16E,0))
62 S VL16E2=$P(VL16E1,U,1)
63 S VL16=VL16E2 ;SubAcct1
64 S VL17=$P(N0,U,7) ;SubAmt1
65 S VL18E=$P(N0,U,8),VL18E1=$G(^PRCD(420.2,+VL18E,0))
66 S VL18E2=$P(VL18E1,U,1)
67 S VL18=VL18E2 ;SubAcct2
68 S VL19=$P(N0,U,9) ;SubAmt2
69 ; set Node 0 of ^TMP
70 S GN0=PPOKEY_U_VL6_U_VL7_U_VL8_U_VL9_U_VL10_U
71 S GN0A=GN0_VL11_U_VL12_U_VL13_U_VL14_U_VL15_U
72 S GN0B=GN0A_VL16_U_VL17_U_VL18_U_VL19_U
73 S ^TMP($J,"POMAST",POID,0)=GN0B ; build and set node 0
74 ; begin Node 1
75 ; look up Vendor
76 S VN=$P(N1,U,1),VN1=$G(^PRC(440,+VN,0)),VN2=$P(VN1,U,1)
77 S VL20=VN2
78 ; S VL20=$P(N1,U,1) ; Vendor
79 S VL21E=$P(N1,U,2),VL21E1=$G(^DIC(49,+VL21E,0))
80 S VL21E2=$P(VL21E1,U,1)
81 S VL21=VL21E2 ; Req. Service
82 S VL22=$P(N1,U,6) ; Fob Point
83 ; get ext. date
84 S EXDT=$P(N0,U,20),EXDT1=$P(EXDT,".",1)
85 S EXDT2=$$FMTE^XLFDT(EXDT1)
86 S VL23=EXDT2 ; Org. Del. Date
87 S VL24=$P(N0,U,11) ; Est. Cost
88 S VL25E=$P(N1,U,7),VL25E1=$G(^PRCD(420.8,+VL25E,0))
89 S VL25E2=$P(VL25E1,U,2)
90 S VL25=VL25E2 ; Source Code
91 S VL26=$P(N0,U,13) ; Est Shipping
92 S VL27=$P(N0,U,18) ; Shp Ln Itm #
93 S VL28=$P(N0,U,14) ; Ln Itm Cnt
94 S PAPAB=$P(N1,U,10),PAPAB1=$G(^VA(200,+PAPAB,0))
95 S VL29=$P(PAPAB1,U,1) ; PaPpmAuthBuyer
96 S AGAPO=$P(N12,U,4),AGAPO1=$G(^VA(200,+AGAPO,0))
97 S VL30=$P(AGAPO1,U,1) ; Agt Assgnd PO
98 ; get external date
99 S EXDT=$P(N12,U,5),EXDT1=$P(EXDT,".",1)
100 S EXDT2=$$FMTE^XLFDT(EXDT1)
101 S VL31=EXDT2 ; DatePoAssigned
102 S VL32=$P(N16,U,0) ;remarks
103 S VL33E=$P(N23,U,3),VL33E1=$G(^PRC(442,+VL33E,0))
104 S VL33E2=$P(VL33E1,U,1)
105 S VL33=VL33E2 ; OldPoRec
106 S VL34E=$P(N23,U,4),VL34E1=$G(^PRC(442,+VL34E,0))
107 S VL34E2=$P(VL34E1,U,1)
108 S VL34=$P(N23,U,4) ; New PoRec
109 S GN1=VL20_U_VL21_U_VL22_U_VL23_U_VL24_U_VL25_U_VL26_U_VL27_U
110 S GN1A=GN1_VL28_U_VL29_U_VL30_U_VL31_U_VL32_U_VL33_U_VL34_U
111 S ^TMP($J,"POMAST",POID,1)=GN1A
112 ;
113 ; build node 2
114 S VL35E=$P(N23,U,14),VL35E1=$G(^PRC(440,+VL35E,0))
115 S VL35E2=$P(VL35E1,U,1)
116 S VL35=VL35E2 ; PcDo Vendor
117 S PCUSR=$P(N23,U,17),PCUSR1=$G(^VA(200,+PCUSR,0))
118 S VL36=$P(PCUSR1,U,1) ; Pur Crd User
119 S VL37=$P(N23,U,21) ; Pur Cost
120 S PCHDR=$P(N23,U,22),PCHDR1=$G(^VA(200,+PCHDR,0))
121 S VL38=$P(PCHDR1,U,1) ; Pur Card Hldr
122 ; get ext. value for 2237
123 S PC2237V=$P(N23,U,23),PC2237V1=$G(^PRCS(410,+PC2237V,0))
124 S VL39=$P(PC2237V1,U,1) ; Pcdo2237
125 S VL40=$P(N0,U,15) ; Total Amount
126 S VL41=$P(N0,U,16) ; Net amount
127 ;
128 S GN2=VL35_U_VL36_U_VL37_U_VL38_U_VL39_U_VL40_U_VL41
129 S ^TMP($J,"POMAST",POID,2)=GN2
130 ;
131 D PODISC^PRCHLO1A
132 D POBOC^PRCHLO1A
133 D POCMTS^PRCHLO1A
134 D PORMKS^PRCHLO1A
135 D PO2237^PRCHLO1A
136 D POAMT^PRCHLO1A
137 D POAMMD^PRCHLO1A
138 D POPPTER^PRCHLO2A
139 D POPART^PRCHLO2A
140 D POOBL^PRCHLO2A
141 D POPMET^PRCHLO2A
142 D GPOITEM^PRCHLO2
143 Q
144PODISCH ; PO Discount Header File
145 ; Header file for PO Discount Multiple
146 W "PoIdNum^PurchaseOrderNum^PoDate^MonthYrRun^StationNum^"
147 W "DiscountIdNum^DiscountItem^PercentDollarAmount^"
148 W "DiscountAmount^ItemCount^Contract^LineItem",!
149 Q
Note: See TracBrowser for help on using the repository browser.