@using CutList.Core @using CutList.Core.Nesting @using CutList.Core.Formatting @inject ReportService ReportService

CUT LIST

Date: @DateTime.Now.ToString("g")
Project: @Project.Name
@if (Project.Material != null) {
Material: @Project.Material.Shape - @Project.Material.Size
} @if (Project.CuttingTool != null) {
Cut Method: @Project.CuttingTool.Name (kerf: @Project.CuttingTool.KerfInches")
}
Stock Bars: @PackResult.Bins.Count
Total Pieces: @TotalPieces
@foreach (var (bin, index) in PackResult.Bins.Select((b, i) => (b, i + 1))) {

BAR #@index - Length: @ReportService.FormatLength(bin.Length)

@foreach (var group in ReportService.GroupItems(bin.Items)) { }
Qty Length Label
@group.Count @ReportService.FormatLength(group.Length) @group.Name
Remaining drop: @ReportService.FormatLength(bin.RemainingLength) (@((bin.Utilization * 100).ToString("F1"))% utilization)
} @if (!string.IsNullOrEmpty(Project.Notes)) {

Notes

@Project.Notes

}
@code { [Parameter, EditorRequired] public Project Project { get; set; } = null!; [Parameter, EditorRequired] public PackResult PackResult { get; set; } = null!; private int TotalPieces => PackResult.Bins.Sum(b => b.Items.Count); private double TotalMaterial => PackResult.Bins.Sum(b => b.Length); private double TotalUsed => PackResult.Bins.Sum(b => b.UsedLength); private double TotalWaste => PackResult.Bins.Sum(b => b.RemainingLength); private double Efficiency => TotalMaterial > 0 ? TotalUsed / TotalMaterial * 100 : 0; }