{!! html()->form( 'POST', isset($project) && $project->id ? route('IPF.update', base64_encode($project->id)) : route('IPF.store'), )->id('IPF_Project_Information_Form')->open() !!} @if (isset($project) && $project->id) @method('PUT') @endif {{-- ======================= MAIN PROJECT CARD ======================== --}}

{{ $project->exists ? "{$project->investment_planning_form_id}" : 'New Project' }}

@if (isset($project) && $project->id)
@endif
{{-- Row 1 --}}
{!! html()->label('Project Title *', 'IPF_project_title')->toHtml() !!} {!! html()->text('IPF_project_title', old('IPF_project_title', $project->project_title))->class('form-control')->id('IPF_project_title')->placeholder('Enter Project Title') !!}
@php $decodedThreatId = !empty($addViathreatId) ? base64_decode($addViathreatId) : old('IPF_threat_id', $project->threat_id); $isThreatReadonly = !empty($addViathreatId); $ThreatLabelText = 'Threat Title'; if (!empty($selectedThreat)) { if ($selectedThreat->record_type === 'Opportunity') { $ThreatLabelText = 'Opportunity Title'; } } @endphp {!! html()->label($ThreatLabelText . '*', 'IPF_threat_id')->toHtml() !!} @if ($isThreatReadonly) {{-- Hidden field to keep the value when dropdown is disabled --}} @endif
{{-- Row 2 --}}
{!! html()->label('Project ID', 'IPF_project_id')->toHtml() !!} {!! html()->text('IPF_project_id', old('IPF_project_id', $project->project_id))->class('form-control')->id('IPF_project_id')->placeholder('Enter Project ID') !!}
{!! html()->label('PDL *', 'IPF_project_owner')->toHtml() !!} {!! html()->select( 'IPF_project_owner', ['' => 'Select PDL'] + ($activeUserList ?? []), old('IPF_project_owner', $project->project_owner), )->id('IPF_project_owner')->addClass('form-control') !!}
{{-- Row 3 --}}
{!! html()->label('BOM', 'IPF_BOM_full_name')->toHtml() !!} {!! html()->text('IPF_BOM_full_name', old('IPF_BOM_full_name', $project->BOM_full_name))->class('form-control')->id('IPF_BOM_full_name')->placeholder('Enter BOM Full Name') !!}
{!! html()->label('Sponsor', 'IPF_sponsor')->toHtml() !!} {!! html()->select('IPF_sponsor', ['' => 'Select Sponsor'] + ($activeUserList ?? []), old('IPF_sponsor', $project->sponsor))->id('IPF_sponsor')->addClass('form-control') !!}
{{-- Row 4 --}}
{!! html()->label('PEL *', 'IPF_project_manager')->toHtml() !!} {!! html()->select( 'IPF_project_manager', ['' => 'Select PEL'] + ($activeUserList ?? []), old('IPF_project_manager', $project->project_manager), )->id('IPF_project_manager')->addClass('form-control') !!}
{!! html()->label('MOC No.', 'IPF_MOC_number')->toHtml() !!} {!! html()->text('IPF_MOC_number', old('IPF_MOC_number', $project->MOC_number))->class('form-control')->id('IPF_MOC_number')->placeholder('Enter MOC Number') !!}
{{-- ======================= PROJECT DETAILS ======================== --}}

Project Details

{{-- Category + Status --}}
{!! html()->label('Project Category *', 'IPF_project_category') !!} {!! html()->select( 'IPF_project_category', ['' => 'Select Project Category'] + ($projectCategoryList ?? collect())->toArray(), old('IPF_project_category', $project->project_category_id), )->class('form-control')->id('IPF_project_category') !!}
{!! html()->label('Project Status *', 'IPF_project_status') !!} {!! html()->select( 'IPF_project_status', \App\Models\ThreatInvestmentPlanningForm::$project_statuses, old('IPF_project_status', $project->project_status), )->class('form-control')->id('IPF_project_status')->placeholder('Select Project Status') !!}
{{-- Description + Minimum Tech --}}
{!! html()->label('Project Description', 'IPF_project_description') !!} {!! html()->textarea('IPF_project_description', old('IPF_project_description', $project->project_description))->class('form-control')->id('IPF_project_description')->rows(3)->placeholder('Enter Project Description') !!}
{!! html()->label('Minimum Technical Solution', 'IPF_minimum_technical_solution') !!} {!! html()->textarea( 'IPF_minimum_technical_solution', old('IPF_minimum_technical_solution', $project->minimum_technical_solution), )->class('form-control')->id('IPF_minimum_technical_solution')->rows(3)->placeholder('Enter Minimum Technical Solution') !!}
{{-- Other Alternatives + Free Text 1 --}}
{!! html()->label('Other Alternatives', 'IPF_other_alternatives') !!} {!! html()->textarea('IPF_other_alternatives', old('IPF_other_alternatives', $project->other_alternatives))->class('form-control')->id('IPF_other_alternatives')->rows(3)->placeholder('Enter Other Alternatives') !!}
{!! html()->label('Remarks', 'IPF_Remarks') !!} {!! html()->textarea('IPF_Remarks', old('IPF_Remarks', $project->remarks))->class('form-control')->id('IPF_Remarks')->rows(3)->placeholder('Enter Remarks') !!}
{{-- Radar ID + Funding Category --}}
{!! html()->label('RADAR ID', 'IPF_radar_id') !!} {!! html()->text('IPF_radar_id', old('IPF_radar_id', $project->radar_id))->class('form-control')->id('IPF_radar_id')->placeholder('Enter RADAR ID') !!}
{!! html()->label('Funding Category', 'IPF_funding_category') !!} {!! html()->select( 'IPF_funding_category', ['' => 'Select Funding Category'] + collect(['IT', 'Medium Project', 'T/A', 'Non-Routine OPEX', 'Small Project'])->mapWithKeys(fn($cat) => [$cat => $cat])->toArray(), old('funding_category', $project->funding_category), )->class('form-control')->id('IPF_funding_category') !!}
{{-- Schedule + Override --}}
{!! html()->label('Schedule', 'IPF_schedule') !!} {!! html()->text('IPF_schedule', old('IPF_schedule', $project->schedule))->class('form-control')->id('IPF_schedule')->placeholder('Enter Schedule') !!}
{!! html()->label('Override', 'IPF_override') !!}
{!! html()->checkbox('IPF_override', old('override', $project->override), 1)->id('IPF_override') !!}
{{-- ======================= JUSTIFICATION ======================== --}}

