@extends('crm.layouts.app')

@section('content')
<div class="content-wrapper">
    <div class="container-fluid">

      <div class="card card-tabs card-secondary">
        <div class="card-header p-0 pt-1 border-bottom-0">
          <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
            <li class="nav-item ml-1">
              <a class="nav-link active" id="proposal_settings" data-toggle="pill" data-target="#proposal_settings_id" role="tab" aria-controls="lead-details-id" aria-selected="true">{{__('proposal_settings')}}</a>
            </li>
            <li class="nav-item ml-1">
              <a class="nav-link" id="estimate_settings" data-toggle="pill" data-target="#estimate_settings_id" role="tab" aria-controls="estimate_settings_id" aria-selected="false">{{__('estimate_settings')}}</a>
            </li>
            <li class="nav-item ml-1">
              <a class="nav-link" id="invoice_settings" data-toggle="pill" data-target="#invoice_settings_id" role="tab" aria-controls="invoice_settings_id" aria-selected="false">{{__('invoice_settings')}}</a>
            </li>
            
          </ul>
        </div>
        
        <div class="card-body bg-light-gray">
          <div class="tab-content" id="custom-tabs-three-tabContent">
            <div class="tab-pane fade show active" id="proposal_settings_id" role="tabpanel" aria-labelledby="proposal_settings">
              <div class="row">
                <div class="col-md-6">
                  <form @if (@$proposal_settings) action="{{url('office/sales_settings/proposal', $proposal_settings)}}" @else action="{{url('office/sales_settings/proposal/store')}}" @endif method="post">
                    @csrf
                    @if (@$proposal_settings)
                      @method('PUT')
                    @endif
                    <div class="row">
                      <div class="col-md-12">
                        <div class="card">
                            <div class="card-header bg-gray">
                              <h4 class="card-title">{{__('proposal_settings')}}</h4>
                            </div>
                            <div class="card-body bg-light-gray">
                              @csrf
    
                                <div class="form-group">
                                  <label><span class="text-danger">* </span>{{__("Proposal Number Prefix")}} </label>
                                  <div class="input-group">
                                      <input type="text" name="proposal_prefix" class="form-control form-control-sm" value="{{@$proposal_settings['proposal_number_prefix']}}" required>
                                  </div>
                                </div>
    
                                <div class="form-group">
                                  <label><span class="text-danger"> </span>{{__('Default Subject')}} </label>
                                  <div class="input-group">
                                      <input type="text" name="proposal_subject" class="form-control form-control-sm" value="{{@$proposal_settings['proposal_default_subject']}}" >
                                  </div>
                                </div>
    
                            </div>
                            <input type="submit" value="{{__('Save Proposal Settings')}}" class="btn btn-primary">
                        </div>
                      </div>
                    </div>
                  </form>
                </div>
              </div>
            </div>
            <div class="tab-pane fade" id="estimate_settings_id" role="tabpanel" aria-labelledby="estimate_settings">
              <div class="col-md-6">
                <form @if (@$estimate_settings) action="{{url('office/sales_settings/estimate', $estimate_settings)}}" @else action="{{url('office/sales_settings/estimate/store')}}" @endif method="post">
                  @csrf
                  @if (@$estimate_settings)
                    @method('PUT')
                  @endif
                  <div class="row">
                    <div class="col-md-12">
                      <div class="card">
                          <div class="card-header bg-gray">
                            <h4 class="card-title">{{__('estimate_settings')}}</h4>
                          </div>
                          <div class="card-body bg-light-gray">
                            @csrf
  
                              <div class="form-group">
                                <label><span class="text-danger">* </span>{{__("Estimate Number Prefix")}} </label>
                                <div class="input-group">
                                    <input type="text" name="estimate_number_prefix" class="form-control form-control-sm" value="{{@$estimate_settings['estimate_number_prefix']}}" required>
                                </div>
                              </div>
  
                              <div class="form-group">
                                <label><span class="text-danger"> </span>{{__('Default Estimate Title')}} </label>
                                <div class="input-group">
                                    <input type="text" name="estimate_title" class="form-control form-control-sm" value="{{@$estimate_settings['estimate_title']}}" >
                                </div>
                              </div>
  
                          </div>
                          <input type="submit" value="{{__('Save Estimate Settings')}}" class="btn btn-primary">
                      </div>
                    </div>
                  </div>
                </form>
              </div>
            </div>
            <div class="tab-pane fade" id="invoice_settings_id" role="tabpanel" aria-labelledby="invoice_settings">
              <div class="col-md-6">
                <form @if (@$invoice_settings) action="{{url('office/sales_settings/invoice', $invoice_settings)}}" @else action="{{url('office/sales_settings/invoice/store')}}" @endif method="post">
                  @csrf
                  @if (@$invoice_settings)
                    @method('PUT')
                  @endif
                  <div class="row">
                    <div class="col-md-12">
                      <div class="card">
                          <div class="card-header bg-gray">
                            <h4 class="card-title">{{__('invoice_settings')}}</h4>
                          </div>
                          <div class="card-body bg-light-gray">
                            @csrf
  
                              <div class="form-group">
                                <label><span class="text-danger">* </span>{{__("Invoice Number Prefix")}} </label>
                                <div class="input-group">
                                    <input type="text" name="invoice_prefix" class="form-control form-control-sm" value="{{@$invoice_settings['invoice_number_prefix']}}" required>
                                </div>
                              </div>
  
                              <div class="form-group">
                                <label><span class="text-danger"> </span>{{__('Default Invoice Title')}} </label>
                                <div class="input-group">
                                    <input type="text" name="invoice_title" class="form-control form-control-sm" value="{{@$invoice_settings['invoice_title']}}" >
                                </div>
                              </div>
  
                          </div>
                          <input type="submit" value="{{__('Save Invoice Settings')}}" class="btn btn-primary">
                      </div>
                    </div>
                  </div>
                </form>
              </div>

            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>


@endsection