Qual: Uniformisation du code. Simplification recup code pays depuis id
This commit is contained in:
parent
bee23ad216
commit
42a34dcfb7
@ -62,18 +62,8 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
|
||||
$sql .= " WHERE rowid = '".$conf->global->MAIN_INFO_SOCIETE_PAYS."'";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj->code) $this->emetteur->code_pays=$obj->code;
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
$this->db->free($result);
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -70,22 +70,11 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
|
||||
$this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
$this->franchise=1;
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
|
||||
$sql .= " WHERE rowid = '".$conf->global->MAIN_INFO_SOCIETE_PAYS."'";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj->code) $this->emetteur->code_pays=$obj->code;
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
$this->db->free($result);
|
||||
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user