Nonhomogeneous charge distribution in doped layered superconducting compounds