vendredi 30 septembre 2016

Calculate Column based on another column laravel

I want to calculate amount column based on type column. and display the result in balance column. with condition if debit is sum, and if credit is minus. here is the table calculate

I'm using laravel and this is the code in view

<thead>
    <tr class="txtcenter">
        <th class="all">Date </th>
        <th class="all">Description </th>
        <th class="all">Amount</th>
        <th class="all">Type</th>
        <th class="all">Reference</th>
        <th class="all">Balance</th>
    </tr>
</thead>
<tbody>@foreach($get_period as $statement)
        <tr class="accordion">
            <td></div>
            <td> </div>
            <td>IDR   </div> 
            <td>  </div>
            <td> </div>
            <td>  </div>
        </tr>@endforeach
</tbody>

I'm newbie in laravel and don't know what code to calculate this, maybe php or javascript or anything else. please help me....... Thanks in advance



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2drPNYj
via IFTTT

Aucun commentaire:

Enregistrer un commentaire