Plugin Contributor
Ewout
(@pomegranate)
It is currently not possible to edit the invoice date, I will look into adding this to the next version!
Any work around possible? Would editing the invoice date with phpMyAdmin work? (just as a quick hack in case I need it urgently) Or are there any side effects to be expected by changing the date directly in the db?
Anyway, can’t wait for the upcoming version 🙂
I mean if the invoice date is persisted in a field within the mysql db somehow… If the pdf simple prints the current date-of-today, then mangling with the db would not help. How does it work currently? Any possiblility for a workaround?
Ok, I found a workaround I can live with until editable invoice dates are implemented. I simply use the order date as invoice date like:
in invoice.php of Modern:
// set $display date & label to user setting
if ( $date_setting == 'invoice_date' ) {
$display_date = $wpo_wcpdf->get_invoice_date();
$display_date_label = __( 'Invoice Date:', 'wpo_wcpdf' );
} else {
$display_date = $wpo_wcpdf->get_order_date();
// FIXME workaround: Use editable Bestelldatum for Rechnungsdatum
// $display_date_label = __( 'Order Date:', 'wpo_wcpdf' );
$display_date_label = __( 'Invoice Date:', 'wpo_wcpdf' );
}
and in packing-slip.php:
<table class="invoice-info">
<tr>
<td><?php _e( 'Order Number:', 'wpo_wcpdf' ); ?></td>
<td><?php $wpo_wcpdf->order_number(); ?></td>
</tr>
<tr>
<!-- FIXME workaround: Use editable Bestelldatum for Rechnungsdatum -->
<!-- <td><?php _e( 'Order Date:', 'wpo_wcpdf' ); ?></td> -->
<td><?php _e( 'Invoice Date:', 'wpo_wcpdf' ); ?></td>
<td><?php echo $wpo_wcpdf->get_order_date(); ?></td>
</tr>
</table>
BTW, in packing-slip.php you are not using get_invoice_date() method like in invoice.php but retrieve the date from mysql directly. I think you should refactor this.
<td><?php echo date_i18n( 'j-n-Y', strtotime( $wpo_wcpdf->export->order->order_date )); ?></td>
Plugin Contributor
Ewout
(@pomegranate)
editable invoice dates are now implemented in the development version and will be included in the next release – although it’s also perfectly safe to edit the date in the mysql database! (it’s only used by this plugin anyway).