Justification

{{-- NPV IRR Date + IRR --}}
@php $config = ['format' => 'DD-MM-YYYY', 'autoclose' => true]; @endphp NPV IRR Calculation Date
{!! html()->label('IRR *', 'IPF_IRR') !!} {!! html()->text('IPF_IRR', old('IPF_IRR', $project->IRR))->class('form-control')->id('IPF_IRR')->placeholder('Enter IRR Value') !!}
{{-- IRR NPV Factor + NPV --}}
{!! html()->label('IRR NPV J-Factor Premises', 'IPF_VIR_NPV_JFactor_premises') !!} {!! html()->text('IPF_VIR_NPV_JFactor_premises', old('IPF_VIR_NPV_JFactor_premises', $project->VIR_NPV_JFactor_premises))->class('form-control')->id('IPF_VIR_NPV_JFactor_premises')->placeholder('Enter IRR NPV J-Factor Premises') !!}
{!! html()->label('NPV', 'IPF_NPV') !!} {!! html()->text('IPF_NPV', old('IPF_NPV', $project->NPV))->class('form-control')->id('IPF_NPV')->placeholder('Enter NPV Value') !!}
{{-- J-Factor + RT --}}
{!! html()->label('J-Factor', 'IPF_J_factor') !!} {!! html()->text('IPF_J_factor', old('IPF_J_factor', $project->J_factor))->class('form-control')->id('IPF_J_factor')->placeholder('Enter J-Factor Value') !!}
{!! html()->label('RT', 'IPF_RT') !!} {!! html()->text('IPF_RT', old('IPF_RT', $project->RT))->class('form-control')->id('IPF_RT')->placeholder('Enter RT Value') !!}
{{-- Problem Solved --}}
{!! html()->label('% of Problem Solved', 'IPF_precentage_of_problem_solved') !!} {!! html()->text( 'IPF_precentage_of_problem_solved', old('IPF_precentage_of_problem_solved', $project->precentage_of_problem_solved), )->class('form-control')->id('IPF_precentage_of_problem_solved')->attribute('placeholder', 'Enter % of Problem Solved') !!}
{{-- ======================= TOTAL INSTALLED COST ======================== --}}

Total Installed Cost

