<!-- BEGIN {$smarty.template} -->

<script type="text/javascript" src="js/tasks.js"></script>

<div id="invoicebox">

<form action="add_bill.php" method="get" name="invoiceboxfrm">
{foreach from=$operation item=opv key=opk}
<input type="hidden" name="{$opk}" value="{$opv}" />
{/foreach}
<input type="hidden" name="action" value="{$smarty.const.ACTION_BILL_WITHOPERATIONS}" />


<table cellspacing="0">
    <caption><em>{t}Create invoice{/t}</em>
        <a class="ptr" onclick="hideElement('invoicebox');"><img src="img/phpaga/close.png" alt="X" title="{t}Close{/t}"></a>
    </caption>
    <tbody>
        {if (isset($operation.cpn_id) && is_numeric($operation.cpn_id)) || (isset($operation.prj_id) && is_numeric($operation.prj_id))}
        <tr>
            <td class="label">{t}Add unbilled expenses{/t}</td>
            <td class="data">
                <input type="checkbox" name="add_expenses" />
            </td>
        </tr>
        {/if}
        <tr>
            <td class="label">{t}Additional information to add{/t}</td>
            <td class="data">
                <input type="text" name="bill_additional_line" id="additional_line" size="40" maxlength="255" value="{$config.LETTERHEAD_ADDITIONAL_LINE}" /> <br />
            </td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                <input type="submit" value="{t}Create invoice{/t}" />
            </td>
        </tr>
    </tfoot>
</table>

</form>
</div>

<div id="opdetails"> </div>

<table cellspacing="0">
    <caption><em>{t}Tasks{/t}</em> [
        {if ($show_create_bill)}
        <a id="createinvoice" class="ptr" onclick="show_box('createinvoice', 'invoicebox');">{t}Create invoice{/t}</a> |
        {/if}
        <a href="operations_pdf.php?{$search_args}">{t}Print{/t}</a>
        ]
    </caption>
    <thead>
        <tr>
            <th> <a href="{$location}{$sort.pr}"{if $porder == $smarty.const.ORDER_OP_PR_ASC} class="sortasc"{elseif $porder == $smarty.const.ORDER_OP_PR_DESC} class="sortdesc"{/if}>{t}Project{/t}</a> </th>
            <th> {t}Project status{/t} </th>
            <th> {t}Task{/t} </th>
            <th class="time"> <a href="{$location}{$sort.start}"{if $porder == $smarty.const.ORDER_OP_TIMESTAMP_START_ASC} class="sortasc"{elseif $porder == $smarty.const.ORDER_OP_TIMESTAMP_START_DESC} class="sortdesc"{/if}>{t}Date{/t}</a> </th>
            <th> <a href="{$location}{$sort.pe}"{if $porder == $smarty.const.ORDER_OP_PE_ASC} class="sortasc"{elseif $porder == $smarty.const.ORDER_OP_PE_DESC} class="sortdesc"{/if}>{t}Person{/t}</a> </th>
            <th> <a href="{$location}{$sort.opcat}"{if $porder == $smarty.const.ORDER_OP_OPCAT_ASC} class="sortasc"{elseif $porder == $smarty.const.ORDER_OP_OPCAT_DESC} class="sortdesc"{/if}>{t}Category{/t}</a> </th>
            <th class="time"> <a href="{$location}{$sort.duration}"{if $porder == $smarty.const.ORDER_OP_DURATION_ASC} class="sortasc"{elseif $porder == $smarty.const.ORDER_OP_DURATION_DESC} class="sortdesc"{/if}>{t}Hours{/t}</a></th>
            <th> {t}Actions{/t} </th>
        </tr>
    </thead>
    {include file="list_operations.tpl.html"}
    <tfoot>
        <tr>
            <td class="browse" colspan="3"> {$BROWSE} </td>
            <td class="desc" colspan="2"> {t}Total duration{/t}: {$TOTALHOURS} </td>
            <td class="number" colspan="2"> {t}Subtotal{/t}: {$SUBTOTALHOURS|phpaga_minutes2duration} </td>
            <td>&nbsp;</td>
        </tr>
    </tfoot>
</table>

<!-- END {$smarty.template} -->
