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

ACRFDI.m

Go to the documentation of this file.
ACRFDI ;IHS/OIRM/DSD/THL,AEF - DUE IN REPORT; [ 02/02/2005  1:01 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**16**;NOV 05, 2001
 ;;ROUTINE USED TO PRINT DUI IN REPORTS
EN D SHIPTO^ACRFRR
 Q:$D(ACRQUIT)!$D(ACROUT)!'$D(ACRRL)
 D DUE
 Q:$D(ACRQUIT)!$D(ACROUT)!'$D(ACRDAT)!'$D(ACRBEFOR)
 D ZIS
EXIT K ACRDAT,ACRJ,ACRDUET,ACRX,ACRQUIT,ACRDOCDA,ACRLATE,ACRDAT1,ACRBEFOR,ACRAFTER,ACRUI,ACRINDEX,ACRDAYS,ACRDSC1,ACRDSC2,ACRQTY,ACRDIR,ACRDOC1,ACR,ACRRTN,ACRRL
 Q
ZIS S ZTDESC="ARMS DUE IN REPORT"
 S ACRRTN="LIST^ACRFDI"
 D ^ACRFZIS
 Q
LIST ;EP;TO PRINT DUE IN REPORT
 D HEAD
 S ACRJ=0
 F  S ACRDAT=$O(^ACRDOC("DI",ACRRL,ACRDAT)) Q:'ACRDAT!$D(ACRQUIT)!$D(ACROUT)!(ACRDAT>ACRBEFOR)  D LIST1
 I 'ACRJ W !?10,"There are NO PO'S ",$G(ACRDUET)
 D PAUSE^ACRFWARN
 K ACRQUIT
 Q
LIST1 D DAT
 N DATA
 Q:$D(ACRQUIT)!$D(ACROUT)
 S ACRJ=ACRJ+1,ACRDOCDA=0
 F  S ACRDOCDA=$O(^ACRDOC("DI",ACRRL,ACRDAT,ACRDOCDA)) Q:'ACRDOCDA!$D(ACRQUIT)!$D(ACROUT)  D
 . Q:'$D(^ACRSS("J",ACRDOCDA))
 . S DATA=$G(^ACRDOC(ACRDOCDA,0))
 . Q:$P(DATA,U,4)=35    ; cc purchase
 . Q:$P(DATA,U,12)      ; draft payment
 . Q:$P(DATA,U,18)      ; total dollars for BPA
 . S DATA=$G(^ACROBL(ACRDOCDA,"APV"))
 . Q:$P(DATA,U)'="A"    ; request approved
 . Q:$P(DATA,U,8)'="A"  ; PO authorized
 . Q:$P(DATA,U,6)=1     ; 1=final RR
 . Q:$P(DATA,U,9)=1     ; 1=final invoice
 . D DOC1
 Q
DAT K ACRQUIT
 S ACRDAT1=$E(ACRDAT,4,5)_"/"_$E(ACRDAT,6,7)_"/"_$E(ACRDAT,2,3)
 S X1=$S(ACRBEFOR=9999999:DT,1:ACRBEFOR)
 S X2=ACRDAT
 Q:ACRDUET["DUE BETWEEN"
 D ^%DTC
 K X1,X2
 I X<ACRDAYS S ACRQUIT="" Q
 S ACRLATE=X
 Q
DOC1 N X
 S X=^ACRDOC(ACRDOCDA,0)
 S ACRDOC=$E($P(X,U,2),1,10)
 S ACRDOC1=$P(X,U)
 I ACRDOC="" S ACRDOC=ACRDOC1                         ;ACR*2.1*16.04 IM11579
 S:$P(X,U,9) ACRDOC=ACRDOC_"-MOD"_+$P(X,U,9)
 ;W !,ACRDOC                         ;ACR*2.1*16.04 IM11579
 N ACRHD                         ;ACR*2.1*16.04 IM11579
 S ACRHD=1                         ;ACR*2.1*16.04 IM11579
 S (ACRSSDA,ACRJ)=0
 F  S ACRSSDA=$O(^ACRSS("J",ACRDOCDA,ACRSSDA)) Q:'ACRSSDA!$D(ACRQUIT)!$D(ACROUT)  D SS1
 Q
SS1 S ACRINDEX=$P($G(^ACRSS(ACRSSDA,"NMS")),U,4)
 S ACRUI=^ACRSS(ACRSSDA,"DT")
 S ACRQTY=$P(ACRUI,U)
 S ACRUI=$P(ACRUI,U,2)
 S ACRDSC1=$G(^ACRSS(ACRSSDA,"DESC"))
 S ACRDSC2=$E($P(ACRDSC1,U,2),1,30)
 S ACRDSC1=$E($P(ACRDSC1,U),1,30)
 S ACRUI=$S($D(^ACRUI(+ACRUI,0)):$P(^(0),U),1:"**")
 D QADJST
 Q:ACRQTY<1
 I ACRHD W !,ACRDOC S ACRHD=0                         ;ACR*2.1*16.04 IM11579
 S ACRJ=ACRJ+1
W W:ACRJ>1 !
 W ?17,ACRINDEX
 W ?24,ACRDSC1
 W ?55,ACRUI
 W ?58,$J(ACRQTY,4)
 W ?63,$J($G(ACRLATE),4)
 I ACRJ=1 D
 .W ?68,ACRDAT1
 .W !?3,"(",ACRDOC1,")"
 I ACRDSC2]"" W:ACRJ>1 ! W ?24,ACRDSC2
 D:$Y#IOSL>20 PAUSE^ACRFWARN
 Q
DUE S (ACRDIR,DIR(0))="SO^1:DUE NOW;2:7 DAYS PAST DUE;3:30 DAYS PAST DUE;4:DUE BETWEEN DATES"
 D DIR^ACRFDIC
 I "1234"'[+Y S ACRQUIT="" Q
 S ACRDUET=$P($P($P(ACRDIR,U,2),";",X),":",2)
 I Y<4 D
 .S X2=$S(X=1:0,X=2:-7,3:-30)
 .S X1=DT
 .S ACRDAYS=X2*-1
 .S ACRDAT=0
 .D C^%DTC
 .S ACRBEFOR=(X-1)
 I Y=4 D DATES
 Q
 W !?17,"DUE IN REPORT"
 W !?17,"RECEIVING LOCATION: ",$P($G(^AUTTPRG(+$G(ACRRL),0)),U)
 W !?17,"REPORT DATE.......: "
 S Y=DT
 X ^DD("DD")
 W Y
 W !?17,"REPORT FOR ORDERS.: ",$G(ACRDUET)
 W !!?58,"DUE"
 W ?63,"NO."
 W ?77,"STO"
 W !?17,"INDEX"
 W ?58,"IN"
 W ?63,"DAYS"
 W ?68,"DATE"
 W ?77,"RES"
 W !,"PO NUMBER"
 W ?17,"NUMBER"
 W ?24,"DESCRIPTION"
 W ?55,"UI"
 W ?58,"QTY"
 W ?63,"LATE"
 W ?68,"DUE IN"
 W ?77,"ITM"
 W !,"----------------"
 W ?17,"------"
 W ?24,"------------------------------"
 W ?55,"--"
 W ?58,"----"
 W ?63,"----"
 W ?68,"--------"
 W ?77,"---"
 Q
DATES ;EP;TO DETERMINE DATES DURING WHICH ITEMS ARE DUE IN
 S DIR(0)="DO^::AE"
 S DIR("A")="Delivery Due On or After"
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'$D(Y)
 S ACRDAT=+Y-1
 S DIR(0)="DO^::AE"
 S DIR("A")="Delivery Due On or Before"
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'$D(Y)
 S (X1,ACRBEFOR)=+Y
 S X2=DT
 D ^%DTC
 S ACRDAYS=X
 Q
QADJST ;ADJUST QUANTITY ORDERED BY DELETING QUANTITY ALREADY ACCEPTED
 N ACRRRDA
 S ACRRRDA=0
 F  S ACRRRDA=$O(^ACRRR("B",ACRSSDA,ACRRRDA)) Q:'ACRRRDA  D
 .I $D(^ACRRR(ACRRRDA,"DT")) S ACRQTY=ACRQTY-$P(^("DT"),U,3)
 Q