{{-- Capex USD + Forecast --}}
{!! html()->label('Capex Planned Expenditure', 'IPF_capex_planned_expenditure') !!} {!! html()->text( 'IPF_capex_planned_expenditure', old('IPF_capex_planned_expenditure', currency_format($project->capex_planned_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_capex_planned_expenditure')->placeholder('Enter Capex Expenditure USD')->attribute('readonly', 'readonly') !!}
{!! html()->label('Capex Forecast Expenditure', 'IPF_capex_forecast_expenditure') !!} {!! html()->text( 'IPF_capex_forecast_expenditure', old('IPF_capex_forecast_expenditure', currency_format($project->capex_forecast_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_capex_forecast_expenditure')->placeholder('Enter Capex Forecast Expenditure')->attribute('readonly', 'readonly') !!}
{{-- Opex USD + Forecast --}}
{!! html()->label('Opex Planned Expenditure', 'IPF_opex_planned_expenditure') !!} {!! html()->text( 'IPF_opex_planned_expenditure', old('IPF_opex_planned_expenditure', currency_format($project->opex_planned_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_opex_planned_expenditure')->placeholder('Enter Opex Expenditure USD')->attribute('readonly', 'readonly') !!}
{!! html()->label('Opex Forecast Expenditure', 'IPF_opex_forecast_expenditure') !!} {!! html()->text( 'IPF_opex_forecast_expenditure', old('IPF_opex_forecast_expenditure', currency_format($project->opex_forecase_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_opex_forecast_expenditure')->placeholder('Enter Opex Forecast Expenditure')->attribute('readonly', 'readonly') !!}
{{-- Total USD + Forecast --}}
{!! html()->label('Total Planned Expenditure', 'IPF_total_planned_expenditure') !!} {!! html()->text( 'IPF_total_planned_expenditure', old('IPF_total_planned_expenditure', currency_format($project->total_planned_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_total_planned_expenditure')->placeholder('Enter Total Expenditure')->attribute('readonly', 'readonly') !!}
{!! html()->label('Total Forecast Expenditure', 'IPF_total_forecast_expenditure') !!} {!! html()->text( 'IPF_total_forecast_expenditure', old('IPF_total_forecast_expenditure', currency_format($project->total_forecast_expenditure ?? 0, 'USD') ?? 0), )->class('form-control price-input')->id('IPF_total_forecast_expenditure')->placeholder('Enter Total Forecast Expenditure')->attribute('readonly', 'readonly') !!}
{{-- Financial Estimate + Business Plan --}}
{!! html()->label('Financial Estimate Quality', 'IPF_financial_estimate_quality') !!} {!! html()->text( 'IPF_financial_estimate_quality', old('IPF_financial_estimate_quality', $project->financial_estimate_quality), )->class('form-control')->id('IPF_financial_estimate_quality')->placeholder('Enter Financial Estimate Quality') !!}
{!! html()->label('Is Business Plan', 'IPF_in_business_plan') !!}
{!! html()->checkbox('IPF_in_business_plan', old('IPF_in_business_plan', $project->in_business_plan)) !!}
{{-- ======================= MILESTONE ======================== --}}

Milestone

@php $config = ['format' => 'DD-MM-YYYY', 'autoclose' => true]; $dateFields = [ 'IPF_identify_planned_date' => 'Identify Planned Date', 'IPF_identify_actual_date' => 'Identify Actual Date', 'IPF_assess_plan_date' => 'Access Plan Date', 'IPF_assess_actual_date' => 'Access Actual Date', // 'IPF_select_plan_date' => 'CAC Plan Date', 'IPF_plan_CAC_date' => 'CAC Plan Date', 'IPF_select_actual_date' => 'CAC Actual Date', 'IPF_plan_PAC_date' => 'PAC Plan Date', // 'IPF_define_plan_date' => 'PAC Define Plan Date', 'IPF_define_actual_date' => 'PAC Actual Date', ]; @endphp
@foreach ($dateFields as $field => $label) @php // Remove 'IPF_' prefix when reading value from $project $dbField = \Illuminate\Support\Str::after($field, 'IPF_'); $value = old( $field, $project->$dbField ? \Carbon\Carbon::parse($project->$dbField)->format('d-m-Y') : '', ); @endphp
{!! $label !!}
@endforeach
{{-- ======================= SYSTEM INFORMATION ======================== --}}

System Information

{!! html()->label('Last Modified By', 'IPF_modified_by') !!}

{{ old('IPF_modified_by', $project->modified_by ? $project->modifiedBy->full_name : '-') }}

{!! html()->label('Created By', 'IPF_created_by') !!}

{{ old('IPF_created_by', $project->created_by ? $project->createdBy->full_name : '-') }}

{!! html()->label('Last Modified At', 'IPF_modified_at') !!}

{{ old('IPF_modified_at', $project->modified_at ? \Carbon\Carbon::parse($project->modified_at)->format('d-m-Y h:i A') : '-') }}

{!! html()->label('Created At', 'IPF_created_at') !!}

{{ old('IPF_created_at', $project->created_at ? \Carbon\Carbon::parse($project->created_at)->format('d-m-Y h:i A') : '-') }}

{{-- ======================= PHASING ======================== --}}

Phasing

{{-- Currency --}}
{!! html()->label('Currency', 'IPF_master_currency_id') !!} {!! html()->select( 'IPF_master_currency_id', ['' => 'Select Currency'] + ($currencyList ?? []), old('IPF_master_currency_id', $project->master_currency_id ?? $defaultCurrencyId), )->id('IPF_master_currency_id')->addClass('form-control') !!}
{{-- Generate Year array Dynamic --}} @php $currentYear = date('Y'); $years = []; for ($i = 0; $i <= 10; $i++) { $year = $currentYear + $i; $years[$year] = $year; } @endphp {{-- From Year --}}
{!! html()->label('From Year', 'IPF_from_year') !!} {!! html()->select('IPF_from_year', ['' => 'Select Year'] + $years, old('IPF_from_year', $currentYear))->class('form-control custom-select')->id('IPF_from_year') !!}
{{-- To Year --}}
{!! html()->label('To Year', 'IPF_to_year') !!} {!! html()->select('IPF_to_year', ['' => 'Select Year'] + $years, old('IPF_to_year', ' '))->class('form-control custom-select')->id('IPF_to_year') !!}
{{-- Buttons --}}
{{-- Table Section --}}
{{-- Here is data comming as per popup submit so please dont remove --}}
{!! html()->form()->close() !!}
{!! html()->form('POST', '#')->id('financialsForm')->open() !!} {!! html()->form()->close() !!}