@if(userCan('ChartOfAccounts-create')==0) @php header("Location: " . URL::to('errors.403'), true, 302); exit(); @endphp @endphp @endif @extends('layouts.default') @php $pageTitle = 'Chart of Accounts'; @endphp @section('title',$pageTitle) @section('PageHead') @if ( session('massage') ) × Success! {{session('massage')}} @endif @if ( session('error') ) × Not Success! {{session('error')}} @endif @if (Session::has('errors')) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif {{$pageTitle}} Dashboard @if(userCan('setting-list')>0) Settings @endif @stop @section('content') @php $defult = ''; $active_tab = 'show active'; $Accounts = $defult; $Accounts_details = $defult; $Accounts_type = $defult; $tablink = app('request')->input('tab'); if($tablink=='accounts'){ $Accounts = $active_tab; }else if($tablink=='accounts_details'){ $Accounts_details = $active_tab; }else if($tablink=='accounts_type'){ $Accounts_type = $active_tab; }else{ $Accounts = $active_tab; } @endphp Chart of Accounts Account Details Type Account Type Add New Code Name Details Type Account Type Debit Cradit Balance Action @php $balance_total = $balance = 0; @endphp @foreach($data_AccountName as $key=>$data) @php $balance = 0; $lable= ''; if($data->sense==1){ $lable = ' Dr'; @$balance = $data->DrTotalByAccID->total - $data->CrTotalByAccID->total; $balance += $data->account_opening_balance; $balance_total += $balance; } elseif($data->sense==2){ $lable = ' Cr'; @$balance = $data->CrTotalByAccID->total - $data->DrTotalByAccID->total;$balance += $data->account_opening_balance; $balance_total += $balance; } @endphp {{@$data->account_number}} {{@$data->account_name}} {{@$data->account_details_informations->detail_type_name}} {{@$data->account_type_informations->account_type_name}} @if($data->sense==1 && $data->account_opening_balance>0) {{@number_format($data->DrTotalByAccID->total+$data->account_opening_balance,2)}} @else {{@number_format($data->DrTotalByAccID->total,2)}} @endif @if($data->sense==2 && $data->account_opening_balance>0) {{number_format(@$data->CrTotalByAccID->total+$data->account_opening_balance,2)}} @else {{number_format(@$data->CrTotalByAccID->total,2)}} @endif {{number_format($balance,2)}} {{$lable}} Update - {{@$data->account_number}} × {{ csrf_field() }} {{ method_field('PUT') }} Account Type * Select One {!!account_type_list(@$data->account_type_id)!!} Account Details Type * Select One {!!account_details_type(@$data->detail_type_id)!!} Root Code @php if(intval(@$data->account_number)>0){ $code = @$data->account_number; $root_code = @$data->account_details_informations->dcode; $final_code = substr($code, strlen($root_code)); } @endphp Code/Account Number * Account Name * Opening Balance As of Date Company Name * Select One {!!company_list(@$data->app_company_id)!!} Branch Name * Select One {!!branchList(@$data->app_branch_id)!!} Description {{@$data->account_description}} Sense * Select sense==1) selected @endif value="1"> Dr sense==2) selected @endif value="2"> Cr @endforeach Chart of Accounts × {{ csrf_field() }} Save Add New Code Details Type Account Type Action @foreach($data_AccountDetails as $key=>$data) {{@$data->dcode}} {{@$data->detail_type_name}} {{@$data->account_type->account_type_name}} {{ csrf_field() }} {{ method_field('PUT') }} Update - {{@$data->dcode}} × Account Type Select One {!!account_type_list(@$data->group_id)!!} Root Code @php if(intval(@$data->dcode)>0){ $code = @$data->dcode; $root_code = @$data->account_type->account_type_number; $final_code = substr($code, strlen($root_code)); } @endphp Code/Account Number * Details Name * Description {{@$data->details}} @endforeach Accounts Details Type × {{ csrf_field() }} Save Add New Code Account Type Root Account Action @foreach($data_AccountTypes as $key=>$data) {{@$data->account_type_number}} {{@$data->account_type_name}} {{@$data->root_account_type->rootID}} - {{@$data->root_account_type->rootName}} {{ csrf_field() }} {{ method_field('PUT') }} Update - {{@$data->account_type_number}} × Root Account * Select One {!! RootAccountType(@$data->root_id) !!} Code @php if(intval(@$data->account_type_number)>0){ $code = @$data->account_type_number; $root_code = @$data->root_account_type->rootID; $final_code = substr($code, strlen($root_code)); } @endphp Account Number * Account Type Name * @endforeach Accounts Type × {{ csrf_field() }} Save @stop