After invoice a sales order, your ledger accounts are generated, and they are consulted

How i get this ledger accounts before invoicing?, when creating the line, here..

It is possible?

In other case, how i get the ledger account from salesparmline?