<?php include_once('../../../config.php') ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Sisplan Web | Oraçamento Simples</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.261.22.1">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.261.22.1">
    <!-- Google Font: Source Sans Pro -->
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" type="text/css" href="../dist/css/dataTables.bootstrap4.min.css?versao=3.261.22.1" />

    <link href='../dist/css/bootstrap.min.css?versao=3.261.22.1'>
    <link rel="stylesheet" href="../dist/css/custom.css?versao=3.261.22.1">
    <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.261.22.1">
    <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.261.22.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.261.22.1">
    <link rel="shortcut icon" href="../favicon.ico">
    <!-- Toastr -->
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.261.22.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.261.22.1" />
    <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.261.22.1">
    <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.261.22.1">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <style>
        #progressbar li {
            list-style-type: none;
            font-size: 12px;
            width: 33%;
            float: left;
            position: relative
        }

        .labelGeral {
            margin-top: 7px;
            margin-bottom: 3px;
        }

        .border-Field .textoBorda {
            font-size: 1.0em !important;
            text-align: left !important;
            width: auto;
            padding: 0 10px;
            border-bottom: none;
        }

        .border-Field {
            border: 1.0px solid var(--font-color) !important;
            padding: 0 1.0em 0.3em 1.0em !important;
            margin: 0 0 1.0em 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
        }

        .divBtnItens {
            background-color: rgb(189 33 48) !important;
        }
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">

    <div class="wrapper">
        <div id="myModal" class="modal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 id="myModalLabel" class="modal-title"></h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <p id="myModalText"></p>
                    </div>
                    <div class="modal-footer">
                        <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
                        <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="wrapper">
            <div id="myModal" class="modal" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 id="myModalLabel" class="modal-title"></h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <p id="myModalText"></p>
                        </div>
                        <div class="modal-footer">
                            <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
                            <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content-wrapper">
                <section class="content">
                    <div class="content-header">
                        <div class="container-fluid">
                            <div class="row mb-2">
                                <div class="col-sm-6 flex">
                                </div>
                                <div class="col-sm-6">
                                </div><!-- /.col -->
                            </div><!-- /.row -->
                        </div>
                        <div class="row justify-content-center mt-0">
                            <div class="col-10 text-center p-0 mt-3 mb-2">
                                <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                                    <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                                        <h2> Orçamento Simples
                                            <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                                                <i class="fas fa-question-circle"></i>
                                            </button>
                                        </h2>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-12 mx-0 mb-3">
                                            <form id="msform">
                                                <ul id="progressbar">
                                                    <li class="active" id="account"><strong>Geral</strong></li>
                                                    <li id="payment"><strong>Itens</strong></li>
                                                    <li id="personal"><strong>Financeiro</strong></li>
                                                </ul>
                                                <p>Preencha os dados e clique em gravar para realizar o cadastro ou alteração do orçamento.</p>
                                                <fieldset>
                                                    <div class="form-card p-0" id="tourGeral">
                                                        <h2 class="fs-title">Dados Gerais</h2>
                                                        <div class="row">

                                                            <div class="col-lg-3  col-12 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtNumero">Número: *</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtNumero" name="txtNumero" placeholder="Número">
                                                                </div>
                                                            </div>


                                                            <div class="col-lg-2  col-12 form-group">
                                                                <label data-error="wrong" data-success="right" for="dtEmissao">Emissão: *</label>
                                                                <div class="input-group">
                                                                    <input type="date" class="input-default focus form-control" id="dtEmissao" name="dtEmissao">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-2 col-2 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtDias">Dias:</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtDias" name="txtDias" placeholder="Dias">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-2 col-12 form-group">
                                                                <label data-error="wrong" data-success="right" for="dtValidade">Validade: *</label>
                                                                <div class="input-group">
                                                                    <input type="date" class="input-default focus form-control" id="dtValidade" name="dtValidade">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-3 col-md-12 col-sm-12 mt-2 pt-1">
                                                                <fieldset class="form border-Field p-0">
                                                                    <legend class="textoBorda pb-0 mb-0">Somar dias a entrega</legend>
                                                                    <div class="form-row">
                                                                        <div class="icheck-primary mr-3"><input type="radio" checked id="rdSumDiasCorridos" name="radioSumDias" value="0"><label for="rdSumDiasCorridos" class="labelCheck">Corridos</label></div>
                                                                        <div class="icheck-primary"><input type="radio" id="rdSumDiasUteis" name="radioSumDias" value="1"><label for="rdSumDiasUteis" class="labelCheck">Úteis</label></div>
                                                                    </div>
                                                                </fieldset>
                                                            </div>

                                                            <div class="col-lg-6  col-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtCliente">Cliente: *</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtCliente" name="txtCliente" placeholder="Cliente">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-cliente" name="btn-cliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                        <button class="btn bg-danger" id="btn-limpa-cliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6  col-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtFuncionario">Funcionario: *</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtFuncionario" name="txtFuncionario" placeholder="Funcionario">
                                                                    <input type="text" id="txtCNPJ" class="d-none">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-funcionario" name="btn-funcionario" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                        <button class="btn bg-danger" id="btn-limpa-funcionario" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6  col-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtVendedor">Vendedor: *</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtVendedor" name="txtVendedor" placeholder="Vendedor">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-vendedor" name="btn-vendedor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                        <button class="btn bg-danger" id="btn-limpa-vendedor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                    </div>
                                                                </div>
                                                            </div>


                                                            <div class="col-lg-2  col-12 form-group" id="divComFat">
                                                                <label data-error="wrong" data-success="right" for="txtComFat">Com. Fat.:</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control maskDecimais" id="txtComFat" name="txtComFat" placeholder="Com. Fat.">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-2  col-12 form-group" id="divComRec">
                                                                <label data-error="wrong" data-success="right" for="txtComRec">Com. Rec.:</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control maskDecimais" id="txtComRec" name="txtComRec" placeholder="Com. Rec.">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-2  col-12 form-group" id="divValorFrete">
                                                                <label data-error="wrong" data-success="right" for="txtValorFrete">Valor Frete:</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control maskDecimais" id="txtValorFrete" name="txtValorFrete" placeholder="Valor Frete">
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6 col-23 form-group">
                                                                <div class="row pl-2">
                                                                    <label data-error="wrong" data-success="right" for="txtTabelaPreco">Tabela de preço: * </label>
                                                                    <div class="icheck-primary ml-2"><input type="checkbox" id="checkPrecoManual"><label for="checkPrecoManual">Preço Manual</label></div>
                                                                </div>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtTabelaPreco" name="txtTabelaPreco" class="form-control" placeholder="Tabela de preço">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-TabelaPreco" name="btn-TabelaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                        <button class="btn bg-danger" id="btn-limpa-TabelaPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6 col-12 m-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtTransportador">Transportador:</label>
                                                                <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgTransportador" class="custom-select focus">
                                                                    <option value="">Selecione um transportador</option>
                                                                    <option value="0">0 - Contratação do Frete por conta do
                                                                        Remetente
                                                                        (CIF)</option>
                                                                    <option value="1">1 - Contratação do Frete por conta do
                                                                        Destinatário
                                                                        (FOB)</option>
                                                                    <option value="2">2 - Contratação do Frete por conta de
                                                                        Terceiros
                                                                    </option>
                                                                    <option value="3">3 - Transporte Próprio por conta do Remetente
                                                                    </option>
                                                                    <option value="4">4 - Transporte Próprio por conta do
                                                                        Destinatário
                                                                    </option>
                                                                    <option selected value="9">9 - Sem Ocorrência de Transporte</option>
                                                                </select>
                                                            </div>

                                                            <div class="col-lg-6  col-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtTransportadora">Transportadora:</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtTransportadora" name="txtTransportadora" placeholder="Transportadora">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-transportadora" name="btn-transportadora" data-button="absolute" type="button">
                                                                            <i class="m-0 p-0 fas fa-search"></i>
                                                                        </button>
                                                                        <button class="btn bg-danger" id="btn-limpa-transportadora" type="button">
                                                                            <i class="m-0 p-0 fas fa-trash"></i>
                                                                        </button>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6  col-6 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtMotivo">Motivo: *</label>
                                                                <div class="input-group">
                                                                    <input type="text" class="input-default focus form-control" id="txtMotivo" name="txtMotivo" placeholder="Motivo">
                                                                    <input type="text" id="txtCNPJ" class="d-none">
                                                                    <div class="input-group-append">
                                                                        <button class="btn bg-danger" id="btn-motivo" name="btn-motivo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                        <button class="btn bg-danger" id="btn-limpa-motivo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-6 col-md-12 col-sm-12 mt-2 pt-1">
                                                                <fieldset class="form border-Field p-0">
                                                                    <legend class="textoBorda pb-0 mb-0">Situação</legend>
                                                                    <div class="form-row" style="padding-left: 5%;">
                                                                        <div class="icheck-primary mr-3"><input type="radio" checked id="rdSituacaoAberto" name="radioSituacao" value="0"><label for="rdSituacaoAberto" class="labelCheck">Aberto</label></div>
                                                                        <div class="icheck-primary mr-3"><input type="radio" id="rdSituacaoFechado" name="radioSituacao" value="1"><label for="rdSituacaoFechado" class="labelCheck">Fechado</label></div>
                                                                        <div class="icheck-primary mr-3"><input type="radio" id="rdSituacaoEmAprov" name="radioSituacao" value="2"><label for="rdSituacaoEmAprov" class="labelCheck">Em aprovação</label></div>
                                                                        <div class="icheck-primary mr-3"><input type="radio" id="rdSituacaoPerdido" name="radioSituacao" value="3"><label for="rdSituacaoPerdido" class="labelCheck">Perdido</label></div>
                                                                    </div>
                                                                </fieldset>
                                                            </div>

                                                            <div class="col-lg-3  col-12 form-group">
                                                                <label>Status comercial:</label>
                                                                <div class="input-group">
                                                                    <select class="form-control select2 select2-danger focus" id="selectStatusComercial" name="selectStatusComercial" data-dropdown-css-class="select2-danger">
                                                                        <option value="0">Bloqueado</option>
                                                                        <option value="1" selected>Liberado</option>
                                                                    </select>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-12 col-12 form-group">
                                                                <label data-error="wrong" data-success="right" for="txtObservacao">Observação:</label>
                                                                <textarea style="resize: none" id="txtObservacao" placeholder="Observação" class="input-default focus form-control" rows="4"></textarea>
                                                            </div>

                                                        </div>
                                                    </div>
                                                    <input type="button" id="avancar1" name="next" class="next action-button" value="Avançar" />
                                                    <input type="button" id="voltarAcesso" class="action-button-previous" value="Voltar" />

                                                </fieldset>
                                                <fieldset>
                                                    <div class="form-card p-0">
                                                        <h2 class="fs-title">Itens</h2>
                                                        <div class="form-row col-lg-12 col-12 justify-content-end">

                                                            <div class="col-lg-2 col-6 d-flex justify-content-end align-items-end">
                                                                <button type="button" id="btnAdicionar" class="btn btn-success btn-sisp" style="max-height: 38px!important">Adicionar</button>
                                                            </div>

                                                            <div class="col-lg-12 col-12" style="margin-top: 10px;">
                                                                <table style="width:100%; white-space: nowrap;" class="table table-responsive-sm table-select table-hover" width="100%" id="tabelaItens">
                                                                    <thead>
                                                                    </thead>
                                                                    <tbody>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>

                                                        <div class="form-row col-xl-12 col-12" id="valoresTotais">
                                                            <div class="col-xl-2 col-4">
                                                                <label data-error="wrong" data-success="right" for="txtValorTotalItem">Valor Item:</label>
                                                                <div class="input-group">
                                                                    <input type="text" disabled class="input-default focus form-control col-9 text-right" id="txtValorTotalItem" name="txtValorTotalItem" placeholder="0">
                                                                </div>
                                                            </div>
                                                            <div class="col-xl-2 col-4">
                                                                <label data-error="wrong" data-success="right" for="txtValorTotal">Valor Total Item:</label>
                                                                <div class="input-group">
                                                                    <input type="text" disabled class="input-default focus form-control col-9 text-right" id="txtValorTotalItens" name="txtValorTotalItens" placeholder="0">
                                                                </div>
                                                            </div>
                                                            <div class="col-xl-2 col-4">
                                                                <label data-error="wrong" data-success="right" for="txtValorTotal">Quantidade Total:</label>
                                                                <div class="input-group">
                                                                    <input type="text" disabled class="input-default focus form-control col-9 text-right" id="txtQtdeTotalItens" name="txtQtdeTotalItens" placeholder="0">
                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <input type="button" id="avancarPagamento" name="next" class="next action-button" value="Avançar" />
                                                    <input type="button" name="previous" id="ultimoVoltar" class="previous action-button-previous" value="Voltar" />
                                                </fieldset>
                                                <fieldset id="financeiroFs">
                                                    <div class="form-card" id="tourFinanceiro">
                                                        <h2 class="fs-title">Dados Financeiros</h2>
                                                        <div class="row">
                                                            <div class="col-12">
                                                                <div class="row">
                                                                    <div class="col-lg-12  col-12 form-group" style="margin-bottom: 0px;">
                                                                        <label data-error="wrong" data-success="right">Condição de pagamento: *</label>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" value="0" class="input-default focus form-control" id="txtCondPagto1" name="txtCondPagto1" placeholder="1">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto2" name="txtCondPagto2" placeholder="2">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto3" name="txtCondPagto3" placeholder="3">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto4" name="txtCondPagto4" placeholder="4">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto5" name="txtCondPagto5" placeholder="5">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto6" name="txtCondPagto6" placeholder="6">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto7" name="txtCondPagto7" placeholder="7">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto8" name="txtCondPagto8" placeholder="8">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto9" name="txtCondPagto9" placeholder="9">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto10" name="txtCondPagto10" placeholder="10">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto11" name="txtCondPagto11" placeholder="11">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-1  col-1 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtCondPagto12" name="txtCondPagto12" placeholder="12">
                                                                        </div>
                                                                    </div>

                                                                    <div class="col-lg-12  col-12 form-group" style="margin-bottom: 0px;">
                                                                        <label data-error="wrong" data-success="right">Desconto:</label>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais dadosFinan" id="txtDesconto1" name="txtDesconto1" placeholder="1">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais dadosFinan" id="txtDesconto2" name="txtDesconto2" placeholder="2">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais dadosFinan" id="txtDesconto3" name="txtDesconto3" placeholder="3">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais dadosFinan" id="txtDesconto4" name="txtDesconto4" placeholder="4">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais dadosFinan" id="txtDesconto5" name="txtDesconto5" placeholder="5">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-2  col-2 form-group">
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control maskDecimais" disabled id="txtDesconto" name="txtDesconto" placeholder="Desconto">
                                                                        </div>
                                                                    </div>

                                                                    <div class="col-lg-6 col-sm-12 form-group">
                                                                        <label data-error="wrong" data-success="right" for="txtMoeda">Moeda: *</label>
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtMoeda" name="txtMoeda" class="form-control" placeholder="Moeda">
                                                                            <div class="input-group-append">
                                                                                <button class="btn bg-danger" id="btnMoeda" name="btnMoeda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                                <button class="btn bg-danger" id="btnAMoeda" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-6 col-sm-12 form-group">
                                                                        <label data-error="wrong" data-success="right" for="txtHistorico">Histórico: *</label>
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtHistorico" name="txtHistorico" class="form-control" placeholder="Histórico">
                                                                            <div class="input-group-append">
                                                                                <button class="btn bg-danger" id="btn-historico" name="btn-historico" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                                <button class="btn bg-danger" id="btn-limpa-historico" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-6 col-sm-12 form-group">
                                                                        <label data-error="wrong" data-success="right" for="txtSituacao">Situação: *</label>
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtSituacao" name="txtSituacao" class="form-control" placeholder="Situação">
                                                                            <div class="input-group-append">
                                                                                <button class="btn bg-danger" id="btn-situacao" name="btn-situacao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                                <button class="btn bg-danger" id="btn-limpa-situacao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-6 col-sm-12 form-group">
                                                                        <label data-error="wrong" data-success="right" for="txtClasseGer">Classe Gerencial: *</label>
                                                                        <div class="input-group">
                                                                            <input type="text" class="input-default focus form-control" id="txtClasseGer" name="txtClasseGer" class="form-control" placeholder="Classe Gerencial">
                                                                            <div class="input-group-append">
                                                                                <button class="btn bg-danger" id="btn-classeGer" name="btn-classeGer" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                                <button class="btn bg-danger" id="btn-limpa-classeGer" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="form-card" id="divTotais">
                                                                        <h2 class="fs-title" style="margin-top: 2%">Totais</h2>
                                                                        <hr>
                                                                        <div class="row card-totais">
                                                                            <div class="col-sm-12 col-12">
                                                                                <div class="row d-flex justify-content-center">
                                                                                    <div class="col-sm-2 col-6">
                                                                                        <div class="description-block border-right">
                                                                                            <h5 id="txtTotalQtde" class="description-header txtTotalQtde">0</h5>
                                                                                            <span>Quantidade</span>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-sm-2 col-6">
                                                                                        <div class="description-block border-right">
                                                                                            <h5 id="txtValorTotal" class="description-header txtValorTotal"> 0,00</h5>
                                                                                            <span>Valor Total Itens</span>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-sm-2 col-6">
                                                                                        <div class="description-block border-right">
                                                                                            <h5 id="txtTotalLiquido" class="description-header txtTotalLiquido"> 0,00</h5>
                                                                                            <span>Valor Líquido</span>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-sm-2 col-6">
                                                                                        <div class="description-block border-right">
                                                                                            <h5 id="txtValorFreteTotal" class="description-header txtValorFrete"> 0,00</h5>
                                                                                            <span>Valor Frete</span>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-sm-2 col-6">
                                                                                        <div class="description-block">
                                                                                            <h5 id="txtValorLiqFrete" class="description-header txtValorLiqFrete"> 0,00</h5>
                                                                                            <span>Valor Liq. + Frete</span>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <hr>
                                                                    </div>

                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <input type="button" id="gravar" class="btn-sisp action-button" value="Gravar" />
                                                    <input type="button" name="previous" id="voltarFinanceiro" class="btn-sisp previous action-button-previous" value="Voltar" />
                                                </fieldset>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>

    <div class="modal fade" id="modalItem" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog " style="min-width: 95%;">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Adicionar Item</h4>
                    <div class="d-flex mt-2 ml-2">
                        <div class="radio-group form-radio icheck-primary"><input type="radio" checked id="rgProduto" name="rgTipoItem" class="rgTipoItem"><label for="rgProduto">Produto</label></div>
                        <div class="radio-group form-radio icheck-primary"><input type="radio" id="rgMaterial" name="rgTipoItem" class="rgTipoItem"><label for="rgMaterial">Material</label></div>
                    </div>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">

                    <div class="row">
                        <div class="col-12 row" id="divProduto">
                            <div class="col-lg-6 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtProduto">Produto:</label>
                                <div class="input-group">
                                    <input type="text" class="input-default focus form-control" id="txtProduto" name="txtProduto" class="form-control" placeholder="Produto">
                                    <div class="input-group-append">
                                        <button class="btn bg-danger" id="btn-Produto" name="btn-Produto" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btn-limpa-Produto" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-lg-3 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtCorProduto">Cor:</label>
                                <div class="input-group">
                                    <input type="text" class="input-default focus form-control" id="txtCorProduto" name="txtCorProduto" class="form-control" placeholder="Cor">
                                    <div class="input-group-append">
                                        <button class="btn bg-danger" id="btn-CorProduto" name="btn-CorProduto" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btn-limpa-CorProduto" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-lg-3 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtFaixa">Faixa:</label>
                                <div class="input-group">
                                    <input type="text" class="input-default focus form-control" disabled id="txtFaixa" name="txtFaixa" class="form-control" placeholder="Faixa">
                                    <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnFaixa" name="btn-representante" disabled data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnAFaixa" disabled type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-12 row d-none" id="divMaterial">
                            <div class="col-lg-6 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtMaterial">Material:</label>
                                <div class="input-group">
                                    <input type="text" class="input-default focus form-control" id="txtMaterial" name="txtMaterial" class="form-control" placeholder="Material">
                                    <div class="input-group-append">
                                        <button class="btn bg-danger" id="btn-Material" name="btn-Material" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btn-limpa-Material" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-lg-3 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtCorMaterial">Cor:</label>
                                <div class="input-group">
                                    <input type="text" class="input-default focus form-control" id="txtCorMaterial" name="txtCorMaterial" class="form-control" placeholder="Cor">
                                    <div class="input-group-append">
                                        <button class="btn bg-danger" id="btn-CorMaterial" name="btn-CorMaterial" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btn-limpa-CorMaterial" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-lg-3  col-12 form-group">
                            <label data-error="wrong" data-success="right" for="txtComplemento">Complemento:</label>
                            <div class="input-group">
                                <input type="text" maxlength="40" class="input-default focus form-control" id="txtComplemento" name="txtComplemento" class="form-control" placeholder="Complemento">
                            </div>
                        </div>

                        <div class="col-lg-6 col-6 form-group">
                            <label data-error="wrong" data-success="right" for="txtObs">Observação:</label>
                            <textarea style="resize: none" id="txtObs" placeholder="Observações" class="input-default focus form-control" rows="2"></textarea>
                        </div>

                    </div>

                    <hr>

                    <div class="tab-content" id="nav-tabContent">
                        <div class="col-lg-12 col-sm-12 form-group">
                            <div class="row d-flex justify-content-end" style="margin-top: 15px;">


                                <div class="col-lg-12 form-group" style="margin-top: 14px;">
                                    <table id="tabelaGrade" class="display table table-sm" width="100%" style="width:100%" style="white-space: nowrap;">
                                    </table>
                                </div>

                                <div class="col-6 row d-flex justify-content-end">
                                    <div class="col-lg-2 col-sm-2 form-group">
                                        <label data-error="wrong" data-success="right" for="txtQtdeTotal">Qtde. total</label>
                                        <div class="input-group">
                                            <input type="text" value="0.00" disabled class="input-default focus form-control text-right" id="txtQtdeTotal" name="txtQtdeTotal" class="form-control" placeholder="Qtde. total">
                                        </div>
                                    </div>

                                    <div class="col-lg-2 col-sm-2 form-group">
                                        <label data-error="wrong" data-success="right" for="txtValTotal">Valor total</label>
                                        <div class="input-group">
                                            <input type="text" value="0.00" disabled class="input-default focus form-control text-right" id="txtValTotal" name="txtValTotal" class="form-control" placeholder="Valor total">
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="row">
                        <div class="col-sm-12">
                            <button id="btnDesistirItem" class="btn btn-sisp btn-danger mr-2" data-dismiss="modal"> Desistir </button>
                            <button id="btnConfirmarItem" class="btn btn-sisp btn-primary"> Confirmar </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
    </aside>
    <?php
    include_once('../../../modais.php');
    include_once('../../../modals/modal_entid_simpl.html');
    ?>
    </div>

    <!-- jQuery -->
    <script src="../plugins/jquery/jquery.min.js?versao=3.261.22.1"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.261.22.1"></script>
    <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.261.22.1"></script>
    <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.261.22.1"></script>
    <!-- SweetAlert2 -->
    <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.261.22.1"></script>
    <script src="../plugins/toastr/toastr.min.js?versao=3.261.22.1"></script>

    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>

    <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.261.22.1"></script>

    <script src="../dist/js/adminlte.min.js?versao=3.261.22.1"></script>
    <script src="../dist/js/requisicoes.js?versao=3.261.22.1"></script>
    <script src="../dist/js/cliente/entidade.js?versao=3.261.22.1"></script>
    <script src="../dist/js/loadingoverlay.min.js?versao=3.261.22.1"></script>
    <script src="../dist/js/valida_cpf_cnpj.js?versao=3.261.22.1"></script>
    <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.261.22.1"></script>
    <script src="../dist/js/sisplan.js?versao=3.261.22.1"></script>
    <script src="../dist/js/popper.min.js?versao=3.261.22.1"></script>
    <script src="../dist/js/tippy-bundle.umd.js?versao=3.261.22.1"></script>
    <script src="../utils/funcoes.js?versao=3.261.22.1"></script>
    <script src="../dist/js/jquery.maskMoney.min.js?versao=3.261.22.1"></script>
    <script src="../utils/cookies.js?versao=3.261.22.1"></script>
    <script src="../dist/js/driver.min.js?versao=3.261.22.1"></script>
    <script src="../dist/js/dataTables.keyTable2.js?versao=3.261.22.1"></script>
    <script type="text/javascript" src="../modals/modal_entid_simpl.js?versao=3.261.22.1"></script>
    <script type="text/javascript" src="../config.js?versao=3.261.22.1"></script>
    <script type="text/javascript" src="../dist/js/sum().js"></script>
    <script type="text/javascript">
        $(document).ready(async function() {

            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

            let usuario = getCookie('usuario');
            let empresa = getCookie('empresa');

            ipInterno = IP_INTERNO;
            ipExterno = IP_EXTERNO;
            basicAuth = BASIC_AUTH;

            const temAcesso = await temAcessoTela('ORCAMENTOSIMPLES');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            const queryString = window.location.href;
            const parametros = queryString.split("/");
            const orcamento = parametros[parametros.length - 1];

            $(window).on("beforeunload", function(e) {
                e.stopPropagation();
                deletaRegistro("ORCAMENTOSIMPLES", getCookie("usuario"), orcamento);
                return undefined;
            });

            sArquivo = `${BASE_URI}/pages/orcamentosimples/cadastro_orcamentosimples/orcamentosimples.js?versao=3.261.22.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>