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

PRCHDAM1.m

Go to the documentation of this file.
PRCHDAM1 ;WISC/DJM-PRINT AMENDMENT ;10/18/95  11:54 AM<<= NOT VERIFIED >
V ;;5.1;IFCAP;**21,180**;Oct 20, 2000;Build 5
 ;Per VHA Directive 2004-038, this routine should not be modified.
 ;
 ;PRC*5.1*180 Add call to display amendment Delivery Date change
 ;
START(PRCHPO,PRCHAM) ;PRCHPO IS 443.6 INTERNAL ENTRY NUMBER FOR RECORD BEING AMENDED.
 ;PRCHAM IS IEN AMENDMENT MULTIPLE WITHIN PRCHPO BEING AMENDED.
 ;FIND OUT WHAT TYPES OF AMENDMENTS HAVE BEEN DONE TO BE ABLE TO
 ;DETERMINE WHAT TO PRINT OUT.
 N AMEND,GOTO
 S AMEND=0 F  S AMEND=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND)) Q:AMEND'>0  S GOTO="E"_+AMEND_"^PRCHDAM1" D @GOTO
 Q
 ;
E20 ;SHIP TO Edit PRINT
 N FIELD,CHANGE,CHANGES,OLD,NEW,LCNT,DATA,SITE
 D LCNT^PRCHDAM4(.LCNT)
 S FIELD=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,0)) Q:FIELD'>0
 S CHANGE=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,0)) Q:CHANGE'>0
 S CHANGES=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
 S SHIP=$P($P(CHANGES,U,3),";")
 I SHIP=5.4 D
 .S SITE=$P($G(^PRC(443.6,PRCHPO,23)),U,7),SITE=$S($G(SITE)]"":SITE,1:$P($P(^PRC(443.6,PRCHPO,0),U),"-"))
 .S OLD=$P(^PRC(411,SITE,1,OLD,0),U)
 .S NEW=$P(^PRC(443.6,PRCHPO,1),U,3),NEW=$P(^PRC(411,SITE,1,NEW,0),U)
 .Q
 I SHIP=5.3 D
 .S NEW=$P(^PRC(443.6,PRCHPO,1),U,12),NEW=$P(^PRC(440.2,NEW,0),U),NEW=$P($P(^DPT(NEW,0),U),",",2)_" "_$P($P(^DPT(NEW,0),U),",")
 .S OLD=$P(^PRC(440.2,OLD,0),U),OLD=$P($P(^DPT(OLD,0),U),",",2)_" "_$P($P(^DPT(OLD,0),U),",")
 .Q
 D LINE^PRCHDAM4(.LCNT,2) S DATA="Ship to location "_OLD_" has been changed to "_NEW_"."
 D DATA^PRCHDAM4(.LCNT,DATA),LCNT1^PRCHDAM4(LCNT)
 Q
E21 ;LINE ITEM Add PRINT
 N FIELD,CHANGE,CHANGES,OLD,ITEM,ITEM0,ITEM1,LCNT,DATA,I,UOP
 S FIELD=0 K ITEM D LCNT^PRCHDAM4(.LCNT)
 F  S FIELD=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD)) Q:FIELD'>0  D
 .S CHANGE=0 F  S CHANGE=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,CHANGE)) Q:CHANGE'>0  D
 ..S CHANGES=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
 ..S ITEM=$P(CHANGES,U,4) Q:$D(ITEM(ITEM))  S ITEM(ITEM)=1
 ..S ITEM0=$G(^PRC(443.6,PRCHPO,2,ITEM,0))
 ..I ITEM0="" Q
 ..I $P(ITEM0,U,2)=0,$P(ITEM0,U,9)=0 Q
 ..S ITEM1=$G(^PRC(443.6,PRCHPO,2,ITEM,1,1,0))
 ..D LINE^PRCHDAM4(.LCNT,2) S DATA=" *ADDED THROUGH AMENDMENT*" D DATA^PRCHDAM4(.LCNT,DATA)
 ..S DATA="Item No. "_$P(ITEM0,U)_"     Item Master File No. "
 ..S DATA=DATA_$P(ITEM0,U,5)_"     BOC: "_+$P(ITEM0,U,4)
 ..S DATA=DATA_"   CONTRACT: "_$P($G(^PRC(443.6,PRCHPO,2,ITEM,2)),U,2)
 ..D DATA^PRCHDAM4(.LCNT,DATA)
 ..D NEW^PRCHDAM4
 ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
 ..S DATA="    Items per "_UOP_": "_$P(ITEM0,U,12)
 ..F I=1:1:26-$L(DATA) S DATA=DATA_" "
 ..S DATA=DATA_"NSN: "_$P(ITEM0,U,13) D DATA^PRCHDAM4(.LCNT,DATA)
 ..I $P(ITEM0,U,6)]"" S DATA="    STK#: "_$P(ITEM0,U,6) D DATA^PRCHDAM4(.LCNT,DATA)
 ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
 ..S DATA="    "_$P(ITEM0,U,2)_" "_UOP_" at $"_$J($P(ITEM0,U,9),12,4)_" = $"_$J($P(ITEM0,U,2)*$P(ITEM0,U,9),9,2)
 ..D DATA^PRCHDAM4(.LCNT,DATA),LCNT1^PRCHDAM4(LCNT)
 Q
 ;
E22 ;LINE ITEM Delete PRINT
 G E22^PRCHDAM2
 ;
E23 ;LINE ITEM Edit PRINT
 G E23^PRCHDAM2
 ;
E24 ;SOURCE CODE Edit PRINT
 G E24^PRCHDAM4
 ;
E25 ;Edit MAIL INVOICE TO PRINT
 G E25^PRCHDAM3
 ;
E26 ;Edit METHOD OF PAYMENT PRINT
 G E26^PRCHDAM3
 ;
E27 ;ADMINISTRATIVE CERTIFICATION Add PRINT
 G E27^PRCHDAM3
 ;
E28 ;ADMINISTRATIVE CERTIFICATION Delete PRINT
 G E28^PRCHDAM3
 ;
E29 ;EST. SHIPPING Edit PRINT
 G E29^PRCHDAM3
 ;
E30 ;F.C.P. Edit PRINT
 G E30^PRCHDAM4
 ;
E31 ;Change VENDOR PRINT
 G E31^PRCHDAM4
 ;
E32 ;REPLACE P.O. NUMBER PRINT
 G E32^PRCHDAM4
 ;
E33 ;PROMPT PAYMENT Edit PRINT
 G E33^PRCHDAM5
 ;
E34 ;AUTHORITY Edit PRINT
 G E34^PRCHDAM5
 ;
E35 ;F.O.B. Point PRINT
 G E35^PRCHDAM5
 ;
E36 ;ITEM DISCOUNT Add/Edit PRINT
 G E36^PRCHDAM6
 ;
E37 ;ITEM DISCOUNT Delete PRINT
 G E37^PRCHDAM6
 ;
E98 ;DELIVERY DATE PRINT
 G E98^PRCHDAM3       ;PRC*5.1*180 Call to display Delivery Date changes
 Q
E99 ;NET AMOUNT PRINT
 Q