Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

basosneo's avatar

PDF

Hi friends I am trying to put the 'current date' and an 'id' to the invoice that is in 'dompdf', but I still do not know how it can be done, do you have any ideas?

Taking into account that I do not have any of those data registered in my database.

So far I've been testing with 'inputs' 'type:date', but they do not come out in the 'pdf stream'

0 likes
5 replies
basosneo's avatar

The truth is that I have it solved almost everything, I just want my id to increase every time I want to see a different invoice, is that possible?

myid

  <input type="text" name="id_factura" value="#0001" size="2">
vipin93's avatar

u can use invoice Id if u saved invoice details in database or u can use str_random

basosneo's avatar
basosneo
OP
Best Answer
Level 1

hey friends! I have a problem with the total bill; The problem comes when I try to add a cost of 9.99 shipment to a hundred items invoice:

 Total: €{{ number_format($item->price * $item->quantity,2)+9.99}}

When I give it to show in the pdf I get a total of ten. How can I change it so that I can not generate this error?

edit: Fix it like that

  Total: €{{ number_format($item->price * $item->quantity+9.99,2)  }}

Please or to participate in this conversation.