Reduce memory print of object thirdparty.

This commit is contained in:
Laurent Destailleur 2014-07-04 14:25:08 +02:00
parent 8e2999f73f
commit 3ea52a7967
2 changed files with 24 additions and 42 deletions

View File

@ -598,24 +598,6 @@ class Societe extends CommonObject
return $result; return $result;
} }
/**
* Update localtax value of third party
* @param int $id id societe
* @param int $local Localtax to update
* @param double $value value of localtax
*/
function update_localtax($id, $local, $value)
{
global $db;
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
if($local==1) $sql .= "localtax1_value = '" .$value."'";
else $sql.="localtax2_value='".$value."'";
$sql.="WHERE rowid=".$id;
$resql=$this->db->query($sql);
}
/** /**
* Update parameters of third party * Update parameters of third party
* *

View File

@ -107,16 +107,16 @@ if (empty($reshook))
//obtidre selected del combobox //obtidre selected del combobox
$value=GETPOST('lt1'); $value=GETPOST('lt1');
$object = new Societe($db); $object = new Societe($db);
$res=$object->update_localtax($socid, 1, $value); $object->fetch($socid);
$res=$object->setValueFrom('localtax1_value', $value);
} }
if($action=='set_localtax2') if($action=='set_localtax2')
{ {
//obtidre selected del combobox //obtidre selected del combobox
$value=GETPOST('lt2'); $value=GETPOST('lt2');
$object = new Societe($db); $object = new Societe($db);
$res=$object->update_localtax($socid, 2, $value); $object->fetch($socid);
$res=$object->setValueFrom('localtax2_value', $value);
} }
// Add new third party // Add new third party