working permit and labor contract for a foreign employee in China

What’s the relationship between working permit period and the termination of the labor contract for a foreign employee in China? According to Chinese relevant laws and regulations, if a foreigner wants to be a legal employee in China and be protected by the Chinese Labor Law and Chinese Labor Contract Law, he or she needs two things first: one is the Working Permit for Foreigners, the other is the Residence Permit for Foreigners. After the foreigner gets them, he can sign a labor contract with the employer and become a legal employee in China. In the practice, if the employer wants to terminate the labor contract with the foreign employee due to his violation of the contract, the working permit period for the foreigner has nothing to do with the termination unless it has been expired.