- PRCHQ12A ;(WASH IRMFO)/LKG-RFQ QUOTE VIEW ;8/6/96 20:44
- ;;5.1;IFCAP;;Oct 20, 2000
- ;Per VHA Directive 10-93-142, this routine should not be modified.
- BUILD(PRCVEN,PRCDA,PRCDA2,PRCTITLE) ;Entry for building Quote report
- N PRCDA3,PRCDA4,PRCF,PRCI,PRCITMDA,PRCJ,PRCK,PRCL,PRCLN,PRCAR,PRCRFQ,PRCSP,PRCT
- N DA,DIC,DIQ,DR,DIWL,DIWR,DIWF,X,Y,PRCDASH S $P(PRCDASH,"-",80)=""
- K ^TMP($J,"RPT") S PRCRFQ=$P(^PRC(444,PRCDA,0),U),$P(PRCSP," ",81)=""
- S (PRCF,DIC)=$P($P(PRCVEN,"(",2),","),DR=".01;4.8;5;18.3;38;46",DA=$P(PRCVEN,";")
- S DIQ="PRCAR(" K ^UTILITY("DIQ1",$J) D EN^DIQ1 K DIQ,DR,^UTILITY("DIQ1",$J)
- S PRCLN="Quote from Dun # "_PRCAR(PRCF,DA,18.3)_" for RFQ #: "_PRCRFQ
- S PRCTITLE=$$CENTER(PRCLN),PRCJ=0
- S PRCLN="Vendor: "_PRCAR(PRCF,DA,.01),PRCLN=$$PAD(PRCLN,50)
- S PRCLN=PRCLN_"Tax ID: "_PRCAR(PRCF,DA,38)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Voice Phone #: "_PRCAR(PRCF,DA,5),PRCLN=$$PAD(PRCLN,50)
- S PRCLN=PRCLN_"Fax #: "_PRCAR(PRCF,DA,46)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Contact: "_PRCAR(PRCF,DA,4.8)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
- K PRCAR,DA,DIC,DIQ,^UTILITY("DIQ1",$J)
- S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)="1;2;3;4;5;6;7;8;10;15"
- S DIQ="PRCAR(" D EN^DIQ1 K DIC,DR,DA,^UTILITY("DIQ1",$J)
- S PRCLN="Sellers's Ref #: "_PRCAR(444.024,PRCDA2,1)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Quote Contact: "_PRCAR(444.024,PRCDA2,4),PRCLN=$$PAD(PRCLN,50)
- S PRCLN=PRCLN_"Phone #: "_PRCAR(444.024,PRCDA2,5)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Government Contract: "_PRCAR(444.024,PRCDA2,10)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Effective Date: "_PRCAR(444.024,PRCDA2,2),PRCLN=$$PAD(PRCLN,39)
- S PRCLN=PRCLN_"Receipt Date/Time: "_PRCAR(444.024,PRCDA2,3)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="FOB: "_PRCAR(444.024,PRCDA2,6),PRCLN=$$PAD(PRCLN,39)
- S PRCLN=PRCLN_"Total of Lines: "_$J($FN(PRCAR(444.024,PRCDA2,15),"",2),9)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Number of Items in RFQ: "_($P($G(^PRC(444,PRCDA,2,0)),U,4)+0)
- S PRCLN=$$PAD(PRCLN,39)_"S/H Charges: "_$J($FN(PRCAR(444.024,PRCDA2,7)+0,"",2),12)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- S PRCLN="Number of Items Quoted: "_($P($G(^PRC(444,PRCDA,8,PRCDA2,3,0)),U,4)+0)
- S PRCLN=$$PAD(PRCLN,39)_"Quote Total: "_$J($FN(PRCAR(444.024,PRCDA2,8),"",2),12)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- K PRCAR
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Prompt Pay Terms: ",79)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" Term / % Days",79)
- S PRCDA3=0
- F S PRCDA3=$O(^PRC(444,PRCDA,8,PRCDA2,2,PRCDA3)) Q:PRCDA3'?1.N D
- . K ^UTILITY("DIQ1",$J),DA,DR,PRCAR,DIQ,DIC
- . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=9
- . S DA(444.025)=PRCDA3,DR(444.025)=".01;1",DIQ="PRCAR("
- . D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
- . S PRCLN=$$PAD(" ",5)_PRCAR(444.025,PRCDA3,.01),PRCLN=$$PAD(PRCLN,18)
- . S PRCLN=PRCLN_$J(PRCAR(444.025,PRCDA3,1),3)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . K PRCAR
- K ^UTILITY("DIQ1",$J) S PRCDA3=0
- F S PRCDA3=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3)) Q:PRCDA3'?1.N D
- . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=11
- . S DA(444.026)=PRCDA3,DIQ="PRCAR("
- . S DR(444.026)=".01;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;18"
- . D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
- . S PRCLN="RFQ Line #: "_PRCAR(444.026,PRCDA3,.01),PRCLN=$$PAD(PRCLN,79)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCDASH
- . S PRCLN=$$PAD("| RFQ Requirements",78)_"|"
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
- . S PRCITMDA=$O(^PRC(444,PRCDA,2,"B",PRCAR(444.026,PRCDA3,.01),""))
- . I PRCITMDA="" S PRCLN="| **** Line Item #"_PRCAR(444.026,PRCDA3,.01)_" was not in the Request ****",PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- . I PRCITMDA]"" D
- . . S PRCLN=$$PAD("| Item Description:",78)_"|"
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
- . . K ^UTILITY($J,"W") S PRCK=0,DIWL=1,DIWR=70,DIWF=""
- . . F S PRCK=$O(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK)) Q:+PRCK'=PRCK D
- . . . Q:'$D(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK,0)) S X=^(0)
- . . . D ^DIWP
- . . S PRCT=$G(^UTILITY($J,"W",1))
- . . F PRCI=1:1:PRCT D
- . . . S PRCLN="| "_$G(^UTILITY($J,"W",1,PRCI,0))
- . . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- . . K ^UTILITY($J,"W"),DIWL,DIWR,DIWF
- . . S PRCLN="| FOB: "_$S($P($G(^PRC(444,PRCDA,1)),U)="O":"ORIGIN",1:"DESTINATION")
- . . S PRCLN=$$PAD(PRCLN,30),PRCI=$G(^PRC(444,PRCDA,2,PRCITMDA,0))
- . . S PRCLN=PRCLN_"Quantity: "_$FN($P(PRCI,U,2)+0,"",2),PRCLN=$$PAD(PRCLN,60)
- . . S PRCLN=PRCLN_"Unit: "_$S($P(PRCI,U,3)]"":$P($G(^PRCD(420.5,$P(PRCI,U,3),0)),U),1:"")
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- . . S PRCK=$G(^PRC(444,PRCDA,2,PRCITMDA,3))
- . . I $P(PRCK,U)]"",$P(PRCK,U,2)]"" D
- . . . S PRCL=$P(PRCK,U,10)
- . . . I PRCL="" D
- . . . . S PRCL=$O(^PRCS(410,$P(PRCK,U),"IT","B",$P(PRCK,U,2),"")) Q:PRCL=""
- . . . . S PRCL=$P($G(^PRCS(410,$P(PRCK,U),"IT",PRCL,0)),U,7)
- . . . S PRCLN="| Unit Price: "_$FN(PRCL,"",4),PRCLN=$$PAD(PRCLN,40)
- . . . S PRCLN=PRCLN_"Total Cost: "_$FN($P(PRCI,U,2)*PRCL,"",2)
- . . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- . . S PRCLN="| Natl Stock #: "_$P(PRCI,U,6),PRCLN=$$PAD(PRCLN,40)
- . . S PRCLN=PRCLN_"Mfg Part #: "_$P(PRCI,U,9),PRCLN=$$PAD(PRCLN,78)_"|"
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCDASH
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Quote Information for this Line Item",79)
- . S PRCLN="Vendor's Product #: "_PRCAR(444.026,PRCDA3,1)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Description: ",79)
- . S PRCDA4=0,DIWL=1,DIWR=70,DIWF="" K ^UTILITY($J,"W")
- . F S PRCDA4=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4)) Q:PRCDA4="" D
- . . Q:'$D(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4,0)) S X=^(0)
- . . D ^DIWP
- . S PRCT=$G(^UTILITY($J,"W",1))
- . F PRCI=1:1:PRCT D
- . . S PRCLN=" "_$G(^UTILITY($J,"W",1,PRCI,0))
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . K ^UTILITY($J,"W"),DIWL,DIWR,DIWF
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
- . S PRCLN="FOB: "_PRCAR(444.026,PRCDA3,11),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Hazmat Code: "_PRCAR(444.026,PRCDA3,12)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Govt Contract: "_PRCAR(444.026,PRCDA3,16),PRCLN=$$PAD(PRCLN,50)
- . S PRCLN=PRCLN_"Quantity: "_PRCAR(444.026,PRCDA3,2)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Unit of Purchase: "_PRCAR(444.026,PRCDA3,3),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Unit Cost: "_PRCAR(444.026,PRCDA3,13)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Volume Discount %: "_PRCAR(444.026,PRCDA3,14),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Volume Discount Amount: "_PRCAR(444.026,PRCDA3,15)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Net Line Amount: "_PRCAR(444.026,PRCDA3,18)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Natl Stock #: "_PRCAR(444.026,PRCDA3,5),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Federal Supply Class: "_PRCAR(444.026,PRCDA3,4)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Natl Drug Code: "_PRCAR(444.026,PRCDA3,7),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Mfg Part #: "_PRCAR(444.026,PRCDA3,8)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="Lot #: "_PRCAR(444.026,PRCDA3,9),PRCLN=$$PAD(PRCLN,40)
- . S PRCLN=PRCLN_"Serial #: "_PRCAR(444.026,PRCDA3,10)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCLN="SIC Code: "_$E(PRCAR(444.026,PRCDA3,6),1,68)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Delivery Schedules: ",79)
- . S PRCDA4=0 K ^UTILITY("DIQ1",$J),PRCAR,DIC,DR,DIQ,DA
- . F S PRCDA4=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,3,PRCDA4)) Q:PRCDA4'?1.N D
- . . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=11
- . . S DA(444.026)=PRCDA3,DR(444.026)=17,DA(444.027)=PRCDA4,DR(444.027)=".01;1;2;3"
- . . S DIQ="PRCAR(" D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
- . . S PRCLN=" Schedule #: "_PRCAR(444.027,PRCDA4,.01),PRCLN=$$PAD(PRCLN,40)
- . . S PRCLN=PRCLN_"Date: "_PRCAR(444.027,PRCDA4,1)
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . . S PRCLN=" Quantity: "_PRCAR(444.027,PRCDA4,2),PRCLN=$$PAD(PRCLN,40)
- . . S PRCLN=PRCLN_"Unit of Purchase: "_PRCAR(444.027,PRCDA4,3)
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
- . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
- . . K PRCAR
- . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
- S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("* End of Quote *",79)
- Q
- PAD(X,Y) ;Pad on right with spaces to specified length
- S X=X_$E(PRCSP,$L(X)+1,Y)
- Q X
- CENTER(X) ;Center Text
- S X=$E(PRCSP,1,79-$L(X)\2)_X,X=$$PAD(X,79)
- Q X
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCHQ12A 9085 printed Mar 13, 2025@21:14:22 Page 2
- PRCHQ12A ;(WASH IRMFO)/LKG-RFQ QUOTE VIEW ;8/6/96 20:44
- +1 ;;5.1;IFCAP;;Oct 20, 2000
- +2 ;Per VHA Directive 10-93-142, this routine should not be modified.
- BUILD(PRCVEN,PRCDA,PRCDA2,PRCTITLE) ;Entry for building Quote report
- +1 NEW PRCDA3,PRCDA4,PRCF,PRCI,PRCITMDA,PRCJ,PRCK,PRCL,PRCLN,PRCAR,PRCRFQ,PRCSP,PRCT
- +2 NEW DA,DIC,DIQ,DR,DIWL,DIWR,DIWF,X,Y,PRCDASH
- SET $PIECE(PRCDASH,"-",80)=""
- +3 KILL ^TMP($JOB,"RPT")
- SET PRCRFQ=$PIECE(^PRC(444,PRCDA,0),U)
- SET $PIECE(PRCSP," ",81)=""
- +4 SET (PRCF,DIC)=$PIECE($PIECE(PRCVEN,"(",2),",")
- SET DR=".01;4.8;5;18.3;38;46"
- SET DA=$PIECE(PRCVEN,";")
- +5 SET DIQ="PRCAR("
- KILL ^UTILITY("DIQ1",$JOB)
- DO EN^DIQ1
- KILL DIQ,DR,^UTILITY("DIQ1",$JOB)
- +6 SET PRCLN="Quote from Dun # "_PRCAR(PRCF,DA,18.3)_" for RFQ #: "_PRCRFQ
- +7 SET PRCTITLE=$$CENTER(PRCLN)
- SET PRCJ=0
- +8 SET PRCLN="Vendor: "_PRCAR(PRCF,DA,.01)
- SET PRCLN=$$PAD(PRCLN,50)
- +9 SET PRCLN=PRCLN_"Tax ID: "_PRCAR(PRCF,DA,38)
- +10 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +11 SET PRCLN="Voice Phone #: "_PRCAR(PRCF,DA,5)
- SET PRCLN=$$PAD(PRCLN,50)
- +12 SET PRCLN=PRCLN_"Fax #: "_PRCAR(PRCF,DA,46)
- +13 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +14 SET PRCLN="Contact: "_PRCAR(PRCF,DA,4.8)
- +15 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +16 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(" ",79)
- +17 KILL PRCAR,DA,DIC,DIQ,^UTILITY("DIQ1",$JOB)
- +18 SET DIC=444
- SET DR=24
- SET DA=PRCDA
- SET DA(444.024)=PRCDA2
- SET DR(444.024)="1;2;3;4;5;6;7;8;10;15"
- +19 SET DIQ="PRCAR("
- DO EN^DIQ1
- KILL DIC,DR,DA,^UTILITY("DIQ1",$JOB)
- +20 SET PRCLN="Sellers's Ref #: "_PRCAR(444.024,PRCDA2,1)
- +21 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +22 SET PRCLN="Quote Contact: "_PRCAR(444.024,PRCDA2,4)
- SET PRCLN=$$PAD(PRCLN,50)
- +23 SET PRCLN=PRCLN_"Phone #: "_PRCAR(444.024,PRCDA2,5)
- +24 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +25 SET PRCLN="Government Contract: "_PRCAR(444.024,PRCDA2,10)
- +26 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +27 SET PRCLN="Effective Date: "_PRCAR(444.024,PRCDA2,2)
- SET PRCLN=$$PAD(PRCLN,39)
- +28 SET PRCLN=PRCLN_"Receipt Date/Time: "_PRCAR(444.024,PRCDA2,3)
- +29 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +30 SET PRCLN="FOB: "_PRCAR(444.024,PRCDA2,6)
- SET PRCLN=$$PAD(PRCLN,39)
- +31 SET PRCLN=PRCLN_"Total of Lines: "_$JUSTIFY($FNUMBER(PRCAR(444.024,PRCDA2,15),"",2),9)
- +32 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +33 SET PRCLN="Number of Items in RFQ: "_($PIECE($GET(^PRC(444,PRCDA,2,0)),U,4)+0)
- +34 SET PRCLN=$$PAD(PRCLN,39)_"S/H Charges: "_$JUSTIFY($FNUMBER(PRCAR(444.024,PRCDA2,7)+0,"",2),12)
- +35 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +36 SET PRCLN="Number of Items Quoted: "_($PIECE($GET(^PRC(444,PRCDA,8,PRCDA2,3,0)),U,4)+0)
- +37 SET PRCLN=$$PAD(PRCLN,39)_"Quote Total: "_$JUSTIFY($FNUMBER(PRCAR(444.024,PRCDA2,8),"",2),12)
- +38 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +39 KILL PRCAR
- +40 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD("Prompt Pay Terms: ",79)
- +41 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(" Term / % Days",79)
- +42 SET PRCDA3=0
- +43 FOR
- SET PRCDA3=$ORDER(^PRC(444,PRCDA,8,PRCDA2,2,PRCDA3))
- if PRCDA3'?1.N
- QUIT
- Begin DoDot:1
- +44 KILL ^UTILITY("DIQ1",$JOB),DA,DR,PRCAR,DIQ,DIC
- +45 SET DIC=444
- SET DR=24
- SET DA=PRCDA
- SET DA(444.024)=PRCDA2
- SET DR(444.024)=9
- +46 SET DA(444.025)=PRCDA3
- SET DR(444.025)=".01;1"
- SET DIQ="PRCAR("
- +47 DO EN^DIQ1
- KILL DIC,DR,DA,DIQ,^UTILITY("DIQ1",$JOB)
- +48 SET PRCLN=$$PAD(" ",5)_PRCAR(444.025,PRCDA3,.01)
- SET PRCLN=$$PAD(PRCLN,18)
- +49 SET PRCLN=PRCLN_$JUSTIFY(PRCAR(444.025,PRCDA3,1),3)
- +50 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +51 KILL PRCAR
- End DoDot:1
- +52 KILL ^UTILITY("DIQ1",$JOB)
- SET PRCDA3=0
- +53 FOR
- SET PRCDA3=$ORDER(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3))
- if PRCDA3'?1.N
- QUIT
- Begin DoDot:1
- +54 SET DIC=444
- SET DR=24
- SET DA=PRCDA
- SET DA(444.024)=PRCDA2
- SET DR(444.024)=11
- +55 SET DA(444.026)=PRCDA3
- SET DIQ="PRCAR("
- +56 SET DR(444.026)=".01;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;18"
- +57 DO EN^DIQ1
- KILL DIC,DR,DA,DIQ,^UTILITY("DIQ1",$JOB)
- +58 SET PRCLN="RFQ Line #: "_PRCAR(444.026,PRCDA3,.01)
- SET PRCLN=$$PAD(PRCLN,79)
- +59 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCLN
- +60 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCDASH
- +61 SET PRCLN=$$PAD("| RFQ Requirements",78)_"|"
- +62 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCLN
- +63 SET PRCITMDA=$ORDER(^PRC(444,PRCDA,2,"B",PRCAR(444.026,PRCDA3,.01),""))
- +64 IF PRCITMDA=""
- SET PRCLN="| **** Line Item #"_PRCAR(444.026,PRCDA3,.01)_" was not in the Request ****"
- SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- +65 IF PRCITMDA]""
- Begin DoDot:2
- +66 SET PRCLN=$$PAD("| Item Description:",78)_"|"
- +67 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCLN
- +68 KILL ^UTILITY($JOB,"W")
- SET PRCK=0
- SET DIWL=1
- SET DIWR=70
- SET DIWF=""
- +69 FOR
- SET PRCK=$ORDER(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK))
- if +PRCK'=PRCK
- QUIT
- Begin DoDot:3
- +70 if '$DATA(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK,0))
- QUIT
- SET X=^(0)
- +71 DO ^DIWP
- End DoDot:3
- +72 SET PRCT=$GET(^UTILITY($JOB,"W",1))
- +73 FOR PRCI=1:1:PRCT
- Begin DoDot:3
- +74 SET PRCLN="| "_$GET(^UTILITY($JOB,"W",1,PRCI,0))
- +75 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- End DoDot:3
- +76 KILL ^UTILITY($JOB,"W"),DIWL,DIWR,DIWF
- +77 SET PRCLN="| FOB: "_$SELECT($PIECE($GET(^PRC(444,PRCDA,1)),U)="O":"ORIGIN",1:"DESTINATION")
- +78 SET PRCLN=$$PAD(PRCLN,30)
- SET PRCI=$GET(^PRC(444,PRCDA,2,PRCITMDA,0))
- +79 SET PRCLN=PRCLN_"Quantity: "_$FNUMBER($PIECE(PRCI,U,2)+0,"",2)
- SET PRCLN=$$PAD(PRCLN,60)
- +80 SET PRCLN=PRCLN_"Unit: "_$SELECT($PIECE(PRCI,U,3)]"":$PIECE($GET(^PRCD(420.5,$PIECE(PRCI,U,3),0)),U),1:"")
- +81 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- +82 SET PRCK=$GET(^PRC(444,PRCDA,2,PRCITMDA,3))
- +83 IF $PIECE(PRCK,U)]""
- IF $PIECE(PRCK,U,2)]""
- Begin DoDot:3
- +84 SET PRCL=$PIECE(PRCK,U,10)
- +85 IF PRCL=""
- Begin DoDot:4
- +86 SET PRCL=$ORDER(^PRCS(410,$PIECE(PRCK,U),"IT","B",$PIECE(PRCK,U,2),""))
- if PRCL=""
- QUIT
- +87 SET PRCL=$PIECE($GET(^PRCS(410,$PIECE(PRCK,U),"IT",PRCL,0)),U,7)
- End DoDot:4
- +88 SET PRCLN="| Unit Price: "_$FNUMBER(PRCL,"",4)
- SET PRCLN=$$PAD(PRCLN,40)
- +89 SET PRCLN=PRCLN_"Total Cost: "_$FNUMBER($PIECE(PRCI,U,2)*PRCL,"",2)
- +90 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
- End DoDot:3
- +91 SET PRCLN="| Natl Stock #: "_$PIECE(PRCI,U,6)
- SET PRCLN=$$PAD(PRCLN,40)
- +92 SET PRCLN=PRCLN_"Mfg Part #: "_$PIECE(PRCI,U,9)
- SET PRCLN=$$PAD(PRCLN,78)_"|"
- +93 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCLN
- End DoDot:2
- +94 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=PRCDASH
- +95 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD("Quote Information for this Line Item",79)
- +96 SET PRCLN="Vendor's Product #: "_PRCAR(444.026,PRCDA3,1)
- +97 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +98 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD("Description: ",79)
- +99 SET PRCDA4=0
- SET DIWL=1
- SET DIWR=70
- SET DIWF=""
- KILL ^UTILITY($JOB,"W")
- +100 FOR
- SET PRCDA4=$ORDER(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4))
- if PRCDA4=""
- QUIT
- Begin DoDot:2
- +101 if '$DATA(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4,0))
- QUIT
- SET X=^(0)
- +102 DO ^DIWP
- End DoDot:2
- +103 SET PRCT=$GET(^UTILITY($JOB,"W",1))
- +104 FOR PRCI=1:1:PRCT
- Begin DoDot:2
- +105 SET PRCLN=" "_$GET(^UTILITY($JOB,"W",1,PRCI,0))
- +106 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- End DoDot:2
- +107 KILL ^UTILITY($JOB,"W"),DIWL,DIWR,DIWF
- +108 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(" ",79)
- +109 SET PRCLN="FOB: "_PRCAR(444.026,PRCDA3,11)
- SET PRCLN=$$PAD(PRCLN,40)
- +110 SET PRCLN=PRCLN_"Hazmat Code: "_PRCAR(444.026,PRCDA3,12)
- +111 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +112 SET PRCLN="Govt Contract: "_PRCAR(444.026,PRCDA3,16)
- SET PRCLN=$$PAD(PRCLN,50)
- +113 SET PRCLN=PRCLN_"Quantity: "_PRCAR(444.026,PRCDA3,2)
- +114 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +115 SET PRCLN="Unit of Purchase: "_PRCAR(444.026,PRCDA3,3)
- SET PRCLN=$$PAD(PRCLN,40)
- +116 SET PRCLN=PRCLN_"Unit Cost: "_PRCAR(444.026,PRCDA3,13)
- +117 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +118 SET PRCLN="Volume Discount %: "_PRCAR(444.026,PRCDA3,14)
- SET PRCLN=$$PAD(PRCLN,40)
- +119 SET PRCLN=PRCLN_"Volume Discount Amount: "_PRCAR(444.026,PRCDA3,15)
- +120 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +121 SET PRCLN="Net Line Amount: "_PRCAR(444.026,PRCDA3,18)
- +122 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +123 SET PRCLN="Natl Stock #: "_PRCAR(444.026,PRCDA3,5)
- SET PRCLN=$$PAD(PRCLN,40)
- +124 SET PRCLN=PRCLN_"Federal Supply Class: "_PRCAR(444.026,PRCDA3,4)
- +125 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +126 SET PRCLN="Natl Drug Code: "_PRCAR(444.026,PRCDA3,7)
- SET PRCLN=$$PAD(PRCLN,40)
- +127 SET PRCLN=PRCLN_"Mfg Part #: "_PRCAR(444.026,PRCDA3,8)
- +128 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +129 SET PRCLN="Lot #: "_PRCAR(444.026,PRCDA3,9)
- SET PRCLN=$$PAD(PRCLN,40)
- +130 SET PRCLN=PRCLN_"Serial #: "_PRCAR(444.026,PRCDA3,10)
- +131 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +132 SET PRCLN="SIC Code: "_$EXTRACT(PRCAR(444.026,PRCDA3,6),1,68)
- +133 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +134 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD("Delivery Schedules: ",79)
- +135 SET PRCDA4=0
- KILL ^UTILITY("DIQ1",$JOB),PRCAR,DIC,DR,DIQ,DA
- +136 FOR
- SET PRCDA4=$ORDER(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,3,PRCDA4))
- if PRCDA4'?1.N
- QUIT
- Begin DoDot:2
- +137 SET DIC=444
- SET DR=24
- SET DA=PRCDA
- SET DA(444.024)=PRCDA2
- SET DR(444.024)=11
- +138 SET DA(444.026)=PRCDA3
- SET DR(444.026)=17
- SET DA(444.027)=PRCDA4
- SET DR(444.027)=".01;1;2;3"
- +139 SET DIQ="PRCAR("
- DO EN^DIQ1
- KILL DIC,DR,DA,DIQ,^UTILITY("DIQ1",$JOB)
- +140 SET PRCLN=" Schedule #: "_PRCAR(444.027,PRCDA4,.01)
- SET PRCLN=$$PAD(PRCLN,40)
- +141 SET PRCLN=PRCLN_"Date: "_PRCAR(444.027,PRCDA4,1)
- +142 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +143 SET PRCLN=" Quantity: "_PRCAR(444.027,PRCDA4,2)
- SET PRCLN=$$PAD(PRCLN,40)
- +144 SET PRCLN=PRCLN_"Unit of Purchase: "_PRCAR(444.027,PRCDA4,3)
- +145 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(PRCLN,79)
- +146 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(" ",79)
- +147 KILL PRCAR
- End DoDot:2
- +148 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD(" ",79)
- End DoDot:1
- +149 SET PRCJ=PRCJ+1
- SET ^TMP($JOB,"RPT",PRCJ)=$$PAD("* End of Quote *",79)
- +150 QUIT
- PAD(X,Y) ;Pad on right with spaces to specified length
- +1 SET X=X_$EXTRACT(PRCSP,$LENGTH(X)+1,Y)
- +2 QUIT X
- CENTER(X) ;Center Text
- +1 SET X=$EXTRACT(PRCSP,1,79-$LENGTH(X)\2)_X
- SET X=$$PAD(X,79)
- +2 QUIT X