I was hoping that someone with greater technical knowledge of laptop circuitry than I have would reply to this, but . . .
Typically, you get about 19 or 20 V DC out of your mains charger unit, which normally connects through a plug arrangement to the motherboard. On the motherboard there is some circuitry which sends this voltage to charge the battery and a regulator circuit to allow the computer to run off this 19 - 20 V supply. Again, typically the computer runs at about 15 - 16 V - the battery ouptut voltage.
It sounds to me that the connection between the socket on the case and the battery input is broken somehow. This would explain why you are able to run the laptop plugged into the mains, but get nothing out of the battery. The battery isn't charging.
If you come back with the make and model of laptop, someone else may be able to give you a more definite answer as to whether or not this is readily fixable, but at least it still works off the charger. Inconvenient, but better than nothing.