Skip to content

Commit 46774bb

Browse files
committed
Works with compound taxes
1 parent d27edd3 commit 46774bb

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
Free invoice and quote templates to use with [FusionInvoice](https://www.fusioninvoice.com/)
44

5+
1.1.0 version only works with FusionInvoice 1.6.0 or higher
6+
57
##How to use
68
- Download this repository by clicking the "Download Zip" button on the right
79
- Upload the app/ folder in the root folder of your FusionInvoice installation
810
- Change the default invoice and quote template in your FusionInvoice system settings
911
- If you have a logo, recommended height is 150px
1012

1113
##TODO / Known Issues
12-
- $quote->amount->total_tax not working (FusionInvoce core issue)
13-
- Taxes details only work when an invoice tax rate is defined (not with items taxes) (FusionInvoce core issue)
14-
- Mixing invoice tax rate and items taxes make taxes details incorrect (FusionInvoce core issue)
1514
- Translations for "Total taxes", "Total excluding taxes", "Total including taxes" (FusionInvoce core issue)
1615
- Set a fixed height for the details table ([DomPDF issue](https://github.com/dompdf/dompdf/issues/857))

app/FI/Modules/Templates/Views/templates/invoices/area.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,18 @@
206206
<th colspan="{{ $colspan }}" class="border-top text-right text-normal">{{ trans('fi.subtotal') }}</th>
207207
<td class="border-top text-right">{{ $invoice->amount->formatted_item_subtotal }}</td>
208208
</tr>
209-
@foreach ($invoice->taxRates as $invoiceTaxRate)
209+
@foreach ($invoice->summarized_taxes as $tax)
210210
<tr>
211-
<td colspan="{{ $colspan }}" class="text-right">{{ $invoiceTaxRate->taxRate->name }} {{ $invoiceTaxRate->taxRate->formatted_percent }}</td>
212-
<td class="text-right">{{ $invoiceTaxRate->formatted_tax_total }}</td>
211+
<td colspan="{{ $colspan }}" class="text-right text-normal">{{{ mb_strtoupper($tax->name) }}} {{{ $tax->percent }}}</td>
212+
<td class="text-right">{{{ $tax->total }}}</td>
213213
</tr>
214214
@endforeach
215+
@if (count($invoice->summarized_taxes) > 1)
215216
<tr>
216217
<th colspan="{{ $colspan }}" class="text-right text-normal">{{ trans('fi.total') }} {{ trans('fi.tax') }}</th>
217218
<td class="text-right">{{ $invoice->amount->formatted_total_tax }}</td>
218219
</tr>
220+
@endif
219221
@endif
220222
<tr>
221223
<th colspan="{{ $colspan }}" class="text-right">{{ trans('fi.total') }}</th>

app/FI/Modules/Templates/Views/templates/quotes/area.blade.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
<th>{{ trans('fi.product') }}</th>
180180
<th class="text-right" style="width:70px;">{{ trans('fi.quantity') }}</th>
181181
<th class="text-right" style="width:70px;">{{ trans('fi.price') }}</th>
182-
@if ($quote->amount->formatted_total_tax != '')<th class="text-right" style="width:70px;">{{ trans('fi.tax_rate') }}</th>@endif
182+
@if ($quote->amount->total_tax > 0)<th class="text-right" style="width:70px;">{{ trans('fi.tax_rate') }}</th>@endif
183183
<th class="text-right" style="width:80px;">{{ trans('fi.subtotal') }}</th>
184184
</tr>
185185
</thead>
@@ -192,29 +192,31 @@
192192
</td>
193193
<td class="text-right">{{ $item->formatted_quantity }}</td>
194194
<td class="text-right">{{ $item->formatted_price }}</td>
195-
@if ($quote->amount->formatted_total_tax != '')<td class="text-right">@if ($item->taxRate) {{ $item->taxRate->formatted_percent }} @endif</td>@endif
195+
@if ($quote->amount->total_tax > 0)<td class="text-right">@if ($item->taxRate) {{ $item->taxRate->formatted_percent }} @endif</td>@endif
196196
<td class="text-right">{{ $item->amount->formatted_subtotal }}</td>
197197
</tr>
198198
@endforeach
199199
</tbody>
200200
<tfoot>
201201
{{--*/ $colspan = 3 /*--}}
202-
@if ($quote->amount->formatted_total_tax != '')
202+
@if ($quote->amount->total_tax > 0)
203203
{{--*/ $colspan = 4 /*--}}
204204
<tr>
205205
<th colspan="{{ $colspan }}" class="border-top text-right text-normal">{{ trans('fi.subtotal') }}</th>
206206
<td class="border-top text-right">{{ $quote->amount->formatted_item_subtotal }}</td>
207207
</tr>
208-
@foreach ($quote->taxRates as $quoteTaxRate)
208+
@foreach ($quote->summarized_taxes as $tax)
209209
<tr>
210-
<td colspan="{{ $colspan }}" class="text-right">{{ $quoteTaxRate->taxRate->name }} {{ $quoteTaxRate->taxRate->formatted_percent }}</td>
211-
<td class="text-right">{{ $quoteTaxRate->formatted_tax_total }}</td>
210+
<td colspan="{{ $colspan }}" class="text-right text-normal">{{{ mb_strtoupper($tax->name) }}} {{{ $tax->percent }}}</td>
211+
<td class="text-right">{{{ $tax->total }}}</td>
212212
</tr>
213213
@endforeach
214+
@if (count($quote->summarized_taxes) > 1)
214215
<tr>
215216
<th colspan="{{ $colspan }}" class="text-right text-normal">{{ trans('fi.total') }} {{ trans('fi.tax') }}</th>
216217
<td class="text-right">{{ $quote->amount->formatted_total_tax }}</td>
217218
</tr>
219+
@endif
218220
@endif
219221
<tr>
220222
<th colspan="{{ $colspan }}" class="text-right">{{ trans('fi.total') }}</th>

0 commit comments

Comments
 (0)