Hi @naiararomm,
That is unfortunate. There are several reasons why this could have happened. If you could answer the following questions we can zone in on the possible problem.
1) Are you using our Professional extension and are you creating Proforma invoices that follow the main invoice numbering sequence?
2) If this is not the case or if you are unsure can you add the following code snippet to the functions.php of your child theme:
add_action( 'wpo_wcpdf_after_settings_page', 'wcpdf_invoice_number_store_debug_tools', 9, 2 );
function wcpdf_invoice_number_store_debug_tools( $tab, $section ){
global $wpdb;
if ($tab !== 'debug') {
return;
}
$store_name = "invoice_number";
$table_name = "{$wpdb->prefix}wcpdf_{$store_name}"; // i.e. wp_wcpdf_invoice_number
$results = $wpdb->get_results( "SELECT * FROM {$table_name}" );
echo "<h1>Invoice Numbers</h1><table>";
echo "<tr><th>invoice number</th><th>order ID</th><th>order date</th><th>status</th></tr>";
foreach ($results as $result) {
$order = wc_get_order( $result->order_id );
$status = !empty($order) ? $order->get_status() : '?';
if ( in_array( $status, ['trash', 'cancelled', '?'] ) ) {
$status = "<strong>{$status}</strong>";
}
$url = sprintf('post.php?post=%s&action=edit', $result->order_id);
$link = sprintf('<a href="%s">%s</a>', $url, $result->order_id);
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", $result->id, $link, $result->date, $status);
}
echo '</table>';
}
If you have never worked with code snippets or functions.php before please read this: How to use filters
This code snippet will add a list to WooCommerce > PDF Invoices > Status that will show you recent invoice numbers and to which order they were assigned and at what time. This might clear up where the “lost” invoice numbers have gone.
3) If this does’t clear things up a final possibility could be that a so called ‘race condition’ occurred. This happens when two invoices are created at exactly the same time. This is sometimes related to the used payment gateway. Can you tell us what the payment methods were for the specific orders you show in your screenshot?
Thank you in advance!
-
This reply was modified 5 years, 6 months ago by
kluver.