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>
@ -445,9 +447,10 @@
<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">
@stack('button_dropdown_start')
@if ($bill->status != 'cancelled') @if ($bill->status != 'cancelled')
@stack('button_pay_start')
@if($bill->status != 'paid') @if($bill->status != 'paid')
@stack('button_pay_start')
@permission('update-purchases-bills') @permission('update-purchases-bills')
<a class="dropdown-item" href="{{ route('bills.paid', $bill->id) }}">{{ trans('bills.mark_paid') }}</a> <a class="dropdown-item" href="{{ route('bills.paid', $bill->id) }}">{{ trans('bills.mark_paid') }}</a>
@endpermission @endpermission
@ -455,19 +458,21 @@
@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
@stack('button_pay_end')
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
@endif @endif
@stack('button_pay_end')
@stack('button_received_start') @stack('button_dropdown_divider_1')
@permission('update-purchases-bills') @permission('update-purchases-bills')
@stack('button_received_start')
@if ($bill->status == 'draft') @if ($bill->status == 'draft')
<a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a> <a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a>
@else @else
<button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button> <button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button>
@endif @endif
@endpermission
@stack('button_received_end') @stack('button_received_end')
@endpermission
@endif @endif
@stack('button_pdf_start') @stack('button_pdf_start')
@ -482,6 +487,8 @@
@endif @endif
@endpermission @endpermission
@stack('button_dropdown_divider_2')
@permission('delete-purchases-bills') @permission('delete-purchases-bills')
@if (!$bill->reconciled) @if (!$bill->reconciled)
@stack('button_delete_start') @stack('button_delete_start')
@ -489,6 +496,7 @@
@stack('button_delete_end') @stack('button_delete_end')
@endif @endif
@endpermission @endpermission
@stack('button_dropdown_end')
</div> </div>
</div> </div>
@stack('button_group_end') @stack('button_group_end')

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>
@ -470,9 +472,10 @@
<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">
@stack('button_dropdown_start')
@if ($invoice->status != 'cancelled') @if ($invoice->status != 'cancelled')
@stack('button_pay_start')
@if ($invoice->status != 'paid') @if ($invoice->status != 'paid')
@stack('button_pay_start')
@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
@ -480,19 +483,21 @@
@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
@stack('button_pay_end')
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
@endif @endif
@stack('button_pay_end')
@stack('button_sent_start') @stack('button_dropdown_divider_1')
@permission('update-sales-invoices') @permission('update-sales-invoices')
@stack('button_sent_start')
@if ($invoice->status == 'draft') @if ($invoice->status == 'draft')
<a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a> <a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a>
@else @else
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button> <button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
@endif @endif
@endpermission
@stack('button_sent_end') @stack('button_sent_end')
@endpermission
@stack('button_email_start') @stack('button_email_start')
@if ($invoice->contact_email) @if ($invoice->contact_email)
@ -517,6 +522,8 @@
@endif @endif
@endpermission @endpermission
@stack('button_dropdown_divider_2')
@permission('delete-sales-invoices') @permission('delete-sales-invoices')
@if (!$invoice->reconciled) @if (!$invoice->reconciled)
@stack('button_delete_start') @stack('button_delete_start')
@ -524,6 +531,7 @@
@stack('button_delete_end') @stack('button_delete_end')
@endif @endif
@endpermission @endpermission
@stack('button_dropdown_end')
</div> </div>
</div> </div>
@stack('button_group_end') @stack('button_group_end')