cTN1012 ; Dagboek : algemene controles + locken; cTN101 ; T1 ;KL.A#Klant ;LE.A#Leverancier ;AR.A#Financiële rekening ; T2 ;AR.A#Grootboekrekening ;ARA.A#Analytische rekening ;EC1#EC1-rekening ;EC2#EC2-rekening ;EC3#EC3-rekening ; T3 ;Grootboekrekening ontbreekt bij registratie; T4 ;Document ; ; T1F ;KL.A#Client;LE.A#Fournisseur;AR.A#Compte financier; T2F ;AR.A#Grootboekrekening ;ARA.A#Analytische rekening ;EC1#EC1-rekening ;EC2#EC2-rekening ;EC3#EC3-rekening ; T3F ;Grootboekrekening ontbreekt bij registratie; T4F ;Document ; ; T1E ;KL.A#Customer;LE.A#Supplier;AR.A#Financial account; T2E ;AR.A#Grootboekrekening ;ARA.A#Analytische rekening ;EC1#EC1-rekening ;EC2#EC2-rekening ;EC3#EC3-rekening ; T3E ;Grootboekrekening ontbreekt bij registratie; T4E ;Document ; ; YZ Q ; CHK(GRIDID) ; Algemene controles ; Input: GRIDID: GridId ; Output: 1: alles OK ; 0\Foutboodschap N RZR,OK,DB,N,NETG,NETD,NETI,NETA,AFBTW,NABTW,TBTW,TOT,V,BEDR S $ZT="TRAP^cAN000" ; ; Onthouden last reference CHK1 D S1^cAFA1 ; ; Controle parameters + variabelen opzetten CHK2 S OK=1 I '$L($G(GRIDID)) G CHKZ S DB=$O(^mtemp99(GRIDID,"DB","")) I '$L(DB) G CHKY S DB(1)=$G(^mtemp99(GRIDID,"BH.DB",DB,0)) F N=1:1:6 S DB(N+1)=$G(^(N)) ; ; Check of bij elke registratie grootboekrekening is ingevuld CHK3 S (V,BEDR)="" CHK30 S V=$O(^mtemp99(GRIDID,"BH.REG",V)) G:'$L(V) CHKY S N=^(V,0) I $P(N,D,30)=2 G CHK30 ; Verwijderd I '$L($P(N,D,8)) S OK=0_D_$P($T(@("T3"_QT)),U,2) G CHKY CHK33 G CHK30 ; ; Terugzetten last reference CHKY D S2^cAFA1 ; CHKZ Q OK ; LOCK(GRIDID,LOCK) ; Input: GRIDID: GridId ; LOCK: Tabel met gelockte ID's, als referentie doorgeven (.LOCK) ; Inhoud tabel, gescheiden door "\" ; 1. DMS ; 2. Gelockt ID S $ZT="TRAP^cAN000" N @$$INITVAR^cAFVBA01("GRIDID,LOCK") ; ; Onthouden last reference LOCK1 D S1^cAFA1 ; ; Controle parameters + variabelen opzetten LOCK2 S OK=1 K LOCK I '$L($G(GRIDID)) G CHKZ S DB=$O(^mtemp99(GRIDID,"DB","")) I '$L(DB) G CHKY S DB(1)=$G(^mtemp99(GRIDID,"BH.DB",DB,0)) F N=1:1:6 S DB(N+1)=$G(^(N)) ; ; Alle rekeningen proberen te locken LOCK3 S (L,i)=0 ; ; Klant, leverancier en financiële rekening LOCK31 S i=i+1 I i>3 G LOCK33 LOCK310 S (UI1,BREK)=$P(DB(1),D,i+8),j=2 LOCK311 I '$L(UI1) G:j>2 LOCK312 G LOCK31 S DMS=$P($P($T(@("T"_(1+(j>2))_QT)),U,$S(j>2:j,1:i+1)),"#") S TXT=$P($P($T(@("T"_(1+(j>2))_QT)),U,$S(j>2:j,1:i+1)),"#",2)_$$SIG^cAFA1(DMS,UI1,101) S OK=$$LOCK^cAFVBA01(.Q,DMS,UI1,1,TXT) I 'OK G LOCK9 S L=L+1 S LOCK(L)=DMS_D_UI1 ; Controle of rekening niet verwijderd is S OK=$$CTRLREK^cTN003("",UI1,DMS,TXT) I 'OK G LOCK9 ; Vaste analytische + EC-rekeningen LOCK312 I j=2,(DMS'="AR.A") G LOCK31 S j=j+1 I j>6 G LOCK31 S UI1=$$SIG^cAFA1("AR.A",BREK,157+((j-3)*3)) G LOCK311 ; ; Registraties LOCK33 S V="" LOCK34 S V=$O(^mtemp99(GRIDID,"BH.REG",V)) I '$L(V) G LOCKY S N0=^(V,0),i=0 I $P(N0,D,30)=2 G LOCK34 ; Verwijderd ; Grootboekrekening,analytische rekening + EC*-rekeningen LOCK35 S i=i+1 I i>5 G LOCK39 S UI1=$P(N0,D,i+7) I '$L(UI1) G LOCK35 S DMS=$P($P($T(@("T2"_QT)),U,i+1),"#") S TXT=$P($P($T(@("T2"_QT)),U,i+1),"#",2)_" "_$$SIG^cAFA1(DMS,UI1,101) S OK=$$LOCK^cAFVBA01(.Q,DMS,UI1,1,TXT) I 'OK G LOCK9 S L=L+1 S LOCK(L+1)=DMS_D_UI1 ; Controle of rekening niet verwijderd is S OK=$$CTRLREK^cTN003("",UI1,DMS,TXT) I 'OK G LOCK9 LOCK36 G LOCK35 ; Afgeboekt document I '$L($P(N0,D,22)) G LOCK39 S DMS="DB",UI1=$P(N0,D,22),FNR=$$SIG^cAFA1(DMS,UI1,103) S TXT=$P($P($T(@("T2"_QT)),U,i+1),"#",2)_" "_$S($L(FNR):FNR,1:UI1) S OK=$$LOCK^cAFVBA01(.Q,DMS,UI1,1,TXT) I 'OK G LOCK9 S L=L+1 S LOCK(L+1)=DMS_D_UI1 LOCK39 G LOCK34 ; ; Alle gelockte ID's unlocken LOCK9 D UNLOCK(.LOCK) ; ; Terugzetten last reference LOCKY D S2^cAFA1 ; LOCKZ Q OK ; UNLOCK(LOCK) ; Input: LOCK: Tabel met gelockte ID's, als referentie doorgeven (.LOCK) ; Inhoud tabel, gescheiden door "\" ; 1. DMS (indien "" -> moet 3 doorgegeven worden) ; 2. Gelockt ID (indien "" -> moet 3 doorgegeven worden) ; 3. Global-referentie N i S $ZT="TRAP^cAN000" ; S i="" F S i=$O(LOCK(i)) Q:'$L(i) D . I $L($P(LOCK(i),D)) D LOCK^cAFVBA01(.Q,$P(LOCK(i),D),$P(LOCK(i),D,2),0) Q . I $L($P(LOCK(i),D,3)) L -@$P(LOCK(i),D,3) K LOCK ; UNLOCKZ Q ; ZZ ; 29.08.07 - 10 u 22 * V8.09