Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Invoice number not automatically generated anymore

  • Resolved ipheau

    (@ipheau)


    Hi you all,

    I have a strange problem.
    Somewhere between 09 april 2017 and 13 april 2017, all of the sudden my automatic generated invoice number has bin stopped within Woocommerce.

    For the record:
    I mean the automatic invoice number that should be created after i complete a order.

    What i have to do now is go into the order and manually press the PDF invoice button to create a invoice number. Can someone please help me, because i have a big of a problem now with my invoice sequence.

    thanks you in advanced!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ewout

    (@pomegranate)

    Hi!
    The invoice number is generated when the invoice is created. This can be either automatic by means of email attachment or manually like you are doing now. Can you check your email attachment settings for the invoice to make sure it is still attached to the ‘completed order’ woocommerce email?

    also see: When is the invoice number assigned?

    Let me know if you need more help with this!

    Ewout

    Damn, You made my day.
    I wanted to reduce the amount of emails that customers get from my company, so i disabled the complete email from Woocommerce>>Settings>>Email. Not thinking about it that the automatic invoice number would be effected to that.

    I enabled the ‘complete’ email again, and everything works fine now.
    Mabye you know a solution for me, so i can disable the ‘complete’ email, but still get a generated invoice number after i press ‘complete’ in order status?

    Plugin Author Ewout

    (@pomegranate)

    Yes, this is possible with a simple code snippet:

    
    add_action('woocommerce_order_status_completed', 'wpo_wcpdf_create_invoice_number');
    function wpo_wcpdf_create_invoice_number ( $order_id ) {
    	$order = wc_get_order( $order_id );
    	$invoice = wcpdf_get_document( 'invoice', $order, true );
    }
    

    This creates the invoice number as soon as the order status is changed to completed.
    Note that this only works with version 2.0+!

    Thank you for the quick answer and great solution. 🙂

    Hi there, I have a similar problem. I need the invoice number to generate automatically once the order is created (pending payment). I have selected the email attachment setting for New Order, however the invoice number will not automatically generate until the order is set to Processing.

    This was working before recent update. Is there any way to fix this?

    Regards,

    @stormlog1

    Is this what you are looking for?

    https://wordpress.org/support/topic/create-invoice-number-when-receive-order/

    But why do you want a invoice number when the order isnt completed? Maybe the order get cancelled (see post) and then you have a invoice number that is not relevant anymore!

    @stormlog1

    If that is not what you are looking for, Then i think i have the solution.

    Go to Woocommerce>>Invoice(PDF)>>Documents

    There you can put a checkmark on processing. A invoice will then be created i guess.
    Try it out!

    Thank you for your response.
    The majority of orders placed on this system are through the backend, so the invoice needs to be generated and sent to the client to allow payment to be made.

    But I understand the difficulty if an order is placed from the frontend.

    Thank you for your response.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Invoice number not automatically generated anymore’ is closed to new replies.