Index: FLOWTOE3.mac.rou =================================================================== diff -u -r948 -r1079 --- FLOWTOE3.mac.rou (.../FLOWTOE3.mac.rou) (revision 948) +++ FLOWTOE3.mac.rou (.../FLOWTOE3.mac.rou) (revision 1079) @@ -557,11 +557,15 @@ . . If ( ProductieGroep="TBX" )||( ProductieGroep="KAD") Set SortKey = ProductieGroep // indien TBX of KAD opsplitsen.. . Else Set SortKey=$G(LastSortKey) . Set:'$L(SortKey) SortKey="0000" + . If 'PRNr,'$D(arSplit(SortKey)) Set arSplit("~~~~",TLNr)="" Quit ; Tekst eventueel op wacht zetten voor bij eerstvolgende productgroep + . Merge arSplit(SortKey)=arSplit("~~~~") Kill arSplit("~~~~") ; Wachtende lijnen toevoegen . Set arSplit(SortKey,TLNr)="" . Set LastSortKey = SortKey - Quit:$O(arSplit($O(arSplit(""))))="" // geen split nodig indien alles onder de zelfde sortkey valt + If $D(arSplit("~~~~")) Set SortKey=$O(arSplit("")) Merge arSplit(SortKey)=arSplit("~~~~") Kill arSplit("~~~~") ; Eventueel nog wachtende lijnen aan de eerste groep toevoegen + Quit:$O(arSplit($O(arSplit(""))))="" // geen split nodig indien alles onder de zelfde sortkey valt + Set SortKey=$O(arSplit("")) //eerste index blijft altijd op originele bon staan For Set SortKey=$O(arSplit(SortKey)) Quit:SortKey="" Do . Set NTOENr=$$GETNUM^FLOW("KTO","KTO1"),NTLNr(NTOENr)=""