Ordinal numbers on invoice items

Hi everyone,

First of all, the community here is awesome and I would love to say thank you!

I was wondering if there is a option to add Ordinal Numbers to items on invoices/offers.

[1.] Item name
[2.] Item name
And so on…

My invoices have more then 50 items on it, and when correcting them with my clients, its much easier to comment on them with a number. I believe you understand the trouble when there are more then 50 items on an invoice/offer.

Thank you very much!

Do you mean in the PDF files?

That would be great if you could export the PDF and there would be Ordinal Numbers added to the items.

You can add an ordered list < ol > and < li > tag (HTML) in PDF:

<ol>
<?php ...foreach ($items as $item) { ?>
            <tr> 
<td><li><b><? php echo nl2br(htmlsc($item->item_name)); ?></b></li> 

<?php } ?>
</ol>

(obviously all tags without the empty space in the tag)

I hope that helps.

1 Like

In your template there is a loop for all items.

Replace

foreach ($items as $item) {

with

$item_no = 0;
foreach ($items as $item) {
    $item_no++;

then place the number wherever you want for your item with <?php echo $item_no; ?>:

<td><?php echo $item_no; ?> <?php _htmlsc($item->item_name); ?></td>

Thank you guys so much! It worked.