Noticed your version has been merged in to FA24Extensions library. Tried multi line sales invoice import with blank references - came across couple of issues there:

1. $Refs->get_next($type) seems to return the same document number until transaction is committed;
2. block of code to get the number document number is too late (lines 274-277 in import_transactions.php), by the time process reaches it, document has already been created. Thinking it should be soon after line 202, after list function is called but before $reference is tested in line 208;
3. $_SESSION['Items']->write(0); (line 212 in import_transactions.php) eventually calls function add_sales_order(&$order), which tries to insert sales order, but sales_type and prep_amount variables are not set in $order object, so fails there as well

Question:
Is there a way to get several new document numbers in the middle of transaction before commit?

Thank you.

Thanks you apmuthu, will try and post results here.

Thanks apmuthu!

This will work if I want to capture second authentication at the same time as login.
In my case I would like to validate username+password first and only after that show separate captive page where I will handle additional auth (users can have different types MFA that will require different handling). Only after that second page user will be logged on. Failure at either of these steps will take user back to login.

I guess my question is "how can I introduce an additional page between successful login and taking user to the main application".

I see what you have done:
- blank reference "" means get new number,
- non "+" reference means use this value as reference
- "+" reference means second, third, n-th lines of the same document
In other words - you only specify document number on the first line.

This way you can mix automatic numbers and given references in the same file, right?

I am thinking to still use reference from CSV file to detect a new document, store it on some memo (external reference) field on sales invoice, but always get a new sales invoice number for each new sales invoice being imported.
May be add a Boolean switch to Import Transactions to indicate whether to use invoice number from CSV or generate new.
What do you think?

Thanks Braath
FA 2.3.24
Import Transactions 2.3.24-1

How do you deal with multi line invoices if reference is left blank?

When using Import Transactions last sales invoice number gets updated and then subsequently used by manual Direct Sales invoice. This causes a problem at times if Import is run, then few Direct Sales Invoices created manually, then another Import is run. Since FA has advanced sales invoice numbers second Import may try to import same references.

Is there any way to either not update last used sales invoice number when running Import Transaction or ignore reference column from Import Transactions and let FA generate Sales Invoice number when importing (as if it was a manual Direct Sales invoice)? The latter is preferred.

@Joe Thanks, understood, will open forum topic first in future.
My question was more along the lines of: "is sf fork + merge request a correct way to send code for consideration or you prefer patch file posted in forum?"

@Joe I have submitted a merge request for exactly that functionality back in March, since I was using it already for a few years, but it was not present in 2.4.6 master
Git Merge Request #1: Added option to send Customer Receipt by e-mail (open)
https://sourceforge.net/p/frontaccounting/git/merge-requests/1/

Is there a better (preferred?) method of contributing to FrontAccounting development?
Pardon, if my question is obvious - new to Git and distributed open source development.

Looking for the correct way to implement 2FA using Duo Security: after successful login I need to make a second authorization call (javascript + iFrame). Here is documentation on Duo architecture: https://duo.com/docs/duoweb
PHP demo Duo code is available here: https://github.com/duosecurity/duo_php

Is it possible to add one more step (with user interaction) to login process?
Have had a look at ldap_auth extension, but it seems to replace FA authenticate, where I want to add an extra step.

Thank you.