Modeling Gain on Sales typically involves three components.
1 - Proceeds from Sale (+)
2 - Book Value of Disposals (-)
3 - Gain on Sale (=)
In most cases, you will find Gain on Sale account in the Income Statement. Assuming that account is defined as an "Income", it's best to turn it into a subtotal by adding two children accounts underneath. These two new accounts should be "Proceeds" (defined as an income) and "Disposals of Assets" (defined as an expense).
This will force the gain formula to work as outlined above. For reporting purposes, you can always just report the gain subtotal without showing the details. This is usually more natural as companies rarely show the break out on a report.
Because the Disposal of Assets is a non-cash activity, we need to model both sides of the transaction.
In other words:
Sum of Disposal Movements on Balance Sheet = Book Value of Disposals (on IS)
To achieve this, make sure that there is a Balance Sheet movement called "Disposals". This can be added in the movements dimension. Generally it makes sense to define it as a "subtractive" movement so it reduces the balance.
In most cases, it makes sense to input the movement by balance sheet account and have that link to the Income Statement automatically. In this case, go to the "Disposal of Assets" line on your Income Statement and set the formula properties from "Input" to "Link". Click on the formula editor icon and set up two account constant references. The first one should be "Total Assets,Disposals" and the second one should be "Total Liabilities and Equity,Disposals". This formula will sum up all the disposal movements across all assets and net it with a sum of all the disposals from your liabilities and Equity.
In other words, the "disposal' movement will now be a non-cash movement that will automatically get offset on the P&L.
As you may recall, setting cash flow destinations is something that is done in the properties window of either the Income Statement, Balance Sheet or Balance Sheet Movement members.
If you are using a Direct Cash Flow method, then the first step would be to assign "proceeds" from the Cash Flow as the cash flow destination for the Proceeds account located on your P&L. This will ensure that any proceeds entered into on the Income Statement will flow through to the Cash Flow.
The last step under the Direct method is to ensure that the disposal from sale don't show as a cash impact at all. This can be done by assigning both the Disposal of assets from the Income Statement and the Disposal movement activity to the same Cash Flow Destination account. Because these two values will be equal and offsetting they will always net out with each other.
If you have an indirect cash flow the steps are a bit more involved. If your Cash Flow starts with Net Income or another Income Statement subtotal, then chances are you have a separate line for adjusting back the Gain on Sale. If this is the case, then much like the Income Statement, you will want to break out the gain adjustment into two subaccounts (lets call the first one "Proceeds (CF)" and the second one "Disposals (CF)").
Once you have this break out, go to the movements table and assign the Cash Flow Destination for the Disposals movement to "Disposals (CF)". This means all disposal activity will show in Net Income and be adjusted out in the Disposals (CF) line.
The last step is to properly show the Proceeds on the cash flow. Currently we should have two proceeds accounts on the cash flow. One in the Operating section of the cash flow called "Proceeds (CF)" that we are going to use to back the proceeds from Net Income and a second in the Investing section of the cash flow to show the real cash impact.
Build a Calculation formula in each one of these proceeds lines that references the Proceeds account from the Income Statement. For the formula in the Operating section make sure the formula multiples the proceeds by negative 1. This will back it out rather than add it twice.