Skip to content

Commit

Permalink
Works with compound taxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb33300 committed Mar 23, 2015
1 parent d27edd3 commit 46774bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

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

1.1.0 version only works with FusionInvoice 1.6.0 or higher

##How to use
- Download this repository by clicking the "Download Zip" button on the right
- Upload the app/ folder in the root folder of your FusionInvoice installation
- Change the default invoice and quote template in your FusionInvoice system settings
- If you have a logo, recommended height is 150px

##TODO / Known Issues
- $quote->amount->total_tax not working (FusionInvoce core issue)
- Taxes details only work when an invoice tax rate is defined (not with items taxes) (FusionInvoce core issue)
- Mixing invoice tax rate and items taxes make taxes details incorrect (FusionInvoce core issue)
- Translations for "Total taxes", "Total excluding taxes", "Total including taxes" (FusionInvoce core issue)
- Set a fixed height for the details table ([DomPDF issue](https://github.com/dompdf/dompdf/issues/857))
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,18 @@
<th colspan="{{ $colspan }}" class="border-top text-right text-normal">{{ trans('fi.subtotal') }}</th>
<td class="border-top text-right">{{ $invoice->amount->formatted_item_subtotal }}</td>
</tr>
@foreach ($invoice->taxRates as $invoiceTaxRate)
@foreach ($invoice->summarized_taxes as $tax)
<tr>
<td colspan="{{ $colspan }}" class="text-right">{{ $invoiceTaxRate->taxRate->name }} {{ $invoiceTaxRate->taxRate->formatted_percent }}</td>
<td class="text-right">{{ $invoiceTaxRate->formatted_tax_total }}</td>
<td colspan="{{ $colspan }}" class="text-right text-normal">{{{ mb_strtoupper($tax->name) }}} {{{ $tax->percent }}}</td>
<td class="text-right">{{{ $tax->total }}}</td>
</tr>
@endforeach
@if (count($invoice->summarized_taxes) > 1)
<tr>
<th colspan="{{ $colspan }}" class="text-right text-normal">{{ trans('fi.total') }} {{ trans('fi.tax') }}</th>
<td class="text-right">{{ $invoice->amount->formatted_total_tax }}</td>
</tr>
@endif
@endif
<tr>
<th colspan="{{ $colspan }}" class="text-right">{{ trans('fi.total') }}</th>
Expand Down
14 changes: 8 additions & 6 deletions app/FI/Modules/Templates/Views/templates/quotes/area.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<th>{{ trans('fi.product') }}</th>
<th class="text-right" style="width:70px;">{{ trans('fi.quantity') }}</th>
<th class="text-right" style="width:70px;">{{ trans('fi.price') }}</th>
@if ($quote->amount->formatted_total_tax != '')<th class="text-right" style="width:70px;">{{ trans('fi.tax_rate') }}</th>@endif
@if ($quote->amount->total_tax > 0)<th class="text-right" style="width:70px;">{{ trans('fi.tax_rate') }}</th>@endif
<th class="text-right" style="width:80px;">{{ trans('fi.subtotal') }}</th>
</tr>
</thead>
Expand All @@ -192,29 +192,31 @@
</td>
<td class="text-right">{{ $item->formatted_quantity }}</td>
<td class="text-right">{{ $item->formatted_price }}</td>
@if ($quote->amount->formatted_total_tax != '')<td class="text-right">@if ($item->taxRate) {{ $item->taxRate->formatted_percent }} @endif</td>@endif
@if ($quote->amount->total_tax > 0)<td class="text-right">@if ($item->taxRate) {{ $item->taxRate->formatted_percent }} @endif</td>@endif
<td class="text-right">{{ $item->amount->formatted_subtotal }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
{{--*/ $colspan = 3 /*--}}
@if ($quote->amount->formatted_total_tax != '')
@if ($quote->amount->total_tax > 0)
{{--*/ $colspan = 4 /*--}}
<tr>
<th colspan="{{ $colspan }}" class="border-top text-right text-normal">{{ trans('fi.subtotal') }}</th>
<td class="border-top text-right">{{ $quote->amount->formatted_item_subtotal }}</td>
</tr>
@foreach ($quote->taxRates as $quoteTaxRate)
@foreach ($quote->summarized_taxes as $tax)
<tr>
<td colspan="{{ $colspan }}" class="text-right">{{ $quoteTaxRate->taxRate->name }} {{ $quoteTaxRate->taxRate->formatted_percent }}</td>
<td class="text-right">{{ $quoteTaxRate->formatted_tax_total }}</td>
<td colspan="{{ $colspan }}" class="text-right text-normal">{{{ mb_strtoupper($tax->name) }}} {{{ $tax->percent }}}</td>
<td class="text-right">{{{ $tax->total }}}</td>
</tr>
@endforeach
@if (count($quote->summarized_taxes) > 1)
<tr>
<th colspan="{{ $colspan }}" class="text-right text-normal">{{ trans('fi.total') }} {{ trans('fi.tax') }}</th>
<td class="text-right">{{ $quote->amount->formatted_total_tax }}</td>
</tr>
@endif
@endif
<tr>
<th colspan="{{ $colspan }}" class="text-right">{{ trans('fi.total') }}</th>
Expand Down

0 comments on commit 46774bb

Please sign in to comment.