On general balance laws with boundary