• Resolved Y2Jacky

    (@y2jacky)


    Hello,

    There is only an option to reset Invoice Numbers on a Yearly basis.

    May I know how I am able to reset Invoice Number on a daily basis? Our invoice number format include current date so it makes sense to start from 01 each day.

    I came across the following page for configuring to reset monthly:
    https://www.ads-software.com/support/topic/reset-invoice-monthly/

    Is there also a way to make it for Daily?

    Please advise.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Y2Jacky

    (@y2jacky)

    I am thinking to modify the reset-invoice-monthly code with the following code:

    add_action( 'wpo_wcpdf_before_sequential_number_increment', 'wpo_wcpdf_reset_invoice_number_daily', 10, 3 );
    function wpo_wcpdf_reset_invoice_number_daily( $number_store, $order_id, $date ) {
        $current_day = date('j');
        $last_number_day = $number_store->get_last_date('j');
        // check if we need to reset
        if ( $current_day != $last_number_day ) {
            $number_store->set_next( 1 );
        }
    }

    I believe this will work but I am not very confident to push this into Production…

    Can anyone advise me?

    Plugin Author WebToffee

    (@webtoffee)

    Hi @y2jacky,

    We believe you are in the wrong support page. Are you sure that you are using Webtoffee’s WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels plugin?

    The support link you shared is for a different plugin.

    Thread Starter Y2Jacky

    (@y2jacky)

    You are right…

    I was confused by the similar names.

    Sorry! Will post in the right forum.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reset Invoice Number Daily/Weekly/Monthly’ is closed to new replies.