cTA183 ;Boekhouding: Extra cumuls (jaarafsluiting); ; [ 06/07/04 10:00 AM ] ; Compiled December 8, 2011 12:06:22 ; G YZ ; T1 ;Enkel boekingsrekeningen zijn toegelaten ; ; T1F ;Uniquement des comptes comptables s.v.p. ; ; T1E ;Only valid accounts are allowed ; ; ; BS(Q,BJR) ; Opzetten beginsaldi extra cumuls (^DBH) ; Input: Q: Firma ; BJR: Oudst openstaand boekjaar ; N UI1,NOK,AJR,INH,DBH,AR,ARA,IAS,UREF,UQC,USC S $ZT="TRAP^cAN000" ; ; Onthouden last reference D S1^cAFA1 ; ; Enkel indien analytische BH I '$P($G(@("^"_Q_"BA(300)")),D) G BSY ; ; Initialisatie D DMS^cAN000("UQC","USC","BS.AR.ARA",1) G BSY:UQC="",BSY:USC="" S UREF=^DMC(UQC,USC,"DATA","REF"),NOK="",AJR=(BJR-1) D ^cT489 ; ; Indien er nog geen ^DBH-gegevens zijn in het voorgaande jaar I BJR'>$$STARTJR^cTA180(Q) D . S ARA=$$REK^cTA180("") . S IAS=$$REK^cTA180("",1) . S AR=0 F S AR=$O(@("^"_Q_"AR(AR)")) Q:'$L(AR) D .. I $P(^(AR,0),D,13)=1 Q ; Tekstrekening .. ;I $P(^(0),D,30) Q ; Verwijderd of buiten gebruik .. S DBH($$REK(AR),$$REK(ARA),$$REK(IAS))=$$BSAL^cAFE1(Q,BJR,"AR",AR) I $D(DBH) G BSX ; ; Beginsaldi van af te sluiten jaar controleren en event. corrigeren S AR=0 F S AR=$O(@("^"_Q_"AR(AR)")) Q:'$L(AR) D . I $P(^(AR,0),D,13)=1 Q ; Tekstrekening . ;I $P(^(0),D,30) Q ; Verwijderd of buiten gebruik . D OPDUMMY^cTA18(AR,AJR,Q) ; ; Doorlopen maandcijfers S UI1=$TR(KM1(AJR),".","")_" " F S UI1=$O(@UREF) Q:'$L(UI1) D Q:NOK . I $E(UI1,5,6)="00" Q ; Geen beginsaldi . S INH=^(UI1,0) I $P(INH,D,30)="2" Q . I $$BJ^cAFE1(Q,$P(INH,D,4))'=AJR S NOK=1 Q ; Stoppen indien ander BJ . S DBH($$REK($P(INH,D)),$$REK($P(INH,D,2)),$$REK($P(INH,D,3)))=$G(DBH($$REK($P(INH,D)),$$REK($P(INH,D,2)),$$REK($P(INH,D,3))))+$P(INH,D,6)-$P(INH,D,7) ; ; Doorlopen beginsaldi S UI1=AJR_"00 " F S UI1=$O(@UREF) Q:$E(UI1,1,4)'=AJR D . S INH=^(UI1,0) I $P(INH,D,30)="2" Q . S DBH($$REK($P(INH,D)),$$REK($P(INH,D,2)),$$REK($P(INH,D,3)))=$G(DBH($$REK($P(INH,D)),$$REK($P(INH,D,2)),$$REK($P(INH,D,3))))+$P(INH,D,10) ; ; Evenueel bestaande BS vewijderen (indien 2x jaar afgesloten) BSX S UI1=BJR_"00 " F S UI1=$O(@UREF) Q:$P(UI1," ")'=(BJR_"00") D . D X^cAN220("BS.AR.ARA","",UI1) ; ; Wegschrijven in ^DBH S AR="" F S AR=$O(DBH(AR)) Q:'$L(AR) D . S ARA="" F S ARA=$O(DBH(AR,ARA)) Q:'$L(ARA) D .. S IAS="" F S IAS=$O(DBH(AR,ARA,IAS)) Q:'$L(IAS) D ... I $$SIG^cAFA1("AR",AR,120) Q ; BS van W\V-rekeningen is altijd 0, wordt dus niet opgezet ... I +DBH(AR,ARA,IAS)=0 Q ; 0-waarden worden niet opgezet ... S TAB(1)=AR_D_ARA_D_IAS_D_BJR_".00"_D_"0"_D_D_D_D_D_DBH(AR,ARA,IAS) ... S UI1=BJR_"00 "_AR_ARA_IAS_"0" ... D P^cAN220("BS.AR.ARA","",UI1,"TAB","") ; BSY ; Terugzetten last reference D S2^cAFA1 ; BSZ Q ; REK(REK) Q $P(REK," ")_" " ; RESWV(Q,BJR,AR,ARA,IAS,BEDR) ; Resultaat W\V-rekeningen bij jaar-afsluiting ; Input: Q: Firma ; BJR: Oudst openstaand boekjaar ; AR: Grootboekrekening ; ARA: Analytische rekening ; IAS: IAS rekening (Indien van toepassing) ; Indien "": gelijk aan ARA ; BEDR: Resultaat W\V-rekeningen ; N SALDO,AREK,UREF,UQC,USC,UI1 S $ZT="TRAP^cAN000" ; ; Onthouden last reference D S1^cAFA1 ; ; Enkel indien analytische BH I '$P($G(@("^"_Q_"BA(300)")),D) G RESWVY ; ; Initialisatie D DMS^cAN000("UQC","USC","BS.AR.ARA",1) G RESWVY:UQC="",RESWVY:USC="" S UREF=^DMC(UQC,USC,"DATA","REF") ; ; Indien nog geen ^DHB-gegevens in voorgaande jaar: BS-van rekening eerst verwijderen ;I BJR<=$$STARTJR^cTA180(Q) D ;. S UI1=BJR_"00 "_AR F S UI1=$O(@UREF) Q:$P(UI1," ",1,2)'=$P((BJR_"00 "_AR)," ",1,2) D ;.. D X^cAN220("BS.AR.ARA","",UI1) ; S AREK=$$REK^cTA180(ARA) I $L(ARA),$P($G(@("^"_Q_"BA(300)")),D,8) S IAS=AREK I '$L(IAS) S IAS=$$REK^cTA180(IAS,1) S UI1=BJR_"00 "_AR_AREK_IAS_"0" S INH=$$SIGN^cAFA1("BS.AR.ARA",UI1,0) S SALDO=$P(INH,D,10) ; ; I $L(INH) G RESWVW ; RESWVO ; Openen S TAB(1)=AR_D_AREK_D_IAS_D_BJR_".00"_D_"0"_D_D_D_D_D_BEDR D P^cAN220("BS.AR.ARA","",UI1,"TAB","") G RESWVX ; RESWVW ; Wijzigen S TAB(110)=SALDO+BEDR D B^cAN220("BS.AR.ARA","",UI1,"TAB") ; RESWVX ; Bedrag van dummy-rekeningen halen I BJR'>$$STARTJR^cTA180(Q) D . S UI1=BJR_"00 "_AR_$$REK^cTA180("")_$$REK^cTA180("",1)_"0" . S SALDO=$$SIG^cAFA1("BS.AR.ARA",UI1,110) . K TAB S TAB(110)=SALDO-BEDR . D B^cAN220("BS.AR.ARA","",UI1,"TAB") ; RESWVY ; Terugzetten last reference D S2^cAFA1 ; RESWVZ Q ; ARA(Q,BR) ; Ingave van de analytische rekening ; Input: BR: Grootboekrekening ; ; Output: Intern nummer anal. rek._"\"_Nummer anal. rek_"\"_Naam anal. rek ; N OUTP,R10,R11,VENT S $ZT="TRAP^cAN000" ; ; Enkel indien analytische BH I '$P($G(@("^"_Q_"BA(300)")),D) G ARZ ; S OUTP="",D="\" I '$L($G(BR)) G ARZ S VENT=$$SIG^cAFA1("AR",BR,106) S R10=$P(VENT,"#",1),R11=$P(VENT,"#",2) G AR2:R10="A",AR1:R10="K",ARZ:R10="0",ARZ:R10="" ; ; Analytisch ventileren "ja" = standaard selectie AR1 S K=$$^cANSYN("ARA") I K="-" S OUTP="-" G ARZ I '$L(K) G AR1 I $P(^(K,0),D,13) D F2 G AR1 S INH=$$SIGN^cAFA1("ARA",K,0) S OUTP=K_D_$P(INH,D)_D_$P(INH,D,2) G ARZ ; ; Analytisch ventileren "vaste rekening" AR2 S K=$$^cANSYN("ARA","",$P(R11," ")) I K="-" S OUTP="-" G ARZ I '$L(K) G AR2 S INH=$$SIGN^cAFA1("ARA",K,0) S OUTP=K_D_$P(INH,D)_D_$P(INH,D,2) G ARZ ; ARZ Q $G(OUTP) ; ; F2 S K=$P($T(@("T1"_QT)),U,2) G FZ FZ D TXT^cAFA1(250) Q ; YZ Q ; ZZ ; 24.02.06 - 9 u 54 * V8.06