-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
140 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire; | ||
|
||
use Livewire\Component; | ||
|
||
class PayInvoiceForm extends Component | ||
{ | ||
public $feeInvoice; | ||
|
||
public function mount() | ||
{ | ||
$this->feeInvoice->loadMissing('feeInvoiceRecords', 'feeInvoiceRecords.fee'); | ||
} | ||
public function render() | ||
{ | ||
return view('livewire.pay-invoice-form'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class PayFeeInvoiceRequest extends FormRequest | ||
{ | ||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'pay' => "required|integer:min:-10000000000000|max:10000000000000", | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2 class="card-title">{{$feeInvoice->name}}</h2> | ||
</div> | ||
<div class="card-body"> | ||
<x-display-validation-errors/> | ||
@foreach ($feeInvoice->feeInvoiceRecords as $record) | ||
<form action="{{route('fee-invoices-records.pay', $record->id)}}" method="POST" class="col-span-5 overflow-scroll beautify-scrollbar grid grid-rows-1 md:grid-cols-5 gap-2 items-center border-b p-2 md:py-0" x-data="{'amount': {{$record->amount->getAmount()->toInt()}}, 'waiver': {{$record->waiver->getAmount()->toInt()}}, 'fine': {{$record->fine->getAmount()->toInt()}}, 'paid': {{$record->paid->getAmount()->toInt()}}, 'payment_amount' : 0 }"> | ||
<p class="font-bold md:font-bold">{{$record->fee->name }}</p> | ||
<x-input id="amount-{{$record['id']}}" name="pay" label="Payment Amount" type="number" x-model.number="payment_amount" error-bag="some-random-thing"/> | ||
<div class="md:place-self-center"> | ||
<p x-text="'Fee Amount: ' + amount"></p> | ||
<p x-text="'Fee Waiver: ' + waiver"></p> | ||
<p x-text="'Fee Fine: ' + fine"></p> | ||
<p x-text="'Fee Amount Paid: ' + paid"></p> | ||
</div> | ||
<p x-text="'Due: ' + (amount - waiver + fine - paid - payment_amount).toLocaleString()" class="md:place-self-center"></p> | ||
<input type="hidden" value="{{$record->fee->id}}"> | ||
<x-button label="Add Payment" class="self-" icon="fas fa-money-check-alt"/> | ||
@csrf | ||
</form> | ||
@endforeach | ||
<p class="my-3"> | ||
Note: The due stated might not be fully precise | ||
</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@extends('layouts.app', ['breadcrumbs' => [ | ||
['href'=> route('dashboard'), 'text'=> 'Dashboard'], | ||
['href'=> route('fees.index'), 'text'=> 'Fees'], | ||
['href'=> route('fee-invoices.index'), 'text'=> 'Fee Invoices'], | ||
['href'=> route('fee-invoices.pay', $feeInvoice->id), 'text'=> 'Pay', 'active'], | ||
]]) | ||
|
||
@section('title', __('Add Payments to Fees Invoice')) | ||
|
||
@section('page_heading', __('Add Payments to Fees Invoice')) | ||
|
||
@section('content', ) | ||
@livewire('pay-invoice-form' , compact('feeInvoice')) | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters