Title: Invoice Data
Last modified: August 22, 2016

---

# Invoice Data

 *  Resolved [andrearinaldi82](https://wordpress.org/support/users/andrearinaldi82/)
 * (@andrearinaldi82)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/invoice-data/)
 * HI,
    how can bring in the bill, as well as the date of the order, the date of
   the invoice? Alternatively, for legal purposes just the date of the order? Thank
   you!
 * [https://wordpress.org/plugins/woocommerce-delivery-notes/](https://wordpress.org/plugins/woocommerce-delivery-notes/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [andrearinaldi82](https://wordpress.org/support/users/andrearinaldi82/)
 * (@andrearinaldi82)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248686)
 * I need to insert the date of invoice in the invoice. Can you help?
 *  [piffpaffpuff](https://wordpress.org/support/users/chabis/)
 * (@chabis)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248713)
 *     ```
       function print_order_add_invoice_date( $fields, $order ) {
       	$new_fields = array();
   
       	$order_invoice_date = wcdn_get_order_invoice_date( $order->id );
       	if( $order_invoice_date ) {
       		$new_fields['order_invoice_date'] = array(
       			'label' => __( 'Invoice Date' ),
       			'value' => $order_invoice_date
       		);
       	}
   
       	return array_merge( $fields, $new_fields );
       }
       add_filter( 'wcdn_order_info_fields', 'print_order_add_invoice_date', 10, 2 );
       ```
   
 *  [WPJG](https://wordpress.org/support/users/wpjg/)
 * (@wpjg)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248731)
 * Could you please specify in what file and where exactly this code needs to be
   added? – Thanks for your help
 *  [piffpaffpuff](https://wordpress.org/support/users/chabis/)
 * (@chabis)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248732)
 * As always: functions.php
 *  [pabeti](https://wordpress.org/support/users/pabeti/)
 * (@pabeti)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248735)
 * Unfortunatly this shows the “Invoice Date” on both the order slip and the invoice
   slip. It only should show on the invoice.
 *  [piffpaffpuff](https://wordpress.org/support/users/chabis/)
 * (@chabis)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248736)
 * use the wcdn_get_template_type() to check the type of template.
 *     ```
       function print_order_add_invoice_date( $fields, $order ) {
       $new_fields = array();
   
       if( wcdn_get_template_type() == 'invoice' ) {
       	$order_invoice_date = wcdn_get_order_invoice_date( $order->id );
       	if( $order_invoice_date ) {
       		$new_fields['order_invoice_date'] = array(
       			'label' => __( 'Invoice Date' ),
       			'value' => $order_invoice_date
       		);
       	}
       }
   
       return array_merge( $fields, $new_fields );
       }
       add_filter( 'wcdn_order_info_fields', 'print_order_add_invoice_date', 10, 2 );
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Invoice Data’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-delivery-notes/assets/icon-256x256.jpg?rev=2829362)
 * [Print Invoice & Delivery Notes for WooCommerce](https://wordpress.org/plugins/woocommerce-delivery-notes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-delivery-notes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-delivery-notes/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-delivery-notes/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [piffpaffpuff](https://wordpress.org/support/users/chabis/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/invoice-data/#post-5248736)
 * Status: resolved