When eCart stores the order in the orders table, it assigns the ID from the order table as the order number.
It does not create an invoice number. for an invoice number, you could use the Session ID, or you could use the Random Password generator from Data Bridge - Security Assist to create the invoice number.
we do not have a "flow chart of how eCart would process input and send to output". I'm not really sure what you are asking for here to be honest.