Hello,
I have a problem with on_update. I want to set the variable “Bearbeitet” to 1 and calculate the gross price. But $data[“params”][“Lg_Spanne”] and $data[“params”][“VAT”] are empty.
Firebug: Array ( [ID] => 46459 [params] => Array ( [LgEP_netto_Neu] => 133 [Bearbeitet] => 1 [LgVP_exkl_neu] => 0 ) )
$e[“on_update”] = array(“update_client”, null, true);
function update_client(&$data)
{
$request_ID = $data[“ID”];
$data[“params”][“Bearbeitet”] = 1;
$LgEP1 = strtr($d[“LgEP_netto_Neu”], “,”, “.”);
$LgEP2 = doubleval($LgEP1);
$data[“params”][“LgVP_exkl_neu”] = ($LgEP2 + $data[“params”][“Lg_Spanne”]) * ($data[“params”][“VAT”]/100 + 1);
}
The on_data_display event works, it calculate the gross price but doesn’t insert it in the table.
$e[“on_data_display”] = array(“filter_display”, null, true);
function filter_display($data)
{
foreach($data[“params”] as &$d)
{
if (!is_null($d[“LgEP_netto_Neu”]))
{
$LgEP1 = strtr($d[“LgEP_netto_Neu”], “,”, “.”);
$LgEP2 = doubleval($LgEP1);
$d[“LgVP_exkl_neu”] = ($LgEP2 + $d[“Lg_Spanne”]) * ($d[“VAT”]/100 + 1);
}
}
}
I hope you can help me. Thanks!
Ronald
Hello,
Apologies for the delay.
You only get those columns posted back on server on edit/add that are:
$col[“editable”] = true;
Others are not posted back.
So if you want them to be readonly on display, you can have another column with same data and make it editable:true and hidden:true and keep the readonly column as it is.