Untitled

mail@pastecode.io avatar
unknown
html
2 years ago
9.6 kB
0
Indexable
Never
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce">
    <head>
        <title>La Vinoteca B2B</title>
        <vtex:metaTags />
        <vtex:template id="B2B-LaVinoteca-DashboardStyles" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link rel="shortcut icon" type="image/ico" href="https://lavinoteca.vteximg.com.br/arquivos/ids/156631/favicon.ico?v=0.00001" />
        <!-- Sweet Altert 2 -->
        <link href="/arquivos/sweetalert2.min.css" rel="stylesheet" type="text/css" />
        <!-- Include Bootstrap Datepicker -->
        <link href="/arquivos/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
         <!-- Jquery para boton de pago transbank -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        
    </head>
  <body>
    <div class="container-fluid">
      <div class="row alturaPantalla">
        <div class="col-2" id="menu">
          <a href="/dashboard/contacto" class="text-decoration-none"
            ><div
              class="pt-4 pr-4 pb-4 border-bottom border-white d-flex align-items-center altoElementoMenu"
            >
              <img
                src="/arquivos/icon-contacto.svg"
                alt=""
                srcset=""
                class="iconosMenu"
              />Contacto
            </div></a
          >
          <a href="/dashboard/logistica" class="text-decoration-none"
            ><div
              class="pt-4 pr-4 pb-4 border-bottom border-white d-flex align-items-center altoElementoMenu"
            >
              <img
                src="/arquivos/icon-logistica.svg"
                alt=""
                srcset=""
                class="iconosMenu"
              />Logística
            </div></a
          >
          <a href="/dashboard/sucursales" class="text-decoration-none"
            ><div
              class="pt-3 pb-3 pl-4 border-bottom border-white adicional"
              style="display: none"
            >
              Sucursales
            </div></a
          >
          <a href="#" class="text-decoration-none"
            ><div
              class="pt-3 pb-3 pl-4 border-bottom border-white adicional"
              style="display: none"
            >
              Notas por despachar
            </div></a
          >
          <a href="/dashboard/finanzas" class="text-decoration-none"
            ><div
              class="pt-4 pr-4 pb-4 border-bottom border-white d-flex align-items-center altoElementoMenu"
            >
              <img
                src="/arquivos/icon-finanzas.svg"
                alt=""
                srcset=""
                class="iconosMenu"
              /><b>Finanzas</b>
            </div></a
          >
          <a href="/dashboard/acuerdoComercial" class="text-decoration-none"
            ><div
              class="pt-4 pr-4 pb-4 border-bottom border-white d-none align-items-center altoElementoMenu"
              id="link-acuerdo"
            >
              <img
                src="/arquivos/icon-doc.svg"
                alt=""
                srcset=""
                class="iconosMenu"
              />Acuerdo<br />Comercial
            </div></a
          >
          <a href="#" class="text-decoration-none"
            ><div
              class="pt-3 pb-3 pl-4 border-bottom border-white adicional"
              style="display: none"
            >
              Acuerdos Vigentes
            </div></a
          >
          <a href="/account/orders" class="text-decoration-none" target="_blank"
            ><div
              class="pt-3 pb-3 pl-4 border-bottom border-white adicional"
              style="display: none"
            >
              Compra histórico
            </div></a
          >
          <a href="/account" class="text-decoration-none" target="_blank"
            ><div
              class="pt-4 pr-4 pb-4 d-flex align-items-center altoElementoMenu"
            >
              <img
                src="/arquivos/icon-usuario.svg"
                alt=""
                srcset=""
                class="iconosMenu"
              />Mi cuenta
            </div></a
          >
        </div>
        <div class="col-10" id="main">
          <div class="row my-3 mx-2">
            <div
              class="col border-right border-bottom border-white"
              id="mtoAprobado"
            ></div>
            <div
              class="col border-right border-bottom border-white"
              id="mtoUtilizado"
            ></div>
            <div
              class="col border-bottom border-white"
              id="mtoDisponible"
            ></div>
          </div>
          <div class="row">
            <div class="col">
              <input
                class="form-control iconPlaceHolderLupa bordeado"
                type="text"
                name=""
                id="parametro"
                placeholder="Buscar por factura"
              />
            </div>
            <div class="col">
              <select
                class="custom-select bordeado"
                id="slEstado"
                placeholder="Buscar por factura"
              >
                <option value="" selected="" hidden="">Estado...</option>
                <option value="Facturado">Facturado</option>
                <option value="Pagado">Pagado</option>
                <option value="Pendiente">Pendiente</option>
              </select>
            </div>
            <div class="col">
              <input
                class="form-control dp-date iconPlaceHolderCalendario bordeado"
                type="text"
                name=""
                id="dateDesde"
                placeholder="Desde"
              />
            </div>
            <div class="col">
              <input
                class="form-control dp-date iconPlaceHolderCalendario bordeado"
                type="text"
                name=""
                id="dateHasta"
                placeholder="Hasta"
              />
            </div>
            <div class="col">
              <button
                class="btn btn-dark bordeado ancho50"
                type="submit"
                id="btnFiltro"
              >
                FILTRAR
              </button>
            </div>
          </div>
          <div
            class="bg-white text-dark mt-2 pb-1 px-3 barraDesplazar"
            id="divTablaFacturas"
          >
            <table class="table borde Tabla" id="tblData">
              <thead>
                <tr class = "payment_process 512195">
                  <th scope="col" class="thSticky">Número facturas</th>
                  <th scope="col" class="thColor thSticky">Fecha emisión</th>
                  <th scope="col" class="thColor thSticky">Monto</th>
                  <th scope="col" class="thColor thSticky">Saldo</th>
                  <th scope="col" class="thColor thSticky">Concepto</th>
                  <th scope="col" class="thColor thSticky">Estado <button class="button_action" payment_id="512195" payment_amount="1386">Prueba Manual</button><div class="action_form"></div></th>
                </tr>
              </thead>
              <tbody></tbody>
            </table>
          </div>
          <div class="col-1 offset-11">
            <button
              class="btn btn-dark bordeado mt-1"
              type="submit"
              id="btnExportar"
              onclick="tableToCSV()"
            >
              Exportar
            </button>
          </div>
        </div>
      </div>
    </div>
  </body>
    <script src="/files/finanzas.js"></script>
    <!-- Sweet Alert -->
    <script type="text/javascript" src="/arquivos/sweetalert2.min.js"></script>
    <vtex:template id="B2B-commonScripts" />
    <vtex:template id="B2B-DashboardCommonScripts" />
    <script type="text/javascript" src="/arquivos/bootstrap-datepicker.min.js"></script>
    <script type="text/javascript" src="/arquivos/bootstrap-datepicker.es.min.js"></script>
    <script>
        
    jQuery(document).ready(function($) {
  var $ = jQuery;

  $('.payment_process').find('.button_action').click(function(e) {
  
    var payment_id = $(this).attr("payment_id");
    var payment_amount = $(this).attr("payment_amount");
    
    console.log(payment_id +' '+ payment_amount);
    
    e.preventDefault();
    $.ajax({
      type: 'POST',
      url: "https://vinotecabp.azurewebsites.net/webpay_init.php?action=init",
      data: {
        id: payment_id,
        amount: payment_amount
      },
      beforeSend: function(results) {
        $('.' + payment_id).find('.button_action').attr("disabled", true);
      },
      success: function(results) {
        $('.' + payment_id).find('.button_action').attr("disabled", false);
        results = $.parseJSON(results);
        if(!results.url) {
          alert("Error al obtener datos de transbank");
        } else {
          $('.' + payment_id).find('.action_form').html('<form target="_blank" name="form_' + payment_id + '" id="form_' + payment_id + '" method="POST" action="' + results.url + '"><input type="hidden" name="token_ws" value="' + results.token + '" /></form>');
          $('#form_' + payment_id).submit();
        }
      },
      error: function(results) {
        $('.' + payment_id).find('.button_action').attr("disabled", false);
        alert("Error al obtener datos de transbank");
      }
    });
  });
});

    </script>
</html>