Theory of the microwave-induced photocurrent and photovoltage magnetooscillations in a spatially non-uniform 2D electron gas