Answers.Body: <p>I think the answer is in the making: Klaas and Björn just proposed this PR: <a href="https://github.com/civicrm/civicrm-core/pull/11110" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/11110</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T07:30:41.577Z
Answers.Text: Yes, the new hook proposed in [CRM-21289](https://issues.civicrm.org/jira/browse/CRM-21289) would exactly cover this scenario. Just waiting for it to be accepted... Björn.
Answers.UserDisplayName: Björn Endres
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T12:56:28.587Z
Answers.Text: I gave it my thumbs up 
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-17T11:09:10.803Z
Answers.Text: Any news on this? My client wants to use invoices, but wants to use their own invoice numbering system.
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-13T03:07:18.447Z
Answers.LastActivityDate: 2017-10-13T03:07:18.447Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>Where exactly is the invoiceID generated? I am not aware of any invoiceID generated automatically but that may well be my bad :-)
  If there is an invoice generated I would imagine you would be able to use the hook_civicrm_pre or if not the hook_civicrm_post on the Entity <strong>ParticipantPayment</strong> to catch and change the invoice ID?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-18T15:06:35.583Z
Answers.Text: Invoicing was added in CiviCRM 4.6 - https://civicrm.org/blogs/tonymazz/civicrm-46-will-support-sales-tax-vat-and-invoicing
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-20T14:20:34.117Z
Answers.Text: Thanks William :-) Hans, did you try with the civicrm_pre hook?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-14T20:10:46.383Z
Answers.Text: Hoi Erik! invoice_id generation was added by Lobo a decade ago :-) It has been sent to payment processors - just about any of them for what must amount to millions of transactions; the 4.6 invoicing feature accidentally repurposed that field - that's now being separated out by Coleman.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T18:44:55.170Z
Answers.Text: Hoi Karin, I know about the invoice_id by now :-). One of the problems we are facing is that most of our customers want their own numbering system, and the 4.6 invoice id generation does not call any hook unfortunately! But moving house right now......:-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-17T16:21:04.457Z
Answers.LastActivityDate: 2015-12-17T16:21:04.457Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>Not a full answer but hope gives some insights. </p>
  
  <p>The invoice ID is taken from the contribution ID, that said, I would rather go for a custom filed/extension. I do remember that contribution ID AND invoice ID (when applicable) is used to check against existing contributions, not 100% sure about this but perhaps someone from the core team could clarify.</p>
  
  <p>There was a similar question <a href="https://civicrm.stackexchange.com/a/7578/872">here</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-20T13:46:56.160Z
Answers.LastActivityDate: 2015-12-20T13:46:56.160Z
Answers.LastEditDate: 2017-04-13T12:53:13.207Z
Answers.UserDisplayName: Andrei
Body: <p>My customer wants a different Invoice ID numbering.</p>
  
  <p>A sequence based on year and contribution type.</p>
  
  <p>So, something like 
  Event-2015-001
  Event-2015-002
  ..
  Event-2015-156
  Event-2016-001
  Memb-2015-001
  Memb-2015-002
  ..
  Memb-2015-129
  Memb-2016-001</p>
  
  <p>How would you approach that? 
  What are the (unwanted) side-effects?</p>
  
  <p>The invoices are generated by CiviCRM (so not an external source of the Invoice ID). The invoice ID's will be used by a financial package. </p>
  
  <hr>
  
  <p>Thanks for the answers.
  After I showed the customer that Invoice ID's were adjustable with Batch Update Contributions via Profile they want to use that for now. Maybe later we will automate it.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-17T15:32:55.967Z
