{{ (@$incomes) ? 'Edit Income' : 'Add Income' }}

{{ Form::open( [ 'method'=> 'POST', 'url' => route('incomes.store'), 'id'=> 'incomes_save', 'enctype' => 'multipart/form-data']) }} {{Form::hidden('id',@$incomes->id) }}
{{Form::text( 'date', ((@$incomes->id && @$incomes->date != NULL) ? date(LaraCore::setting('date_format'),strtotime(@$incomes->date)) : @$today), [ "class" => "form-control date_input", "id" => 'date' ]) }}
{{ Form::select( 'client_id', @$clients, ((@$incomes->id) ? @$incomes->client_id : ""), [ "class" => "form-control select2" ] ) }}
{{--
{{ Form::select( 'type', @$type, ((@$incomes->id) ? @$incomes->type : ""), [ "class" => "form-control select2" ] ) }}
--}} {{ Form::hidden('type', 1, ['id' => 'type']) }}
{{Form::text( 'amount', ((@$incomes->id) ? (@$incomes->amount) + (@$incomes->tds) + (@$incomes->discount) : ""), [ "class" => "form-control", "placeholder" => "", "id" => "add-income-amount" ]) }}
{{--
{{Form::text( 'bill_no', (@$bill_no != '' ? $bill_no : ((@$incomes->bill_no && @$incomes->bill_no != NULL) ? @$incomes->bill_no : '')), ["class"=>"form-control padd-right-text",]) }}
--}}
{{Form::number( 'tds', ((@$incomes->id) ? @$incomes->tds : ""), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::number( 'discount', ((@$incomes->id) ? @$incomes->discount : ""), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::textarea( 'description', ((@$incomes->id) ? @$incomes->description : ""), [ "class" => "form-control", "rows" => 3, "placeholder" => "" ]) }}
@if(isset($unpaid_bills) && $unpaid_bills->isNotEmpty())

Unpaid Bills

Total Balance/Credit: {{ isset($balance) ? $balance->amount : 0 }}

Bills that automatically checked can be paid from your balance/credit amount.

@php $balanceAmount = isset($balance) ? $balance->amount : false; @endphp @foreach($unpaid_bills as $bill) @php $checked = false; $grandTotal = (float) $bill->grandtotal; $roundingAmount = (float) ($bill->rounding_amount ?? 0); $displayAmount = $grandTotal; if (isset($client) && $client->is_rounded_bill_amounts == 0 && $roundingAmount !== null) { $displayAmount = $grandTotal - $roundingAmount; } elseif (isset($client) && $client->is_rounded_bill_amounts == 1) { $ceilAmount = ceil($grandTotal); $floorAmount = floor($grandTotal); $roundValue = $ceilAmount - $grandTotal; $displayAmount = ($roundValue < 0.50 ? $ceilAmount : $floorAmount); } if ($balanceAmount && ($balanceAmount - $displayAmount) > 0) { $balanceAmount -= $displayAmount; $checked = true; } @endphp @endforeach
Mark as Paid? Month Dues ( Total: {{ $unpaid_bills->sum(function ($bill) { return round($bill->grandtotal); }) - (isset($balance) ? $balance->amount : 0) }}) Bill No.
{{ $bill->month }} {{ number_format($displayAmount, 2) }} {{ $bill->billno }}
@endif
{{ Form::close() }}