Here's a demo file that illustrates a way that you might be able to adapt to your purposes: https://www.dropbox.com/s/ggjy88cgkescopy/CategorySerialNos.fp7
Each "category" could be one invoice. Open the demo from FileMaker 12's File menu to get a copy converted to the .fmp12 format.
Well, partially. As for "no-error" approach, it would work fine. But I want for it to have conditional functionality (and therefore be formatted as "Calculation", instead of Auto-enter Number Field), for cases, when user mistakenly added portal row with incorrect value selected from drop-down, so, if such a case is row #17 and it is later deleted (I have "x" button with a script that deletes portal row at the very right of the portal line), then the sequence is like this 15, 16, 18, 19 (and no 17, which is deleted). And I would like for it to adjust so that no numbers in the sequence are omitted.
Then you'll need to add a script that "fixes" the sequence when that occurs. Go To Related Records or a scripted find can isolate the portal records on a found set based on the portal's table. Then Replace Field Contents with the serial number option can renumber them.
Could you hook me up with script? I believe that scripted find is the preferred option.
Maybe you don't need it. Consider this alternative:
If the portal records have an auto-entered serial number, sorting them in ascending order will sort them in the order you want. Editing the serial number, even to add serial number with a decimal such as 2.5 can be used to change an item's position in the order. Then, with the records sorted on this field, the record number symbol will display a gap free sequence of values and a running count summary field can provide the same numbering on reports where you might have groups of the same portal records from multiple invoices as might be needed in some summary reports.
If you do want to do a scripted find (GTRR uses fewer script steps), it'd be patterned after this generalized outline:
Set Variable [$InvoiceID ; Invoices::__pkINvoiceID ]
Go to Layout ["PortalTable" (PortalTable)]
Enter Find Mode 
Set Field [PortalTable::_fkInvoiceID ; $InvoiceID ]
Set Error Capture [on]
Perform Find 
Replace Field contents [No dialog ; PortalTable::SerialNumber ; SerialNumbers ]
Go to Layout [original layout]
Thanks, running count summary field was enough.