mercredi 20 janvier 2016

loop in table and handle the rows

I'm working on something that should do a loop in a table to get the data

I should get the In/Out of the employees form fingerprint machine and design a page to print out the in/out per day

Of course the in/out could various from day to day it may be 0 finger print or 4 or any number per day

I need to print out the in/out per day in row but what I'm getting is the in/out printing in same column

Here what i tried i need help

<table class="table table-bordered" style="border:solid;3px;black;width: 100%">
    <tr>
        <td width="30%">Date
        </td>
        <td width="60%">In/Out
        </td>
        <td width="10%">ToTal
        </td>
    </tr>
    <tbody>
    <tr t-foreach="get_employee_date_range(data['form']['date_from'],data['form']['date_to'])"
        t-as="i">
        <td width="30%">
            <span t-esc="i['date_day_name']"/>
        </td>
        <td width="60%">
            <table>
                <tbody>
                <tr t-foreach="get_employee_in_out_day(i['date'],data['form']['emp_id'])"
                    t-as="g">
                    <th>
                        <span t-esc="g['action']"/>
                        <br/>
                        <span t-esc="g['name']"/>
                    </th>
                </tr>
                </tbody>
            </table>
        </td>
        <td t-foreach="get_employee_work_hours_day(i['date'],data['form']['emp_id'])"
            t-as="s" width="10%">
            <span t-esc="s['total_work']"/>
        </td>
    </tr>
    </tbody>
</table>

here i need to get the in/out all in one row not under each other

<td width="60%">
                <table>
                    <tbody>
                    <tr t-foreach="get_employee_in_out_day(i['date'],data['form']['emp_id'])"
                        t-as="g">
                        <th>
                            <span t-esc="g['action']"/>
                            <br/>
                            <span t-esc="g['name']"/>
                        </th>
                    </tr>

Thanks




Aucun commentaire:

Enregistrer un commentaire