discount
This commit is contained in:
		@@ -114,17 +114,10 @@
 | 
			
		||||
                        <tbody>
 | 
			
		||||
                        @foreach($bill->totals as $total)
 | 
			
		||||
                            @if ($total->code != 'total')
 | 
			
		||||
                                @if (($total->code == 'tax') && isset($taxes[$total->name]))
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>{{ $taxes[$total->name] }}:</th>
 | 
			
		||||
                                        <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                @else
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>{{ trans($total->name) }}:</th>
 | 
			
		||||
                                        <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                @endif
 | 
			
		||||
                                <tr>
 | 
			
		||||
                                    <th>{{ trans($total->name) }}:</th>
 | 
			
		||||
                                    <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                </tr>
 | 
			
		||||
                            @else
 | 
			
		||||
                                @if ($bill->paid)
 | 
			
		||||
                                    <tr class="text-success">
 | 
			
		||||
 
 | 
			
		||||
@@ -76,6 +76,15 @@
 | 
			
		||||
                            <td class="text-right" colspan="5"><strong>{{ trans('bills.sub_total') }}</strong></td>
 | 
			
		||||
                            <td class="text-right"><span id="sub-total">0</span></td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td class="text-right" style="vertical-align: middle;" colspan="5"><strong>{{ trans('bills.discount') }}</strong></td>
 | 
			
		||||
                            <td class="text-right">
 | 
			
		||||
                                <div class="input-group">
 | 
			
		||||
                                    <div class="input-group-addon"><i class="fa fa-percent"></i></div>
 | 
			
		||||
                                    {!! Form::number('discount', null, ['class' => 'form-control text-right']) !!}
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td class="text-right" colspan="5"><strong>{{ trans_choice('general.taxes', 1) }}</strong></td>
 | 
			
		||||
                            <td class="text-right"><span id="tax-total">0</span></td>
 | 
			
		||||
@@ -255,7 +264,7 @@
 | 
			
		||||
                url: '{{ url("items/items/totalItem") }}',
 | 
			
		||||
                type: 'POST',
 | 
			
		||||
                dataType: 'JSON',
 | 
			
		||||
                data: $('#currency_code, #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select'),
 | 
			
		||||
                data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select'),
 | 
			
		||||
                headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
 | 
			
		||||
                success: function(data) {
 | 
			
		||||
                    if (data) {
 | 
			
		||||
 
 | 
			
		||||
@@ -92,6 +92,15 @@
 | 
			
		||||
                                <td class="text-right" colspan="5"><strong>{{ trans('bills.sub_total') }}</strong></td>
 | 
			
		||||
                                <td class="text-right"><span id="sub-total">0</span></td>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td class="text-right" style="vertical-align: middle;" colspan="5"><strong>{{ trans('bills.discount') }}</strong></td>
 | 
			
		||||
                            <td class="text-right">
 | 
			
		||||
                                <div class="input-group">
 | 
			
		||||
                                    <div class="input-group-addon"><i class="fa fa-percent"></i></div>
 | 
			
		||||
                                    {!! Form::number('discount', $bill->discount, ['class' => 'form-control text-right']) !!}
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <td class="text-right" colspan="5"><strong>{{ trans_choice('general.taxes', 1) }}</strong></td>
 | 
			
		||||
                                <td class="text-right"><span id="tax-total">0</span></td>
 | 
			
		||||
@@ -300,7 +309,7 @@
 | 
			
		||||
                url: '{{ url("items/items/totalItem") }}',
 | 
			
		||||
                type: 'POST',
 | 
			
		||||
                dataType: 'JSON',
 | 
			
		||||
                data: $('#currency_code, #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select'),
 | 
			
		||||
                data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select'),
 | 
			
		||||
                headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
 | 
			
		||||
                success: function(data) {
 | 
			
		||||
                    if (data) {
 | 
			
		||||
 
 | 
			
		||||
@@ -119,17 +119,10 @@
 | 
			
		||||
                            <tbody>
 | 
			
		||||
                                @foreach ($bill->totals as $total)
 | 
			
		||||
                                @if ($total->code != 'total')
 | 
			
		||||
                                    @if (($total->code == 'tax') && isset($taxes[$total->name]))
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>{{ $taxes[$total->name] }}:</th>
 | 
			
		||||
                                            <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @else
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th>{{ trans($total->name) }}:</th>
 | 
			
		||||
                                            <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    @endif
 | 
			
		||||
                                    <tr>
 | 
			
		||||
                                        <th>{{ trans($total->name) }}:</th>
 | 
			
		||||
                                        <td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
 | 
			
		||||
                                    </tr>
 | 
			
		||||
                                @else
 | 
			
		||||
                                    @if ($bill->paid)
 | 
			
		||||
                                        <tr class="text-success">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user