PHP / LARAVEL: Need to show all taxes exept key=0

  laravel, php

I am using an open source billing program that I found on the web. I have managed to modify several elements, however I have serious problems with taxes.

The challenge is here, at least for me;

In my country we use three taxes; 15%, 18% and 0% (which would be an exempt product). I need my invoice to always list 15% and 18% (no matter if any of them are not invoiced, because currently it only shows the tax that has been invoiced), but i also need the tax with label ‘0%’ to be omitted.

It currently does this:

subtotal —————— L. 537.00
subtotal taxed (15%) – L. 297.00
subtotal taxed (18%) – L. 0.00
exempt ——————- L. 240.00
15% —————— (+) L. 44.55
0% ——————– (+) L.0.00 -> I need this to go away
Discounts (0%) —– (-) L. 0.00
Total ———————– L. 581.55

and I need it to be something like this:

subtotal —————– L. 537.00
subtotal taxed(15%) – L. 297.00
subtotal taxed(18%) – L. 0.00
exempt —————— L. 240.00
15% —————– (+) L. 44.55
18% —————– (+) L. 0.00 –>included even if it has not been invoiced
Discounts (0%) —- (-) L. 0.00
Total ———————- L. 581.55

The actual code goes like this:

<!-- Taxes -->
    @foreach($receipt_details->taxes as $k => $v)
        <tr>
            <th style="width:70%">{{$k}}</th>
            <td class="text-right">{{$v}}</td>
        </tr>
    @endforeach

Source: Laravel

Leave a Reply