Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @voytekd,

    We can certainly write a code snippet to do it as part of our premium support. If you’re interested, please write to [email protected]

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi again @voytekd,

    I received authorization to share the code snippet for free, so here it is:

    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

    Enjoy! ??

    Thread Starter voytekd

    (@voytekd)

    Oh!
    Thank you very much!
    I started working on it myself but that probably would do no good. ??

    so thanks again!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m happy to help!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Reset invoice number monthly’ is closed to new replies.