<?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 | Faturamento de Serviço</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.255.7.1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.255.7.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.255.7.1" />

  <link href='../dist/css/bootstrap.min.css?versao=3.255.7.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.255.7.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.255.7.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.255.7.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.255.7.1">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.255.7.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: 25%;
      float: left;
      position: relative
    }

    .card-totais {
      margin-top: 2%;
    }

    #txtDados {
      padding-top: .7%;
      padding-left: .85%;
    }

    .input-group-append>a>i {
      margin-left: 0 !important;
      padding-left: 5px;
      padding-right: 5px;
    }

    .focus:read-only:focus {
      border-color: #aa1212 !important;
    }

    .checkboxMoeda {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding-top: 1.6%;
      padding-bottom: 0%;
    }

    .configCheck {
      -ms-transform: scale(1.5);
      -moz-transform: scale(1.5);
      -webkit-transform: scale(1.5);
      -o-transform: scale(1.5);
      transform: scale(1.5);
      padding: 10px;
    }
  </style>

</head>

<body class="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="content-wrapper">
      <section class="content">
        <div class="container-fluid" id="grad1">
          <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>Faturamento de Serviço
                    <button title="Tutorial" type="button" class="btn btn-info btn-sm ml-2" 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">
                      <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>
                        <li id="confirm"><strong>Conclusão</strong></li>
                      </ul>
                      <p>Preencha os dados e clique em avançar até a conclusão do faturamento</p>
                      <fieldset>
                        <div class="form-card" id="tourGeral">
                          <h2 class="fs-title"> Dados Gerais </h2>
                          <div class="row">

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

                            <div class="col-lg-3 col-3 form-group">
                              <label data-error="wrong" data-success="right" for="txtCodObra">Cód. Obra: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtCodObra" name="txtCodObra" class="form-control" placeholder="Cód. Obra">
                              </div>
                            </div>

                            <div class="col-lg-3 col-3 form-group">
                              <label data-error="wrong" data-success="right" for="txtCodArt">Cód. ART.: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtCodArt" name="txtCodArt" class="form-control" placeholder="Cód. ART.">
                              </div>
                            </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" class="form-control" placeholder="Cliente">
                                <input type="text" id="txtCNPJ" class="d-none">
                                <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-2  col-12 form-group">
                              <label data-error="wrong" data-success="right" for="txtDataEmissao">Data emissão: </label>
                              <div class="input-group">
                                <input type="date" max="2500-12-31" value="" class="input-default focus form-control" id="txtDataEmissao" name="txtDataEmissao" class="form-control">
                              </div>
                            </div>

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

                            
                            <div class="col-lg-2 col-12 form-group">
                              <label data-error="wrong" data-success="right" for="txtDesconto">Desconto: %</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtDesconto" name="txtDesconto" value="0" class="form-control" placeholder="Desconto">
                              </div>
                            </div>

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

                            <div class="col-lg-3 col-3 form-group">
                              <label data-error="wrong" data-success="right" for="txtCom1">% Comissão 1: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtCom1" name="txtCom1" class="form-control" placeholder="% Comissão 1">
                              </div>
                            </div>

                            <div class="col-lg-3 col-3 form-group">
                              <label data-error="wrong" data-success="right" for="txtCom2">% Comissão 2: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtCom2" name="txtCom2" class="form-control" placeholder="% Comissão 2">
                              </div>
                            </div>

                            <div class="col-lg-6 col-6 form-group">
                              <label data-error="wrong" data-success="right" for="txtNatureza">Natureza: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtNatureza" name="txtNatureza" class="form-control" placeholder="Natureza">
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btn-Natureza" name="btn-Natureza" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                  <button class="btn bg-danger" id="btn-limpa-Natureza" 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="txtCidade">Cidade prest. serv.: </label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtCidade" name="txtCidade" class="form-control" placeholder="Cidade prest. serv.">
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btn-Cidade" name="btn-Cidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                  <button class="btn bg-danger" id="btn-limpa-Cidade" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                              </div>
                            </div>

                            <div class="col-lg-12  col-12 form-group">
                              <label data-error="wrong" data-success="right" for="txtOutrasInfo">Outras informações: </label>
                              <textarea style="resize: none" id="txtOutrasInfo" placeholder="Outras informações" class="input-default focus form-control" rows="4"></textarea>
                            </div>

                            <div class="col-sm-12 table-wrap" id="testestes">
                              <label class="labelGeral" data-error="wrong" data-success="right">Opções</label>
                            </div>

                            <div class="col-sm-6 table-wrap">
                              <div class="checkboxMoeda">
                                <label class="labelCheck" for="cbRpsZerado">    <input type="checkbox" class="configCheck" id="cbRpsZerado">     Enviar valor RPS zerado</label> <br>
                                <label class="labelCheck" for="cbDescRetencoes">    <input type="checkbox" class="configCheck" id="cbDescRetencoes">     Descontar retenções do valor líquido</label> <br>
                              </div>
                            </div>

                            <div class="col-sm-6 table-wrap">
                              <div class="checkboxMoeda">
                                <label class="labelCheck" for="cbDescIss">    <input type="checkbox" class="configCheck" id="cbDescIss">     Descontar ISS do valor líquido</label> <br>
                                <!-- <label class="labelCheck" for="cbDescEmpenho">    <input type="checkbox" class="configCheck" id="cbDescEmpenho">     Descontar empenho do valor total</label> <br> -->
                              </div>
                            </div>

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

                          <div class="row">
                            <div class="col-lg-1">
                              <h2 class="fs-title">Itens</h2>
                            </div>
                          </div>

                          <hr>
                          <div id="items-wrap" class="table-wrap">
                          </div>

                          <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">0</h5>
                                    <span>Quantidade</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block border-right">
                                    <h5 id="txtTotDesconto" class="description-header">0</h5>
                                    <span>Desconto</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block border-right">
                                    <h5 id="txtTotalLiquido" class="description-header">R$ 0,00</h5>
                                    <span>Valor Líquido</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block">
                                    <h5 id="txtValorTotal" class="description-header">R$ 0,00</h5>
                                    <span>Valor Total</span>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <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="txtValorPis" class="description-header">R$ 0,00</h5>
                                    <span>Valor PIS</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block border-right">
                                    <h5 id="txtValorCofins" class="description-header">R$ 0,00</h5>
                                    <span>Valor COFINS</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block">
                                    <h5 id="txtValorIss" class="description-header">R$ 0,00</h5>
                                    <span>Valor ISS</span>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <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="txtValorCsll" class="description-header">R$ 0,00</h5>
                                    <span>Valor CSLL</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block border-right">
                                    <h5 id="txtValorInss" class="description-header">R$ 0,00</h5>
                                    <span>Valor INSS</span>
                                  </div>
                                </div>
                                <div class="col-sm-2 col-6">
                                  <div class="description-block">
                                    <h5 id="txtValorIrrf" class="description-header">R$ 0,00</h5>
                                    <span>Valor IRRF</span>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <hr>
                        </div>

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

                      </fieldset>
                      <fieldset id="financeiroFs">
                        <div class="form-card">
                          <h2 class="fs-title">Dados Financeiros</h2>
                          <div class="row">
                            <div class="col-12">
                              <label>Vencimentos</label>
                              <div class="row">
                                <div class="col-6">
                                  <div class="row">
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento1" type="tel" placeholder="Parcela 01" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento2" type="tel" placeholder="Parcela 02" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento3" type="tel" placeholder="Parcela 03" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento4" type="tel" placeholder="Parcela 04" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento5" type="tel" placeholder="Parcela 05" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento6" type="tel" placeholder="Parcela 06" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento7" type="tel" placeholder="Parcela 07" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento8" type="tel" placeholder="Parcela 08" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento9" type="tel" placeholder="Parcela 09" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento10" type="tel" placeholder="Parcela 10" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento11" type="tel" placeholder="Parcela 11" />
                                    </div>
                                    <div class="col-lg-6 col-sm-3 form-group">
                                      <input min="0" class="input-default focus" maxlength="3" id="edtVencimento12" type="tel" placeholder="Parcela 12" />
                                    </div>
                                  </div>
                                </div>
                                <!-- <span id="txtValorNota" class="d-none"></span> -->
                                <div class="col-lg-6">
                                  <div class="row">

                                    <div class="col-lg-12 table-responsive">
                                      <!-- <label data-error="wrong" data-success="right" for="tabelaDuplicatas">Financeiro</label> -->
                                      <table id="tabelaDuplicatas" class="display table table-sm" width="100%" style="width:100%">
                                        <thead>
                                          <tr>
                                            <th>Parcela</th>
                                            <th>Vencimento</th>
                                            <th>Valor</th>
                                          </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                      </table>
                                    </div>

                                    <div class="col-lg-12" style="margin-left: .7%;">
                                      <div class="info-box row" style="background-color: var(--blue-color)!important">
                                        <span class="info-box-icon"><i class="fas fa-dollar-sign text-white"></i></span>
                                        <div class="info-box-content">
                                          <span class="info-box-text text-white" style="font-size:15px">VALOR
                                            TOTAL</span>
                                          <span id="txtValorFinanceiro" class="info-box-number text-white" style="font-size:20px">R$&nbsp;0,00</span>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>

                                <div class="col-lg-4 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-4 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-4 col-sm-12 form-group">
                                  <label data-error="wrong" data-success="right" for="txtBanco">Banco *</label>
                                  <div class="input-group">
                                    <input type="text" class="input-default focus form-control" id="txtBanco" name="txtBanco" class="form-control" placeholder="Banco">
                                    <div class="input-group-append">
                                      <button class="btn bg-danger" id="btn-banco" name="btn-banco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                      <button class="btn bg-danger" id="btn-limpa-banco" 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>
                            </div>
                          </div>
                        </div>
                        <input type="button" id="avancarFinanceiro" name="next" class="next action-button" value="Avançar" />
                        <input type="button" name="previous" id="voltarFinanceiro" class="previous action-button-previous" value="Voltar" />
                      </fieldset>
                      <fieldset>
                        <div class="form-card">
                          <h2 class="fs-title text-center">Conclusão</h2> <br><br>
                          <div class="row justify-content-center">
                            <input type="button" id="gravar" class="btn btn-danger" value="Gravar">
                          </div>
                        </div>
                        <input type="button" name="previous" id="ultimoVoltar" class="previous action-button-previous" value="Voltar" />
                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>

  <div class="modal fade" id="modalProduto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header">
          <h4 id="modalProduto-titulo" class="modal-title">Pesquisa Serviço</h4>
          <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-9">
              <div class="row">
                <div class="col-sm-4">
                  <input class="d-none" id="idLinha" />
                  <input type="text" placeholder="Codigo" class="input-default focus" id="txtProdutoCodigo" name="txtProdutoCodigo">
                </div>
                <div class="col-sm-4">
                  <input type="text" placeholder="Descrição" class="input-default focus" id="txtProdutoDescricao" name="txtProdutoDescricao">
                </div>
              </div>
            </div>
            <div class="col-sm-3" style="text-align:center">
              <button type="button" class="btn btn-info focus" id="btnConsultarProduto" name="btnConsultarProduto">
                <i class='fas fa-search'></i> Consultar
              </button>
            </div>
            <div class="col-sm-12 table-responsive" style="margin-top: 2%;">
              <table style="width:100%" width="100%" id="tabelaProdutos" class="display table table-sm">
              </table>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <div class="row">
            <div class="col-sm-12">
              <button id="btn_confirmar_produto" class="btn btn-danger"> Confirmar </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div id="modalTribProd" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div id="modalProdutoTrib" class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">Tributações</h4>
          <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">
            <input type="text" class="input-default form-control d-none" id="txtIndiceAlteracao" name="txtIndiceAlteracao">
            <div class="col-lg-6 col-sm-12 form-group">
              <label data-error="wrong" data-success="right" for="txtEnquadra">Enquadramento IPI</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtEnquadra" name="txtEnquadra" class="form-control" placeholder="Enquadramento IPI">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnEnquadra" name="btnEnquadra" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnAEnquadra" 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="txtCsosn">CSOSN</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCsosn" name="txtCsosn" class="form-control" placeholder="CSOSN">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnCsosn" name="btnCsosn" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnACsosn" 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="txtCstIcms">CST ICMS</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCstIcms" name="txtCstIcms" class="form-control" placeholder="CST ICMS">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnCstIcms" name="btn-representante" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnACstIcms" 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="txtCstIpi">CST IPI</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCstIpi" name="txtCstIpi" class="form-control" placeholder="CST IPI">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnCstIpi" name="btn-representante" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnACstIpi" 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="txtCstPis">CST PIS</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCstPis" name="txtCstPis" class="form-control" placeholder="CST PIS">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnCstPis" name="btn-representante" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnACstPis" 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="txtCstCofins">CST COFINS</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCstCofins" name="txtCstCofins" class="form-control" placeholder="CST COFINS">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnCstCofins" name="btn-representante" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btnACstCofins" type="button">
                    <i class="m-0 p-0 fas fa-trash"></i>
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <div class="row">
            <div class="col-sm-12">
              <button id="btnConfirmarTrib" class="btn btn-danger"> Confirmar </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <?php
  include_once('../../modais.php');
  ?>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
  </div>

  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.255.7.1"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.255.7.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.255.7.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.255.7.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.255.7.1"></script>

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

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

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

    });
  </script>
</body>

</html>