{foreach from=$header_fields_array item=name key=key} {strparse var=fmt value=$name} {/foreach} {foreach from=$list_fields_array item=name key=key} {strparse var=fmt value=$name} {/foreach} {foreach from=$ls item=sls} {foreach from=$sls item=row} {foreach from=$list_fields_array item=name key=key} {strparse var=fmt value=$name} {if $key == "list_no"} {elseif $key == "branch_id"} {elseif $key == "warranty"} {elseif $key == "storehouse_id"} {elseif $key == "create_date"} {elseif $key == "list_status"} {else} {/if} {*合计字段处理开始*} {if $fmt.sum} {php} $key = $this->_tpl_vars["key"]; $value = $this->_tpl_vars["row"][$key]; $_total_list_array[$key] += $value +0; $this->_tpl_vars["_total_list_array"] = $_total_list_array; $_total_single_list_array[$key] += $value +0; $this->_tpl_vars["_total_single_list_array"] = $_total_single_list_array; {/php} {/if} {*合计字段处理结束*} {/foreach} {/foreach} {foreach from=$list_fields_array item=name key=key name="listeach"} {strparse var=fmt value=$name} {if $smarty.foreach.listeach.first} {elseif $fmt.sum} {else} {/if} {if $fmt.sum} {php} $key = $this->_tpl_vars["key"]; $_total_single_list_array[$key] = 0; {/php} {/if} {/foreach} {/foreach} {if $ls|@count==0} {/if}
{$fmt.title}
{$sort.$key|default:$fmt.title}
{$row.$key}{$branch_array[$row.branch_id]}{$warranty_array[$row.warranty]}{$storehouse_array[$row.storehouse_id]}{$row.$key|local_date:8:5} {if $row.approved==0}待审核{elseif $row.checkin}已入账{elseif $row.abort}已取消{elseif $row.approved}已审核{/if} {if is_numeric($row.$key) && $row.$key==0}-{else}{$row.$key}{/if}
合计{if $_total_single_list_array.$key > 0}{$_total_single_list_array.$key|string_format:'%.02f'}{else}-{/if}