maia/.svn/pristine/9d/9ddcbd5bd5068f9805594047c48...

249 lines
17 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="#{ventaController}"
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="fdoctype" value="#{msg_armas.lbl_tipodocumento}:" />
<p style="width: 23px"></p>
<p:inputText id="fdoctype" value="#{ventaController.cdetalle.description}" maxlength="30" disabled="true" style="width: 75px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fdocnum" value="#{msg_armas.lbl_numerodocumento}:" style="width:94px;display:block"/>
<p:inputText id="fdocnum" value="#{ventaController.persondetail.identification}" maxlength="15" disabled="true" style="width: 115px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="ffech" value="#{msg_armas.lbl_fecharegistro}:" />
<p:inputText id="ffech" value="#{ventaController.fecha}" maxlength="20"
disabled="true" style="width: 70px;" onkeyup="Maia.forceupper(event, this);">
<f:convertDateTime pattern="dd-MM-yyyy"/>
</p:inputText>
</h:panelGrid>
<h:panelGrid id="filter" columns="3">
<p:outputLabel for="fraz" value="#{msg_general.lbl_razonsocial}:" />
<p:inputText id="fraz" value="#{ventaController.persondetail.name}" maxlength="180" disabled="true" style="width: 300px;" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
<h:panelGrid id="loteFiltro" columns="3">
<p:outputLabel for="txtSerieLote" value="#{msg_armas.lbl_serielote}:"/>
<p:inputText id="txtSerieLote" maxlength="15" onkeyup="Maia.forceupper(event, this);" value="#{ventaController.loteFilter}"/>
</h:panelGrid>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{ventaController}"
queryUpdate=":formTable:data-content" queryProcess=":formTable:txtSerieLote"
dialogWidgetVar="dialogCarga" showCreateBtn="false" showSaveBtn="false"/>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_armas.htbl_detalledelmaterial}" />
</f:facet>
<p:dataTable id="dt-table" var="row" value="#{ventaController.lrecord}" rowIndexVar="rowIndex" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="No." resizable="true" style="width:60px" >
<h:outputText value="#{rowIndex+1}" />
</p:column>
<p:column headerText="#{msg_general.lbl_code}" resizable="true" >
<h:outputText value="#{row.codigoarma}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_serie}" resizable="true" sortBy="#{row.lote}">
<h:outputText value="#{row.lote}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_longitud}" resizable="true" >
<h:outputText value="#{row.modifiedData['longitud']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_clase}" resizable="true" >
<h:outputText value="#{row.modifiedData['clase']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_tipo}" resizable="true" >
<h:outputText value="#{row.modifiedData['tipoarmaexplosivo']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_calibre}" resizable="true" >
<h:outputText value="#{row.modifiedData['calibre']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_estado}" resizable="true" >
<h:outputText value="#{row.modifiedData['estado']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_color}" resizable="true" >
<h:outputText value="#{row.modifiedData['color']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_marca}" resizable="true">
<h:outputText value="#{row.modifiedData['marca']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_cantidad}" resizable="true" >
<h:outputText value="#{row.cantidad}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_peso}" resizable="true" >
<h:outputText value="#{row.peso}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_unidadcantidad}" resizable="true" >
<h:outputText value="#{row.modifiedData['unidadmedidapeso']}" />
</p:column>
<p:column>
<p:commandButton value="#{msg_general.btn_delete}" actionListener="#{ventaController.create(row)}" icon="ui-icon-script"
process="@this, :formTable:data-content :formCarga" styleClass="m-action-button" oncomplete="PF('dialogCarga').show()"
update=":formCarga:datosventa :formCarga">
<f:setPropertyActionListener target="#{ventaController.record}" value="#{row}" />
<f:setPropertyActionListener target="#{ventaController.showRow}" value="#{false}" />
<f:setPropertyActionListener target="#{ventaController.newRow}" value="#{false}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialogCarga" resizable="false" closeOnEscape="true" modal="true" appendToBody="true" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" >
<f:facet name="header">
<h:outputText value="Venta de Material" />
</f:facet>
<h:form id="formCarga">
<h:panelGrid column="1">
<h:panelGrid columns="2" style="width:300px">
<p:outputLabel for="ftranstipo" value="#{msg_armas.lbl_tipotransaccion}:" style="width:125px;display:block"/>
<h:panelGrid>
<p:selectOneMenu id="ftranstipo" var="p" value="#{ventaController.movimientoArma.tipomovimiento}" required="true" style="width:150px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax listener="#{ventaController.changeType()}" event="change" update=":formCarga" process="@this"/>
<f:selectItems value="#{ventaController.lmovimientos}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="ftranstipo"/>
</h:panelGrid>
</h:panelGrid>
<p:panelGrid id="venta" columns="1" style="width:460px" rendered="#{ventaController.movimientoArma.tipomovimiento=='VENT'}">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datoscomprador}" />
</f:facet>
<h:panelGrid columns="4" id="detallePersona" >
<p:outputLabel for="fidentificacion" value="#{msg_armas.lbl_noDocumento}:" />
<p style="width: 32px" />
<p:inputText id="fidentificacion" value="#{ventaController.compradorArma.identification}" maxlength="30" disabled="true" style="width: 120px;" onkeyup="Maia.forceupper(event, this);"/>
<p:commandButton id="cargar" value="#{msg_armas.btn_buscar}" actionListener="#{ventaController.openPersonLov()}" process="@this">
<p:ajax event="dialogReturn" listener="#{ventaController.onReturnPersonLov}" update=":formCarga:venta"/>
</p:commandButton>
</h:panelGrid>
<h:panelGrid columns="2">
<p:outputLabel for="fnombre" value="#{msg_armas.lbl_nombrerazonsocial}:" />
<p:inputText id="fnombre" value="#{ventaController.compradorArma.name}" maxlength="50" disabled="true" style="width: 185px;" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
<h:panelGrid columns="2">
<p:outputLabel for="ffactura" value="#{msg_armas.lbl_factura}:" style="width:107px;display:block"/>
<p:inputText id="ffactura" value="#{ventaController.movimientoArma.factura}"
maxlength="20" required="true" style="width: 125px" onkeyup="Maia.forceupper(event, this);">
<pe:keyFilter for="ffactura" mask="int"/>
<p:message for="ffactura"/>
</p:inputText>
</h:panelGrid>
<h:panelGrid columns="2">
<p:outputLabel for="fregistro" value="#{msg_armas.lbl_registro}:" style="width:107px;display:block"/>
<p:inputText id="fregistro" value="#{ventaController.movimientoArma.noregistro}" maxlength="5" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<pe:keyFilter for="fregistro" mask="int"/>
</p:inputText>
</h:panelGrid>
</p:panelGrid>
<p:panelGrid id="datosventa" columns="1" style="width:450px">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datostransaccion}" />
</f:facet>
<h:panelGroup>
<h:panelGrid columns="4">
<p:outputLabel for="ffecha" value="#{msg_armas.lbl_fecha}:" style="width:107px;display:block" />
<p:calendar id="ffecha" value="#{ventaController.fecha}" maxlength="30" pattern="dd-MM-yyyy" disabled="false" required="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<p:ajax event="dateSelect" update="ffecha" listener="#{ventaController.validarfecha(ventaController.fecha)}"/>
</p:calendar>
<p:outputLabel for="festado" value="#{msg_armas.lbl_estado}:" style="width:107px;display:block" />
<p:inputText id="festado" value="#{ventaController.record.estado}" maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fidentificac" value="#{msg_general.lbl_code}:" style="width:107px;display:block"/>
<p:inputText id="fidentificac" value="#{ventaController.record.pk}" maxlength="30"
disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fserielot" value="#{msg_armas.lbl_serie}" style="width:107px;display:block"/>
<p:inputText id="fserielot" value="#{ventaController.record.lote}" maxlength="30"
disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fclase" value="#{msg_armas.lbl_clase}:" style="width:107px;display:block"/>
<p:inputText id="fclase" value="#{ventaController.record.modifiedData['clase']}"
maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="ftipo" value="#{msg_armas.lbl_tipo}:" style="width:107px;display:block"/>
<p:inputText id="ftipo" value="#{ventaController.record.modifiedData['tipoarmaexplosivo']}"
maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fmarca" value="#{msg_armas.lbl_marca}:" style="width:107px;display:block"/>
<p:inputText id="fmarca" value="#{ventaController.record.modifiedData['marca']}"
maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fcalibre" value="#{msg_armas.lbl_calibre}:" style="width:107px;display:block"/>
<p:inputText id="fcalibre" value="#{ventaController.record.modifiedData['calibre']}"
maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="fcantidad" value="#{msg_armas.lbl_cantidad}:" style="width:107px;display:block"/>
<p:inputText id="fcantidad" value="#{ventaController.cantidad}" disabled="#{ventaController.cantidad==null or ventaController.cantidad==0}"
required="true" maxlength="7" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<f:convertNumber pattern="#0" minFractionDigits="0" />
<p:ajax event="blur" listener="#{ventaController.validarCantidadMexima(ventaController.cantidad)}" process="@this, fcantidad" update="fcantidad"></p:ajax>
<pe:keyFilter for="fcantidad" mask="int"/>
</p:inputText>
<p:outputLabel for="fpeso" value="#{msg_armas.lbl_peso}:" style="width:107px;display:block"/>
<p:inputText id="fpeso" value="#{ventaController.peso}" disabled="#{ventaController.peso==null}"
required="true" maxlength="8" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<f:convertNumber pattern="#0.00" minFractionDigits="2" />
<p:ajax event="blur" listener="#{ventaController.validarPesoMexima(ventaController.peso)}" process="@this fpeso" update="fpeso"></p:ajax>
</p:inputText>
</h:panelGrid>
<h:panelGrid columns="4">
<p:outputLabel for="fcantidadunidad" value="#{msg_armas.lbl_unidadcantidad}:" style="width:107px;display:block"/>
<p:inputText id="fcantidadunidad" value="#{ventaController.record.modifiedData['unidadmedidapeso']}"
maxlength="30" disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
<h:panelGrid id="just" columns="3" style="width:450px">
<p:outputLabel for="fjust" value="#{msg_armas.lbl_justificacion}:" style="width:98px;display:block"/>
<p style="width: 5px"></p>
<p:inputTextarea id="fjust" autoResize="false" value="#{ventaController.movimientoArma.justificacion}" maxlength="190"
style="width: 340px;resize: none" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
<h:panelGrid columns="2" styleClass="m-dialog-controls">
<p:commandButton value="#{msg_general.btn_save}" process="@this, @form" update="@form :formTable:data-content"
action="#{ventaController.update()}"
icon="ui-icon-disk" oncomplete="if(args.validationFailed){return false;} else {PF('dialogCarga').hide()}" />
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogCarga').hide()" icon="ui-icon-trash" process="@this" />
</h:panelGrid>
</h:panelGroup>
</p:panelGrid>
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>