<!DOCTYPE html>
<HTML {$html_attrs}><HEAD><TITLE>{$pagetitle}</TITLE>
<STYLE>
/* Estilos Base */
.flash-alert {
    position: fixed;
    top: 25px;
    right: 25px;
    min-width: 250px;
    padding: 16px 20px;
    border-radius: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10000;
    
    /* Animación */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateX(100px); /* Aparece desde la derecha */
}

/* Color Success (Verde) */
.alert-success {
    background-color: #198754;
    border-left: 6px solid #146c43;
    color: white;
}

/* Color Info (Azul) */
.alert-info {
    background-color: #0dcaf0;
    border-left: 6px solid #0aa2c0;
    color: #000; /* Texto oscuro para mejor contraste en azul claro */
}

/* Color Warning (Amarillo/Naranja) */
.alert-warning {
    background-color: #ffc107;
    border-left: 6px solid #d3a006;
    color: #000;
}

/* Clase para activar la visualización */
.flash-visible {
    opacity: 1;
    transform: translateX(0);
}
</STYLE>

<SCRIPT>
	document.addEventListener("DOMContentLoaded", function() {
    const urlParams = new URLSearchParams(window.location.search);
    const status = urlParams.get('status'); 
    const flash = document.getElementById('flash-message');

    // Definimos las variantes en un objeto
    const variants = {
        'info': {
            text: "ℹ️ Información: Su sesión caducará pronto.",
            class: 'alert-info'
        },
        'warning': {
            text: "⚠️ Atención: El importe indicado supera el total de la Venta!",
            class: 'alert-warning'
        },
        'success': {
            text: "Ok: Venta registrada correctamente!",
            class: 'alert-success'
        }
    };

    // Si el status existe en nuestras variantes...
    if (variants[status]) {
        const config = variants[status];

        // 1. Configurar contenido y clase
        flash.textContent = config.text;
        flash.classList.add(config.class);

        // 2. Mostrar con un pequeño delay
        setTimeout(() => {
            flash.classList.add('flash-visible');
        }, 100);

        // 3. Ocultar y limpiar URL
        setTimeout(() => {
            flash.classList.remove('flash-visible');
            
            // Limpiar la URL sin recargar la página
            window.history.replaceState({}, document.title, window.location.pathname);
            
            // Opcional: remover la clase de color al terminar para que esté limpio la próxima vez
            setTimeout(() => {
                flash.classList.remove(config.class);
            }, 500);
        }, 3100);
    }
});
</SCRIPT>
<META content=IE=7 http-equiv=X-UA-Compatible>
<META content="text/html; charset=utf-8" http-equiv=Content-Type><LINK rel=stylesheet type=text/css href="styles/default.css">{BEGIN rtlCSS}<LINK rel=stylesheet type=text/css href="styles/defaultRTL.css">{END rtlCSS}{BEGIN styleCSSFiles}<LINK rel=stylesheet type=text/css href="{$stylepath}">{END styleCSSFiles}{BEGIN pageCSSFiles}<LINK rel=stylesheet type=text/css href="{$pagestylepath}">{END pageCSSFiles}<!--[if IE]><LINK rel=stylesheet type=text/css href="styles/defaultIE.css">{BEGIN IEcssFiles}<LINK rel=stylesheet type=text/css href="{$stylepathIE}">{END IEcssFiles}<![endif]-->
<META name=GENERATOR content="MSHTML 8.00.7601.17514"></HEAD>
<BODY class="{$stylename}" {$bodyattrs}>{BEGIN body}{$header} 
<TABLE class=runner-toptable cellPadding=0><TR class=runner-header><TD class=runner-top colSpan=3>{BEGIN container_add}<TABLE class="runner-c runner-c-add" cellPadding=0 align=center><TR class="runner-toprow style2 header"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
          <TD class=runner-cc><DIV class="runner-b-addheader {$brickclass_addheader}"><FONT 
            size=3>Registrar nueva Venta</FONT></DIV></TD>
          <TD class=runner-cr><IMG src="images/spacer.gif"></TD></TR>
        {BEGIN message_block}<TR class="runner-row style1 runner-b-message {$brickclass_message}"><TD class=runner-cl></TD>
          <TD class="runner-cc runner-brickcontents"><DIV class=runner-message>{$message}</DIV></TD>
          <TD class=runner-cr></TD></TR>
        {END message_block}<TR class="runner-row style1 runner-b-wrapper {$wrapperclass_fields}"><TD class=runner-cl></TD>
          <TD class="runner-cc runner-brickcontents runner-wrapper">{BEGIN container_fields}<TABLE class="runner-c runner-c-fields" cellPadding=0><TR class="{$cheaderclass_fields}"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
                <TD class=runner-cc></TD>
                <TD class="runner-cc alt"></TD>
                <TD class="runner-cr alt"><IMG src="images/spacer.gif"></TD></TR>
              {BEGIN tipo_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_tipo {$fielddispclass_tipo}">{BEGIN tipo_label}Tipo {END tipo_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV class="fieldcontrol_tipo {$fielddispclass_tipo}"><FONT 
                  size=3>{$tipo_editcontrol}</FONT>&nbsp; 
                </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END tipo_fieldblock}{BEGIN fecha_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_fecha {$fielddispclass_fecha}">{BEGIN fecha_label}Fecha {END fecha_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV class="fieldcontrol_fecha {$fielddispclass_fecha}"><FONT 
                  size=3>{$fecha_editcontrol}</FONT>&nbsp; 
                  </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END fecha_fieldblock}{BEGIN cliente_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_cliente {$fielddispclass_cliente}">{BEGIN cliente_label}Cliente {END cliente_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV 
                  class="fieldcontrol_cliente {$fielddispclass_cliente}"><FONT 
                  size=3>{$cliente_editcontrol}</FONT>&nbsp; 
                  </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END cliente_fieldblock}{BEGIN idarticulo_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_idarticulo {$fielddispclass_idarticulo}">{BEGIN idarticulo_label}Artículo {END idarticulo_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV 
                  class="fieldcontrol_idarticulo {$fielddispclass_idarticulo}"><FONT 
                  size=3>{$idarticulo_editcontrol}</FONT>&nbsp; 
                  </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END idarticulo_fieldblock}{BEGIN cant_fieldblock}<TR style="HEIGHT: 25px" class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_cant {$fielddispclass_cant}">{BEGIN cant_label}Cant {END cant_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV class="fieldcontrol_cant {$fielddispclass_cant}"><FONT 
                  size=3>{$cant_editcontrol}</FONT>&nbsp; 
                </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END cant_fieldblock}{BEGIN importe_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_importe {$fielddispclass_importe}">{BEGIN importe_label}Importe {END importe_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV 
                  class="fieldcontrol_importe {$fielddispclass_importe}"><FONT 
                  size=3>{$importe_editcontrol}</FONT>&nbsp; 
                  </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END importe_fieldblock}{BEGIN observacion_fieldblock}<TR class="runner-row style1 runner-b-addfields"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-cc1"><DIV class="fieldlabel_observacion {$fielddispclass_observacion}">{BEGIN observacion_label}Observación {END observacion_label}</DIV></TD>
                <TD class="runner-cc alt runner-fixedcell"><DIV 
                  class="fieldcontrol_observacion {$fielddispclass_observacion}">{$observacion_editcontrol}&nbsp; 
                  </DIV></TD>
                <TD class="runner-cr alt"></TD></TR>
              {END observacion_fieldblock}{BEGIN legend}<TR class="runner-row style3 runner-b-legend {$brickclass_legend}"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-brickcontents" colSpan=2><SPAN id=required_block{$id}><IMG alt=bullet src="images/icon_required.gif"> - Campo&nbsp;requerido</SPAN></TD>
                <TD class=runner-cr></TD></TR>
              {END legend}<TR 
              class="runner-row style2 runner-b-addbuttons {$brickclass_addbuttons}"><TD class=runner-cl></TD>
                <TD class="runner-cc runner-brickcontents" colSpan=2><P align=right>{BEGIN back_button}<SPAN class=runner-btnframe><SPAN class=runner-btnleft></SPAN><SPAN class=runner-btnright></SPAN><A class=runner-button href="#" {$backbutton_attrs}><FONT size=3>Cancelar</FONT></A> 
                  </SPAN>{END back_button}{BEGIN save_button}<SPAN class=runner-btnframe><SPAN class=runner-btnleft></SPAN><SPAN class=runner-btnright></SPAN><A class=runner-button href="#" {$savebutton_attrs}><FONT 
                  color=#009300 size=3>Guardar</FONT></A> </SPAN>{END save_button}</P></TD>
                <TD class=runner-cr></TD></TR>
              <TR class="{$cfooterclass_fields}"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
                <TD class=runner-cc></TD>
                <TD class=runner-cc></TD>
                <TD class=runner-cr><IMG src="images/spacer.gif"></TD></TR></TABLE>{END container_fields}</TD>
          <TD class=runner-cr></TD></TR>
        <TR class="{$cfooterclass_add}"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
          <TD class=runner-cc></TD>
          <TD class=runner-cr><IMG src="images/spacer.gif"></TD></TR></TABLE>{END container_add}
      {BEGIN container_details}<TABLE class="runner-c runner-c-details" cellPadding=0><TR class="{$cheaderclass_details}"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
          <TD class=runner-cc></TD>
          <TD class=runner-cr><IMG src="images/spacer.gif"></TD></TR>
        {BEGIN detail_tables}<TR class="runner-row style1 runner-b-adddetails {$brickclass_adddetails}"><TD class=runner-cl></TD>
          <TD class="runner-cc runner-brickcontents"></TD>
          <TD class=runner-cr></TD></TR>
        {END detail_tables}<TR class="{$cfooterclass_details}"><TD class=runner-cl><IMG src="images/spacer.gif"></TD>
          <TD class=runner-cc></TD>
          <TD class=runner-cr><IMG src="images/spacer.gif"></TD></TR></TABLE>{END container_details}</TD></TR>
  <TR class=runner-body><TD class="runner-left {$blockclass_left}"></TD>
    <TD class="runner-center {$blockclass_center}"></TD>
    <TD class="runner-right {$blockclass_right}"></TD></TR>
  <TR class=runner-footer><TD class=runner-bottom 
colSpan=3><!--%%bottom%%--></TD></TR></TABLE>{$footer}{END body} </BODY></HTML>
