Index: AXimpl/PM/SchaduwPrijs/CalculateAll.cls.xml =================================================================== diff -u -r70992 -r71135 --- AXimpl/PM/SchaduwPrijs/CalculateAll.cls.xml (.../CalculateAll.cls.xml) (revision 70992) +++ AXimpl/PM/SchaduwPrijs/CalculateAll.cls.xml (.../CalculateAll.cls.xml) (revision 71135) @@ -33,6 +33,12 @@ 0 + +%Integer +10000000 +1 + + D ##class(AXimpl.PM.SchaduwPrijs.CalculateAll).%New().VerwerkEenMaand() @@ -162,10 +168,11 @@ -D ##class(AXimpl.PM.SchaduwPrijs.CalculateAll).VerwijderAlles() D ##class(AXimpl.PM.SchaduwPrijs.CalculateAll).%New().VerwerkEenMaandTAOR() D ##class(AXimpl.PM.SchaduwPrijs.CalculateAll).%New().VerwerkTAOR() @@ -213,14 +224,17 @@ #dim RecID as %String #dim PRNr as %String #dim GenTyp as %String + #dim IsTaor As %Boolean = $$$False + #dim IsNotLosseComponenten As %Boolean = $$$False + #dim QuitCount As %Integer = 0 Set Count=1 #dim ProductTypeAPI As DOM.PM.ProductTypeAPI = ##class(DOM.DomeinContext).Instance().GeefProductTypeAPI() #dim ProductAPI As DOM.PM.ProductAPI = ##class(DOM.DomeinContext).Instance().GeefProductAPI() Set BerekeningServiceProduct = ##class(APPS.PM.Maatwerk.impl.BerekeningServiceProduct).%New() Set VerkoopAPI = ##class(DOM.VKP.impl.VerkoopAPI).%New() Set DotNetMaatwerkService = ##class(WSimpl.PM.Maatwerk.MaatwerkService.DotNet.GeefMaatwerkDetails).%New() Set MaatwerkDetailsConvertor = ##class(WSimpl.PM.Maatwerk.MaatwerkService.DotNet.MaatwerkDetailsFromJsonNaarDomConverter).%New() - + While ..itProduct.HasNext() { Set rs=..itProduct.Next() @@ -231,41 +245,57 @@ try { If (ProductAPI.BestaatProduct(PRNr)) { - If ($$$Not(PRNr = "") && (ProductTypeAPI.IsTAORboxProduct(PRNr)) && $$$Not($Get(^PRBS("BSS",PRNr)) = "")) { - #dim Klnr As %String = "K||4682" - If (VerkoopAPI.BestaatKlant("K||"_+rs.Data("KlantNr"))) { - Set Klnr = "K||"_+rs.Data("KlantNr") - } + If ($$$Not(PRNr = "") && (ProductTypeAPI.IsTAORboxProduct(PRNr))) { + Set IsNotLosseComponenten = $$$Not(ProductTypeAPI.IsTaxLosseComponentenProduct(PRNr)) - #Dim Product As DOM.PM.impl.MaatwerkProductImpl = ProductAPI.GeefProduct(PRNr) - Set ProductData = ##class(DOM.PM.dto.ProductData).%New() - Set ProductData.PRNr = PRNr - Set ProductData.DossierNummer = Product.GeefDossierCode() + If IsNotLosseComponenten { + // LosseComponenten kunnen met oudere creatiedatum voorkomen. Om te weten wat het KleinstePRNr is, nodig voor querry in zTryout.THB.BOMBOL.TAOR.VergelijkCacheDotnet, + // moet je ze in deze If tijdelijk uitsluiten. Tenzij ^THBTaorPriceDiff gebruikt wordt, dan is dit irrelevant. + Set IsTaor = $$$True + Set QuitCount = QuitCount + 1 + #dim Klnr As %String = "K||4682" + If (VerkoopAPI.BestaatKlant("K||"_+rs.Data("KlantNr"))) { + Set Klnr = "K||"_+rs.Data("KlantNr") + } + + #Dim Product As DOM.PM.impl.MaatwerkProductImpl = ProductAPI.GeefProduct(PRNr) + Set ProductData = ##class(DOM.PM.dto.ProductData).%New() + Set ProductData.PRNr = PRNr + Set ProductData.DossierNummer = Product.GeefDossierCode() - #dim ProductSpecificatie As DOM.PM.Maatwerk.Calc.Common.ProductSpecificatie = Product.GeefProductSpecificatie() - #dim IngegevenKenmerken As DOM.PM.Maatwerk.Calc.Common.impl.TBXKenmerken = ProductSpecificatie.GeefIngegevenKenmerken() + #dim ProductSpecificatie As DOM.PM.Maatwerk.Calc.Common.ProductSpecificatie = Product.GeefProductSpecificatie() + #dim IngegevenKenmerken As DOM.PM.Maatwerk.Calc.Common.impl.TAORKenmerken = ProductSpecificatie.GeefIngegevenKenmerken() - If (IngegevenKenmerken.LadeVariant = ##class(DOM.PM.enu.Variant).Taorbox()) { - ;&& $$$Not(##class(TECH.StringUtils).Equals(PRNr, "1206479")) //Product met opvullijst LG + If (IngegevenKenmerken.GeefVariant() = ##class(DOM.PM.enu.Variant).Taorbox()) { + Set ^THBTaorPriceDiff(+PRNr) = PRNr + Kill ^PRBS("BSS",PRNr) + If (PRNr < ..KleinstePRNr) Set ..KleinstePRNr = PRNr - #dim BerekeningsSpecificatie As DOM.PM.Maatwerk.Calc.Common.BerekeningsSpecificatie = ..GeefBerekeningsSpecificatie(Klnr, 1) - #dim HalffabItemsBoom As DOM.PM.Maatwerk.Calc.HF.HalffabItemsBoom - #dim KostItem As DOM.PM.Maatwerk.Calc.Kost.SamengesteldKostItem + #dim BerekeningsSpecificatie As DOM.PM.Maatwerk.Calc.Common.BerekeningsSpecificatie = ..GeefBerekeningsSpecificatie(Klnr, 1) + #dim HalffabItemsBoom As DOM.PM.Maatwerk.Calc.HF.HalffabItemsBoom + #dim KostItem As DOM.PM.Maatwerk.Calc.Kost.SamengesteldKostItem - #dim MaatwerkDetails As APPS.PM.Maatwerk.dto.DotNet.MaatwerkDetailsParsedFromJson = DotNetMaatwerkService.GeefMaatwerkDetails(IngegevenKenmerken, Klnr, 1, ProductData) - Set HalffabItemsBoom = MaatwerkDetailsConvertor.GeefHalffabItemsBoom(MaatwerkDetails) - Set KostItem = MaatwerkDetailsConvertor.GeefKostItems(MaatwerkDetails) + #dim MaatwerkDetails As APPS.PM.Maatwerk.dto.DotNet.MaatwerkDetailsParsedFromJson = DotNetMaatwerkService.GeefMaatwerkDetails(IngegevenKenmerken, Klnr, 0, ProductData,,##class(DOM.PM.Maatwerk.Calc.Common.enu.BerekeningWijze).PrijsBerekening()) + Set HalffabItemsBoom = MaatwerkDetailsConvertor.GeefHalffabItemsBoom(MaatwerkDetails) + ;Do $System.OBJ.Dump(HalffabItemsBoom) + Set KostItem = MaatwerkDetailsConvertor.GeefKostItems(MaatwerkDetails) - Set BouwsteenCreator = ##class(DOM.PM.impl.DataM.DataMBouwsteenCreator).%New() - Do BouwsteenCreator.Init(PRNr, ProductSpecificatie, BerekeningsSpecificatie, HalffabItemsBoom, KostItem, $$$True) + Set BouwsteenCreator = ##class(DOM.PM.impl.DataM.DataMBouwsteenCreator).%New() + Do BouwsteenCreator.Init(PRNr, ProductSpecificatie, BerekeningsSpecificatie, HalffabItemsBoom, KostItem, $$$True) + } } } } } catch { Do ##class(Tools.Wlip).%New(191).String("SchaduwPrijs-berekening voor TAOR gefaald, want in de catch terechtgekomen!") } - Do ..ConverteerOne(ProductID, PRNr, ItemID, ConfigID) Set Count=Count+1 Write:-..Debug&(Count#1000=0) !,"Aantal: ",Count," Tijd (in min): ",$$DIFFTIME^vhLib.DataTypes(StartTijd,$H,"M") + + If (IsTaor) { + Write !, "Product: '"_PRNr_"' en AX-ProductID: '"_ProductID_"' en Klant: '"_Klnr_"' en IsNotLosseComponenten: '"_IsNotLosseComponenten_"'" + ;Quit:(QuitCount = 1) + } + Set IsTaor = $$$False } ]]>