• Resolved fumupooh

    (@fumupooh)


    Hello.

    I’d like to make a PDF invoice but the invoice date and the order date are different.
    I want to set the ORDER date for invoice date as well (this time, 20/07/2020.)

    How can I solve it?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @fumupooh

    You want to have the same date for the order and invoice is that?

    Let me know.

    Thread Starter fumupooh

    (@fumupooh)

    Hi thank you for the replying!

    Yes I’d like to have the same date on the invoice and order dates, but not only this time, there are several invoices which has different date.
    So I want to fix all dates and dates’ setting for future.

    Best,
    Fumi

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @fumupooh

    To replace the order date with the invoice date you could use the code snippet below:

    add_filter( 'wpo_wcpdf_order_date', 'wpo_wcpdf_use_invoice_date', 10, 3 );
    function wpo_wcpdf_use_invoice_date( $date, $mysql_date, $document )
    {
    	if( empty($document) ) return $date;
    	return date(wc_date_format(), strtotime($document->get_date()));
    }

    If you never used actions/filters please read our documentation page: How to use filters

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @fumupooh

    I forgot that we have a setting for that too under WooCommerce > PDF Invoices > Documents > Invoice > Display invoice date:

    Captura-de-ecr-de-2020-08-25-09-07-10

    Thread Starter fumupooh

    (@fumupooh)

    Hello @alexmigf : )

    I forgot that we have a setting for that too under WooCommerce > PDF Invoices > Documents > Invoice > Display invoice date:
    I’d already tried it but it didn’t work.

    Also, I put the snippet you gave me on a plugin, “Code Snippets”, but nothing happened.

    So could you give me more tip? : (
    Thanks!

    • This reply was modified 4 years, 3 months ago by fumupooh. Reason: I forget to write the end
    Plugin Contributor Ewout

    (@pomegranate)

    changing that setting only affects new invoices, not existing ones.
    Did you check this with a new invoice?

    You can edit existing dates directly in the order details by clicking the edit button in the “PDF Invoice Data” panel.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can I fix the invoice date?’ is closed to new replies.