Bullet List of Kit Components on Invoice, Pack List, etc.
Posted: Fri Oct 29, 2010 4:05 pm
Right now I am focused on the Packing List, but I likely will need to pursue this on Invoices and maybe some other things.
Bottom line is that I want to list the Kits and the components on the packing list with the Kit Master left justified (no bullet) and the items that make up the kit (the components) with a bullet.
I know how to show this in an email. My order confirmation email has the code for this:
But I am not smart enough to know how to do this in the PackingList.
I can see the .aspx code is:
And I think the .cs code is currently:
Can someone help me figure out how to get bullets on the selected items (same logic as the email NVelocity above)?
Bottom line is that I want to list the Kits and the components on the packing list with the Kit Master left justified (no bullet) and the items that make up the kit (the components) with a bullet.
I know how to show this in an email. My order confirmation email has the code for this:
Code: Select all
#if ( ($orderItem.ParentItemId == $MasterID))
<li>$orderItem.Sku</li>
#elseif($orderItem.Product.KitStatus == "Master")
#set ($MasterID = ($orderItem.OrderItemId))
$orderItem.Sku
#elseif($orderItem.Product.KitStatus == "None")
$orderItem.Sku
#else
$orderItem.Sku
#end
I can see the .aspx code is:
Code: Select all
<tr>
<td colspan="3" class="dataSheet">
<asp:GridView ID="ShipmentItems" runat="server" ShowHeader="true"
AutoGenerateColumns="false" CellPadding=0 CellSpacing=0 GridLines="none"
Width="100%" DataSource='<%#GetProducts(Container.DataItem)%>' CssClass="dataSheet">
<Columns>
<asp:BoundField DataField="Quantity" HeaderText="Quantity" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Sku" HeaderText="Sku" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Item">
<ItemTemplate>
<uc:OrderItemDetail ID="OrderItemDetail1" runat="server" OrderItem='<%#(OrderItem)Container.DataItem%>' ShowAssets="False" LinkProducts="False" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
Code: Select all
protected OrderItemCollection GetProducts(object dataItem)
{
OrderShipment shipment = (OrderShipment)dataItem;
Order order = shipment.Order;
OrderItemCollection products = new OrderItemCollection();
foreach (OrderItem item in order.Items)
{
if ((item.OrderItemType == OrderItemType.Product) && (item.OrderShipmentId == shipment.OrderShipmentId))
{
products.Add(item);
}
}
products.Sort(new OrderItemComparer());
return products;
}