When to use Battery Fuel gauge
It's possible to get a very rough estimate for battery capacity from voltage and current draw, but as the battery ages and as the temperature changes it will lead to very significant errors.  Probably the best method out there is impedance tracking, which you can read about here:

http://www.ti.com/lit/an/slua450/slua450.pdf