Index: KFA12.mac.rou =================================================================== diff -u -r762 -r1823 --- KFA12.mac.rou (.../KFA12.mac.rou) (revision 762) +++ KFA12.mac.rou (.../KFA12.mac.rou) (revision 1823) @@ -7,6 +7,10 @@ T4 ;\\\WERD VERWIJDERD\\\\\ T5 ;NAAM OF NUMMER VAN T6 ; [] = vervolg +T7 ;LEVERINGSADRES : +T8 ;.[] = manueel [] = andere klant als leveringsadres +T80 ;*[] = manueel via andere klant + ; 1 N FG,F7,F8 Set F7="$C(27),""(0""",F8="$C(27),""(B""" @@ -46,6 +50,15 @@ ; YZ Q ; +S0 S FP=2203+F60 W @F,@F1,$P($T(T7),";",2),!?2,$P($T(T8),";",2),!?2,$P($T(T80),";",2) +S0A S FP=2220+F60 W @F,@F0 R K S KCM=K I "*"'[K G S0Z:"-.,"[K&$L(K),S0:K'="" +S0B D E^cA612 S K=$$SELECT^KLANT6(),FP=2101 W @F,@F1 + G S0:'K S K=^KK1(K) + G S0B:K=KI1 S B(0)=^KKL(K,0) + I KCM'="*" S KCL=K,K=$P(B(0),D,1) + E S $P(B(1),D,2,9)=$P(B(0),D,2,9),$P(B(1),D,13,14)=$P(B(0),D,13,14),$P(B(1),D,15)=$P(^KKL(K,1),D,24),K="." +S0Z Q + ; S1 N K S K=$P($T(+1),U,2)_QN_" ",FP=203+$L(K) W @F61,@F11,@F1,@F,@F5 S FP=202 W @F,@F4,K,@F5 Q @@ -98,22 +111,50 @@ ; Ingave adrestype AdresType New AdresType,zb,R,U2,X - D E^cA612 - Set K=$P(B(1),D,12) - For Set AdresType=$$PI^vhPOPUP("C;C","-1O","","KLANT","ADRESTYPE",$S(K="":"L",1:K)) Quit:zb="CANC" Quit:$$CheckAdresTypes(AdresType) - Set K=$S(zb="CANC":"-",AdresType="L":"",1:AdresType) - D - .N FG,F7,F8 - .D O^cA612(1,1,24,80,0,0,0,0) - D S1,S2,S4 + If $G(K)'="-" Do + .D E^cA612 + .Set K=$P(B(1),D,12) + .For Set AdresType=$$PI^vhPOPUP("C;C","-1OA","","KLANT","ADRESTYPE",$S(K="":"L",1:K)),zb=$G(zb) Quit:zb="CANC" Quit:$$CheckAdresTypes(AdresType) + .Set K=$S(zb="CANC":"-",AdresType="L":"",1:AdresType) + .D + ..N FG,F7,F8 + ..D O^cA612(1,1,24,80,0,0,0,0) + .D S1,S2,S4 Quit ; ; Controle op ingave adrestype CheckAdresTypes(AdresType) New AdresTypeOk,LevAdr,KlKey Set AdresTypeOk=1,LevAdr="L",KlKey=^KK1(KC) - If AdresType="F" Do ; Verzendadres factuur + If AdresType="F"!(AdresType="B") Do ; Verzendadres factuur of Bezoekadres (mag niet dubbel) . For Set LevAdr=$O(^KKL(KlKey,LevAdr)) Quit:$E(LevAdr)'="L" If $P(^KKL(KlKey,LevAdr),D)'=$P(B(1),D) Set AdresTypeOk=($P(^KKL(KlKey,LevAdr),D,12)'=AdresType) Quit:'AdresTypeOk - . If 'AdresTypeOk Do WARN^vhTXTPOP("Er bestaat reeds een adres van~het type 'Verzendadres factuur'.","") + . If 'AdresTypeOk Do WARN^vhTXTPOP("Er bestaat reeds een adres van~het type '"_$P(^RES("KLANT","PI","ADRESTYPE","D",AdresType),"`",2)_"'.","") Quit AdresTypeOk - ; \ No newline at end of file + ; + ; Mag een popupitem getoond worden? +CBADRESTYPE(Item) + New Include + If '$D(^KKL(KI1,KI2)) Do ; Indien nieuw adres + . New R,KI2 + . Do:$P(Item,"`")="B" ; Er mag slechts een bezoekadres ingegeven worden + . . Set KI2="L" + . . For Set KI2=$O(^KKL(KI1,KI2)) Quit:$E(KI2)'="L" Do Quit:'Include + . . . Set R=^KKL(KI1,KI2),Include=$P(R,"\",12)'="B" + . Do:$P(Item,"`")="F" ; Er mag slechts een verzendadres factuur ingegeven worden + . . Set KI2="L" + . . For Set KI2=$O(^KKL(KI1,KI2)) Quit:$E(KI2)'="L" Do Quit:'Include + . . . Set R=^KKL(KI1,KI2),Include=$P(R,"\",12)'="F" + Quit $G(Include,1) + ; +AantalAdressen + New R,KLNr,LevCount,BezCount + Set KLNr=$P($G(B(1)),D,1) + If $L(KLNr),$D(^KK1(KLNr)) Do + . Set U3="L",(LevCount,BezCount)=0 + . For Set U3=$O(^KKL(^KK1(KLNr),U3)) Quit:$E(U3)'="L" Do + . . Set R=^KKL(^KK1(KLNr),U3) + . . If $P(R,D,12)="B" Set BezCount=BezCount+1 + . . Else Set LevCount=LevCount+1 + . Set U3="ja ("_LevCount_"/"_BezCount_")" + ; + \ No newline at end of file