Purchase return in Weighted Average & FIFO Inventory Methods

Hello to all,
Have a question regarding Weighted Average Cost and FIFO when returning purchases to vendor
1- Weighted Average Cost
we have following purchase:
10 unit @ $20 & 5 unit @ $15 so average cost per unit is $ 18.33 = (10*20)+(5*15)/15
after that we sold 5 units, remaining 10 units @ $18.33
then we return our first purchase (10 unit @ $20), the journal entry is:
DR. Accounts Payable $ 183.3
CR. Inventory $ 183.3
in this case the vendor balance will not zero out, and if the journal entry is:
DR. Accounts Payable $ 200
CR. Inventory $ 183.3
the two sides are not balances, so how Sage treats this? please answer with journal entries.
=======================
2- FIFO
we have following purchase:
3 unit @ $2000 & 3 unit @ $1500 & 1 @ $ 1750
After a few sales and purchases the stock will be like that:
6 unit @ $2700 & 3 unit @ $3500 & 2 @ $ 1000
then we had to return first purchase (3 units @ 2000), but now we don't have any batch @ $2000, according to FIFO rule, the journal entry will be:
DR. Accounts Payable $ 8100
CR. Inventory $ 8100 ---> (3*2700)
but our purchase was of $ 2000, so the vendor balance will not zero out.
so how Sage treats this?
Thanks.