#include Prod.Product INKORTBAAR ;Produkt creatie voor zaagsnedes GENERATE(Ref,GenPRNr,Params,FromPRNr) New %SC,%SelProd,sFL,IngekortPRNr,KLNr,LEVNr,Taal,KortTxt,PR,LT,Binnenmaat,OLProductInTeKorten,Factory,Product Set (GenPRNr,PR)=$G(GenPRNr),FromPRNr=$G(FromPRNr),Binnenmaat="" Set KLNr=Ref For Do Quit:'%SC Quit:$G(IngekortPRNr) . Do NIEUW^vhScherm("INKORTBAAR",,,,,,3) . If %SC Do . . Set OLProductInTeKorten = ##class(DOM.DomeinContext).Instance().GeefProductAPI().GeefProduct(FromPRNr) . . Set Factory = ##class(APPS.PM.Maatwerk.OLM.OrgaluxOpMaatFactory).%New() . . Set $ZTRAP="ErrorHandler^INKORTBAAR" . . Set KlantID = ##class(DOM.DomeinContext).Instance().GeefLegacyPartijAPI().GeefKlantPartijID(KLNr) . . Set Product = Factory.GeefOrgaluxOpMaat(OLProductInTeKorten, Binnenmaat, KlantID) . . Set $ZTRAP="" . . Set IngekortPRNr = Product.GeefPRNr() Quit $G(IngekortPRNr) ; Basisproduct selecteren FROMPRNR(FromPRNr) New R,X If '$G(FromPRNr) Do . Do STORE^vhTERMINA() . Set FromPRNr=$$SELECT^PRODUKT6("KL",837,,"Basisprodukt : ") . Do REFRESH^vhTERMINA() Quit FromPRNr ; ErrorHandler Set $ZTRAP="" New Exception,ProbleemOmschrijving Set Exception=##class(TECH.ExceptionHandler).Catch("APPS.PM.Maatwerk.OLM.OrgaluxOpMaatException") Set ProbleemOmschrijving=Exception.GeefOmschrijving() Do WARN^vhTXTPOP(ProbleemOmschrijving,"") Quit ;