<?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 | Regras B2B</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.14.1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.261.14.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.14.1" />

  <link href='../dist/css/bootstrap.min.css?versao=3.261.14.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.261.14.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.261.14.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.261.14.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.261.14.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.261.14.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.261.14.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.261.14.1">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.261.14.1">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <!-- <link rel="stylesheet" href="dist/css/leaflet.css?versao=3.261.14.1"> -->
    <link rel="stylesheet" href="../pages/regrab2b/css/regrab2b.css">
    <style>
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <?php
        include_once('../../menu.php');
        ?>
        <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">
                                <!-- <ol class="breadcrumb float-sm-right">
                                    <li class="breadcrumb-item active">Cadastro Regra B2B</li>
                                </ol> -->
                            </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>Cadastro de Regra B2B
                                        <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">
                                        <form id="msform">
                                            <!-- progressbar -->
                                            <ul id="progressbar">
                                                <li class="active" id="account"><strong>Tipos Pedidos</strong></li>
                                                <li id="payment"><strong>Estoque</strong></li>
                                                <li id="personal"><strong>Status</strong></li>
                                            </ul> <!-- fieldsets -->
                                            <p>Preencha os dados e clique em avançar para realizar a configuração da regra B2B</p>
                                            <fieldset>
                                                <div class="form-card" id="formcard1">
                                                    <h2 class="fs-title">Tipos Pedidos</h2>
                                                    <div class="row">
                                                        <div class="col-lg-6  col-12 form-group">
                                                            <div class="row">
                                                                <div class="col-lg-6  col-12 form-group">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtCodigo">Código *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" readonly class="input-default focus form-control" id="txtCodigo" name="txtCodigo" class="form-control" placeholder="Campo preenchido automaticamente">
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-6  col-12 form-group">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrioridade">Prioridade *</label>
                                                                    <div class="input-group">
                                                                        <input type="number" class="input-default focus form-control" id="txtPrioridade" name="txtPrioridade" class="form-control" placeholder="Prioridade">
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-12  col-12 form-group">
                                                                    <label data-error="wrong" data-success="right" for="txtDescricao">Descrição regra *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtDescricao" name="txtDescricao" class="form-control" placeholder="Descrição da regra">
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-12  col-12 form-group">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtOperacaoFiscal">Operação fiscal *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtOperacaoFiscal" name="txtOperacaoFiscal" class="form-control" placeholder="Operação fiscal">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnOperacaoFiscal" name="btnEmpresa" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnAOperacaoFiscal" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-6  col-12 form-group">
                                                            <table id="tabelaEmpresa" class="table table-sm table-hover table-select table-condensed">
                                                                <thead>
                                                                    <tr>
                                                                        <th>Sel</th>
                                                                        <th>Empresa</th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                    </div>
                                                </div>
                                                <input type="button" name="avancar1" class="btn-sisp next action-button" id="avancar1" value="Avançar" />
                                                <button type="button" id="btnVoltar" style="font-size:15px;" class="btn-sisp action-button-previous" data-dismiss="modal">Voltar</button>
                                            </fieldset>
                                            <fieldset>
                                                <div class="form-card">
                                                    <h2 class="fs-title">Campos de Comparação</h2>
                                                    <div class="row" id="tourcamposcomparacao">

                                                        <div class="col-lg-12 col-12 d-flex justify-content-start">
                                                            <input type="button" name="btnCFOP" class="action-button" value="CFOP" id="btnCFOP">
                                                            <input type="button" name="btnNCM" class="action-button" value="NCM" id="btnNCM">
                                                            <input type="button" name="btnEstados" class="action-button" value="ESTADOS" id="btnEstados">
                                                            <input type="button" name="btnEntidade" class="action-button" value="ENTIDADE" id="btnEntidade">
                                                            <input type="button" name="btnOrigem" class="action-button" value="ORIG. ITEM" id="btnOrigem">
                                                            <input type="button" name="btnCodSPED" class="action-button" value="COD. SPED" id="btnCodSPED">
                                                            <input type="button" name="btnEntidAux" class="action-button" value="ENTID. AUX" id="btnEntidAux">
                                                            <input type="button" name="btnPresenca" class="action-button" value="PRESENÇA" id="btnPresenca">
                                                        </div>

                                                        <div class="col-lg-4  col-12" style="padding-right: 2%;">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="tipoPessoa">Tipo Pessoa</label>
                                                            <div class="row form-group checkboxMoeda" id="tipoPessoa">
                                                                <div class="col-lg-12">
                                                                    <label class="labelCheck" for="checkFisica"><input type="checkbox" class="configCheck" id="checkFisica">  1 - Física</label><br>
                                                                    <label class="labelCheck" for="checkJuridica"><input type="checkbox" class="configCheck" id="checkJuridica">  2 - Jurídica</label><br>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12" style="padding-right: 2%;">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="consFinal">Consumidor Final</label>
                                                            <div class="row form-group checkboxMoeda" id="consFinal">
                                                                <div class="col-lg-12">
                                                                    <label class="labelCheck" for="checkSim"><input type="checkbox" class="configCheck" id="checkSim">  1 - Sim</label><br>
                                                                    <label class="labelCheck" for="checkNao"><input type="checkbox" class="configCheck" id="checkNao">  2 - Não</label><br>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="tipoVenda">Tipo Venda Item</label>
                                                            <div class="row form-group checkboxMoeda" id="tipoVenda">
                                                                <div class="col-lg-12">
                                                                    <label class="labelCheck" for="checkProducao"><input type="checkbox" class="configCheck" id="checkProducao">  0 - Produção</label><br>
                                                                    <label class="labelCheck" for="checkRevenda"><input type="checkbox" class="configCheck" id="checkRevenda">  1 - Revenda</label><br>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-12  col-12">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="porteCliente">Porte Cliente</label>
                                                            <div class="row form-group checkboxMoeda" id="porteCliente">
                                                                <div class="col-lg-3">
                                                                    <label class="labelCheck" for="checkSA"><input type="checkbox" class="configCheck" id="checkSA">  SA</label><br>
                                                                    <label class="labelCheck" for="checkLTDA"><input type="checkbox" class="configCheck" id="checkLTDA">  LTDA</label><br>
                                                                </div>
                                                                <div class="col-lg-3">
                                                                    <label class="labelCheck" for="checkSimples"><input type="checkbox" class="configCheck" id="checkSimples">  Simples</label><br>
                                                                    <label class="labelCheck" for="checkME"><input type="checkbox" class="configCheck" id="checkME">  ME</label><br>
                                                                </div>
                                                                <div class="col-lg-3">
                                                                    <label class="labelCheck" for="checkEPP"><input type="checkbox" class="configCheck" id="checkEPP">  EPP</label><br>
                                                                    <label class="labelCheck" for="checkNormal"><input type="checkbox" class="configCheck" id="checkNormal">  Normal</label><br>
                                                                </div>
                                                                <div class="col-lg-3">
                                                                    <label class="labelCheck" for="checkMEI"><input type="checkbox" class="configCheck" id="checkMEI">  MEI</label><br>
                                                                    <label class="labelCheck" for="checkEireli"><input type="checkbox" class="configCheck" id="checkEireli">  EIRELI</label><br>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <input type="button" name="avancar2" class="next action-button" value="Avançar" id="avancar2" />
                                                <input type="button" name="voltar" class="previous action-button-previous" value="Voltar" id="voltar" />
                                            </fieldset>
                                            <fieldset>
                                                <div class="form-card">
                                                    <h2 class="fs-title">Dados a serem alterados</h2>
                                                    <div class="row" id="campostouralteracao">
                                                        <div class="col-lg-12 col-12 d-flex justify-content-start">
                                                            <input type="button" name="btnICMS" class="action-button" value="ICMS" id="btnICMS">
                                                            <input type="button" name="btnIPI" class="action-button" value="IPI" id="btnIPI">
                                                            <input type="button" name="btnPISCOFINS" class="action-button" value="PIS/COFINS" id="btnPISCOFINS">
                                                        </div>

                                                        <div class="col-lg-12  col-12" style="margin-top: 1%;">
                                                            <label class="labelCheck" for="checkAplicaDesc"><input type="checkbox" class="configCheck" id="checkAplicaDesc">  Aplica Desconto</label>  
                                                            <label class="labelCheck" for="checkGeraDup"><input type="checkbox" class="configCheck" id="checkGeraDup">  Gera Duplicata</label>  
                                                            <label class="labelCheck" for="checkMVAZerada"><input type="checkbox" class="configCheck" id="checkMVAZerada">  MVA Zerada</label>
                                                        </div>

                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtReducaoMVA">Redução/MVA</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.0000" class="input-default focus form-control" id="txtReducaoMVA" name="txtReducaoMVA" class="form-control" placeholder="Redução/MVA">
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtAliqInternaUF">Alíq. interna da UF</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.00" class="input-default focus form-control" id="txtAliqInternaUF" name="txtAliqInternaUF" class="form-control" placeholder="Alíquota interna da UF">
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercFCP">Percentual FCP</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.00" class="input-default focus form-control" id="txtPercFCP" name="txtPercFCP" class="form-control" placeholder="Percentual FCP">
                                                            </div>
                                                        </div>
                                                        <!-- -->
                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtCredPresumido">Crédito presumido</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.00" class="input-default focus form-control" id="txtCredPresumido" name="txtCredPresumido" class="form-control" placeholder="Crédito presumido">
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercEfetivo">Percentual efetivo</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.00" class="input-default focus form-control" id="txtPercEfetivo" name="txtPercEfetivo" class="form-control" placeholder="Percentual efetivo">
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-4  col-12 form-group">
                                                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercRedBase">Perc. reduzido base ST</label>
                                                            <div class="input-group">
                                                                <input type="text" value="0.00" class="input-default focus form-control" id="txtPercRedBase" name="txtPercRedBase" class="form-control" placeholder="Percentual reduzido base ST">
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                                <input type="button" name="btnGravar" class="action-button" value="Gravar" id="btnGravar" />
                                                <input type="button" name="voltar2" class="previous action-button-previous" value="Voltar" id="voltar2" />
                                            </fieldset>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

        </div>
    </div>


    <?php
    include_once('../../modais.php');
    ?>
    <aside class="control-sidebar control-sidebar-dark">
    </aside>
   
  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.261.14.1"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.261.14.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.261.14.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.261.14.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.261.14.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.261.14.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.14.1"></script>

  <script src="../dist/js/adminlte.min.js?versao=3.261.14.1"></script>

  <script src="../dist/js/requisicoes.js?versao=3.261.14.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.261.14.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.261.14.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.261.14.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.261.14.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.261.14.1"></script>
  <script src="../dist/js/popper.min.js?versao=3.261.14.1"></script>
  <script src="../dist/js/tippy-bundle.umd.js?versao=3.261.14.1"></script>
  <script src="../utils/funcoes.js?versao=3.261.14.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.261.14.1"></script>
  <script src="../utils/cookies.js?versao=3.261.14.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.261.14.1"></script>
  <script src="../dist/js/dataTables.keyTable2.js?versao=3.261.14.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.261.14.1"></script>
    <script>
        $(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('REGRAB2B');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            sArquivo = `${BASE_URI}/pages/regrab2b/js/regrab2b.js?versao=3.261.14.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>