maia/.svn/pristine/28/284b1b305def68fa9fada65ee03...

287 lines
16 KiB
Plaintext
Executable File

<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{armaController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:dt-table"
saveProcess=""
saveUpdate=""
focusContainer=":formTable:filters" />
<p:panelGrid styleClass="m-filters" columns="1" style="width:1200px">
<f:facet name="header">
<h:outputText value="#{msg_armas.hfld_datosgenerales}" />
</f:facet>
<h:panelGrid id="filters" columns="1" >
<h:panelGrid columns="7">
<p:outputLabel for="tipoDocumento" value="#{msg_armas.lbl_tipodocumento}:" />
<p style="width: 23px"></p>
<p:inputText id="tipoDocumento" value="#{armaController.tipoDocumento.description}"
maxlength="30" disabled="true" style="width: 75px;" onkeyup="Maia.forceupper(event, this);">
</p:inputText>
<p:outputLabel for="numeroDocumento" value="#{msg_armas.lbl_numerodocumento}:" style="width:94px;display:block"/>
<p:inputText id="numeroDocumento" value="#{armaController.detallesPersona.identification}"
maxlength="15" disabled="true" style="width: 115px;" onkeyup="Maia.forceupper(event, this);">
</p:inputText>
<p:outputLabel for="fechaRegistro" value="#{msg_armas.lbl_fecharegistro}:" />
<p:inputText id="fechaRegistro" value="#{armaController.fechaActual}" maxlength="20"
disabled="true" style="width: 70px;" onkeyup="Maia.forceupper(event, this);">
<f:convertDateTime pattern="#{msg_general.dateformat}"/>
</p:inputText>
</h:panelGrid>
<h:panelGrid id="filter" columns="2">
<p:outputLabel for="nombre" value="#{msg_general.lbl_razonsocial}:" />
<p:inputText id="nombre" value="#{armaController.detallesPersona.name}"
maxlength="180" disabled="true" style="width: 308px;" onkeyup="Maia.forceupper(event, this);">
</p:inputText>
</h:panelGrid>
<h:panelGroup id="pnlCombos" layout="block">
<h:panelGrid id="filter2" columns="6">
<p:outputLabel for="tipoRegistro" value="#{msg_armas.lbl_tiporegistro}:" style="width:150px;display:block;"/>
<p:selectOneMenu id="tipoRegistro"
value="#{armaController.registro.tiporegistro}" var="p" style="width:100px" required="true">
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax event="change" update=":formTable:pnlCombos :formTable:pnlProduccion" process="@this" listener="#{armaController.cambioTipoRegistro()}"/>
<f:selectItems value="#{armaController.tiposRegistro}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="tipoRegistro"/>
<p:outputLabel for="tipo" value="#{msg_armas.lbl_categoria}:" style="width:150px;display:block;"/>
<p:selectOneMenu id="tipo"
value="#{armaController.clase}" var="p" style="width:150px" required="true" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{armaController.ldocumentospersona}" var="id"
itemLabel="#{id.modifiedData['descriptionact']}"
itemValue="#{id.modifiedData['clase']}" />
</p:selectOneMenu>
<p:message for="tipo"/>
</h:panelGrid>
</h:panelGroup>
</h:panelGrid>
</p:panelGrid>
<h:panelGroup id="pnlProduccion">
<p:panelGrid styleClass="m-filters" rendered="#{!empty armaController.registro.tiporegistro and !armaController.registro.tiporegistro.equalsIgnoreCase('PRO')}"
columns="1" style="width:1200px">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datosImportacion}" />
</f:facet>
<h:panelGrid id="datosImportacion" columns="1" >
<h:panelGrid columns="9">
<p:outputLabel for="paisOrigen" value="#{msg_armas.lbl_paisorigen}:" />
<p:selectOneMenu id="paisOrigen" required="true"
value="#{armaController.registro.paisorigen}" var="p" style="width:290px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{armaController.lpaises}" var="id" itemLabel="#{id.description}" itemValue="#{id.pk}" />
</p:selectOneMenu>
<p:message for="paisOrigen"/>
<p:outputLabel for="fabricante" value="#{msg_armas.lbl_fabricante}:" />
<p:inputText id="fabricante" value="#{armaController.registro.fabricante}" maxlength="100"
required="true" style="width: 300px;" onkeyup="Maia.forceupper(event, this);"/>
<p:message for="fabricante"/>
<h:panelGrid/>
<h:panelGrid/>
<h:panelGrid/>
<p:outputLabel for="paisDestino" value="#{msg_armas.lbl_paisdestino}:" />
<p:inputText id="paisDestino" value="ECUADOR" required="true" disabled="true" maxlength="30"
style="width: 300px;" onkeyup="Maia.forceupper(event, this);" />
<p:message for="paisDestino"/>
<p:outputLabel for="provincia" value="#{msg_general.lbl_province}:" />
<p:selectOneMenu id="provincia" required="true"
value="#{armaController.record.provincecode}" var="p" style="width:290px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax listener="#{armaController.seleccionarProvincia()}" event="change" update=":formTable:canton, :formTable:ciudad"/>
<f:selectItems value="#{armaController.lprovincias}" var="id" itemLabel="#{id.description}" itemValue="#{id.pk.provincecode}" />
</p:selectOneMenu>
<p:message for="provincia"/>
<p:outputLabel for="canton" value="#{msg_general.lbl_canton}:" />
<p:selectOneMenu id="canton" required="true"
value="#{armaController.record.cantoncode}" var="p" style="width:290px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax listener="#{armaController.seleccionarCanton()}" event="change" update=":formTable:ciudad"/>
<f:selectItems value="#{armaController.lcantones}" var="id" itemLabel="#{id.description}" itemValue="#{id.pk.cantoncode}" />
</p:selectOneMenu>
<p:message for="canton"/>
<p:outputLabel for="ciudad" value="#{msg_general.lbl_city}:" />
<p:selectOneMenu id="ciudad" required="true"
value="#{armaController.record.citycode}" var="p" style="width:290px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{armaController.lciudades}" var="id" itemLabel="#{id.description}" itemValue="#{id.pk.citycode}" />
</p:selectOneMenu>
<p:message for="ciudad"/>
<p:outputLabel for="aeropuerto" value="#{msg_armas.lbl_aeropuertopuerto}:" />
<p:selectOneMenu id="aeropuerto"
value="#{armaController.registro.aeropuertopuerto}" var="p"
style="width:290px" required="true">
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{armaController.laeropuertos}" var="id"
itemLabel="#{id.description}" itemValue="#{id.description}" />
</p:selectOneMenu>
<p:message for="aeropuerto"/>
<p:outputLabel for="totalFOB" value="#{msg_armas.lbl_fob}:" />
<pe:inputNumber id="totalFOB" value="#{armaController.registro.totalfob}" required="true" maxValue="999999" minValue="0" decimalPlaces="2"
decimalSeparator="." thousandSeparator=""/>
<p:message for="totalFOB"/>
<p:outputLabel for="numeroSolicitud" value="#{msg_armas.lbl_numerosolicitud_aucp}:" />
<p:inputText
id="numeroSolicitud"
value="#{armaController.registro.solicitudnum}"
required="true" style="width:300px" onkeyup="Maia.forceupper(event, this);" maxlength="21">
<pe:keyFilter regEx="/[a-z0-9]/" />
</p:inputText>
<p:message for="numeroSolicitud"/>
<p:outputLabel for="fechaSolicitud" value="#{msg_armas.lbl_fechasolicitud_aucp}:" />
<p:calendar id="fechaSolicitud"
value="#{armaController.registro.fechasolicitud}" maxlength="30"
pattern="#{msg_general.dateformat}" style="width: 300px;" disabled="false"
maxdate="#{armaController.fechaActual}"/>
<p:message for="fechaSolicitud"/>
</h:panelGrid>
</h:panelGrid>
</p:panelGrid>
</h:panelGroup>
<h:panelGrid columns="7" id="controls" styleClass="m-controls" >
<p:commandButton id="cargar" value="#{msg_armas.btn_cargar}" oncomplete="if (!args.validationFailed) PF('dialogCarga').show()" update=":formTable:datosImportacion, :formTable:filter, :formTable:filter2">
<p:ajax event="dialogReturn" update=":formTable:datosImportacion, :formTable:tipoRegistro"/>
</p:commandButton>
<maia:pageControls controller="#{armaController}"
saveUpdate=":formTable:controls"
dialogWidgetVar="dialog" showNextBtn="false" showPreviousBtn="false"
showQueryBtn="false" showCreateBtn="false" showSaveBtn="false"
/>
<p:commandButton id="limpiar" value="#{msg_armas.btn_limpiar}"
actionListener="#{armaController.limpiar()}"
process="@this" update=":formTable:data-content,:formTable:controls,:formTable:filters,:formTable:datosImportacion" >
</p:commandButton>
<p:commandButton id="DescargarLog" value="Descargar" ajax="false" immediate="true"
action="#{armaController.descargarArchivo()}" process="@this" update=":formTable:data-content :formTable:controls :formTable:filters :formTable:datosImportacion" rendered="#{armaController.descargar}">
</p:commandButton>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content" style="width:1200px">
<f:facet name="header">
<h:outputText value="#{msg_armas.htbl_detalledelmaterial}" />
</f:facet>
<p:dataTable id="dt-table" var="row" value="#{armaController.listaArmas}"
rows="15" style="min-width: 800px; width: auto;" rowKey="#{row.numero}" selectionMode="single"
rowIndexVar="index" paginator="true" paginatorTemplate="{PreviousPageLink} {NextPageLink}" paginatorPosition="top">
<p:column headerText="#{msg_armas.lbl_No}" resizable="true" style="width:60px" >
<h:outputText value="#{index+1}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_serie}" resizable="true" >
<h:outputText value="#{row.serie}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_clase}" resizable="true" >
<h:outputText value="#{row.clase}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_tipo}" resizable="true" >
<h:outputText value="#{row.tipo}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_calibre}" resizable="true" >
<h:outputText value="#{row.calibre}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_color}" resizable="true" >
<h:outputText value="#{row.color}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_marca}" resizable="true" >
<h:outputText value="#{row.marca}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_cantidad}" resizable="true" >
<h:outputText value="#{row.textoCantidad}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_unidadcantidad}" resizable="true" >
<h:outputText value="#{row.unidadMedidaCantidad}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_peso}" resizable="true" >
<h:outputText value="#{row.textoPeso}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_unidadpeso}" resizable="true" >
<h:outputText value="#{row.unidadMedidaPeso}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialogCarga" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" >
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formCarga">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEditCarga" columns="2" bodyrows="1">
<p:fileUpload fileUploadListener="#{armaController.cargarArchivo}" multiple="false"
update=":formTable:data-content :formTable:controls :formTable:filters :formTable:datosImportacion" allowTypes="/(\.|\/)(xlsx)$/"
uploadLabel="#{msg_armas.lbl_cargararchivo}" cancelLabel="#{msg_armas.lbl_cancelar}"
label="#{msg_armas.lbl_seleccionar}" oncomplete="PF('dialogCarga').hide()" invalidFileMessage="#{msg_armas.msg_error_tipoarchivoinvalido}"/>
</h:panelGrid>
<h:panelGrid columns="1" >
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogCarga').hide()" icon="ui-icon-trash" process="@this" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>