Expense against sales invoice

Maybe this thread can help: https://discuss.frappe.io/t/how-to-know-the-cost-of-a-sales-order/1751