<!-- sidebar menu -->
<div class="col-md-3 left_col">
    <div class="left_col scroll-view">
        <div class="navbar nav_title text-center" style="border: 0; ">
            <a href="{{ route('home') }}" class="site_title" style="padding: 0;">
                <img class="" src="{{ asset('img/logo/factura-16-mini.png') }}" height="40" />
            </a>
        </div>

        <div class="clearfix"></div>

        <!-- menu profile quick info -->
        <div class="profile clearfix">
            <div class="profile_pic">
                <img src="{{!empty(Auth::user()->avatar) ? Auth::user()->pathAvatar() : asset('img/logged-user.jpg')}}" alt="{{ Auth::user()->name }}" class="img-circle profile_img">
            </div>
            <div class="profile_info">
                <span>Hola,</span>
                <h2>{{ str_limit(Auth::user()->name, 20) }}</h2>
            </div>
            <div class="clearfix"></div>
        </div>
        <!-- /menu profile quick info -->

        <br />

        <!-- sidebar menu -->
        <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
            <div class="menu_section">
                <h3>MENU</h3>
                <ul class="nav side-menu">
                    <li><a href="{{ route('home') }}"><i class="fa fa-dashboard"></i> @lang('general.text_menu_dashboard')</a></li>
                    @if (\Auth::user()->sysCustomer)
                    @if(\Auth::user()->p_customers)
                    <li><a href="{{ route('customers.index') }}"><i class="fa fa-users"></i> @lang('general.text_menu_customers')</a></li>
                    @endif
                    @if(\Auth::user()->p_products)
                    <li><a href="{{ route('products.index') }}"><i class="fa fa-cubes"></i> @lang('general.text_menu_products')</a></li>
                    @endif
                    @if(\App\Helpers\Helper::companyModuleCustomerQuotations() && \Auth::user()->p_customer_quotations)
                        <li><a href="{{ route('customer-quotations.index') }}"><i class="fa fa-file"></i>@lang('general.text_menu_customer_quotations')</a></li>
                    @endif
                    @if(\App\Helpers\Helper::companyModuleCustomerRemissions() && \Auth::user()->p_customer_remissions)
                        <li><a href="{{ route('customer-remissions.index') }}"><i class="fa fa-file"></i>@lang('general.text_menu_customer_remissions')</a></li>
                    @endif
                    @if(\Auth::user()->p_cfdis)
                    <li><a><i class="fa fa-file-text"></i> @lang('general.text_menu_group_cfdis') <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            @php
                                $customer_invoice = \App\Models\Base\DocumentType::active()->where('code','=','customer.invoice')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $customer_lease = \App\Models\Base\DocumentType::active()->where('code','=','customer.lease')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $customer_fee = \App\Models\Base\DocumentType::active()->where('code','=','customer.fee')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $customer_transfer = \App\Models\Base\DocumentType::active()->where('code','=','customer.transfer')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $customer_credit_note = \App\Models\Base\DocumentType::active()->where('code','=','customer.credit_note')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $customer_payment = \App\Models\Base\DocumentType::active()->where('code','=','customer.payment')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                                $employee_payroll = \App\Models\Base\DocumentType::active()->where('code','=','employee.payroll')->where('company_id','=',\App\Helpers\Helper::defaultCompany()->id)->get()->first();
                            @endphp
                            @if(!empty($customer_invoice))
                                <li><a href="{{ route('customer-invoices.index') }}">@lang('general.text_menu_customer_invoices')</a></li>
                                <li><a href="{{ route('recurring-customer-invoices.index') }}">@lang('general.text_menu_recurring_customer_invoices')</a></li>
                            @endif
                            @if(\App\Helpers\Helper::companyComplementoCfdiForeignTrade())
                                <li><a href="{{ route('customer-foreign-trades.index') }}">@lang('general.text_menu_customer_foreign_trades')</a></li>
                            @endif
                            @if(!empty($customer_lease))
                            <li><a href="{{ route('customer-leases.index') }}">@lang('general.text_menu_customer_leases')</a></li>
                            @endif
                            @if(!empty($customer_fee))
                            <li><a href="{{ route('customer-fees.index') }}">@lang('general.text_menu_customer_fees')</a></li>
                            @endif
                            @if(!empty($customer_credit_note))
                            <li><a href="{{ route('customer-credit-notes.index') }}">@lang('general.text_menu_customer_credit_notes')</a></li>
                            @endif
                            @if(!empty($customer_payment))
                            <li><a href="{{ route('customer-payments.index') }}">@lang('general.text_menu_customer_payments')</a></li>
                            @endif
                            @if(!empty($customer_transfer))
                                <li><a href="{{ route('customer-transfers.index') }}">@lang('general.text_menu_customer_transfers')</a></li>
                            @endif
                        </ul>
                    </li>
                    @endif
                    @if(\App\Helpers\Helper::companyModulePayroll() && \Auth::user()->p_payrolls)
                        <li><a><i class="fa fa-list-alt"></i> @lang('general.text_menu_group_payrolls') <span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">
                                <li><a href="{{ route('employees.index') }}">@lang('general.text_menu_employees')</a></li>
                                <li><a href="{{ route('employee-payrolls.index') }}">@lang('general.text_menu_employee_payrolls')</a></li>
                                <li><a href="{{ route('payrolls.index') }}">@lang('general.text_menu_payrolls')</a></li>
                                <li><a href="{{ route('employee-categories.index') }}">@lang('general.text_menu_employee_categories')</a></li>
                            </ul>
                        </li>
                    @endif
                    @php
                        $pac = App\Models\Base\Pac::find(setting('default_pac_id')); //PAC
                        $enable_tax_mailbox = false;
                        if(!empty($pac) && (preg_match('/finkok/i', $pac->code) || preg_match('/timbox/i', $pac->code) || preg_match('/swsapien/i', $pac->code) || preg_match('/sifei/i', $pac->code) || preg_match('/timbradorXpress/i', $pac->code))){
                            $enable_tax_mailbox = true;
                        }
                    @endphp
                    @if($enable_tax_mailbox && \Auth::user()->p_tax_mailbox)
                        <li><a href="{{ route('tax-mailbox') }}"><i class="fa fa-envelope"></i> @lang('general.text_menu_tax_mailbox')</a></li>
                    @endif
                    @if((!empty(setting('cfdi_download')) || \Auth::user()->new_user) && \Auth::user()->p_cfdi_downloads)
                        <li><a href="{{ route('cfdi-downloads.index') }}"><i class="fa fa-download"></i> @lang('general.text_menu_cfdi_downloads')</a></li>
                    @endif
                    @if((!empty(setting('bank_reconciliation')) || \Auth::user()->new_user) && \Auth::user()->p_bank_reconciliations)
                        <li><a href="{{ route('bank-reconciliations.index') }}"><i class="fa fa-money"></i> @lang('general.text_menu_bank_reconciliations')</a></li>
                    @endif
                    @if(\Auth::user()->p_report_income_expenses)
                    <li><a><i class="fa fa-list-alt"></i> @lang('general.text_menu_group_reports') <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <li><a href="{{ route('income-expenses.index') }}">@lang('general.text_menu_income_expenses')</a></li>
                        </ul>
                    </li>
                    @endif
                    @if(\Auth::user()->p_catalogs)
                    <li><a><i class="fa fa-files-o"></i> @lang('general.text_menu_group_catalogs') <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <li><a href="{{ route('payment-terms.index') }}">@lang('general.text_menu_payment_terms')</a></li>
                            <li><a href="{{ route('salespersons.index') }}">@lang('general.text_menu_salespersons')</a></li>
                            @if(!empty(setting('black_list_sat')) || \Auth::user()->new_user)
                            <li><a href="{{ route('black-list-sats.index') }}">@lang('general.text_menu_black_list_sats')</a></li>
                            @endif
                            <li><a href="{{ route('projects.index') }}">@lang('general.text_menu_projects')</a></li>
                            <li><a href="{{ route('banks.index') }}">@lang('general.text_menu_banks')</a></li>
                            <li><a href="{{ route('unit-measures.index') }}">@lang('general.text_menu_unit_measures')</a></li>
                            <li><a href="{{ route('expense-types.index') }}">@lang('general.text_menu_expense_types')</a></li>
                            <li><a href="{{ route('operational-types.index') }}">@lang('general.text_menu_operational_types')</a></li>
                            <li><a href="{{ route('countries.index') }}">@lang('general.text_menu_countries')</a></li>
                            <li><a href="{{ route('states.index') }}">@lang('general.text_menu_states')</a></li>
                            <li><a href="{{ route('cities.index') }}">@lang('general.text_menu_cities')</a></li>
                            <li><a href="{{ route('postcodes.index') }}">@lang('general.text_menu_postcodes')</a></li>
                            <li><a href="{{ route('currencies.index') }}">@lang('general.text_menu_currencies')</a></li>
                            <li><a href="{{ route('taxes.index') }}">@lang('general.text_menu_taxes')</a></li>
                            <li><a>@lang('general.text_menu_group_catalogs_cfdi')<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="{{ route('payment-ways.index') }}">@lang('general.text_menu_payment_ways')</a></li>
                                    <li><a href="{{ route('payment-methods.index') }}">@lang('general.text_menu_payment_methods')</a></li>
                                    <li><a href="{{ route('sat-products.index') }}">@lang('general.text_menu_sat_products')</a></li>
                                    <li><a href="{{ route('cfdi-relations.index') }}">@lang('general.text_menu_cfdi_relations')</a></li>
                                    <li><a href="{{ route('cfdi-types.index') }}">@lang('general.text_menu_cfdi_types')</a></li>
                                    <li><a href="{{ route('tax-regimens.index') }}">@lang('general.text_menu_tax_regimens')</a></li>
                                    <li><a href="{{ route('cfdi-uses.index') }}">@lang('general.text_menu_cfdi_uses')</a></li>
                                    @if(\App\Helpers\Helper::companyComplementoCfdiIedu())
                                        <li><a href="{{ route('iedu-nivel-educativos.index') }}">@lang('general.text_menu_iedu_nivel_educativos')</a></li>
                                    @endif
                                </ul>
                            </li>
                            @if(\App\Helpers\Helper::companyModulePayroll())
                            <li><a>@lang('general.text_menu_group_catalogs_payroll')<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="{{ route('source-resources.index') }}">@lang('general.text_menu_source_resources')</a></li>
                                    <li><a href="{{ route('frequency-payments.index') }}">@lang('general.text_menu_frequency_payments')</a></li>
                                    <li><a href="{{ route('contract-types.index') }}">@lang('general.text_menu_contract_types')</a></li>
                                    <li><a href="{{ route('deductions.index') }}">@lang('general.text_menu_deductions')</a></li>
                                    <li><a href="{{ route('overtimes-types.index') }}">@lang('general.text_menu_overtimes_types')</a></li>
                                    <li><a href="{{ route('disability-types.index') }}">@lang('general.text_menu_disability_types')</a></li>
                                    <li><a href="{{ route('workday-types.index') }}">@lang('general.text_menu_workday_types')</a></li>
                                    <li><a href="{{ route('payroll-types.index') }}">@lang('general.text_menu_payroll_types')</a></li>
                                    <li><a href="{{ route('other-payment-types.index') }}">@lang('general.text_menu_other_payment_types')</a></li>
                                    <li><a href="{{ route('perceptions.index') }}">@lang('general.text_menu_perceptions')</a></li>
                                    <li><a href="{{ route('recruitment-regimes.index') }}">@lang('general.text_menu_recruitment_regimes')</a></li>
                                    <li><a href="{{ route('job-risk-classes.index') }}">@lang('general.text_menu_job_risk_classes')</a></li>
                                </ul>
                            </li>
                            @endif
                            @if(\App\Helpers\Helper::companyComplementoCfdiForeignTrade())
                            <li><a>@lang('general.text_menu_group_catalogs_foreign_trade')<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="{{ route('pediments.index') }}">@lang('general.text_menu_pediments')</a></li>
                                    <li><a href="{{ route('tariff-fractions.index') }}">@lang('general.text_menu_tariff_fractions')</a></li>
                                    <li><a href="{{ route('incoterms.index') }}">@lang('general.text_menu_incoterms')</a></li>
                                    <li><a href="{{ route('transfer-reasons.index') }}">@lang('general.text_menu_transfer_reasons')</a></li>
                                    <li><a href="{{ route('operation-types.index') }}">@lang('general.text_menu_operation_types')</a></li>
                                    <li><a href="{{ route('uom-customs.index') }}">@lang('general.text_menu_uom_customs')</a></li>
                                </ul>
                            </li>
                            @endif
                            <li><a>@lang('general.text_menu_group_catalogs_carta_porte')<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="{{ route('transport-types.index') }}">@lang('general.text_menu_transport_types')</a></li>
                                    <li><a href="{{ route('station-types.index') }}">@lang('general.text_menu_station_types')</a></li>
                                    <li><a href="{{ route('stations.index') }}">@lang('general.text_menu_stations')</a></li>
                                    <li><a href="{{ route('measure-packagings.index') }}">@lang('general.text_menu_measure_packagings')</a></li>
                                    <li><a href="{{ route('dangerous-products.index') }}">@lang('general.text_menu_dangerous_products')</a></li>
                                    <li><a href="{{ route('packaging-types.index') }}">@lang('general.text_menu_packaging_types')</a></li>
                                    <li><a href="{{ route('permit-types.index') }}">@lang('general.text_menu_permit_types')</a></li>
                                    <li><a href="{{ route('setting-transports.index') }}">@lang('general.text_menu_setting_transports')</a></li>
                                    <li><a href="{{ route('trailer-types.index') }}">@lang('general.text_menu_trailer_types')</a></li>
                                    <li><a href="{{ route('setting-maritimes.index') }}">@lang('general.text_menu_setting_maritimes')</a></li>
                                    <li><a href="{{ route('load-types.index') }}">@lang('general.text_menu_load_types')</a></li>
                                    <li><a href="{{ route('container-maritimes.index') }}">@lang('general.text_menu_container_maritimes')</a></li>
                                    <li><a href="{{ route('authorization-agents.index') }}">@lang('general.text_menu_authorization_agents')</a></li>
                                    <li><a href="{{ route('transport-aerials.index') }}">@lang('general.text_menu_transport_aerials')</a></li>
                                    <li><a href="{{ route('sat-product-stccs.index') }}">@lang('general.text_menu_sat_product_stccs')</a></li>
                                    <li><a href="{{ route('service-types.index') }}">@lang('general.text_menu_service_types')</a></li>
                                    <li><a href="{{ route('rights-ways.index') }}">@lang('general.text_menu_rights_ways')</a></li>
                                    <li><a href="{{ route('car-types.index') }}">@lang('general.text_menu_car_types')</a></li>
                                    <li><a href="{{ route('container-types.index') }}">@lang('general.text_menu_container_types')</a></li>
                                    <li><a href="{{ route('transport-parts.index') }}">@lang('general.text_menu_transport_parts')</a></li>
                                    <li><a href="{{ route('transport-figures.index') }}">@lang('general.text_menu_transport_figures')</a></li>
                                    <li><a href="{{ route('traffic-types.index') }}">@lang('general.text_menu_traffic_types')</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    @endif
                    @if(\Auth::user()->p_branch_offices)
                    <li><a href="{{ route('branch-offices.index') }}"><i class="fa fa-home"></i> @lang('general.text_menu_branch_offices')</a></li>
                    @endif
                    @if(\Auth::user()->p_companies)
                    <li><a href="{{ route('companies.index') }}"><i class="fa fa-university"></i> @lang('general.text_menu_companies')</a></li>
                    @endif
                    @if(\Auth::user()->p_settings)
                    <li><a><i class="fa fa-cog"></i> @lang('general.text_menu_group_settings') <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <li><a href="{{ route('document-types.index') }}">@lang('general.text_menu_document_types')</a></li>
                            @if (!setting('app_demo',0) || \Auth::user()->superadmin)
                                @if(empty(setting('disabled_folio_cart')))
                                    <li><a href="{{ route('folios.index') }}">@lang('general.text_menu_folios')</a></li>
                                @endif
                            @endif
                            <li><a href="{{ route('settings') }}">@lang('general.text_menu_settings')</a></li>
                        </ul>
                    </li>
                    @endif
                    @endif
                    @if((Auth::user()->superadmin || Auth::user()->distributor) && \Auth::user()->p_admin)
                        <li><a><i class="fa fa-unlock-alt"></i> @lang('general.text_menu_group_admin') <span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">
                                <li><a href="{{ route('sys-customers.index') }}">@lang('general.text_menu_sys_customers')</a></li>
                                <li><a href="{{ route('sys-sales-orders.index') }}">@lang('general.text_menu_sys_sales_orders')</a></li>
                                @if(\Auth::user()->p_users)
                                <li><a href="{{ route('users.index') }}">@lang('general.text_menu_users')</a></li>
                                @endif
                                @if(Auth::user()->superadmin)
                                    @if(empty(setting('disabled_folio_cart')))
                                    <li><a href="{{ route('shop-products.index') }}">@lang('general.text_menu_shop_products')</a></li>
                                    @endif
                                    <li><a href="{{ route('announcements.index') }}">@lang('general.text_menu_announcements')</a></li>
                                @endif
                                @if(empty(setting('disabled_folio_cart')))
                                <li><a href="{{ route('sys-list-price-distributors.index') }}">@lang('general.text_menu_list_price_distributor')</a></li>
                                @endif
                                @if(Auth::user()->superadmin)
                                    @if (\Auth::user()->sysCustomer)
                                    <li><a href="{{ route('pacs.index') }}">@lang('general.text_menu_pacs')</a></li>
                                    @endif
                                    <li><a href="{{ route('logs') }}">@lang('general.text_menu_logs')</a></li>
                                @endif
                            </ul>
                        </li>
                    @endif
                </ul>
            </div>

        </div>
        <!-- /sidebar menu -->

        <!-- /menu footer buttons -->
        <div class="sidebar-footer hidden-small">

        </div>
        <!-- /menu footer buttons -->
    </div>
</div>
<!-- /sidebar menu -->
