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?

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

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....}

  • This would perhaps be the desired default behaviour for CiviCRM, i assume. Feb 26 '19 at 14:04
  • Thank you so much! You have no idea how grateful I am! This helped my question on how to add new items in my invoice, like check_number and payment_instrument. Mar 19 '19 at 4:49

Hold Tab five seconds, Press F11 CTRL P Space bar twice. Remove touch and display by restarting and press F5 after done.. Actualy do this. Twice or delet current past note.s invoices


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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