source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCUFCB.m@ 1638

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1PRCUFCB ;WISC/SJG-FMS MO3 SEGMENT FOR CONVERSION ONLY ;11/29/93 09:45
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; Routine is modification of PRCFFU21 for conversion processing
6MO3 ;BUILD 'MO3' SEGMENT
7 ; 7 - DELIVERY DATE (FILE 442)
8 ; 7.2 - ESTIMATED COST (FILE 442)
9 ; 9.2 - PROMPT PAYMENT TERMS (FILE 442)
10 ; 8.3 - PURCHASE METHOD (442.12)
11 ; 91 - TOTAL AMOUNT (FILE 442)
12 ; 92 - NET AMOUNT (FILE 442)
13 ; 5 - VENDOR (FILE 442)
14 ; .07 - PRIMARY 2237 REQUEST (FILE 442)
15 ; 13 - VENDOR CONTRACT NUMBER (FILE 410)
16 ; 21 - DATE COMMITTED (FILE 410)
17 ; 33 - END DATE FOR 1358 (FILE 410)
18 ; 34 - AUTO ACCRUE (FILE 410)
19 ;
20MO3A N SEG,DELDATE,FMSYR,FMSMO,FMSDAY,PPT,PM,TOT,CONT,START,VENID,PRIMREQ,VENCONT,CONTIEN,CONTEND,CONTBEG
21 S TMPLINE=TMPLINE+1,SEG="MO3^^^^^^^01"
22 K PRCTMP N DA S DIC=442,DR=".07;5;7.2;7;8.3;91;92",DA=+PO,DIQ="PRCTMP(",DIQ(0)="IE",DR(442.12)=".01",DA(442.12)=1 D EN^DIQ1 K DIC,DIQ,DR
23MO3B D
24 .I TYCODE="M" Q:(PRCFA("DEL")="")&(PRCFA("DELSCH")="")
25 .S DELDATE=PRCTMP(442,+PO,7,"I")
26 .S DELDATE=$$DELSCH^PRCFFU5(.DELDATE)
27 .S X1=BEGDATE,X2=DELDATE D ^%DTC I X>0 S DELDATE=BEGDATE
28 .D DATE(DELDATE,.A,.B,.C) S DELDATE=FMSYR_U_FMSMO_U_FMSDAY
29 .S $P(SEG,U,9)=DELDATE
30MO3C I TRCODE="MO" D
31 .S PM=$G(PRCTMP(442.12,1,.01,"I"))
32 .S CONT="" I $D(^PRC(442,+PO,2,"AC"))\10 S START="",CONT=$O(^PRC(442,+PO,2,"AC",START))
33 .I TYCODE="E" S:PRCFMO("G/N")="G" TOT=$G(PRCTMP(442,+PO,91,"E")) S:PRCFMO("G/N")="N" TOT=$G(PRCTMP(442,+PO,92,"E")) S TOT=$FN(TOT,"",2),$P(SEG,U,27)=TOT
34 .I TYCODE="M" D
35 ..Q:'$D(PRCFCHG("BOC"))
36 ..S TOT=$FN(TOTAMT,"",2),$P(SEG,U,27)=TOT
37 .I $G(CONT) I TRCODE'="MO" S $P(SEG,U,33)=$E(CONT,1,10)
38MO3D I TRCODE="SO" D
39 .S VENID=$G(PRCTMP(442,+PO,5,"I")),PRIMREQ=$G(PRCTMP(442,+PO,.07,"I"))
40 .S PRCFA("AUTOACC")=""
41 .I PRIMREQ]"" D
42 ..N DA S DA=+PRIMREQ,DIC=410,DR="13;21;33;34;52",DIQ="PRCTMP(",DIQ(0)="IEN" D EN^DIQ1 K DIC,DIQ,DR
43 ..S PRCFA("AUTOACC")=$E($G(PRCTMP(410,+PRIMREQ,34,"E")),1)
44 ..I TYCODE="M" D
45 ...N POIEN S POIEN=$G(PRCTMP(410,PRIMREQ,52,"I"))
46 ...I POIEN]"" D
47 ....N ORGIEN S ORGIEN=$G(PRCTMP(442,POIEN,.07,"I"))
48 ....D GENDIQ^PRCFFU7(410,ORGIEN,"11;13;21;33;34","IEN","")
49 ....S PRCFA("AUTOACC")=$E($G(PRCTMP(410,ORGIEN,34,"E")),1)
50 ....Q
51 ...Q
52 ..I PRCFA("AUTOACC")="" S PRCFA("AUTOACC")="N"
53 ..S VENCONT=$G(PRCTMP(410,+PRIMREQ,13,"E"))
54 ..I VENID]""&(VENCONT]"")&($G(PRCTMP(410,+PRIMREQ,33,"I"))="") D
55 ...S DIC="^PRC(440,"_VENID_",4,",DIC(0)="MNQZ",X=VENCONT D ^DIC K DIC
56 ...S CONTIEN=+Y
57 ...N DA S DIC=440,DR=6,DA=+VENID,DIQ="PRCTMP(",DIQ(0)="IEN",DR(440.03)=".5;1",DA(440.03)=CONTIEN D EN^DIQ1 K DIC,DIQ,DR
58 ...S CONTEND=$G(PRCTMP(440.03,CONTIEN,1,"I")) I CONTEND]"" D DATE(CONTEND,.A,.B,.C) S CONTEND=FMSYR_U_FMSMO_U_FMSDAY,$P(SEG,U,9)=CONTEND
59 ...S CONTBEG=$G(PRCTMP(440.03,CONTIEN,.5,"I")) I CONTBEG]"" D DATE(CONTBEG,.A,.B,.C) S CONTBEG=FMSYR_U_FMSMO_U_FMSDAY,$P(SEG,U,18)=CONTBEG
60 ..I $G(PRCTMP(410,+PRIMREQ,33,"I"))]"" D
61 ...S ENDDATE=$G(PRCTMP(410,+PRIMREQ,33,"I")) I ENDDATE]"" D DATE(ENDDATE,.A,.B,.C) S ENDDATE=FMSYR_U_FMSMO_U_FMSDAY,$P(SEG,U,9)=ENDDATE
62 ...S BEGDATE=$G(PRCTMP(410,+PRIMREQ,21,"I")) I PRCFA("AUTOACC")["Y" I BEGDATE]"" D DATE(BEGDATE,.A,.B,.C) S BEGDATE=FMSYR_U_FMSMO_U_FMSDAY,$P(SEG,U,18)=BEGDATE
63 ...Q
64 ..Q
65 .I TYCODE="E" D
66 ..I PRCFA("MP")=21 S TOT=$G(PRCTMP(442,+PO,91,"E")),TOT=$FN(TOT,"",2),$P(SEG,U,27)=TOT
67 ..I PRCFA("MP")=1!(PRCFA("MP")=8)!(PRCFA("MP")=2) S TOT=$G(PRCTMP(442,+PO,92,"E")),TOT=$FN(TOT,"",2),$P(SEG,U,27)=TOT
68 .I TYCODE="M" D
69 ..I PRCFA("MP")=21 S TOT=$G(PRCTMP(442,+PO,7.2,"E")),TOT=$FN(TOT,"",2),$P(SEG,U,27)=TOT
70 ..I PRCFA("MP")=2 Q:'$D(PRCFCHG("BOC")) S TOT=$FN(TOTAMT,"",2),$P(SEG,U,27)=TOT
71 .I $G(VENCONT) S $P(SEG,U,33)=$E(VENCONT,1,10)
72 S ^TMP($J,"PRCMO",INT,TMPLINE)=SEG_"^~" K PRCTMP
73 Q
74 ;
75DATE(X,A,B,C) ;
76 S FMSYR=$E(X,2,3),FMSMO=$E(X,4,5),FMSDAY=$E(X,6,7)
77 Q
78DATE1(X) ;
79 Q $E(X,4,5)_$E(X,6,7)_$E(X,2,3)
80 Q
81ASKDATE(X) ;
82 N Y,ASKDATE
83 S %DT="AEX",%DT("A")=X D ^%DT
84 S ASKDATE=Y K %DT
85 Q ASKDATE
Note: See TracBrowser for help on using the repository browser.