Answers.Body: <p>The best approach in recent versions of CiviCRM is to replace <code>$invoice_date</code> with</p>
  <pre><code>{contribution.receive_date|crmDate:&quot;Full&quot;}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-28T03:10:38.530Z
Answers.LastActivityDate: 2024-01-28T03:10:38.530Z
Answers.UserDisplayName: eileen
Answers.Body: <p>EDIT (petednz) - there is a newer solution in 2024 - see other answer</p>
  <p>I came accross the same issue. The invoice date gives the current date and that is in most cases not correct.</p>
  <p>We have used the receive date of the contribution in the invoice template as follows.</p>
  <pre><code>...
  {crmAPI var='contribution' entity='Contribution' action='getsingle' id=$id}
  ...
  {ts}Invoice Date:{/ts} {$contribution.receive_date|crmDate:$config-&gt;dateformatFull}
  ...
  </code></pre>
  <p>The top line with <code>{crmApi...}</code> could be present already in the template. So check whether you can find that line. The <code>{crmApi...}</code> line is not defined before the <code>{$contribution....}</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-26T14:04:56.660Z
Answers.Text: This would perhaps be the desired default behaviour for CiviCRM, i assume.
Answers.UserDisplayName: Richard van Oosterhout
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-19T04:49:03.527Z
Answers.Text: 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.
Answers.UserDisplayName: Jennifer Lee
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-06T04:16:25.737Z
Answers.Text: Is this still the way to do this? or is there something newer via https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#date
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-28T03:12:34.690Z
Answers.Text: There is a better way to do this now replace $invoice_date with
  
  {contribution.receive_date|crmDate:"Full"}
  
  - we will probably make that change in the template that ships with core https://lab.civicrm.org/dev/core/-/issues/4940
Answers.UserDisplayName: eileen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-11-02T08:28:56.593Z
Answers.LastActivityDate: 2024-01-28T22:58:54.087Z
Answers.LastEditDate: 2024-01-28T22:58:54.087Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>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.</p>
  
  <p>In the template, the line</p>
  
  <blockquote>
    <p>{ts}Invoice Date:{/ts} {$invoice_date}</p>
  </blockquote>
  
  <p>gives me the CURRENT date, not the date the invoice was issued.</p>
  
  <p>I have looked for other variables I could use, but I had no luck finding anything. </p>
  
  <p>Does anyone have a solution for this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-01T10:17:12.667Z
Comments.Text: To clarify: by invoice, you mean the receipt (email) or generated pdf?
Comments.UserDisplayName: Xavier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-01T11:14:37.410Z
Comments.Text: I mean the generated pdf that went through wkhtmltopdf
Comments.UserDisplayName: nwtnsqrd
Tags: <civicontribute><receipts><invoice>
Title: How do I print the "received date" on an invoice?
ThreadText: # How do I print the "received date" on an invoice?
  
  (Asked by: username_0 on 2017-11-01)
  
  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?
  
  **Tags:** civicontribute, receipts, invoice
  
  > **Comments:**
  > **username_1**: To clarify: by invoice, you mean the receipt (email) or generated pdf?  
  > **username_0**: I mean the generated pdf that went through wkhtmltopdf  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2017-11-02. Score: 5 | Accepted answer
  
  EDIT (username_6) - there is a newer solution in 2024 - see other answer
  
  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....}`
  
  > **Comments:**
  > **username_4**: This would perhaps be the desired default behaviour for CiviCRM, i assume.  
  > **username_5**: 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.  
  > **username_6**: Is this still the way to do this? or is there something newer via https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#date  
  > **username_2**: There is a better way to do this now replace $invoice_date with  {contribution.receive_date|crmDate:"Full"}  - we will probably make that change in the template that ships with core https://lab.civicrm.org/dev/core/-/issues/4940  
  
  ---
  
  ### Answer by username_2 on 2024-01-28. Score: 3
  
  The best approach in recent versions of CiviCRM is to replace `$invoice_date` with
  
  ```
  {contribution.receive_date|crmDate:"Full"}
  
  ```
  
  
  ---
  
  