How do I alter formatted invoice numbers?

In order to alter formatted invoice numbers, simply add the following filter to your themes  functions.php

function alter_formatted_invoice_number( $formatted_invoice_number, $document_type ) {
   if ( $document_type === 'invoice/global' ) { // 'simple' or 'global'.
      // add M for global invoices.
      return 'M' . $formatted_invoice_number;
   }


   return $formatted_invoice_number;
}
add_filter( 'bewpi_formatted_invoice_number', 'alter_formatted_invoice_number', 10, 2 );
	

Please test the functionality on a development environment of your website. If it ceases to work, please revert back to the original state of your website and follow the tutorial again.