3 Replies Latest reply on Aug 20, 2010 9:15 AM by RafalKwiatkowski

    Invoice auto numbering



      Invoice auto numbering


      I try to modify the invoicing module from starter solution. Now the invoice number is only "1, 2, 3...8, 9...".  I wish to get auto generated (serial number) in three places.

      The serial number is XX (it should be restartable every month)

      The auto generated month number is MM and

      automaticaly generated year is YYYY.

      The whole invioce number should look like this: XX/MM/YYYY - how to make this thing work?

        • 1. Re: Invoice auto numbering

          There are invoice ID's and Invoice Numbers and they should not be treated the same. The starter system uses an auto-entered serial number to be used as an Invoice ID to link to line item records. I would not change this to turn the ID code into a "number".

          Numbering systems such as you descibe are often used in invoicing systems for auditing and other purposes. This should be set up as a differnt field and not used to link to other tables.

          Define a new serial number field, InvSequence, for XX. You can manually reset it's next serial value to 1 at the start of each new year or you can write a script that checks dates and settings every time the file is opened and if it determines this is the first business day of a new year, resets the serial number for you.

          Define a text field with the following calculation for your Invoice Number:

          Let ( Today = Get ( CurrentDate ) ; InvSequence & "/" & Right ( "0" & Month ( Today ) ; 2 ) & "/" & Year ( Today ) )

          • 2. Re: Invoice auto numbering

            Create field Serial#

            Set Serial# to  auto-enter serial

             Create a field InvoiceID

            Set it to auto-enter by calculated value

            Enter the formula: GetAsText(Serial#) & Filter ( Middle (Get (CurrentDate); 4;7); 1234567890")


            Edit: Ignore my answer. Phil's solution more robust. Beat me to it

            • 3. Re: Invoice auto numbering

              Thanks, it works Phil.