I am using Version 5.62
I have 4 tables. The first is projects, 2nd is steel_types, 3rd is steel_sizes and the 4th is project_items. I have added the following to the project_items hooks file to calculate the sub total of the steel each line.
Code: Select all
function project_items_before_update(&$data, $memberInfo, &$args){
$project_steel_weight = sqlValue(
"SELECT steel_weight FROM steel_sizes where ID='{$data['project_steel_weight']}'"
);
$data['project_line_weight'] = $project_steel_weight * $data['project_line_quantity'];
return TRUE;
}