close #46 Enhancement: Bill and Invoice improve total status and system

This commit is contained in:
cuneytsenturk
2017-10-11 19:52:35 +03:00
parent 40dea7fa99
commit d36bcaaf13
14 changed files with 716 additions and 148 deletions

View File

@ -112,26 +112,15 @@
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table">
<table class="table">
<tbody>
@foreach($invoice->totals as $total)
<tr>
<th style="width:50%">{{ trans('bills.sub_total') }}:</th>
<td class="text-right">@money($bill->sub_total, $bill->currency_code, true)</td>
</tr>
<tr>
<th>{{ trans('bills.tax_total') }}:</th>
<td class="text-right">@money($bill->tax_total, $bill->currency_code, true)</td>
</tr>
@if($bill->paid)
<tr>
<th>{{ trans('bills.paid') }}:</th>
<td class="text-right">@money('-' . $bill->paid, $bill->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans('bills.total') }}:</th>
<td class="text-right">@money($bill->grand_total, $bill->currency_code, true)</td>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>

View File

@ -95,7 +95,7 @@
</td>
<td class="text-center">{{ $item->quantity }}</td>
<td class="text-right">@money($item->price, $bill->currency_code, true)</td>
<td class="text-right">@money($item->total - $item->tax, $bill->currency_code, true)</td>
<td class="text-right">@money($item->total, $bill->currency_code, true)</td>
</tr>
@endforeach
</tbody>
@ -117,24 +117,25 @@
<div class="table-responsive">
<table class="table">
<tbody>
<tr>
<th style="width:50%">{{ trans('bills.sub_total') }}:</th>
<td class="text-right">@money($bill->sub_total, $bill->currency_code, true)</td>
</tr>
<tr>
<th>{{ trans('bills.tax_total') }}:</th>
<td class="text-right">@money($bill->tax_total, $bill->currency_code, true)</td>
</tr>
@if($bill->paid)
<tr>
<th>{{ trans('bills.paid') }}:</th>
<td class="text-right">@money('-' . $bill->paid, $bill->currency_code, true)</td>
</tr>
@foreach($invoice->totals as $total)
@if($total->code != 'total')
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">@money('-' . $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans('bills.total') }}:</th>
<td class="text-right">@money($bill->grand_total, $bill->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>

View File

@ -114,24 +114,12 @@
<div class="table-responsive">
<table class="table">
<tbody>
@foreach($invoice->totals as $total)
<tr>
<th style="max-width: 214px">{{ trans('invoices.sub_total') }}:</th>
<td class="text-right">@money($invoice->sub_total, $invoice->currency_code, true)</td>
</tr>
<tr>
<th>{{ trans('invoices.tax_total') }}:</th>
<td class="text-right">@money($invoice->tax_total, $invoice->currency_code, true)</td>
</tr>
@if($invoice->paid)
<tr>
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">@money('-' . $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans('invoices.total') }}:</th>
<td class="text-right">@money($invoice->grand_total, $invoice->currency_code, true)</td>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>

View File

@ -95,7 +95,7 @@
</td>
<td class="text-center">{{ $item->quantity }}</td>
<td class="text-right">@money($item->price, $invoice->currency_code, true)</td>
<td class="text-right">@money($item->total - $item->tax, $invoice->currency_code, true)</td>
<td class="text-right">@money($item->total, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
@ -117,24 +117,25 @@
<div class="table-responsive">
<table class="table">
<tbody>
<tr>
<th>{{ trans('invoices.sub_total') }}:</th>
<td class="text-right">@money($invoice->sub_total, $invoice->currency_code, true)</td>
</tr>
<tr>
<th>{{ trans('invoices.tax_total') }}:</th>
<td class="text-right">@money($invoice->tax_total, $invoice->currency_code, true)</td>
</tr>
@if ($invoice->paid)
<tr>
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">@money('-' . $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@foreach($invoice->totals as $total)
@if($total->code != 'total')
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">@money('-' . $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans('invoices.total') }}:</th>
<td class="text-right">@money($invoice->grand_total, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>