• Resolved Fantou

    (@fantou)


    Hello

    I have a worry with the numerotation of the invoice: in the settings, I choose a custom number (3) for starting. The first invoice was ok and it was a 3.
    But the second one was a 2, not a 4. How can I fix this?
    For information : there was a payment problem with the first one. Could it cause a problem for the numerotation of the invoice?

    WP version : 6.2
    PDF Incvoice packing slips : 3.5.0
    Woocommerce : 7.5.1
    php: 8.0

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor dwpriv

    (@dwpriv)

    @fantou

    You can adjust the next number in the invoice sequence via WooCommerce > PDF Invoices > Documents > “Next invoice number”. When you made your custom number of 3, you could made the next invoice number to be 4, with this setting.

    Thread Starter Fantou

    (@fantou)

    Hi @dwpriv

    Thanks for your reply. I know this option and that is what I do at the beginning. I set a custom number of 3 and the first order was with this number. But the next one was with the number 2, not 4.

    But I think I’ve understood the problem : it’s a WooCommerce shop which was a Prestashop before. A migration have been done and now, in WooCommerce, when I go to an older order (made with the older Prestashop’s site) the plugin creates automatically a new invoice.

    Is there a way to prevent the plugin to create invoice for older orders?
    Because my problem is that now the invoice of the older orders are not the good one.

    Plugin Contributor dwpriv

    (@dwpriv)

    @fantou

    You can try using our Number Tools plugin to see what’s happening to your invoice numbers. Migrating your orders shouldn’t be influencing the invoice numbers.

    Download, install and active the last release of Number tools.

    You can then go to?WooCommerce > PDF Invoices > Number tools, and check the sequence of the numbers.

    Thread Starter Fantou

    (@fantou)

    Hi @dwpriv

    Thanks for the tip. It helps me. The problem was that invoice are made totally differently between Prestashop and Woocommerce.
    WHen I transfered the site, the orders made with the Prestashop’s site had no more associate’s invoice.
    So when I installed your plugin for the first time and set a number to begin invoice, it was ok at the beginning. But after, I click on the action button “Invoice PDF” on a older order. Obviously, like your plugin did not see an invoice, it created one. Like I did not see immediatly that was not the good number, I did not understand at all the problem.

    But it’s clear now, thanks for your advice!

    Just one more question : is it possible to prevent any possibility to change the invoice’s number once it was created? (for example, an order have the number invoice : F01-01 and in the backoffice, I can change for example F01-12. Is it possible to prevent this for all user, even administrator?)

    Plugin Contributor dwpriv

    (@dwpriv)

    @fantou

    Invoice numbers can be changed via the order edits page “PDF document data” section. We can disable editing here for all users with this snippet:

    
    
    /**
    
    ?* Disable invoice edits for all users
    
    ?*/
    
    add_filter( 'wpo_wcpdf_current_user_is_allowed', function( $func, $document ) {
    
    ? ? $screen = get_current_screen();
    
    ? ? if ( ! is_null( $screen )
    
    ? ? && in_array( $screen->id, array( 'shop_order', 'edit-shop_order', 'woocommerce_page_wc-orders' ) )
    
    ? ? && $document == 'invoice' ) {
    
    ? ? ? ? return false;
    
    ? ? }
    
    ? ? return true;
    
    }, 10, 2 );
    
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide:?How to use filters

    Thread Starter Fantou

    (@fantou)

    Hi @dwpriv

    Ok, thanks a lot for the snippet and your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Invoice numerotation going backwards’ is closed to new replies.