Reduce memory print of object thirdparty.
This commit is contained in:
parent
8e2999f73f
commit
3ea52a7967
@ -598,24 +598,6 @@ class Societe extends CommonObject
|
||||
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
|
||||
*
|
||||
|
||||
@ -107,16 +107,16 @@ if (empty($reshook))
|
||||
//obtidre selected del combobox
|
||||
$value=GETPOST('lt1');
|
||||
$object = new Societe($db);
|
||||
$res=$object->update_localtax($socid, 1, $value);
|
||||
|
||||
$object->fetch($socid);
|
||||
$res=$object->setValueFrom('localtax1_value', $value);
|
||||
}
|
||||
if($action=='set_localtax2')
|
||||
{
|
||||
//obtidre selected del combobox
|
||||
$value=GETPOST('lt2');
|
||||
$object = new Societe($db);
|
||||
$res=$object->update_localtax($socid, 2, $value);
|
||||
|
||||
$object->fetch($socid);
|
||||
$res=$object->setValueFrom('localtax2_value', $value);
|
||||
}
|
||||
|
||||
// Add new third party
|
||||
|
||||
Loading…
Reference in New Issue
Block a user