$value) { foreach ($value as $k => $v) { if (isset($v['tax_rate']) && $v['tax_rate'] != '') { // These only need assigning once, but code is more readable with them here $this->assign('getTaxDetails', TRUE); $this->assign('taxTerm', CRM_Invoicing_Utils::getTaxTerm()); // Cast to float to display without trailing zero decimals $tplLineItems[$key][$k]['tax_rate'] = (float) $v['tax_rate']; } } } } /** * Assign line items to the template. * * @param $tplLineItems */ protected function assignLineItemsToTemplate($tplLineItems) { // @todo this should be a hook that invoicing code hooks into rather than a call to it. $this->alterLineItemsForTemplate($tplLineItems); $this->assign('lineItem', $tplLineItems); } }