added more stacks

This commit is contained in:
Denis Duliçi 2020-08-07 15:26:34 +03:00
parent 3f3a412000
commit 30639e29b6
4 changed files with 168 additions and 144 deletions

View File

@ -238,27 +238,29 @@
<tbody> <tbody>
@foreach ($invoice->totals_sorted as $total) @foreach ($invoice->totals_sorted as $total)
@if ($total->code != 'total') @if ($total->code != 'total')
@stack($total->code . '_td_start') @stack($total->code . '_total_tr_start')
<tr> <tr>
<th>{{ trans($total->title) }}:</th> <th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr> </tr>
@stack($total->code . '_td_end') @stack($total->code . '_total_tr_end')
@else @else
@if ($invoice->paid) @if ($invoice->paid)
@stack('paid_total_tr_start')
<tr> <tr>
<th class="text-success"> <th class="text-success">
{{ trans('invoices.paid') }}: {{ trans('invoices.paid') }}:
</th> </th>
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td> <td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('paid_total_tr_end')
@endif @endif
@stack('grand_total_td_start') @stack('grand_total_tr_start')
<tr> <tr>
<th>{{ trans($total->name) }}:</th> <th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('grand_total_td_end') @stack('grand_total_tr_end')
@endif @endif
@endforeach @endforeach
</tbody> </tbody>

View File

@ -186,21 +186,27 @@
<tbody> <tbody>
@foreach($invoice->totals_sorted as $total) @foreach($invoice->totals_sorted as $total)
@if($total->code != 'total') @if($total->code != 'total')
@stack($total->code . '_total_tr_start')
<tr> <tr>
<th>{{ trans($total['name']) }}:</th> <th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr> </tr>
@stack($total->code . '_total_tr_end')
@else @else
@if ($invoice->paid) @if ($invoice->paid)
@stack('paid_total_tr_start')
<tr class="text-success"> <tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th> <th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td> <td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('paid_total_tr_end')
@endif @endif
@stack('grand_total_tr_start')
<tr> <tr>
<th>{{ trans($total['name']) }}:</th> <th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('grand_total_tr_end')
@endif @endif
@endforeach @endforeach
</tbody> </tbody>

View File

