resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,206 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.add') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::open(['route' => 'fixed_assets.store','data-toggle'=>'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('fixed_assets.asset_name')) }}
{{ Form::text('name', '', ['class'=>'form-control compulsory','required']) }}
</div>
<div class="form-group">
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
{{ Form::text('serial_number', '', ['class'=>'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('cost_price', __('fixed_assets.cost_price') ." / Asset Value") }}
{{ Form::number('cost_price', '', ['class'=>'form-control compulsory', 'id'=>'cost_price', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
<div class="input-group">
{{ Form::text('acquisition_date','',['class' => 'form-control compulsory','required'=>'true','readonly'=>'true','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon" required><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
{{ Form::number('depreciation', '', ['class'=>'form-control', 'step' => 'any']) }}
</div>
<div class="form-group">
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
<br>
<div>
&nbsp;{{ Form::radio('item_condition', 1, false, ["required"]) }} New
&nbsp;{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
{{ Form::select('supplier', $suppliers, null, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, null, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
<div class="input-group">
{{ Form::text('warranty_expiration_date','',['class' => 'form-control','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
@php $payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset'); @endphp
<div class="form-group">
{{ Form::label('payment_type', 'Payment Type') }}
{{ Form::select('payment_type', $payment_type, null, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
</div>
<div id="cash_div" style="display: none">
<div class="form-group">
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
{{ Form::select('bank_account_id', $bank_chart_of_accounts, null, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount_paid', 'Amount Paid') }}
{{ Form::number('amount_paid', 0, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('balance', 'balance') }}
{{ Form::number('balance', 0, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div id="bill_div" style="display: none">
<div class="form-group">
{{ Form::label('payable_account', 'Payable Account') }}
{{ Form::select('payable_account', $payable_accounts, 14, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
{{ Form::label('description', __('fixed_assets.description')) }}
{{ Form::textArea('description', '', ['class'=>'form-control', 'rows' => 4]) }}
</div>
<button class="btn btn-rounded btn-success pull-right" onclick="return confirm('Are you sure you wish to purchase this asset ?')">{{ __('fixed_assets.create_fixed_asset') }}</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#datepicker-autoclose,#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: new Date(),
readOnly: true
});
$('#payment_type').change(function() {
if (this.value === 'cash') {
$('#cash_div').show();
$('#bill_div').hide();
} else if (this.value === 'bill') {
$('#cash_div').hide()
$('#bill_div').show()
} else {
$('#cash_div').hide()
$('#bill_div').hide()
}
});
function get_balance() {
var bill_div = $('#bill_div');
let cost_price = $('#cost_price').val();
let amount_paid = $('#amount_paid').val();
let balance = parseInt(cost_price) - parseInt(amount_paid);
$('#balance').val(balance);
(balance > 0) ? bill_div.show(): bill_div.hide();
}
</script>
@endpush
@@ -0,0 +1,248 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.edit') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::model($fixed_asset, ['method' => 'PUT', 'route' => ['fixed_assets.update',$fixed_asset], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('fixed_assets.asset_name')) }}
{{ Form::text('name', $fixed_asset->name, ['class'=>'form-control compulsory','required']) }}
</div>
<div class="form-group">
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
{{ Form::text('serial_number', $fixed_asset->serial_number , ['class'=>'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('cost_price', __('fixed_assets.cost_price')) }}
{{ Form::number('cost_price', $fixed_asset->cost_price , ['class'=>'form-control', 'readonly','onkeyup'=>'get_balance()']) }}
</div>
<div class="form-group"> @php $acquisition_date = \Carbon\Carbon::parse($fixed_asset->acquisition_date)->format('d-m-Y'); @endphp
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
<div class="input-group">
{{ Form::text('acquisition_date', $acquisition_date, ['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
{{ Form::number('depreciation', $fixed_asset->depreciation , ['class'=>'form-control', 'step' => 'any']) }}
</div>
<div class="form-group">
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
<br>
<div>
&nbsp;{{ Form::radio('item_condition', 1, false, ["required"]) }} New
&nbsp;{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
{{ Form::select('supplier', $suppliers, $fixed_asset->supplier_id, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, $fixed_asset->fixed_asset_account_id, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
<div class="input-group">
{{ Form::text('warranty_expiration_date',$fixed_asset->warranty_expiration_date,['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('edit_payment_type', 'Edit payment options') }}
<br>
<div>
&nbsp;{{ Form::radio('edit_payment_type', 1, false, ["required", "id" => "edit_payment"]) }} Yes
&nbsp;{{ Form::radio('edit_payment_type', 0, false, ["required", "id" => "do_not_edit_payment"]) }} No
</div>
<div class="help-block with-errors"></div>
</div>
@php
$payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset');
$balance = 0;
$payable_account_id = 14; //default payable
$bill = \Streamline\Models\HospitalBill::where(['item_ids' => $fixed_asset->id, 'bill_type' => 'ASSETS'])->first();
if ($bill) {
$balance = (int)$bill->total_amount;
$payable_account_id = $bill->payable_account;
}
@endphp
<div id="edit_payment_type_div" style="display: none;">
@if($fixed_asset->payment_type != null)
<div class="form-group">
{{ Form::label('payment_type', 'Payment Type') }}
{{ Form::select('payment_type', $payment_type, $fixed_asset->payment_type, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
</div>
<div id="cash_div" @if($fixed_asset->payment_type != "cash") style="display: none" @endif>
<div class="form-group">
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
{{ Form::select('bank_account_id', $bank_chart_of_accounts, $fixed_asset->bank_account_id, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount_paid', 'Amount Paid') }}
{{ Form::number('amount_paid', $fixed_asset->cost_price-$balance, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('balance', 'balance') }}
{{ Form::number('balance', $balance, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div id="bill_div" @if($fixed_asset->payment_type != "bill") style="display: none" @endif>
<div class="form-group">
{{ Form::label('payable_account', 'Payable Account') }}
{{ Form::select('payable_account', $payable_accounts, $payable_account_id, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
{{ Form::label('description', __('fixed_assets.description')) }}
{{ Form::textArea('description', $fixed_asset->description , ['class'=>'form-control', 'rows' => 4]) }}
</div>
@else
<div class="alert alert-info">Can not edit payment type</div>
@endif
</div>
</div>
{{ Form::button(__('fixed_assets.update'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('fixed_assets.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
window.onload = function(){
var fixed_asset = {!! json_encode($fixed_asset) !!};
console.log(fixed_asset);
$('#datepicker-autoclose').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: fixed_asset.acquisition_date,
readOnly: true
});
$('#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: fixed_asset.warranty_expiration_date,
readOnly: true
});
}
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#payment_type').change(function() {
if (this.value === 'cash') {
$('#cash_div').show();
$('#bill_div').hide();
} else if (this.value === 'bill') {
$('#cash_div').hide()
$('#bill_div').show()
} else {
$('#cash_div').hide()
$('#bill_div').hide()
}
});
$('#edit_payment,#do_not_edit_payment').click(function(){
if($('#edit_payment').is(':checked')) {
$('#edit_payment_type_div').show();
$("#cost_price").removeAttr("readonly");
}
if($('#do_not_edit_payment').is(':checked')) {
$('#edit_payment_type_div').hide();
}
});
function get_balance() {
var bill_div = $('#bill_div');
let cost_price = $('#cost_price').val();
let amount_paid = $('#amount_paid').val();
let balance = parseInt(cost_price) - parseInt(amount_paid);
$('#balance').val(balance);
(balance > 0) ? bill_div.show(): bill_div.hide();
}
</script>
@endpush
@@ -0,0 +1,151 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="/service_items/index">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.view') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<p class="text-muted m-b-30">{{ __('fixed_assets.export_to_pdf') }}</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('fixed_assets.asset_name') }}</th>
<th>{{ __('fixed_assets.serial_number') }}</th>
<th>{{ __('fixed_assets.cost_price') }}</th>
<th>{{ __('fixed_assets.acquisition_date') }}</th>
<th>{{ __('fixed_assets.description') }}</th>
<th>{{ __('fixed_assets.warranty_expiry') }}</th>
<th>{{ __('fixed_assets.item_condition') }}</th>
<th>{{ __('fixed_assets.supplier') }}</th>
<th>{{ __('fixed_assets.payment_type') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@php $total_fixed_assets_value = 0; @endphp
@if(count($fixed_assets) > 0)
@foreach($fixed_assets as $fixed_asset)
@php $total_fixed_assets_value += $fixed_asset->cost_price; @endphp
<tr>
<td>{{ $fixed_asset->name }}</td>
<td>{{ $fixed_asset->serial_number }}</td>
<td>{{ ugandan_shillings($fixed_asset->cost_price) }}</td>
<td>{{ $fixed_asset->acquisition_date }}</td>
<td>{{ $fixed_asset->description }}</td>
<td>{{ $fixed_asset->warranty_expiration_date }}</td>
<td>{{ $fixed_asset->item_condition == 1 ? 'New' : 'Used' }}</td>
<td>{{ isset($suppliers[$fixed_asset->supplier_id]) ? $suppliers[$fixed_asset->supplier_id] : "" }}</td>
<td>
@switch($fixed_asset->payment_type)
@case("cash")
<span>Cash/EFT/Cheque</span>
@break
@case("bill")
<span>Bill</span>
@break
@case("asset_exists")
<span>Already existing asset</span>
@break
@default
@endswitch
</td>
<td>
@if(Auth::user()->can('edit-fixed-assets'))
<a href="/fixed_assets/{{ $fixed_asset->id }}/edit/" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> {{ __('fixed_assets.edit') }}</a>
@endif
</td>
<td>
@if(Auth::user()->can('delete-fixed-assets'))
{{ Form::model($fixed_asset->id ,['method' => 'DELETE', 'route' => ['fixed_assets.destroy', $fixed_asset->id]]) }}
<button type="submit" class="btn btn-danger btn-sm deleteButton" value="{{$fixed_asset->id}}"><i class="fa fa-trash"></i>
{{ __('fixed_assets.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<td></td>
<td><strong>{{ __('family_accounts.total') }}</strong></td>
<td colspan="9"><strong>{{ ugandan_shillings($total_fixed_assets_value) }}</strong></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$(".deleteButton").click(function(e){
//e.preventDefault();
var fixedAssetId = $(this).val();
console.log(fixedAssetId);
checkBeforeSubmission(fixedAssetId);
})
function checkBeforeSubmission(fixedAssetId) {
$.ajax({
url: '/is_fixed_asset_attached_to_bill',
data: {'fixed_asset_id':fixedAssetId},
success: function(response){
if (response == "has_attached_bill") {
return confirm('The corresponding bill attached to this asset will also be deleted. Do you want to proceed');
} else {
return confirm('The corresponding chart of accounts will be affected by this action. Do you want to proceed');
}
}
});
}
</script>
@endpush
@@ -0,0 +1,8 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="\fixed_assets\create" class="nav-item btn btn-default ti-plus"> {{ __('fixed_assets.add_fixed_asset') }}</a>
<!-- <a href="\fixed_assets\edit" class="nav-item btn btn-default ti-pencil"> Edit Fixed Asset</a> -->
<a href="\fixed_assets" class="nav-item btn btn-default ti-pencil"> {{ __('fixed_assets.view_fixed_assets') }}</a>
<!-- <a href="#" class="nav-item btn btn-danger ti-pencil"> Delete Fixed Asset</a> -->
</div>
</div>