https://discuss.frappe.io/t/unrealized-exchange-gain-and-loss-per-sales-purchase-invoice/
This is what has been done.