MaterialScheduleAllowed: block( allowed = true, foreach(child, Hierarchy, allowed = allowed && (!child.attrExists("MaterialScheduleAllowed") || (child.MaterialScheduleAllowed && isNull(child.MaterialSchedule))) ), allowed ) RollupColors: if (__Parent__.MaterialScheduleAllowed, __Parent__.Hierarchy.filter(Active).join(MaterialRollup.Colors).vector(), vector(ref_type) ) RollupMaterials: if (__Parent__.MaterialScheduleAllowed, __Parent__.Hierarchy.filter(Active).join(MaterialRollup.Materials).vector(), vector(ref_type) ) RollupPhases: if (__Parent__.MaterialScheduleAllowed, __Parent__.Hierarchy.filter(Active).join(MaterialRollup.Phases).vector(), vector(ref_type) ) RollupStyles: if (__Parent__.MaterialScheduleAllowed, __Parent__.Hierarchy.filter(Active).join(MaterialRollup.Styles).vector(), vector(ref_type) ) RollupSuppliers: if (__Parent__.MaterialScheduleAllowed, __Parent__.Hierarchy.filter(Active).join(MaterialRollup.Suppliers).vector(), vector(ref_type) ) StyleRollupColors block ( boms = __Parent__.DataSheets.filter(attr("Node Type") == "ApparelBOM"), boms = boms.join(PhaseCurrentRevisions).filter(State!=enum("Revision.State:ABANDONED") && EnableMaterialSchedule), partmaterials = boms.join(Items), partmaterials = partmaterials.filter(attr("Node Type") == "PartMaterial" && isNull(Copy)), colors = vector(ref_type), foreach(partmaterial, partmaterials, if (partmaterial.UsedColors.isEmpty(), colors.add(dummy), colors.add(partmaterial.UsedColors) ) ), colors ) StyleRollupMaterials: block ( boms = __Parent__.DataSheets.filter(attr("Node Type") == "ApparelBOM"), boms = boms.join(PhaseCurrentRevisions).filter(State!=enum("Revision.State:ABANDONED") && EnableMaterialSchedule), partmaterials = boms.join(Items), partmaterials = partmaterials.filter(attr("Node Type") == "PartMaterial" && isNull(Copy)), materials = vector(ref_type), foreach(partmaterial, partmaterials, if (partmaterial.UsedColors.isEmpty(), materials.add(partmaterial.Actual), foreach(color, partmaterial.UsedColors, materials.add(partmaterial.Actual) ) ) ), materials ) StyleRollupPhases: block ( boms = __Parent__.DataSheets.filter(attr("Node Type") == "ApparelBOM"), boms = boms.join(PhaseCurrentRevisions).filter(State!=enum("Revision.State:ABANDONED") && EnableMaterialSchedule), phases = vector(ref_type), foreach(bom, boms, partmaterials = bom.Items, partmaterials = partmaterials.filter(attr("Node Type") == "PartMaterial" && isNull(Copy)), foreach(partmaterial, partmaterials, if (partmaterial.UsedColors.isEmpty(), phases.add(bom.Phase), foreach(color, partmaterial.UsedColors, phases.add(bom.Phase) ) ) ) ), phases ) StyleRollupStyles: block ( styles = vector(ref_type), foreach(color, Colors, styles.add(__Parent__) ), styles ) StyleRollupSuppliers: block ( suppliers = vector(ref_type), foreach(phase, Phases, suppliers.add( if(phase == ref("centric://REFLECTION/INSTANCE/_CS_Phase/Production"), __Parent__.Attributes.ProductionSupplier, __Parent__.Attributes.SampleSupplier ) ) ), suppliers ) PartMaterial.UsedColors set(CommonColor,ColorwaysColor,Variations.filter(UseColor).join(Color)) Collection Color CntApprovedColor: if (PhasedColor.attr("Node Type") == "ColorManaged", if (PhasedColor.Status.enumValue() == "Approved", 1, 0), if (CurrentRevision.State.enumValue() == "APPROVED", 1, 0) ) Collection Material CntApprovedMaterial if (__Parent__.Material.Managed, if (__Parent__.Material.Status.enumValue() == "Approved", 1, 0), if (__Parent__.CurrentRevision.State.enumValue() == "APPROVED", 1, 0) ) Collection Supplier CntApprovedColor: __Parent__.Materials.filter(ApprovalNeeded).sum(Attributes.CntApprovedColor) Collection Supplier CntColor: __Parent__.Materials.filter(ApprovalNeeded).sum(Attributes.CntColor) Collection Supplier CntApprovedMaterial __Parent__.Materials.filter(ApprovalNeeded).sum(Attributes.CntApprovedMaterial) Collection Supplier CntMaterial __Parent__.Materials.filter(ApprovalNeeded).size() Collection Color ColorHasColorways: Styles.sum(Hierarchy.CntColorway) > 0