Answers.Body: <p>The invoice ID it shouldn't be a random number, I might be wrong but I believe under normal circumstances (unless an extension is already hooking in the contribution entity) the invoice ID is taken from the contribution ID.</p>
  
  <p>As I'm not quite sure what is exactly what you want to achieve, here are some thoughts, I won't elaborate too much.</p>
  
  <p>If what you want is to manually assign a invoice number, you can create a custom field, create a custom token for the given field and edit the invoice template (navigate to Administer - Communication - Message Templates - System Workflow Messages - Invoice receipt) replacing the invoiceID with your custom token.</p>
  
  <p>If you want the custom invoice ID to be generated automatically every time a new contribution is submitted, I don't think there is a straight forward way to do it, as you will need an autoincrement value, and I can't think of an easy way to do that, mysql only allows one autoincrement column per table and when creating a custom filed, Civi creates a new table in the database with a autoincrement column, maybe some of the core team could point you in a better direction.</p>
  
  <p>My thoughts:</p>
  
  <ul>
  <li>(a bit of a workaround, maybe not the best way as I said) create a custom field group with an INT text/numeric field, using the appropriate hooks, save that filed in every Contribution submission and copy the value of the ID (autoincrement column) of the custom filed group to the custom filed itself so you can search by invoice id, create the custom token and modify the invoice template.</li>
  </ul>
  
  <p>Hope I explained myself.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-09T23:59:39.440Z
Answers.LastActivityDate: 2015-11-09T23:59:39.440Z
Answers.UserDisplayName: Andrei
Answers.Body: <p>Under Admin > CiviContribute > CiviContribute Component Settings, after turning on Sales Tax and Invoices, you have an option to change the prefix of invoices. The number itself is indeed the contribution number, which means it is unique and monotonically increasing. </p>
  
  <p>It wouldn't be too difficult to replace it everywhere with an extension: contribution view, contact dashboard, possibly contact summary contribution tab, find contributions, advanced search, and a bunch of reports would be where I'd start.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-31T14:10:17.100Z
Answers.LastActivityDate: 2017-03-31T14:10:17.100Z
Answers.UserDisplayName: Joe Murray
Body: <p>I have a customer that is wanting to customize/assign invoice numbers to each receipt/invoice for event registrations rather than the long and completely random ones that CiviCRM puts out and not just for those who select "Pay Later". Is this possible to do? Is it possible to have it reflect for all CiviEvents going forward?</p>
  
  <p>Any help would be greatly appreciated. :)</p>
  
  <p>Using: CiviCRM 4.6.8
  Drupal 7</p>
  
  <p>Thank You,
  Nicole</p>
  
Tags: <civievent><drupal><civireport>
Title: Is it possible to change the Invoice numbers that are used in CiviCRM?
ThreadText: # Is it possible to change the Invoice numbers that are used in CiviCRM?
  
  (Asked by: username_0 on 2015-11-06)
  
  I have a customer that is wanting to customize/assign invoice numbers to each receipt/invoice for event registrations rather than the long and completely random ones that CiviCRM puts out and not just for those who select "Pay Later". Is this possible to do? Is it possible to have it reflect for all CiviEvents going forward?
  
  Any help would be greatly appreciated. :)
  
  Using: CiviCRM 4.6.8
  Drupal 7
  
  Thank You,
  username_0
  
  **Tags:** civievent, drupal, civireport
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-11-09. Score: 2 | Accepted answer
  
  The invoice ID it shouldn't be a random number, I might be wrong but I believe under normal circumstances (unless an extension is already hooking in the contribution entity) the invoice ID is taken from the contribution ID.
  
  As I'm not quite sure what is exactly what you want to achieve, here are some thoughts, I won't elaborate too much.
  
  If what you want is to manually assign a invoice number, you can create a custom field, create a custom token for the given field and edit the invoice template (navigate to Administer - Communication - Message Templates - System Workflow Messages - Invoice receipt) replacing the invoiceID with your custom token.
  
  If you want the custom invoice ID to be generated automatically every time a new contribution is submitted, I don't think there is a straight forward way to do it, as you will need an autoincrement value, and I can't think of an easy way to do that, mysql only allows one autoincrement column per table and when creating a custom filed, Civi creates a new table in the database with a autoincrement column, maybe some of the core team could point you in a better direction.
  
  My thoughts:
  
  * (a bit of a workaround, maybe not the best way as I said) create a custom field group with an INT text/numeric field, using the appropriate hooks, save that filed in every Contribution submission and copy the value of the ID (autoincrement column) of the custom filed group to the custom filed itself so you can search by invoice id, create the custom token and modify the invoice template.
  
  Hope I explained myself.
  
  
  ---
  
  ### Answer by username_2 on 2017-03-31. Score: 1
  
  Under Admin > CiviContribute > CiviContribute Component Settings, after turning on Sales Tax and Invoices, you have an option to change the prefix of invoices. The number itself is indeed the contribution number, which means it is unique and monotonically increasing.
  
  It wouldn't be too difficult to replace it everywhere with an extension: contribution view, contact dashboard, possibly contact summary contribution tab, find contributions, advanced search, and a bunch of reports would be where I'd start.
  
  
  ---
  
  