Title: Reset Invoice Number Monthly
Last modified: August 2, 2017

---

# Reset Invoice Number Monthly

 *  Resolved [jdaldana](https://wordpress.org/support/users/jdaldana/)
 * (@jdaldana)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/reset-invoice-monthly/)
 * Hi,
 * This plug-in is working fine for us right now and its great!
 * I see an option to toggle “Reset invoice number yearly” but I would like to know
   if there’s an option to reset the invoice monthly? That way we can track how 
   many invoices/sales we generate each month in an easier way.
 * I also tried adding prefixes and suffixes but it doesn’t seem to be working. 
   I added a padding number (4) as well but the invoice number (i.e., 27) did not
   change to 0027.
 * Any suggestions/comments/help is appreciated.
    Thanks in advance!
    -  This topic was modified 8 years, 9 months ago by [jdaldana](https://wordpress.org/support/users/jdaldana/).
      Reason: Updated title; added some questions

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/reset-invoice-monthly/#post-9377314)
 * Hi! Answering your last question first:
    The prefix and suffix settings only 
   apply to new orders, if you have already created an invoice and want to reformat
   the number, you have to ‘edit’ the invoice number in the order details – not 
   actually change anything, just click the edit button and save the order. That
   way the formatted invoice number will get updated.
 * There is currently no built in way to reset the invoice number monthly, unfortunately.
 * Let me know if you have any other questions!
 * Ewout
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/reset-invoice-monthly/#post-9748020)
 * For anyone else looking to reset the invoice number monthly, with the latest 
   version this is possible with the following 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 );
           }
       }
       ```
   
 * If you haven’t worked with code snippets (actions/filters) or functions.php before,
   read this guide: [How to use filters](https://docs.wpovernight.com/general/how-to-use-filters/)
 * Hope that helps!
    Ewout
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/reset-invoice-monthly/#post-10058453)
 * We found there’s a small error with the above code (using `do_action` instead
   of `add_action`), the correct filter is:
 *     ```
       add_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 );
           }
       }
       ```
   

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

The topic ‘Reset Invoice Number Monthly’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [prefix](https://wordpress.org/support/topic-tag/prefix/)
 * [suffix](https://wordpress.org/support/topic-tag/suffix/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/reset-invoice-monthly/#post-10058453)
 * Status: resolved