Jump to content

Marking invoices as PAID


Recommended Posts

Firstly, I want to thank the PrestaShop team for making this amazing product available, for free!

I am wanting to be able to easily distinguish between invoices which are paid, and those which are still outstanding. Is there a way to mark invoices which have been paid with the word "PAID" in large letters somewhere on the PDF page?

I suspect it may be a matter of hacking the PDF invoice template, but I'd rather avoid this if possible. Does anyone have any suggestions as to how I can achieve this?

Link to comment
Share on other sites

I decided to hack the code, as I needed this functionality fairly urgently.

For the benefit of others, what I did was add the following block of code

           if (self::$order->hasBeenPaid())
           {
               $pdf->Ln(6);
               $pdf->Ln(7);
               $pdf->SetFont(self::fontname(), 'B', 20);
               $pdf->Cell(0, 0, 'PAID - Thank You', 0, 0, 'C'); 
           }



just before the line in the invoice() function in /classes/PDF.php which says:

           $pdf->TaxTab();




Note that due to the way the hasBeenPaid() function works, if an order has been marked as "Payment Accepted" at any point in time, even if you change the status back to "Awaiting payment" it will still show up as paid.

Link to comment
Share on other sites

I would personaly create an invoice after the order has been paid.

This so you do not have to create a credit note when an order falls thru.


I agree totally. Is this possible?


Yes.
Go to: Back Office >> Orders >> Order statuses
There you can change the statusmessage so they will not create an invoice until whatever status you choose.

I hope it is clear.
Link to comment
Share on other sites

Thanks for the comments guys. Where I'm based, the word "invoice" is usually associated with "you have to pay $x" rather than "thank you for paying $x". That's why companies typically mark invoices as "paid" when they have been paid, otherwise assume that they are still open and awaiting payment.

Link to comment
Share on other sites

  • 7 months later...

Yes, the invoice means (outstanding to be paid) until it is stamped (flagged as invoice paid)...
thanks for the solution wguser

The only problem is when you have a huge list of products, the "Paid-thank you" moves to page 2 (sometimes you see a full page 1 invoice without paid, then the paid-thank you is on its own on the second page.

any idea on how to make it as backgroud stamp.

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...