All prices in the #_prices table have only the stock_id references. If we put in new prices with item_code as the stock_id which is different from the original stock_id, then the Price before Tax in the Direct Invoice gets populated correctly!. But prices added/edited thru' FA in the Items => Sales Pricing form will bear only the stock_id.
This workaround will cause lookup clashes when the item_code of one item matches the stock_id of another item.
Hence all lookups must be based only on the stock_id in the js/ajax code that auto populates the Price before Tax field in the Direct Invoice form even for foreign items having a different value for the item_code than it's stock_id!