fix total discount issue

This commit is contained in:
spvarma
2020-12-24 13:43:29 +05:30
parent fa512629d9
commit 8b04e94446
2 changed files with 50 additions and 44 deletions

View File

@ -94,26 +94,27 @@
</tr> </tr>
@endforeach @endforeach
@endif @endif
@if($estimate->discount > 0)
@if ($estimate->discount_per_item === 'NO') @if ($estimate->discount_per_item === 'NO')
<tr> <tr>
<td class="pl-10 border-0 total-table-attribute-label"> <td class="pl-10 border-0 total-table-attribute-label">
@if($estimate->discount_type === 'fixed') @if($estimate->discount_type === 'fixed')
@lang('pdf_discount_label') @lang('pdf_discount_label')
@endif @endif
@if($estimate->discount_type === 'percentage') @if($estimate->discount_type === 'percentage')
@lang('pdf_discount_label') ({{$estimate->discount}}%) @lang('pdf_discount_label') ({{$estimate->discount}}%)
@endif @endif
</td> </td>
<td class="text-right border-0 item-cell total-table-attribute-value"> <td class="text-right border-0 item-cell total-table-attribute-value">
@if($estimate->discount_type === 'fixed') @if($estimate->discount_type === 'fixed')
{!! format_money_pdf($estimate->discount_val, $estimate->user->currency) !!} {!! format_money_pdf($estimate->discount_val, $estimate->user->currency) !!}
@endif @endif
@if($estimate->discount_type === 'percentage') @if($estimate->discount_type === 'percentage')
{!! format_money_pdf($estimate->discount_val, $estimate->user->currency) !!} {!! format_money_pdf($estimate->discount_val, $estimate->user->currency) !!}
@endif @endif
</td> </td>
</tr> </tr>
@endif
@endif @endif
<tr> <tr>
<td class="py-3"></td> <td class="py-3"></td>

View File

@ -39,19 +39,21 @@
> >
{!! format_money_pdf($item->price, $invoice->user->currency) !!} {!! format_money_pdf($item->price, $invoice->user->currency) !!}
</td> </td>
@if($invoice->discount_per_item === 'YES') @if($invoice->discount_per_item === 'YES')
<td <td
class="pl-10 text-right item-cell" class="pl-10 text-right item-cell"
style="vertical-align: top;" style="vertical-align: top;"
> >
@if($item->discount_type === 'fixed') @if($item->discount_type === 'fixed')
{!! format_money_pdf($item->discount_val, $invoice->user->currency) !!} {!! format_money_pdf($item->discount_val, $invoice->user->currency) !!}
@endif @endif
@if($item->discount_type === 'percentage') @if($item->discount_type === 'percentage')
{{$item->discount}}% {{$item->discount}}%
@endif @endif
</td> </td>
@endif @endif
<td <td
class="text-right item-cell" class="text-right item-cell"
style="vertical-align: top;" style="vertical-align: top;"
@ -100,26 +102,29 @@
@endforeach @endforeach
@endif @endif
@if ($invoice->discount_per_item === 'NO') @if($invoice->discount > 0)
<tr> @if ($invoice->discount_per_item === 'NO')
<td class="border-0 total-table-attribute-label"> <tr>
@if($invoice->discount_type === 'fixed') <td class="border-0 total-table-attribute-label">
@lang('pdf_discount_label') @if($invoice->discount_type === 'fixed')
@endif @lang('pdf_discount_label')
@if($invoice->discount_type === 'percentage') @endif
@lang('pdf_discount_label') ({{$invoice->discount}}%) @if($invoice->discount_type === 'percentage')
@endif @lang('pdf_discount_label') ({{$invoice->discount}}%)
</td> @endif
<td class="py-2 border-0 item-cell total-table-attribute-value" > </td>
@if($invoice->discount_type === 'fixed') <td class="py-2 border-0 item-cell total-table-attribute-value" >
{!! format_money_pdf($invoice->discount_val, $invoice->user->currency) !!} @if($invoice->discount_type === 'fixed')
@endif {!! format_money_pdf($invoice->discount_val, $invoice->user->currency) !!}
@if($invoice->discount_type === 'percentage') @endif
{!! format_money_pdf($invoice->discount_val, $invoice->user->currency) !!} @if($invoice->discount_type === 'percentage')
@endif {!! format_money_pdf($invoice->discount_val, $invoice->user->currency) !!}
</td> @endif
</tr> </td>
</tr>
@endif
@endif @endif
<tr> <tr>
<td class="py-3"></td> <td class="py-3"></td>
<td class="py-3"></td> <td class="py-3"></td>