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

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

@include('budgets::budgets.menu') @include('flash::message')
{{ Form::open(['method' => 'POST', 'route' => 'budgets.store', 'data-toggle' => 'validator', 'id' => 'budgetForm']) }}
{{ Form::label('budget_name', __('budgets.budget_name')) }} {{ Form::text('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','',['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(); $months_select = array_merge(array(__('budgets.select')), $period_months); $period_quarters = array("First", "Second", "Third", "Fourth"); $quarters_select = array_merge(array(__('budgets.select')), $period_quarters); @endphp
{{ Form::label('period_start_month', __('budgets.period_start_month')) }} {{ Form::select('period_start_month', $months_select, ($budget->period == "months") ? $budget->period_start : '', ['class' =>'form-control compulsory required'])}}
{{ Form::label('period_start_quarter', __('budgets.period_start_quarter')) }} {{ Form::select('period_start_quarter', $quarters_select, ($budget->period == "quarters") ? $budget->period_start : '', ['class' => 'form-control compulsory required'])}}
{{ Form::label('period_start_year', __('budgets.period_start_year')) }} {{ Form::number('period_start_year', ($budget->period == "years") ? $budget->period_start : $this_year, ['class' => 'form-control compulsory','required', 'data-error' => '', 'min' => $this_year]) }}
--}}

{{--
Calculate totals
Remove rows
--}}
@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