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

View File

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

View File

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

View File

@ -402,27 +402,29 @@
<tbody>
@foreach ($invoice->totals_sorted as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@stack($total->code . '_td_end')
@stack($total->code . '_total_tr_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@stack($total->code . '_total_tr_end')
@else
@if ($invoice->paid)
@stack('paid_total_tr_start')
<tr>
<th class="text-success">
{{ trans('invoices.paid') }}:
</th>
<td class="text-success text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('paid_total_tr_end')
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@stack('grand_total_tr_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('grand_total_tr_end')
@endif
@endforeach
</tbody>
@ -445,87 +447,93 @@
<div class="col-xs-12 col-sm-8 text-right">
@stack('button_edit_start')
@if(!$invoice->reconciled)
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a>
@endif
@if(!$invoice->reconciled)
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a>
@endif
@stack('button_edit_end')
@stack('button_print_start')
<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') }}
</a>
<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') }}
</a>
@stack('button_print_end')
@if ($invoice->status != 'cancelled')
@stack('button_share_start')
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
<i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }}
</a>
@stack('button_share_end')
@stack('button_share_start')
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
<i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }}
</a>
@stack('button_share_end')
@endif
@stack('button_group_start')
<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>
<div class="dropdown-menu" role="menu">
@if ($invoice->status != 'cancelled')
<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>
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
@if ($invoice->status != 'cancelled')
@if ($invoice->status != 'paid')
@stack('button_pay_start')
@if ($invoice->status != 'paid')
@permission('update-sales-invoices')
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
@endpermission
@permission('update-sales-invoices')
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
@endpermission
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
@endif
<div class="dropdown-divider"></div>
@endif
@if (empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
@endif
@stack('button_pay_end')
@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')
<div class="dropdown-divider"></div>
@endif
@stack('button_pdf_start')
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
@stack('button_pdf_end')
@stack('button_dropdown_divider_1')
@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')
@stack('button_sent_start')
@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
@stack('button_sent_end')
@endpermission
@permission('delete-sales-invoices')
@if (!$invoice->reconciled)
@stack('button_delete_start')
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
@stack('button_delete_end')
@endif
@endpermission
</div>
@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
@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>
@stack('button_group_end')
</div>
</div>