Comments.Text: Can you explain a little more about the overall process? What are you doing that originates the invoice? This will help others to understand your problem and the answer you will get :-)
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-17T15:48:22.487Z
Comments.Text: Adjusted the question a bit
Comments.UserDisplayName: Catorghans
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-16T14:09:00.540Z
Comments.Text: What are the unwanted side-effects? The invoice-id is used by payment processors for different tasks: See https://issues.civicrm.org/jira/browse/CRM-20387
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-14T17:06:51.190Z
Comments.Text: I won't pretend to understand Civi's invoicing system - but I saw something that seems relevant in my Github feed, where the human-readable invoice ID is going to be a separate field from the internal invoice ID.  I believe that this will make what you're describing possible, or at least get you most of the way there: https://github.com/civicrm/civicrm-core/pull/10298
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-15T23:31:25.980Z
Comments.Text: probably useful to add your own answer as an Answer and +1 it
Comments.UserDisplayName: petednz - fuzion
Tags: <invoice>
Title: Custom Invoice ID
ThreadText: # Custom Invoice ID
  
  (Asked by: username_0 on 2015-12-17)
  
  My customer wants a different Invoice ID numbering.
  
  A sequence based on year and contribution type.
  
  So, something like
  Event-2015-001
  Event-2015-002
  ..
  Event-2015-156
  Event-2016-001
  Memb-2015-001
  Memb-2015-002
  ..
  Memb-2015-129
  Memb-2016-001
  
  How would you approach that?
  What are the (unwanted) side-effects?
  
  The invoices are generated by CiviCRM (so not an external source of the Invoice ID). The invoice ID's will be used by a financial package.
  
  ---
  
  Thanks for the answers.
  After I showed the customer that Invoice ID's were adjustable with Batch Update Contributions via Profile they want to use that for now. Maybe later we will automate it.
  
  **Tags:** invoice
  
  > **Comments:**
  > **username_1**: Can you explain a little more about the overall process? What are you doing that originates the invoice? This will help others to understand your problem and the answer you will get :-)  
  > **username_0**: Adjusted the question a bit  
  > **username_2**: What are the unwanted side-effects? The invoice-id is used by payment processors for different tasks: See https://issues.civicrm.org/jira/browse/CRM-20387  
  > **username_3**: I won't pretend to understand Civi's invoicing system - but I saw something that seems relevant in my Github feed, where the human-readable invoice ID is going to be a separate field from the internal invoice ID.  I believe that this will make what you're describing possible, or at least get you most of the way there: https://github.com/civicrm/civicrm-core/pull/10298  
  > **username_4**: probably useful to add your own answer as an Answer and +1 it  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_5 on 2017-10-13. Score: 4
  
  I think the answer is in the making: Klaas and Björn just proposed this PR: <https://github.com/civicrm/civicrm-core/pull/11110>
  
  > **Comments:**
  > **username_6**: Yes, the new hook proposed in [CRM-21289](https://issues.civicrm.org/jira/browse/CRM-21289) would exactly cover this scenario. Just waiting for it to be accepted... Björn.  
  > **username_5**: I gave it my thumbs up   
  > **username_7**: Any news on this? My client wants to use invoices, but wants to use their own invoice numbering system.  
  
  ---
  
  ### Answer by username_1 on 2015-12-17. Score: 0
  
  Where exactly is the invoiceID generated? I am not aware of any invoiceID generated automatically but that may well be my bad :-)
  If there is an invoice generated I would imagine you would be able to use the hook\_civicrm\_pre or if not the hook\_civicrm\_post on the Entity **ParticipantPayment** to catch and change the invoice ID?
  
  > **Comments:**
  > **username_8**: Invoicing was added in CiviCRM 4.6 - https://civicrm.org/blogs/tonymazz/civicrm-46-will-support-sales-tax-vat-and-invoicing  
  > **username_1**: Thanks William :-) Hans, did you try with the civicrm_pre hook?  
  > **username_5**: Hoi Erik! invoice_id generation was added by Lobo a decade ago :-) It has been sent to payment processors - just about any of them for what must amount to millions of transactions; the 4.6 invoicing feature accidentally repurposed that field - that's now being separated out by Coleman.  
  > **username_1**: Hoi Karin, I know about the invoice_id by now :-). One of the problems we are facing is that most of our customers want their own numbering system, and the 4.6 invoice id generation does not call any hook unfortunately! But moving house right now......:-)  
  
  ---
  
  ### Answer by username_9 on 2015-12-20. Score: 0
  
  Not a full answer but hope gives some insights.
  
  The invoice ID is taken from the contribution ID, that said, I would rather go for a custom filed/extension. I do remember that contribution ID AND invoice ID (when applicable) is used to check against existing contributions, not 100% sure about this but perhaps someone from the core team could clarify.
  
  There was a similar question [here](https://civicrm.stackexchange.com/a/7578/872)
  
  
  ---
  
  