Browse Source

Skipping empty POI for bill timberline poster

Kenric Nugteren 1 year ago
parent
commit
58fadae39e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      prs.shared/Posters/Timberline/BillTimberlinePoster.cs

+ 5 - 1
prs.shared/Posters/Timberline/BillTimberlinePoster.cs

@@ -475,8 +475,12 @@ public class BillTimberlinePoster : ITimberlinePoster<Bill, BillTimberlineSettin
 
                     if(allocations.TryGetValue(billLine.OrderItem.ID, out var poias))
                     {
+                        var remQty = poQty - poias.Sum(x => x.Quantity);
+                        if(remQty != 0.0)
+                        {
+                            lineData.Add(new(poItem.Job, poCost, poQty, poItem, remQty));
+                        }
                         lineData.AddRange(poias.Select(x => new LineData(x.Job, poCost, poQty, x, x.Quantity)));
-                        lineData.Add(new(poItem.Job, poCost, poQty, poItem, poQty - poias.Sum(x => x.Quantity)));
                     }
 
                     foreach(var line in lineData)