3

I have an urgent problem with invoices. For our finance department, I have to print out all invoices we generated this year. On the invoice, it HAS to display the date the invoice was issued, but instead it displays the date that I print the invoice.

In the template, the line

{ts}Invoice Date:{/ts} {$invoice_date}

gives me the CURRENT date, not the date the invoice was issued.

I have looked for other variables I could use, but I had no luck finding anything.

Does anyone have a solution for this?

2
  • To clarify: by invoice, you mean the receipt (email) or generated pdf?
    – Xavier
    Nov 1, 2017 at 10:17
  • I mean the generated pdf that went through wkhtmltopdf
    – nwtnsqrd
    Nov 1, 2017 at 11:14

1 Answer 1

8

I came accross the same issue. The invoice date gives the current date and that is in most cases not correct.

We have used the receive date of the contribution in the invoice template as follows.

...
{crmAPI var='contribution' entity='Contribution' action='getsingle' id=$id}
...
{ts}Invoice Date:{/ts} {$contribution.receive_date|crmDate:$config->dateformatFull}
...

The top line with {crmApi...} could be present already in the template. So check whether you can find that line. The {crmApi...} line is not defined before the {$contribution....}

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.