• Resolved Ram Shengale

    (@ramshengale)


    We had Reset invoice number yearly setting enabled by accident and that caused the invoices to start generating for 001 again from 1st Jan, 2024.

    We want to reset this so that those invoices start from where they got left on 31st Dec, 2023. We checked the Danger Zone Tools, set the next invoice number from Documents > Invoices > Next invoice number (without prefix/suffix etc.) and used the Renumber existing documents tool from 1st Jan till date.

    But the tool is not working.

    It shows success message in popup but the actual renumbering does not happen. Can you check if this is a bug in the plugin or am I doing anything wrong?

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

    (@yordansoares)

    Hi @ramshengale,

    Thanks for reporting this. We will be performing some testings to try to reproduce it and, if we found an issue, we will work on a fix as soon as possible.

    I will keep you posted!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @ramshengale,

    We have fixed this issue within our development environment, and should be available publicly next week.

    That said, I have prepared a beta release for you, so you can get the fix in advance and be able to use it earlier: https://we.tl/t-1Oa6Ou30Ix

    Thread Starter Ram Shengale

    (@ramshengale)

    When are you going to publish the update? I was not able to download earlier. Can you share the latest file again? Or it’ll be better if you directly push the new update.

    Thanks

    Plugin Contributor alexmigf

    (@alexmigf)

    Thread Starter Ram Shengale

    (@ramshengale)

    Thanks for this. I tested the plugin. The renumbering is happening but not as per invoice date. It’s following some other ordering.

    Plugin Contributor alexmigf

    (@alexmigf)

    I have tested now and seems to be working fine for me. We use the order date_created, you can check that here.

    Did you reset the next number following the instructions on the tool?

    Thread Starter Ram Shengale

    (@ramshengale)

    It needs to use the _wcpdf_invoice_date or _wcpdf_invoice_date_formatted meta for sorting. That’s because the order can be created first but the payment may get processed after sometime (due to late payment or other reasons) and new orders can get created in-between.

    _wcpdf_invoice_date or _wcpdf_invoice_date_formatted will give us true sequence of invoice numbers.

    • This reply was modified 9 months, 1 week ago by Ram Shengale.
    • This reply was modified 9 months, 1 week ago by Ram Shengale.
    Plugin Contributor alexmigf

    (@alexmigf)

    I have opened a PR to address your situation here. When it gets released you can use the code snippet from there.

    Thread Starter Ram Shengale

    (@ramshengale)

    I was able to achieve my goal by replacing your $args with this:

    $args = array(
    'return' => 'ids',
    'type' => 'shop_order',
    'limit' => -1,
    'order' => 'ASC',
    'orderby' => 'meta_value',
    'meta_key' => '_wcpdf_invoice_date',
    'paginate' => true,
    'posts_per_page' => 250,
    'page' => $page_count,
    'date_paid' => $from_date . '…' . $to_date,
    );

    All good now.

    Plugin Contributor alexmigf

    (@alexmigf)

    Your modification will disappear when you update the plugin, in any case we are including a new selector for the date type in the next plugin release.

    Thread Starter Ram Shengale

    (@ramshengale)

    Yeah, tthat’s fine. This was anyways a one-time thing.

    Thanks for your help. We can close this ticket now.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Renumber existing documents not working’ is closed to new replies.