VERPAK ; Verpakking [ 05/13/2002 11:18 AM ] ; SAVE(KLNr,Type,Rec) New Next Set Next=$O(^VERPAK(KLNr,Type,""),-1)+1,^VERPAK(KLNr,Type,Next)=Rec Quit ; TYPE(Type,Beperk) New zb,K Set Type=$G(Type),Beperk=$G(Beperk) Set K=$$PI^vhPOPUP("C;C","-DOZM1","Verpakking","VERPAK","TYPE",Type) If zb="CANC" Set K="-" Else Set Type=K Quit Type ; CBSTYPE(Select,Old,New,Rec) New I,Types,Type,Ok Set (Types,Type)="",Ok='$P(Rec,"`",6) If Ok,'Old,New Do .Set Types="" .For I=1:1:sY If $D(sX(I)),I'=Select Set Types=Types_";"_$P(sY(I),"`") .Set $E(Types)="",Type=$P(Rec,"`") .Set Ok=$$CHKMIX(Types,Type) Quit Ok ; CBITYPE(Rec) New Insert Set Insert=1 Xecute:$L($P(Rec,"`",5)) "Set Insert="_$P(Rec,"`",5) Quit Insert ; ADDTYPE(Types,Type) New I,R,Sort,SortKey Set Types=$G(Types),Type=$G(Type) If $L(Type,";")=1 Do .Quit:'$$CHKMIX(Types,Type) .Set Types=$$REMTYPE(Types,Type),Types=Types_";"_Type .For I=1:1:$L(Types,";") Do ..Set Type=$P(Types,";",I) ..Quit:Type="" ..Set R=$G(^RES("VERPAK","PI","TYPE","D",Type)) ..Quit:R="" ..Set SortKey=$P(R,"`"),Sort(SortKey)=Type .Set (Types,SortKey)="" .For Set SortKey=$O(Sort(SortKey)) Quit:SortKey="" Set Types=Types_";"_Sort(SortKey) .Set $E(Types)="" Else For I=1:1:$L(Type,";") Set Types=$$ADDTYPE(Types,$P(Type,";",I)) Quit Types ; REMTYPE(Types,Type) Set Types=";"_Types_";",Type=";"_Type_";" Set:Types[Type Types=$P(Types,Type)_";"_$P(Types,Type,2) Set:$E(Types)=";" $E(Types)="" Set:$E(Types,$L(Types))=";" $E(Types,$L(Types))="" Quit Types ; CHKMIX(Types,Type) New ChkMix Set Types=$G(Types),Type=$G(Type),ChkMix=1 If $L(Types),$L(Type) Do .Set Type=";"_Type_";" .For Do Quit:'ChkMix Quit:Types="" ..Set InConfl=";"_$P(^RES("VERPAK","PI","TYPE","D",$P(Types,";")),"`",3)_";" ..Set Types=$P(Types,";",2,99),ChkMix=InConfl'[Type Quit ChkMix ; KLANT(KLNr) Quit $P(^KKL(^KK1(KLNr),2),D,18) ; ORDER(ORDNr) New KLNr Set KLNr=$P(^KO1(ORDNr,"F"),D) Quit $P(^KOD(KLNr,"F",ORDNr,1),D,30) ; BON(BONNr) New KLNr Set KLNr=$P(^KU1(BONNr,"F"),D) Quit $P(^KUL(KLNr,"F",BONNr,1),D,30) ;