Update facture.php

$soc already filled upper if $socid filled
I hope you did read http://wiki.dolibarr.org/index.php/Language_and_development_rules#PHP_Norms