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

ASUJHIST.m

Go to the documentation of this file.
  1. ASUJHIST ; IHS/ITSC/LMH -MARK TRANSACTION AS UPDATED ;
  1. ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
  1. ;This routine updates a successfully processed transaction's status
  1. ;flag to 'Updated', stores the date processed, and the balance on
  1. ;the master updated for both quantity and value after the transaction
  1. ;was posted. For transaction code '3J' the account code from the
  1. ;master is also stored in the transaction.
  1. S ASUT(ASUT,"STATUS")="U",ASUT(ASUT,"DTP")=ASUK("DT","FM"),ASUTDA=ASUHDA
  1. S ASUT(ASUT,"MST","QTY")=$G(ASUMS("QTY","O/H")),ASUT(ASUT,"MST","VAL")=$G(ASUMS("VAL","O/H"))
  1. S ASUT(ASUT,"MST","D/I")=$G(ASUMS("D/I","QTY-TOT")),ASUT(ASUT,"DTE")=$P(ASUT(ASUT,"TRKY"),".") S:ASUT(ASUT,"TRKY")["." ASUT(ASUT,"DTE")=ASUT(ASUT,"DTE")_"."_$P(ASUT(ASUT,"TRKY"),".",2)
  1. S ASUJV=$S(ASUT="BOR":3,1:ASUJ)
  1. L +^ASUH(0):DTIME I '$T W !,"History file in use by another user try later!" S DA="" Q
  1. D HISTKEY L -^ASUH(0)
  1. D WRITE^ASU0TRWR(DA,"H") ;Write History transaction from variables
  1. S DA=ASUTDA,DIK="^ASUT("_ASUJV_","
  1. ;I ASUT("TRCD")'="4A" D ^DIK ;Delete old transaction
  1. K ASUJV
  1. I $G(ASUF("SV")) K ASUF("SV") Q
  1. D PSTKL^ASUCOKIL
  1. Q
  1. HISTKEY ;EP ;GET HISTORY IEN
  1. N V,X,Y,Z S Z=ASUL(2,"STA","E#")_"-"_ASUK("DT","FM")_"-"_"9999999"
  1. S Y=($O(^ASUH("AA"),-1))+1,X=$O(^ASUH("B",Z),-1)
  1. I $E(X,1,14)=$E(Z,1,14) D
  1. .S V=($P(X,"-",3))+1
  1. .S V=(V*.000001)
  1. .S V=$P(V,".",2) S:$L(V)<6 V=V_$E("000000",1,(6-$L(V))) S $P(X,"-",3)=V
  1. E D
  1. .S V="000001" S X=Z,$P(X,"-",3)=V
  1. S (ASUT(ASUT,"TRKY"),ASUH("KEY"))=X,DA=Y
  1. Q
  1. ACCT ;EP ;UPDATE ACCOUNT
  1. S:ASUT(ASUT,"ACC")']"" ASUT(ASUT,"ACC")=$G(ASUMX("ACC"))
  1. S DR=DR_";.04///"_ASUT(ASUT,"ACC")_";4///"_ASUT(ASUT,"ACC")
  1. Q