cTN1111 ; Aankoop/Verkoop : Inschrijven documenten: filter; cTN1111;; [ 17/11/09 10:31:59 ] ; T1 ;'Tot boekingsmaand' mag niet voor 'Van boekingsmaand' liggen.; T2 ;Van ;Tot ;boekingsmaand is niet ingevuld.; T3 ;Ongeldige input voor ;Van ;Tot ;maand (jjjj.mm).; T4 ;Document;Aankoopdocument;Verkoopdocument;Financiële verrichting;Diverse verrichting;Voorschot;Analytisch diverse verrichting; T5 ;Boekingsmaand verschillend van ;huidige maand.;datum document.; T6 ;Documentdatum ligt te ver in de toekomst.; T7 ;Boekingsmaand groter dan huidige maand.; ; T1F ;'A mois comptable' avant 'De mois comptable'.; T2F ;De ;A ;mois comptable n'est pas rempli.; T3F ;Entrée invalide pour ;De ;A ;moois (aaaa.mm).; T4F ;Document;Document d'achat;Document de vente;Extrait financier;Opérations diverse;Avance;Opération diverse analytique; T5F ;Le mois comptable diffère ;du mois actuel.;de la date du document.; T6F ;La date du document est trop loin dans le futur.; T7F ;Le mois comptable est supérieure au mois actuel.; ; T1E ;'Till Fiscal Month' may not be before 'From Fiscal Month'.; T2E ;From ; Till; Fiscal Month has to be filled in.; T3E ;Invalid input for ;From ;Till ;Fiscal Month (yyyy.mm).; T4E ;Document;Purchase Document;Sales Document;Financial Statement;Miscellaneous Transaction;Advance;Analytical Miscellaneous Transaction; T5E ;The fiscal month differs from ;the current month.;date of the document.; T6E ;The document date is too far away in the future.; T7E ;Fiscal month is greater than current month.; ; YZ Q ; ; CHKINV(BM,BINV,BTWT) ; Vraag om IC-investering (0=goederen,1=diensten) stellen? ; Input: BM: Boekingsmaand ; BINV: Bedrag investering ; BTWT: UI1 BTW-type ; ;Output: 1: IC-investering moet gevraagd worden ; 0: IC-investering moet niet gevraagd worden ; S $ZT="^dmERROR" N @$$INITVAR^cAFVBA01("BM,BINV,BTWT") ; ; Controle parameters CHKINV1 F i="BM","BINV","BTWT" S @i=$G(@i) ; ; Checks CHKINV2 S R=0 I BM<2010 G CHKINVZ ; Geldt pas vanaf kalenderjaar 2010 I 'BINV G CHKINVZ ; Geen investeringsbedrag ingevuld I '$L(BTWT) G CHKINVZ I $$SIG^cAFA1("CODE.9032",BTWT,104)'=1001 G CHKINVZ ; Geen IC-BTW type gekozen S R=1 ; CHKINVZ Q R ; CHKBM(BM,DOCDT,PAR) ; Checkt of boekingsmaand = huidige maand en maand documentdatum ; Input: BM: Boekingsmaand ; DOCDT: Documentdatum ; PAR: Parameters gescheiden door "\" ; 1. Test op boekingsmaand ; "",0: Testen of boekingsmaand verschilt van huidige maand: waarschuwing ; 1: Testen of boekingsmaand in toekomst ligt: waarschuwing ; 2: Testen of boekingsmaand in toekomst ligt: fout ; 3: Testen of boekingsmaand verschilt van huidige maand (W) + niet in toekomst (F) ; 2. Test op documentdatum ; "",0: Test op documentdatum te ver in de toekomst: fout ; 1: Geen test op documentdatum in de toekomst ; Output: 1: Alles OK ; 0\Documentdatum ligt te ver in de toekomst ; -1\Waarschuwing (ivm boekingsmaand) ; -2\Waarschuwing (ivm documentdatum) ; -3\Error (ivm boekingsmaand) S $ZT="^dmERROR" N @$$INITVAR^cAFVBA01("BM,DOCDT,PAR") ; CHKBM1 F i="BM","DOCDT","PAR" S @i=$G(@i) S R=1 I '$L(DOCDT) G CHKBM2 I DOCDT'?2N1"."2N1"."2N S DOCDT=$$HD^cAFD1(DOCDT) S DOCDMJ=DOCDT,DOCDT=$$DC^cAFD1(DOCDT) ; ; Documentdatum te ver in de toekomst (> 31 dagen) CHKBM15 G:$P(PAR,D,2) CHKBM2 S R=$$HD^cAFD1($H)_D_DOCDMJ D ^cA326 I R<-31 S R="0\"_$P($T(@("T6"_QT)),U,2) G CHKBMZ S R=1 ; ; Boekingsmaand = huidige maand? CHKBM2 I '$P(PAR,D)!($P(PAR,D)=3) I +$P(BM,".",2)'=+DM S R="-1\"_$P($T(@("T5"_QT)),U,2)_$P($T(@("T5"_QT)),U,3) G:'$P(PAR,D) CHKBMZ I $P(PAR,D) I $TR(BM,".")>(DJ_DM) S R=$S($P(PAR,D)=1:-1,1:-3)_D_$P($T(@("T7"_QT)),U,2) G CHKBMZ ; ; Boekingsmaand = maand documentdatum? CHKBM3 I '$L(DOCDT) G CHKBMZ I +$P(BM,".",2)'=+$E(DOCDT,5,6) S R="-2\"_$P($T(@("T5"_QT)),U,2)_$P($T(@("T5"_QT)),U,4) G CHKBMZ ; CHKBMZ Q R ; CHKMT(VBM,TBM) ; Geldige maanden ingegeven in filterframe N R S $ZT="^dmERROR" ; S R="1",U=";",D="\" F i="VBM","TBM" S @i=$G(@i) ; ; Geldige van-maand? CHKMT1 I '$L(VBM) S $P(R,D)=0,$P(R,D,2)=$P($T(@("T2"_QT)),U,2)_$P($T(@("T2"_QT)),U,4) G CHKMT2 I '(VBM?4N1"."2N&($P(VBM,".",2)>0)&($P(VBM,".",2)<13)) S $P(R,D)=0,$P(R,D,2)=$P($T(@("T3"_QT)),U,2)_$P($T(@("T3"_QT)),U,3)_$P($T(@("T3"_QT)),U,5) ; ; Geldige tot-maand? CHKMT2 I '$L(TBM) S $P(R,D)=0,$P(R,D,3)=$P($T(@("T2"_QT)),U,3)_$P($T(@("T2"_QT)),U,4) G CHKMT3 I '(TBM?4N1"."2N&($P(TBM,".",2)>0)&($P(TBM,".",2)<13)) S $P(R,D)=0,$P(R,D,3)=$P($T(@("T3"_QT)),U,2)_$P($T(@("T3"_QT)),U,4)_$P($T(@("T3"_QT)),U,5) ; ; Van boekingsmaand <= tot boekingsmaand CHKMT3 I R I VBM>TBM S $P(R,D)=0,$P(R,D,3)=$P($T(@("T1"_QT)),U,2) ; CHKMTZ Q R ; DEFMT(SW) ; Default range van/tot maand in filterframe ; SW: Output-switch ; "": default van-maand / default tot-maand ; 0 : default van-maand ; 1 : default tot-maand N DEFMT S $ZT="^dmERROR" ; ; Beginmaand: huidige maand DEFMT1 D ^cA106 ; ; Van maand = vorige maand DEFMT2 I $G(SW) G DEFMT3 S DEFMT=$E(((DJ_"."_DM)-.01)_0,1,7) S:$L(DEFMT)=5 DEFMT=$E(DEFMT,1,4)-.88 ; ; Tot maand = huidige maand DEFMT3 I $G(SW)=0 G DEFMTZ S DEFMT=$S($G(SW)="":DEFMT_D,1:"")_DJ_"."_DM ; DEFMTZ Q DEFMT ; FILTER(JRN,VBM,TBM) ; Fixed-wherestatement samenstellen voor filter op grid met aankoop\verkoop documenten ; Input: JRN: UI1 journaal ; VBM: Van boekingsmaand ; TBM: Tot boekingsmaand ; Output: Fixed-wherestatment N R,i S $ZT="^dmERROR" ; ; Controle parameters FILTER1 F i="JRN","VBM","TBM","R" S @i=$G(@i) I '$L(JRN),'$L(VBM),'$L(TBM) G FILTERZ ; ; Samenstellen wherestatement FILTER2 I $L(JRN) S R="%ALPHAUP(T1.B102) = %ALPHAUP('"_JRN_"')" I $L(VBM) S R=R_$S($L(R):" AND ",1:"")_"%ALPHAUP(T1.B105) >= %ALPHAUP('"_VBM_"')" I $L(TBM) S R=R_$S($L(R):" AND ",1:"")_"%ALPHAUP(T1.B105) <= %ALPHAUP('"_TBM_"')" ; FILTERZ Q R ; HDDB(SW,DOCNR,TYPE) ; Hoofding dagboek ; Input: SW: Switch ; "" of 0: Via object ; 1: Via parameters ; DOCNR: Extern documentnummer ; TYPE: Type document ; A = Aankoop ; V = Verkoop ; F = Financieel ; D = Divers ; AD = Analytisch divers ; KV = Klantenvoorschot ; LV = Leveranciersvoorschot ; Output: hoofding N i,HD,PC S $ZT="^dmERROR" D QT^cAFVBO01 S D="\",U=";" ; F i="SW","DOCNR","TYPE" S @i=$G(@i) ; I 'SW S DOCNR=..B103,TYPE=..B101GetObjectId() S PC=$S(TYPE="A":2,TYPE="V":3,TYPE="F":4,TYPE="D":5,TYPE="KV":6,TYPE="LV":6,TYPE="AD":7,1:1) ; andere types nog in te werken S HD="\\"_$P($T(@("T4"_QT)),";",1+PC)_"\ ;"_DOCNR ; HDDBZ Q HD ; ZZ ; 18.04.08 - 16 u 39 * V9.01