Hello @janbong
If you set the the prefix with the placeholders for year and month correctly, the number can be reset with this code snippet:
do_action( 'wpo_wcpdf_before_sequential_number_increment', 'wpo_wcpdf_reset_invoice_number_monthly', 10, 3 );
function wpo_wcpdf_reset_invoice_number_monthly( $number_store, $order_id, $date ) {
$current_month = date('n');
$last_number_month = $number_store->get_last_date('n');
// check if we need to reset
if ( $current_month != $last_number_month ) {
$number_store->set_next( 1 );
}
}
Hi there,
Thanks. Let us try on the following month and see if it will reset.
Hi @alexmigf
I’m looking for similar functionality “Reset invoice number annually”.
Is the code snippet above future-proof?
Thanks
Hello @phirefly
Annually is already an option inside de plugin, under PDF Invoices > Documents > Invoice:

-
This reply was modified 5 years, 11 months ago by
alexmigf.
Apologies @alexmigf ; typo – I meant monthly. #Doh!
I’m looking for similar functionality “Reset invoice number monthly”.
Is the code snippet above future-proof?
Thanks
Thanks @alexmigf – good to know that is still working.