@ -385,27 +385,29 @@
<tbody> <tbody>
@foreach ($bill->totals_sorted as $total) @foreach ($bill->totals_sorted as $total)
@if ($total->code != 'total') @if ($total->code != 'total')
@stack($total->code . '_td_start') @stack($total->code . '_total_tr_start')
<tr> <tr>
<th>{{ trans($total->title) }}:</th> <th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $bill->currency_code, true)</td> <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
</tr> </tr>
@stack($total->code . '_td_end') @stack($total->code . '_total_tr_end')
@else @else
@if ($bill->paid) @if ($bill->paid)
@stack('paid_total_tr_start')
<tr> <tr>
<th class="text-success"> <th class="text-success">
{{ trans('bills.paid') }}: {{ trans('bills.paid') }}:
</th> </th>
<td class="text-success text-right">- @money($bill->paid, $bill->currency_code, true)</td> <td class="text-success text-right">- @money($bill->paid, $bill->currency_code, true)</td>
</tr> </tr>
@stack('paid_total_tr_end')
@endif @endif
@stack('grand_total_td_start') @stack('grand_total_tr_start')
<tr> <tr>
<th>{{ trans($total->name) }}:</th> <th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td> <td class="text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
</tr> </tr>
@stack('grand_total_td_end') @stack('grand_total_tr_end')
@endif @endif
@endforeach @endforeach
</tbody> </tbody>
@ -428,69 +430,75 @@
<div class="col-xs-12 col-sm-8 text-right"> <div class="col-xs-12 col-sm-8 text-right">
@stack('button_edit_start') @stack('button_edit_start')
@if(!$bill->reconciled) @if(!$bill->reconciled)
<a href="{{ route('bills.edit', $bill->id) }}" class="btn btn-info header-button-top"> <a href="{{ route('bills.edit', $bill->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }} <i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a> </a>
@endif @endif
@stack('button_edit_end') @stack('button_edit_end')
@stack('button_print_start') @stack('button_print_start')
<a href="{{ route('bills.print', $bill->id) }}" target="_blank" class="btn btn-success header-button-top"> <a href="{{ route('bills.print', $bill->id) }}" target="_blank" class="btn btn-success header-button-top">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }} <i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a> </a>
@stack('button_print_end') @stack('button_print_end')
@stack('button_group_start') @stack('button_group_start')
<div class="dropup header-drop-top"> <div class="dropup header-drop-top">
<button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button> <button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button>
<div class="dropdown-menu" role="menu"> <div class="dropdown-menu" role="menu">
@if ($bill->status != 'cancelled') @stack('button_dropdown_start')
@stack('button_pay_start') @if ($bill->status != 'cancelled')
@if($bill->status != 'paid') @if($bill->status != 'paid')
@permission('update-purchases-bills') @stack('button_pay_start')
<a class="dropdown-item" href="{{ route('bills.paid', $bill->id) }}">{{ trans('bills.mark_paid') }}</a> @permission('update-purchases-bills')
@endpermission <a class="dropdown-item" href="{{ route('bills.paid', $bill->id) }}">{{ trans('bills.mark_paid') }}</a>
@endpermission
@if(empty($bill->paid) || ($bill->paid != $bill->amount)) @if(empty($bill->paid) || ($bill->paid != $bill->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('bills.add_payment') }}</button> <button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('bills.add_payment') }}</button>
@endif @endif
<div class="dropdown-divider"></div>
@endif
@stack('button_pay_end') @stack('button_pay_end')
<div class="dropdown-divider"></div>
@stack('button_received_start')
@permission('update-purchases-bills')
@if($bill->status == 'draft')
<a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a>
@else
<button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button>
@endif
@endpermission
@stack('button_received_end')
@endif @endif
@stack('button_pdf_start') @stack('button_dropdown_divider_1')
<a class="dropdown-item" href="{{ route('bills.pdf', $bill->id) }}">{{ trans('bills.download_pdf') }}</a>
@stack('button_pdf_end')
@permission('update-purchases-bills') @permission('update-purchases-bills')
@if ($bill->status != 'cancelled') @stack('button_received_start')
@stack('button_cancelled_start') @if ($bill->status == 'draft')
<a class="dropdown-item" href="{{ route('bills.cancelled', $bill->id) }}">{{ trans('general.cancel') }}</a> <a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a>
@stack('button_cancelled_end') @else
<button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button>
@endif @endif
@stack('button_received_end')
@endpermission @endpermission
@endif
@permission('delete-purchases-bills') @stack('button_pdf_start')
@if (!$bill->reconciled) <a class="dropdown-item" href="{{ route('bills.pdf', $bill->id) }}">{{ trans('bills.download_pdf') }}</a>
@stack('button_delete_start') @stack('button_pdf_end')
{!! Form::deleteLink($bill, 'purchases/bills') !!}
@stack('button_delete_end') @permission('update-purchases-bills')
@endif @if ($bill->status != 'cancelled')
@endpermission @stack('button_cancelled_start')
</div> <a class="dropdown-item" href="{{ route('bills.cancelled', $bill->id) }}">{{ trans('general.cancel') }}</a>
@stack('button_cancelled_end')
@endif
@endpermission
@stack('button_dropdown_divider_2')
@permission('delete-purchases-bills')
@if (!$bill->reconciled)
@stack('button_delete_start')
{!! Form::deleteLink($bill, 'purchases/bills') !!}
@stack('button_delete_end')
@endif
@endpermission
@stack('button_dropdown_end')
</div> </div>
</div>
@stack('button_group_end') @stack('button_group_end')
</div> </div>
</div> </div>

View File

