@extends('layouts.main') @push('styles') @endpush @section('content')

{{ __('finance.budgets') }}

@include('budgets::budgets.menu') @include('flash::message')
{{ Form::model($budget, ['method' => 'PUT', 'route' => ['budgets.update', $budget], 'data-toggle' =>'validator', 'id' =>'budgetForm']) }}
{{ Form::label('budget_name', __('budgets.budget_name')) }} {{ Form::text('budget_name', $budget->name, ['class' => 'form-control compulsory','required','data-error'=> '']) }}
{{ Form::label('period', 'Budget Breakdown') }}
{{ Form::label('period_start', 'Budget Start Date') }}
{{ Form::text('period_start', $budget->period_start,['class' => 'form-control compulsory', 'required','readonly','id'=>'period_start']) }}
{{ Form::label('period_count_months', __('budgets.period_count_months')) }} {{ Form::number('period_count_months', ($budget->period == "months") ? $budget->period_count : '', ['class' => 'form-control compulsory', 'required', 'data-error' => '', 'min' => 1, 'max' => 12]) }}
{{ Form::label('period_count_quarters', __('budgets.period_count_quarters')) }} {{ Form::number('period_count_quarters',($budget->period == "quarters") ? $budget->period_count : '', ['class' => 'form-control compulsory', 'required', 'data-error' => '', 'min' => 1, 'max' => 20]) }}
{{ Form::label('period_count_years', __('budgets.period_count_years')) }} {{ Form::number('period_count_years',($budget->period == "years") ? $budget->period_count :'', ['class' => 'form-control compulsory', 'required', 'data-error' => '', 'min' => 1, 'max' => 5]) }}

@php $period_months = getMonthsList(); $period_quarters = array("First", "Second", "Third", "Fourth"); $option_accounts = ""; $option_accounts_income=''; $option_accounts_expenses='';$option_accounts_cost_of_goods = ''; foreach ($accounts as $account) { $value=$account->id.'~'.$account->name.'~'.$account->type.'~'.$account->sub_account_of; if($account->type == 'Income') $option_accounts_income .= ""; else if($account->type == 'Expense') $option_accounts_expenses .= ""; else $option_accounts_cost_of_goods .= ""; } $option_accounts .= "" . $option_accounts_income . " " . $option_accounts_expenses . ""; $new_accn_arr = count(explode(',', $budget->accounts)); @endphp

{{ Form::close() }}
@endsection @push('scripts') @endpush