<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/font-awesome/css/font-awesome.min.css')); ?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/simple-line-icons/simple-line-icons.min.css')); ?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/bootstrap/css/bootstrap.min.css')); ?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/uniform/css/uniform.default.css')); ?>"" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css')); ?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/plugins/bootstrap-sweetalert/sweetalert.css')); ?>" rel="stylesheet" type="text/css" />

    <script src="<?php echo e(asset('/assets/global/plugins/bootstrap-sweetalert/sweetalert.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/pages/scripts/ui-sweetalert.min.js')); ?>" type="text/javascript"></script>

    <!-- END GLOBAL MANDATORY STYLES -->
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="<?php echo e(asset('/assets/global/css/components.min.css')); ?>" rel="stylesheet" id="style_components" type="text/css" />
    <link href="<?php echo e(asset('/assets/global/css/plugins.min.css')); ?>" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->

    <!-- BEGIN PAGE LEVEL STYLES -->
    <link href="<?php echo e(asset('/assets/pages/css/profile.min.css')); ?>" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL STYLES -->

    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="<?php echo e(asset('/assets/layouts/layout3/css/layout.min.css')); ?>" rel="stylesheet" type="text/css" />
    <link href="<?php echo e(asset('/assets/layouts/layout3/css/themes/default.min.css')); ?>" rel="stylesheet" type="text/css" id="style_color" />
    <link href="<?php echo e(asset('/assets/layouts/layout3/css/custom.min.css')); ?>" rel="stylesheet" type="text/css" />

    <link rel="stylesheet" href="<?php echo e(asset('/assets/apps/css/global.css')); ?>">

    <script src="<?php echo e(asset('/assets/global/plugins/jquery.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/js.cookie.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/jquery.blockui.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/uniform/jquery.uniform.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/apps/scripts/functions.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/scripts/valida-cpf-cnpj.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/jquery.blockui.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/pages/scripts/ui-blockui.min.js')); ?>" type="text/javascript"></script>
</head>
<body class="page-container-bg-solid page-header-menu-fixed">  
    <div class="page-container" id="myContainer">
        <!-- BEGIN CONTENT -->
        <div class="page-content-wrapper">
            <!-- BEGIN PAGE HEAD-->
            <div class="page-head">
                <div class="container-fluid">
                    <br/>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet light">
                                <div class="row">
                                    <div class="col-md-12">
                                        <span class="font-blue-madison title"><i class="fa fa-file-text-o"></i> Info Fatura</span>
                                        <hr>
                                    </div>
                                </div>
                                <div class="portlet-body">
                                    
                                    <?php if(empty($fatura->id)): ?>
                                        <div class="alert alert-danger">
                                            <center>
                                                <br><br><strong> A fatura solicitada não foi encontrado!</strong><br><br>
                                                <br><br><strong> Por favor tente novamente mais tarde!</strong><br><br>
                                            </center>
                                        </div>
                                    <?php else: ?>
                                        <div class="row">
                                            <div class="form-group col-md-6"> 
                                                <fieldset>
                                                    <legend><strong>#<?php echo e($fatura->id); ?></strong></legend>
                                                    <strong>Status: </strong><?php echo e($fatura->status); ?> <br/>
                                                    <strong>Valor: </strong><?php echo e(financialPrice($fatura->valorTotal)); ?> <br/>
                                                    <strong>Código Iugu: </strong><?php echo e($fatura->invoice_id); ?><br/>
                                                    <strong>Data de Geração: </strong><?php echo e(dateToBR($fatura->created_at)); ?><br/>
                                                    <?php if(dateToBR($fatura->data_vencimento) != dateToBR($fatura->data_vencimento_antigo)): ?>
                                                    <strong>Data Vencimento Original:</strong> <?php echo e(dateToBR($fatura->data_vencimento_antigo)); ?> <br/>
                                                    <?php endif; ?>
                                                    <strong>Data Vencimento:</strong> <?php echo e(dateToBR($fatura->data_vencimento)); ?> <br/>
                                                    <strong>Forma de Pagamento:</strong> <?php echo e($fatura->form); ?> <br/>
                                                    <strong>Cliente:</strong> <?php echo e($fatura->name); ?> <br/>
                                                    <strong>CNPJ/CPF:</strong> <?php echo e($fatura->cpf_cnpj); ?> <br/>
                                                    <?php if($fatura->salesman == 0): ?>
                                                        <strong>Vendedor:</strong> Venda Online <br/>
                                                    <?php else: ?>
                                                        <strong>Vendedor:</strong> <?php echo e($fatura->vendedor); ?> <br/>
                                                    <?php endif; ?>
                                                </fieldset>
                                                <br/>
                                                <fieldset>
                                                    <legend><strong>Histórico de Bloqueio</strong></legend>
                                                </fieldset>
                                                    <?php if(count($bloqueios) > 0): ?>
                                                    <table class="table table-striped table-hover table-light">
                                                        <tr>
                                                            <th class="col-md-1">ID</th>
                                                            <th class="col-md-1">Tipo de Bloqueio</th>
                                                            <th class="col-md-1">Data do Bloqueio</th>
                                                        </tr>
                                                        <?php foreach($bloqueios as $bloqueio): ?>
                                                            <tr>
                                                                <td>#<?php echo e($bloqueio->id); ?></td>
                                                                <td><?php echo e($bloqueio->type); ?></td>
                                                                <td><?php echo e(dateToBR($bloqueio->created_at)); ?></td>
                                                            </tr>
                                                        <?php endforeach; ?>
                                                    </table>
                                                    <?php else: ?>
                                                    Cliente sem histórico de bloqueio
                                                    <?php endif; ?>
                                                </fieldset>
                                                <br>
                                                <fieldset>
                                                    <legend><strong>Observações importantes:</strong></legend>
                                                    <?php if(!empty($fatura->observacao)): ?>
                                                        <?php echo $fatura->observacao; ?>

                                                    <?php else: ?>
                                                        Fatura sem observações.
                                                    <?php endif; ?>
                                                </fieldset>
                                                <br>
                                            </div>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>                  
            </div>
            <!-- END PAGE HEAD-->
        </div>
        <!-- END CONTENT -->
    </div>
</body>
</html>