@ -402,27 +402,29 @@
<tbody> <tbody>
@foreach ($invoice->totals_sorted as $total) @foreach ($invoice->totals_sorted as $total)
@if ($total->code != 'total') @if ($total->code != 'total')
@stack($total->code . '_td_start') @stack($total->code . '_total_tr_start')
<tr> <tr>
<th>{{ trans($total->title) }}:</th> <th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr> </tr>
@stack($total->code . '_td_end') @stack($total->code . '_total_tr_end')
@else @else
@if ($invoice->paid) @if ($invoice->paid)
@stack('paid_total_tr_start')
<tr> <tr>
<th class="text-success"> <th class="text-success">
{{ trans('invoices.paid') }}: {{ trans('invoices.paid') }}:
</th> </th>
<td class="text-success text-right">- @money($invoice->paid, $invoice->currency_code, true)</td> <td class="text-success text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('paid_total_tr_end')
@endif @endif
@stack('grand_total_td_start') @stack('grand_total_tr_start')
<tr> <tr>
<th>{{ trans($total->name) }}:</th> <th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td> <td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr> </tr>
@stack('grand_total_td_end') @stack('grand_total_tr_end')
@endif @endif
@endforeach @endforeach
</tbody> </tbody>
@ -445,87 +447,93 @@
<div class="col-xs-12 col-sm-8 text-right"> <div class="col-xs-12 col-sm-8 text-right">
@stack('button_edit_start') @stack('button_edit_start')
@if(!$invoice->reconciled) @if(!$invoice->reconciled)
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top"> <a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }} <i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a> </a>
@endif @endif
@stack('button_edit_end') @stack('button_edit_end')
@stack('button_print_start') @stack('button_print_start')
<a href="{{ route('invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success header-button-top"> <a href="{{ route('invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success header-button-top">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }} <i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a> </a>
@stack('button_print_end') @stack('button_print_end')
@if ($invoice->status != 'cancelled') @if ($invoice->status != 'cancelled')
@stack('button_share_start') @stack('button_share_start')
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top"> <a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
<i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }} <i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }}
</a> </a>
@stack('button_share_end') @stack('button_share_end')
@endif @endif
@stack('button_group_start') @stack('button_group_start')
<div class="dropup header-drop-top"> <div class="dropup header-drop-top">
<button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button> <button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button>
<div class="dropdown-menu" role="menu"> <div class="dropdown-menu" role="menu">
@if ($invoice->status != 'cancelled') @stack('button_dropdown_start')
@if ($invoice->status != 'cancelled')
@if ($invoice->status != 'paid')
@stack('button_pay_start') @stack('button_pay_start')
@if ($invoice->status != 'paid') @permission('update-sales-invoices')
@permission('update-sales-invoices') <a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a> @endpermission
@endpermission
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount)) @if (empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button> <button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
@endif @endif
<div class="dropdown-divider"></div>
@endif
@stack('button_pay_end') @stack('button_pay_end')
<div class="dropdown-divider"></div>
@stack('button_sent_start')
@permission('update-sales-invoices')
@if ($invoice->status == 'draft')
<a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a>
@else
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
@endif
@endpermission
@stack('button_sent_end')
@stack('button_email_start')
@if ($invoice->contact_email)
<a class="dropdown-item" href="{{ route('invoices.email', $invoice->id) }}">{{ trans('invoices.send_mail') }}</a>
@else
<button type="button" class="dropdown-item" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
</button>
@endif
@stack('button_email_end')
@endif @endif
@stack('button_pdf_start') @stack('button_dropdown_divider_1')
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
@stack('button_pdf_end')
@permission('update-sales-invoices') @permission('update-sales-invoices')
@if ($invoice->status != 'cancelled') @stack('button_sent_start')
@stack('button_cancelled_start') @if ($invoice->status == 'draft')
<a class="dropdown-item" href="{{ route('invoices.cancelled', $invoice->id) }}">{{ trans('general.cancel') }}</a> <a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a>
@stack('button_cancelled_end') @else
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
@endif @endif
@stack('button_sent_end')
@endpermission @endpermission
@permission('delete-sales-invoices') @stack('button_email_start')
@if (!$invoice->reconciled) @if ($invoice->contact_email)
@stack('button_delete_start') <a class="dropdown-item" href="{{ route('invoices.email', $invoice->id) }}">{{ trans('invoices.send_mail') }}</a>
{!! Form::deleteLink($invoice, 'sales/invoices') !!} @else
@stack('button_delete_end') <button type="button" class="dropdown-item" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
@endif <span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
@endpermission </button>
</div> @endif
@stack('button_email_end')
@endif
@stack('button_pdf_start')
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
@stack('button_pdf_end')
@permission('update-sales-invoices')
@if ($invoice->status != 'cancelled')
@stack('button_cancelled_start')
<a class="dropdown-item" href="{{ route('invoices.cancelled', $invoice->id) }}">{{ trans('general.cancel') }}</a>
@stack('button_cancelled_end')
@endif
@endpermission
@stack('button_dropdown_divider_2')
@permission('delete-sales-invoices')
@if (!$invoice->reconciled)
@stack('button_delete_start')
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
@stack('button_delete_end')
@endif
@endpermission
@stack('button_dropdown_end')
</div> </div>
</div>
@stack('button_group_end') @stack('button_group_end')
</div> </div>
</div> </div>