Index: FLOWTOE6.mac.rou =================================================================== diff -u -r1024 -r1134 --- FLOWTOE6.mac.rou (.../FLOWTOE6.mac.rou) (revision 1024) +++ FLOWTOE6.mac.rou (.../FLOWTOE6.mac.rou) (revision 1134) @@ -192,12 +192,12 @@ Quit ; ; Afsplitsen van een aantal van een toeleveringslijn via het uniek lijnnummer - ; Het aantal is het aantal wat in in de originele lijn moet blijven + ; Het aantal is het aantal dat in de opgesplitste lijn komt SplitsLijn(TOENr,TLUNr,Aantal) New LEVNr,ReturnLocal,TLNr,NewTLNr,NewTLUNr Set LEVNr=$P(^KTO1(TOENr),D),TLNr=^TO("IU",TOENr,TLUNr) Set AantalInOrigineel = $P(^KTO(LEVNr,TOENr,TLNr),D,3) - If (Aantal '< AantalInOrigineel) + If (Aantal > AantalInOrigineel) { Set Exceptie = ##class(TECH.Exceptions.BaseException).%New(##class(TECH.enu.ExceptionCode).InvalidInput(),"Aantal is groter dan het aantal in de lijn") Do ##class(TECH.ExceptionHandler).Throw(Exceptie) @@ -207,7 +207,6 @@ Set Exceptie = ##class(TECH.Exceptions.BaseException).%New(##class(TECH.enu.ExceptionCode).InvalidInput(),"De lijn is kan niet meer opgedeeld worden") Do ##class(TECH.ExceptionHandler).Throw(Exceptie) } - Set Aantal=AantalInOrigineel-Aantal ; Aantal bepalen wat in de originele lijn moet blijven omdat SPLITTLN omgekeerd werkt Do SPLITTLN(LEVNr,TOENr,TLNr,Aantal,,.ReturnLocal) Set NewTLNr=$G(ReturnLocal("NewTLNr")) Set:NewTLNr NewTLUNr=$P(^KTO(LEVNr,TOENr,NewTLNr),D,15)