• Resolved luck7

    (@luck7)


    Hello,

    First of all, great plugin!
    Im looking for a small tweak though.
    Is it possible to have the plugin edit the ordernumber to match the invoice number?

    Before using this plugin I used Custom Order Numbers for WooCommerce.
    That plugin would change the actual ordernumber. Is there a way to do the same with PDF Invoices & Packing Slips?

    Customers get confused easily, so it would be perfect if these number can be identical.

    Many thanks and best regards,
    Luck Hermsen

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

    (@pomegranate)

    Hello Luck!
    If you are absolutely, 100% sure that the Custom Order Numbers plugin does not create order numbers for unfinished or cancelled orders (or if you don’t care about potential gaps in the invoice number sequence), you can use a snippet from the documentation: use order number as invoice number

    Hope that helps!

    Thread Starter luck7

    (@luck7)

    Hi Ewout,
    Thanks for the fast reply!

    The Custom Order Numbers plugin creates a custom, sequential order number.
    I’m using S-2018-x. I have a feeling it doesn’t acutally change the (post)number, but only creates a reference. Not sure though.

    I found this snippet online yesterday:

    
    /**
     * Use order number as invoice number
     */
    add_filter( 'wpo_wcpdf_invoice_number', 'wpo_wcpdf_format_invoice_number', 20, 4 );
    function wpo_wcpdf_format_invoice_number( $invoice_number, $order_number, $order_id, $order_date ) {
        return $order_number;
    }
    

    This seems to work. It’l copy the custom order Id (S-2018-X) and make the invoicenumber identical to it.

    However, what do you mean by being sure the plugin doesn’t create order numbers for unfinished or cancelled orders? In what way would that create a problem?

    Many thanks for the support!

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! I would recommend using the filter from the documentation instead of that one (which is a deprecated legacy filter), it’s more compatible with current & future versions.

    However, what do you mean by being sure the plugin doesn’t create order numbers for unfinished or cancelled orders? In what way would that create a problem?

    As explained in the documentation from my link above (under “Why is the PDF invoice number different from the woocommerce order number?“), even if you have sequential order numbers, this can still pose an issue if you get orders that are created but never paid for (i.e. orders that get stuck during payment etc.). If this sequence is used for invoices, you get numbers missing from the actual invoice sequence. Most tax authorities require a sequential, gap-free invoice number sequence, so to resolve this, you would need to create invoices for all these cancelled/failed orders and then create credit notes for them. If you use a separate invoice number sequence you don’t get these gaps and it saves you a lot of trouble.
    That said, I am not familiar with the custom order numbers plugin, so I don’t know if it can keep separate sequences for failed vs actual orders.

    Thread Starter luck7

    (@luck7)

    Hi Ewout,

    I should have looked for the documentation and read it fist. Apologies!

    I see what the problem is. I hadn’t thought of the requirement that invoice numbers must be sequential by law, and that cancelled or unpaid order will mess with the sequence.

    Many thanks for your great support. I’ll get myself a nice premium template to compensate for your time.

    Best regards,
    Luck Hermsen

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ordernumber and Invoicenumber equal’ is closed to new replies.