cTN1301 ; Financieel/Divers : Dagboek: specifieke controles en locks ; cTN101 ; T1 ;AR.A#Financiële rekening; T2 ; T3 ; ; T1F ;AR.A#Compte financier; T2F ; T3F ; ; T1E ;AR.A#Financial account; T2E ; T3E ; ; YZ Q ; CHK(GRIDID,PAR) ; Specifieke controles voor financieel ; Input: GRIDID: GridId ; ; PAR: Parameters, gescheiden door "\" ; 1. Switch bedragen ; "" of 0: bedragen doorgegeven in munt document ; 1: bedragen doorgegeven in munt BH ; Output: 1: Alles OK ; 0\Foutboodschap N RZR,OK,DB,N 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,"BH.DB","")) I '$L(DB) G CHKY S DB(1)=$G(^mtemp99(GRIDID,"BH.DB",DB,0)) F N=1:1:9 S DB(N+1)=$G(^(N)) S PAR=$G(PAR) ; ; Terugzetten last reference CHKY D S2^cAFA1 ; CHKZ Q OK ; DB(GRIDID,INTDOCNR) ; Aanpassen hoofding specifieke velden voor financieel\divers ; Input: GRIDID: GridId ; INTDOCNR: Intern document nummer N RZR,DB,GDB,DB,UI1DB S $ZT="TRAP^cAN000" ; ; Onthouden last reference DB1 D S1^cAFA1 ; ; Controle parameters + variabelen opzetten DB2 I '$L($G(GRIDID)) G DBY I $L($G(INTDOCNR)) G DBY S GDB="^mtemp99(GRIDID,""BH.DB"")" S DB=$O(@GDB@("")) I '$L(DB) G DBY S DB(1)=$G(^(DB,0)),DB(6)=$G(^(5)),DB(7)=$G(^(6)) ; ; Bestaat dit uitreksel al? ; Uittreksel is een groepering per: ; - Firma ; - Type dagboek ; - Journaal ; - Documentnummer ; - Boekingsmaand DB3 S UI1=$$UI1OP^cAFA1("DB","M6","",$P(DB(1),D,49),$P(DB(1),D),$P(DB(1),D,2),$P(DB(1),D,3),$P(DB(1),D,5)) I '$L(UI1) G DBY D DMS^cAN000("UQC","USC","DB",1) I (UQC="")!(USC="") G DBY S UREF=$G(^DMC(UQC,USC,"DATA","REF")) I '$L(UREF) G DBY M ^mtemp99(GRIDID,"BH.DB",DB)=@UREF S IDOCNR=UI1,WIJZ=1 ; ; Terugzetten last reference DBY D S2^cAFA1 ; DBZ Q ; TB(REG) ; Tegenboeking op financiële rekening ; Input: REG: Registratie nodes, doorgegeven als referentie N RZR,FIAR,REF,UREF,I4,I5,I6,I7,REGUI1,N N UI1,NGRIDID,i,USC,UQC,NREG,WREG,OK S $ZT="TRAP^cAN000" ; ; Onthouden last reference TB1 D S1^cAFA1 ; ; Tegenboeking bij manuele boeking in het financieel TB2 I $P($G(REG(1)),D)'="F" G TBY I '$P(REG(1),D,32) G TBY ; ; Tegenboeking gebeurt op de financiële rekening. Deze tegenboeking ; wordt via dit programma automatisch opgezet. ; Nagaan of er al een tegenboek-registratie opstaat: ; - Ja: tegeboeking in deze registratie verwerken ; - Neen: nieuwe registratie opzetten ; ; Bestaat tegenboeking-registratie al? TB3 S REF=$$REF^cAFA10(.Q,"REG") S UREF=$P(REF,D),IREF=$P(REF,D,3) G:'$L(IREF) TBY G:'$L(UREF) TBY S FIAR=$$SIG^cAFA1("DB",$P(REG(1),D,3),111) I '$L(FIAR) G TBY ; ; Subscripten: S I4=$P(REG(1),D,49) ; Firma S I5=$P(REG(1),D) ; Type registratie S I6=$P($$DI^cAN000($P(REG(1),D,3),"")," ") ; Dagboek ; ; Dagboek aflopen TB31 S (I7,UI1REG)="" TB32 S I7=$O(@IREF@("M1",I4,I5,I6,I7)) I '$L(I7) G TB4 S UI1=$P(^(I7),D) S N(1)=@UREF@(0) I $P(N(1),D,30)=2 G TB32 ; Verwijderd I $P(N(1),D,32) G TB32 ; Manuele registratie I $P(N(1),D,8)'=FIAR G TB32 ; Grootboekrekening '= financiële rekening S REGUI1=UI1 G TB5 ; ; --- Nieuw ----------------------------------------------------------- TB4 S NGRIDID=$$GRIDID^cAFVBF01() K ^mtemp99(GRIDID) D DMS^cAN000("UQC","USC","DB",1) I (UQC="")!(USC="") G TBY S UREF=$G(^DMC(UQC,USC,"DATA","REF")) I '$L(UREF) G TBY S UI1=$P(REG(1),D,3) M ^mtemp99(NGRIDID,"BH.DB",UI1)=@UREF ; S NREG(1)=REG(1) F i=7:1:14,19:1:25,28:1:100 S $P(NREG(1),D,i)="" S $P(NREG(1),D,7)="G" ; Soort grootboekrekening S $P(NREG(1),D,8)=FIAR ; Grootboekrekening S $P(NREG(1),D,28)=$P(REG(1),D,28) ; Datum laatste wijziging S $P(NREG(1),D,29)=$P(REG(1),D,29) ; Initialen laatste wijziging S $P(NREG(1),D,30)=0 ; Operationeel S $P(NREG(1),D,31)=$T(+0) ; Naam programma F i=15,17,26 S $P(NREG(1),D,i)=$P(REG(1),D,i+1),$P(NREG(1),D,i+1)=$P(REG(1),D,i) ; Bedragen (omkeren) S ^mtemp99(NGRIDID,"BH.REG",1000,0)=NREG(1) ; TB49 D REG^cTN101(NGRIDID,UI1,"",3) G TBY ; --------------------------------------------------------------------- ; ; ; --- Bestaand -------------------------------------------------------- TB5 S NGRIDID=$$GRIDID^cAFVBF01() K ^mtemp99(GRIDID) S WREG(1)=N(1) F i=15,17,26 D ; Bedragen (omkeren) . S DEB=$P(WREG(1),D,i)+$P(REG(1),D,i+1) . S CRE=$P(WREG(1),D,i+1)+$P(REG(1),D,i) . ;S SALDO=DEB-CRE . ;S DEB="" I SALDO'<0 S DEB=+SALDO . ;S CRE="" I SALDO<0 S CRE=-SALDO . S $P(WREG(1),D,i)=DEB ; Debet . S $P(WREG(1),D,i+1)=CRE ; Credit . S $P(WREG(1),D,28)=$P(REG(1),D,28) ; Datum laatste wijziging . S $P(WREG(1),D,29)=$P(REG(1),D,29) ; Initialen laatste wijziging S ^mtemp99(NGRIDID,"BH.REG",1000,0)=WREG(1) ; TB59 D REG^cTN101(NGRIDID,$P(REG(1),D,3),REGUI1,3) ; --------------------------------------------------------------------- ; ; Terugzetten last reference TBY D S2^cAFA1 ; TBZ Q $G(OK,2) ; ZZ ; 29.08.07 - 10 u 22 * V8.09