Page 1 of 1

Add line numbers to invoice

Posted: Fri Oct 01, 2010 12:07 am
by Jaz
How can I add line numbers to the invoice.

Re: Add line numbers to invoice

Posted: Fri Oct 01, 2010 6:28 am
by plugables
Not sure what you mean... line numbers to the invoice?

Re: Add line numbers to invoice

Posted: Wed Nov 03, 2010 7:38 pm
by Jaz
Similar to most invoices. For example

right no you have:

HDTV - $100
DVD player -$50

I want

1 HDTV - $100
2 DVD Player - $50


This way I have a way to refer to the items on the invoice by line number.

Re: Add line numbers to invoice

Posted: Thu Nov 04, 2010 6:56 am
by s_ismail
For adding line no you need to customize ConLib/ReceiptPage.ascx control.
Locate this code in ReceiptPage.ascx

Code: Select all

 <asp:GridView ID="ShipmentItemsGrid" runat="server" Width="100%" AutoGenerateColumns="false"
                        DataSource='<%# OrderHelper.GetShipmentItems(Container.DataItem) %>' GridLines="none"
                        SkinID="ItemList" OnDataBinding="ItemsGrid_DataBinding">
                        <Columns>
and replace with this code

Code: Select all

  <asp:GridView ID="ShipmentItemsGrid" runat="server" Width="100%" AutoGenerateColumns="false"
                        DataSource='<%# OrderHelper.GetShipmentItems(Container.DataItem) %>' GridLines="none"
                        SkinID="ItemList" OnDataBinding="ItemsGrid_DataBinding">
                        <Columns>
                            <asp:TemplateField HeaderText="No">
                                <HeaderStyle Width="50" HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="center" />
                                <ItemTemplate>
                                    <asp:Label ID="No" runat="server" Text='<%# GetCounter().ToString()  %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
Now go ReceiptPage.ascx.cs and add this code at the end

Code: Select all

 int i = 1;
    public int GetCounter()
    {   
        return i++;
    }