program "VERKOOPDAGBOEK" dcl blz%,loop_%,swit#,w% dcl selma%,totmede=6,totbtw=6,totegal=6,totuitv=6 dcl somdeb=6(9),somcre=6(9),afdruk=6(9),som=6,totaal=6 dcl central$=6(99),cenbed=6(99),cendebet=6(99) dcl cencredit=6(99),credit=6,debet=6,totool=6,totbow=6 dcl seljaar$=2,selboek$=1,seltyp$=1,selok$=1 dcl leessec$=1,leesmaan$=2,verwerk$=1,reken$=6 dcl drmaan$=2,maanden$=2(12),tabverk$=8(25),keuze$=1 #INCLUDE "CRINCLU" #INCLUDE "CRINCLU2" assign=45,"IM0",wr,ex,im assign=02,bestand(04),si ;klantenbestan. assign=04,bestand(08),wr,si ;verkoopdagboekbestan assign=08,bestand(01),si ;rekeningen bestand assign=10,bestand(02),wr,si ;maandhistoriek &10 for e=1 to 12 maanden(e)="31" next e for e=4 to 6 step 2 maanden(e)="30" next e for e=9 to 11 step 2 maanden(e)="30" next e maanden(2)="28" madatum=ndat drmaan=" " leesmaan=" " verwerk="N" seltyp="A" selboek=" " selok="Y" &12 print=1:clear,paint(kh,ka),naam,paint(kt,0)," AFDRUKKEN VERKOOPDAGBOEK ",tab(70),ndat print=1:paint(kl,0),tab(01,02),gener(79,hto) print=1:tab(01,05),paint(kt,ka),"Aantal ingevoerde verkoopfakturen : ",paint(kt,0),(-4),teller(02)-1 print=1:tab(01,07),paint(kt,ka2),"1 --> Afdrukken verkoopdagboek.",paint(kt,0) print=1:tab(01,09),paint(kt,ka3),"2 --> Afdrukken centralisatie.",paint(kt,0) print=1:tab(01,11),paint(kl,0),gener(79,hto),paint(kt,0) &13 ask=1,i=&1,u=&1:tab(01,13),"Maak uw keuze 1--2",esc,(z)=keuze if keuze="1" : goto &16 if keuze="2" : goto &16 goto &13 &16 print=1:clear,ltb,paint(kl,0),gener(77,hto),rtb,tab(01,03),lto,gener(77,hto),rto,tab(01,02),vtb,tab(79,02),vtb print=1:tab(01,06),gener(79,hto) print=1:tab(01,10),gener(79,hto) print=1:tab(01,14),gener(79,hto) print=1:tab(01,18),gener(79,hto) print=1:tab(01,21),gener(79,hto),paint(kt,0) print=1:tab(03,02),paint(kh,ka),naam,paint(kt,0)," : VERKOOPDAGBOEK Bewerkingen : ",(-5),teller(02)-1 print=1:tab(01,04),"Opgave van jaartal voor afdrukken van het verkoopdagboek,indien niets" print=1:tab(01,05),"ingevuld is dan wordt alles afgedrukt" print=1:tab(60,05),"Jaartal",tab(70),": ",paint(kh,ka),seljaar,paint(kt,0),"." print=1:tab(01,07),"Opgave van maand ofwel 01-12, indien niets ingevuld is wordt alles gedrukt" print=1:tab(01,08),"Ofwel opgave van een kwartaal : K1=eerste kwartaal (K1,K2,K3,K4) " print=1:tab(60,09),"Periode",tab(70),": ",paint(kh,ka),drmaan,paint(kt,0),"." print=1:tab(01,11),"Verwerken van de centralisatie naar historieken toe Y-N " print=1:tab(01,12),"Indien dit een voorlopig dagboek is antwoorden met N (nee)" print=1:tab(60,13),"Verw. ?",tab(70),": ",paint(kh,ka),verwerk,paint(kt,0),"." print=1:tab(01,15),"Keuzemogelijk om alles af te drukken, zowel fakturen als kredietnota's" print=1:tab(01,16),"Ofwel ",paint(kh,ka),"A",paint(kt,0),"=alles, ",paint(kh,ka),"F",paint(kt,0),"=alleen de FAKTUREN ",paint(kh,ka),"K",paint(kt,0),"=alleen de KREDIETNOTA'S " print=1:tab(60,17),"A-K-F",tab(70),": ",paint(kh,ka),seltyp,paint(kt,0),"." if kodes(05)<>"Y" : goto &17 print=1:tab(01,19),"Dagboeknummer ",tab(70),": ",paint(kh,ka),selboek,paint(kt,0),"." &17 print=1:tab(01,23),"O.K. om af te drukken Y-N",tab(70),": ",paint(kh,ka),selok,paint(kt,0) &18 seljaar=right(ndat,2) ask=1,i=&10,u=&10:tab(72,05),seljaar,tab(72),(nn)=seljaar if seljaar=" " : goto &19 if seljaar<"00" : goto &18 if seljaar>"99" : goto &18 &19 ask=1,i=&10,u=&18:tab(72,09)=drmaan drmaan=large(drmaan) if drmaan=" " : goto &20 if drmaan="K1" : goto &20 if drmaan="K2" : goto &20 if drmaan="K3" : goto &20 if drmaan="K4" : goto &20 if len$(drmaan)<>2 : goto &19 if conv(drmaan)<1 : goto &19 if conv(drmaan)>12 : goto &19 if left(drmaan,1)=" " : goto &20 if left(drmaan,1)="K" : goto &20 e=conv(drmaan) madatum=maanden(e)+"."+drmaan+"."+seljaar &20 ask=1,i=&10,u=&19:tab(72,13)=verwerk verwerk=large(verwerk) if verwerk="N" : goto &25 if verwerk="Y" : goto &25 goto &20 &25 ask=1,i=&10,u=&20:tab(72,17)=seltyp seltyp=large(seltyp) if seltyp="A" : goto &27 if seltyp="F" : goto &27 if seltyp<>"K" : goto &25 &27 if kodes(05)<>"Y" : goto &28 ask=1,i=&10,u=&25:tab(72,20)=selboek selboek=large(selboek) &28 ask=1,i=&10,u=&25:tab(72,23)=selok selok=large(selok) if selok="N" : goto &10 if selok="Y" : goto &31 goto &10 &31 print=45:atb(70) print=45:atb(6) blz=0 lijntel=0 totegal=0 totmede=0 totuitv=0 for i=1 to 9 somdeb(i)=0 somcre(i)=0 afdruk(i)=0 next i for i=1 to 99 central(i)=" " cendebet(i)=0 cencredit(i)=0 cenbed(i)=0 next i if teller(02)>1 : goto &35 print=1:tab(01,24),atb(21) ask=1,i=&1,u=&1:tab(01,24),"Er werden geen gegevens ingebracht voor deze periode "=j goto &1 &35 if keuze="2" : goto &40 gosub &1100 ;hoofdtitel gosub &1200 ;subtittel goto &41 &40 gosub &1300 ;centralisatie titel &41 open=4:&42,e &42 down=4:&165,e,verkdown op &285,w &43 if kodes(05)<>"Y" : goto &45 if selboek=" " : goto &45 if selboek<>verkboek : goto &42 &45 for i=1 to 9 afdruk(i)=0 next i if lijntel0 : goto &48 if verkcnf="K" : goto &60 &48 afdruk(1)=verkdeb afdruk(2)=0 for i=1 to 5 if verkkod(i)=" " : goto &59 if verkkod(i)="1" : goto &49 if verkkod(i)="2" : goto &50 if verkkod(i)="3" : goto &51 if verkkod(i)="4" : goto &52 if verkkod(i)="5" : goto &53 if verkkod(i)="8" : goto &54 ;luxe - egalisatie if verkkod(i)="6" : goto &56 ;mede kontraktant if verkkod(i)="7" : goto &57 ;uitvoer goto &58 &49 afdruk(3)=verkbed(i) goto &58 &50 afdruk(4)=verkbed(i) goto &58 &51 afdruk(5)=verkbed(i) goto &58 &52 afdruk(6)=verkbed(i) goto &58 &53 afdruk(7)=verkbed(i) goto &58 &54 afdruk(7)=verkbed(i) totegal=totegal+verkbed(i) j="L" goto &58 &56 afdruk(7)=verkbed(i) totmede=totmede+verkbed(i) j="M" goto &58 &57 afdruk(7)=verkbed(i) totuitv=totuitv+verkbed(i) j="U" goto &58 &58 next i &59 afdruk(8)=verkbtw afdruk(9)=verktbe(1) ;eerste tegenboekingsbedrag for i=1 to 9 somdeb(i)=somdeb(i)+afdruk(i) next i goto &100 &60 if verkbtw>=0 : goto &48 afdruk(1)=0 afdruk(2)=abs(verkdeb) for i=1 to 5 if verkkod(i)=" " : goto &99 if verkkod(i)="1" : goto &66 if verkkod(i)="2" : goto &67 if verkkod(i)="3" : goto &68 if verkkod(i)="4" : goto &69 if verkkod(i)="5" : goto &70 if verkkod(i)="6" : goto &72 ;medekontraktant if verkkod(i)="7" : goto &73 ;uitvoer if verkkod(i)="8" : goto &71 goto &98 &66 afdruk(3)=verkbed(i) goto &98 &67 afdruk(4)=verkbed(i) goto &98 &68 afdruk(5)=verkbed(i) goto &98 &69 afdruk(6)=verkbed(i) goto &98 &70 afdruk(7)=verkbed(i) goto &98 &71 afdruk(7)=verkbed(i) totegal=totegal+verkbed(i) j="L" goto &98 &72 afdruk(7)=verkbed(i) totmede=totmede+verkbed(i) j="M" goto &98 &73 afdruk(7)=verkbed(i) totuitv=totuitv+verkbed(i) j="U" goto &98 &98 next i &99 ;einde bepalen btw afdruk(8)=verkbtw afdruk(9)=verktbe(1) ;eerste tegenboekingsbedrag for i=1 to 9 somcre(i)=somcre(i)+abs(afdruk(i)) next i ;bepalen cumul goto &100 &100 credit=0 debet=0 if verkteg(1)=" " : goto &105 reken=verkteg(1) som=verktbe(1) if som>0 : goto &103 debet=abs(som) goto &104 &103 credit=som &104 gosub &900 ;uitvoering centralisatie &105 if keuze="2" : goto &110 print=45:tabv(01),verkdat,tab(10),(u19),klnaam,tab(30),(u6),verkfak,(u),verkcnf,(-7.n2),afdruk(1),afdruk(2),afdruk(3),afdruk(4),afdruk(5),afdruk(6),afdruk(7),tab(105),(-6.n2),afdruk(8),tab(115),(u6),verkteg(1),(-7.n2),verktbe(1) lijntel=lijntel+1 &110 if verkteg(2)=" " : goto &150 ;geen tweede rekening meer reken=verkteg(2) som=verktbe(2) somdeb(9)=somdeb(9)+verktbe(2) if som>0 : goto &113 debet=abs(som) goto &114 &113 credit=som &114 gosub &900 ;centralisatie tweede rekening if keuze="2" : goto &120 if lijntel0 : goto &123 debet=abs(som) goto &124 &123 credit=som &124 gosub &900 somdeb(9)=somdeb(9)+verktbe(i) if keuze="2" : goto &130 if lijntel"Y" : goto &270 &250 makode="A" matgfak="Centra" maomsch="Verkoopdagboek" makllev="A" maklv=" " for i=1 to 99 if central(i)=" " : goto &270 mareknr=central(i) &251 matel=teller(01) teller(01)=teller(01)+1 mabedrd=cendebet(i) mabedrc=cencredit(i) insert=10,makod9:&252,e,mahisre goto &260 &252 if e=81 : goto &251 print=1:tab(01,24),"Fout insert historiek : ",e," ",makod9 stop &260 next i &270 goto &12 &285 if w=83 : goto &286 if w=115 : goto &286 goto &43 &286 print=45:page goto &12 &290 if seltyp="A" : goto &295 if seltyp="K" : goto &292 if verkcnf=" " : goto &295 if verkcnf<>"F" : goto &160 goto &295 &292 if verkcnf<>"K": goto &160 &295 if seljaar=" " : goto &300 if right(verkdat,2)<>seljaar : goto &160 &300 if drmaan=" " : goto &47 if drmaan="K1" : goto &301 if drmaan="K2" : goto &302 if drmaan="K3" : goto &303 if drmaan="K4" : goto &304 if drmaan<>substr(verkdat,4,2) : goto &160 goto &47 &301 if substr(verkdat,4,2)="01" : goto &47 if substr(verkdat,4,2)="02" : goto &47 if substr(verkdat,4,2)="03" : goto &47 goto &160 &302 if substr(verkdat,4,2)="04" : goto &47 if substr(verkdat,4,2)="05" : goto &47 if substr(verkdat,4,2)="06" : goto &47 goto &160 &303 if substr(verkdat,4,2)="07" : goto &47 if substr(verkdat,4,2)="08" : goto &47 if substr(verkdat,4,2)="09" : goto &47 goto &160 &304 if substr(verkdat,4,2)="10" : goto &47 if substr(verkdat,4,2)="11" : goto &47 if substr(verkdat,4,2)="12" : goto &47 goto &160 &900 for i2=1 to 99 if central(i2)=" " : goto &903 if central(i2)<>reken : goto &904 cenbed(i2)=cenbed(i2)+som cencredit(i2)=cencredit(i2)+credit cendebet(i2)=cendebet (i2)+debet goto &905 &903 central(i2)=reken cenbed(i2)=som cencredit(i2)=credit cendebet(i2)=debet goto &905 &904 next i2 &905 credit=0 debet=0 return &1100 print=45:tabv(00),naam," V E R K O O P D A G B O E K ",tab(110),"Maand : ",drmaan print=45:tabv(01),gener(132,hto) print=45:tabv(01) lijntel=3 return &1200 blz=blz+1 print=45:tabv(01),tab(118),"Blz : ",(-3),blz print=45:tabv(01),"Datum",tab(10),"Naam klant",tab(32),"Fakt.",tab(41),"Debet",tab(52),"Kredit",tab(61),vertek(1),tab(69),vertek(2),tab(78),vertek(3),tab(87),vertek(4),tab(96),vertek(5),tab(105),"BTW.tot",tab(116),"Rek.",tab(125),"Bedrag" print=45:tabv(01),gener(132,hto) lijntel=lijntel+3 return &1300 print=45:atb(6) print=45:tabv(01),"Centralisatie van het verkoopdagboek Maand : ",drmaan," ",naam print=45:tabv(01),"ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"," DEBET KREDIT" lijntel=lijntel+2 return &1400 print=45:tabv(01),gener(132,hto) print=45:tabv(01),tab(25),"Totalen",tab(37),(-7.n2),somdeb(1),somdeb(2),somdeb(3),somdeb(4),somdeb(5),somdeb(6),somdeb(7),tab(104),somdeb(8),tab(121),somdeb(9) print=45:tabv(01),tab(25),"Kredit.",tab(37),(-7.n2),somcre(1),somcre(2),somcre(3),somcre(4),somcre(5),somcre(6),somcre(7),tab(104),somcre(8),tab(121),somcre(9) lijntel=lijntel+3 print=45:page lijntel=0 return eseg 0 end