Does it have an X on the battery? This is SMC data line being pulled down, or bad SMC.
Does it say battery not charging? This is PPBUS_G3H not being created, current sensing issue on the charger, or current sensing issue on the battery.
Does it work off the battery but not off the charger, or does it work off the charger and not off the battery?
Does it work off the battery and not charge it, or does it NOT work off the battery and not charge it?
These are all separate issues, from battery detection, to current sensing on the charger, to current sensing on the battery, to PPBUS_G3H not being created at all.
Watch this in full and you will have every piece of knowledge required to answer this question. https://www.youtube.com/watch?v=6I2Rd2iVa64