-- cambios E140. recolecciones

This commit is contained in:
2024-02-25 19:20:28 -07:00
parent 9e12eb370b
commit f3b83548df
9 changed files with 363 additions and 339 deletions

View File

@@ -143,33 +143,33 @@ Partial Class AF_ValesCombustible
#Region "DDL CHANGED & CHK CHANGED & TXT CHANGUED"
Private Sub DdlActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlActivoFijo.SelectedIndexChanged
Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, -1, -1, DdlActivoFijo.SelectedValue.ToEntero, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
Dim dtAF As DataTable = ObjValesCombustible.DtResultados.FiltraParametros("", Orderby:="CveVale DESC")
If dtAF.Rows.Count > 0 Then
Dim dr As DataRow = dtAF.Rows(0)
LblFecha.Text = dr("Fecha").ToString
LblLitrosAF.Text = dr("Litros").ToString
LblCombustible.Text = dr("Combustible").ToString
LblOdometro.Text = dr("Odometro").ToString
'Dim ObjValesCombustible As New ClsAF
'If ObjValesCombustible.GetValesCombustible(-1, -1, -1, -1, DdlActivoFijo.SelectedValue.ToEntero, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' Dim dtAF As DataTable = ObjValesCombustible.DtResultados.FiltraParametros("", Orderby:="CveVale DESC")
' If dtAF.Rows.Count > 0 Then
' Dim dr As DataRow = dtAF.Rows(0)
' LblFecha.Text = dr("Fecha").ToString
' LblLitrosAF.Text = dr("Litros").ToString
' LblCombustible.Text = dr("Combustible").ToString
' LblOdometro.Text = dr("Odometro").ToString
If dr("CvePersonal").ToString.ToEntero > 0 Then
LbPersonal.Text = String.Format("{0}, {1}", dr("NombreCompleto").ToString, dr("Recibe").ToString)
Else
LbPersonal.Text = dr("NombreCompleto").ToString
End If
' If dr("CvePersonal").ToString.ToEntero > 0 Then
' LbPersonal.Text = String.Format("{0}, {1}", dr("NombreCompleto").ToString, dr("Recibe").ToString)
' Else
' LbPersonal.Text = dr("NombreCompleto").ToString
' End If
Else
LblFecha.Text = ""
LblLitrosAF.Text = ""
LblCombustible.Text = ""
LblOdometro.Text = ""
LbPersonal.Text = ""
UpConsumo.Update()
End If
End If
ObjValesCombustible.Dispose()
' Else
' LblFecha.Text = ""
' LblLitrosAF.Text = ""
' LblCombustible.Text = ""
' LblOdometro.Text = ""
' LbPersonal.Text = ""
' UpConsumo.Update()
' End If
'End If
'ObjValesCombustible.Dispose()
End Sub
'Private Sub DdProveedorVinculacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdProveedorVinculacion.SelectedIndexChanged
@@ -297,8 +297,8 @@ Partial Class AF_ValesCombustible
'Si TipoVale es 1 = Externo
If ChkExterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Folio = ObjVales.FolioVale
If CveVale < 0 Then
@@ -307,8 +307,8 @@ Partial Class AF_ValesCombustible
ElseIf ChkInterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Folio = ObjVales.FolioVale
'AGREGAMOS LA SALIDA
@@ -339,37 +339,37 @@ Partial Class AF_ValesCombustible
'Si el odometro es mayor a la proxima recarga
Else
'Si TipoVale es 1 = Externo
If ChkExterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'If ChkExterno.Checked = True Then
' CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' Folio = ObjVales.FolioVale
If CveVale < 0 Then
ErrorMovInv = True
End If
' If CveVale < 0 Then
' ErrorMovInv = True
' End If
'Si TipoVale es 2 = Interno
ElseIf ChkInterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
' 'Si TipoVale es 2 = Interno
'ElseIf ChkInterno.Checked = True Then
' CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' Folio = ObjVales.FolioVale
'AGREGAMOS LA SALIDA
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFechaVale.Text.Trim.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
FolioSalida = ObjInventario.Folio
' 'AGREGAMOS LA SALIDA
' CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFechaVale.Text.Trim.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
' FolioSalida = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtLitros.Text.Trim.ToEntero, CveUM, CvePS, -1, DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos"
End If
' If CveMovimientoSalida <= 0 Then
' TextoError = "No se pudo generar el movimiento de salida correctamente"
' ErrorMovInv = True
' Else
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtLitros.Text.Trim.ToEntero, CveUM, CvePS, -1, DdlActivoFijo.SelectedValue.ToEntero) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos"
' End If
End If
' End If
Else
Alert("Debe Seleccionar un Tipo de Vale", TipoMensaje.MsgError)
End If
'Else
' Alert("Debe Seleccionar un Tipo de Vale", TipoMensaje.MsgError)
'End If
End If
If Not ErrorMovInv Then
@@ -397,51 +397,51 @@ Partial Class AF_ValesCombustible
Private Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
Dim ObjValesCombustible As New ClsAF
For Each gvr As GridViewRow In GVBuscar.Rows
If gvr.RowType = DataControlRowType.DataRow Then
If gvr.FCCheckBox("Chk").Checked Then
Dim CveProveedor = If(gvr.FCDropDownList("DdlBuscarP").Visible, gvr.FCDropDownList("DdlBuscarP").SelectedValue.ToEntero, gvr.FCLiteral("LtlProveedor").Text.ToEntero)
ObjValesCombustible.UpdateValeCombustible(gvr.DataKey("CveVale").ToEntero, gvr.DataKey("CveCompra").ToEntero, CveProveedor, gvr.FCTextBox("TxtNombreRecibe").Text, gvr.FCTextBox("TxtCantidad").Text.ToDouble, gvr.FCTextBox("TxtRecibo").Text.ToEntero, gvr.FCTextBox("TxtImporte").Text.ToEntero, UsuarioActual.CveEmpresa)
Alert("Se Actualizo con exito")
ActualizarM()
Else
Alert("Seleccione una opcion")
End If
End If
'Dim ObjValesCombustible As New ClsAF
'For Each gvr As GridViewRow In GVBuscar.Rows
' If gvr.RowType = DataControlRowType.DataRow Then
' If gvr.FCCheckBox("Chk").Checked Then
' Dim CveProveedor = If(gvr.FCDropDownList("DdlBuscarP").Visible, gvr.FCDropDownList("DdlBuscarP").SelectedValue.ToEntero, gvr.FCLiteral("LtlProveedor").Text.ToEntero)
' ObjValesCombustible.UpdateValeCombustible(gvr.DataKey("CveVale").ToEntero, gvr.DataKey("CveCompra").ToEntero, CveProveedor, gvr.FCTextBox("TxtNombreRecibe").Text, gvr.FCTextBox("TxtCantidad").Text.ToDouble, gvr.FCTextBox("TxtRecibo").Text.ToEntero, gvr.FCTextBox("TxtImporte").Text.ToEntero, UsuarioActual.CveEmpresa)
' Alert("Se Actualizo con exito")
' ActualizarM()
' Else
' Alert("Seleccione una opcion")
' End If
' End If
Next
ObjValesCombustible.Dispose()
'Next
'ObjValesCombustible.Dispose()
End Sub
Private Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click
Dim ObjValesCombustible As New ClsAF
'Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
GVBuscar.DataSource = ObjValesCombustible.DtResultados
If ObjValesCombustible.DtResultados.Rows.Count > 0 Then
BtnActualizar.Visible = True
End If
Else
GVBuscar.DataSource = Nothing
BtnActualizar.Visible = False
End If
ObjValesCombustible.Dispose()
GVBuscar.DataBind()
UpBuscar.Update()
'If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' GVBuscar.DataSource = ObjValesCombustible.DtResultados
' If ObjValesCombustible.DtResultados.Rows.Count > 0 Then
' BtnActualizar.Visible = True
' End If
'Else
' GVBuscar.DataSource = Nothing
' BtnActualizar.Visible = False
'End If
'ObjValesCombustible.Dispose()
'GVBuscar.DataBind()
'UpBuscar.Update()
End Sub
Private Sub ActualizarM()
Dim ObjValesCombustible As New ClsAF
'Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
GVBuscar.DataSource = ObjValesCombustible.DtResultados
Else
GVBuscar.DataSource = Nothing
End If
ObjValesCombustible.Dispose()
GVBuscar.DataBind()
UpBuscar.Update()
'If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' GVBuscar.DataSource = ObjValesCombustible.DtResultados
'Else
' GVBuscar.DataSource = Nothing
'End If
'ObjValesCombustible.Dispose()
'GVBuscar.DataBind()
'UpBuscar.Update()
End Sub
#End Region

View File

@@ -32,7 +32,7 @@
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" Visible="true" />
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
@@ -74,6 +74,14 @@
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 " style="width: 80px;">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" CssClass="select2me" runat="server">
<asp:ListItem Text="Vigente" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="Cerrado" Value="2"></asp:ListItem>
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
@@ -92,7 +100,7 @@
<ContentTemplate>
<asp:GridView ID="GvR" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvR_RowDataBound"
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre,CveCliente,FolioReferencia,Referencia"
DataKeyNames="CveEntregaAlmacen,CveSubProyecto,Estatus,CveCliente,FolioReferencia,Referencia"
EmptyDataText="No se encontraron registros"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn"
data-sort="true"
@@ -134,29 +142,29 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Referencia" >
<ItemTemplate>
&nbsp;<asp:Literal ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Literal>
&nbsp;<asp:Label ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Label>
&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("CveEntregaAlmacen") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dirección" >
<asp:TemplateField HeaderText="">
<ItemTemplate>
<div class="truncate" style="width: 150px;">
&nbsp;<asp:Literal ID="LblDir" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:HyperLink ID="HplR" runat="server" visible="false" AlternateText="Registrar" ToolTip="Registrar entrada" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-location-arrow'></i>" />
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" Visible="false" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
<asp:HyperLink ID="HplEnt" runat="server" NavigateUrl='<%# Eval("CveMovimientoEntrada", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}") %>' CssClass="Texto" Text='<%# Eval("FolioEntrada") %>' />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" Visible="false" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
<asp:HyperLink ID="HplTra" runat="server" NavigateUrl='<%# Eval("CveMovimientoTraslado", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}") %>' CssClass="Texto" Text='<%# Eval("FolioTraslado") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Factura" >
<ItemTemplate>
<asp:HyperLink ID="HplCompra" runat="server" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}") %>' CssClass="Texto" Text='<%# Eval("FolioCompra") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -242,21 +250,19 @@
</div>
<div class="row">
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="86px" HeaderStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Unidad" DataField="Abreviatura" ItemStyle-Width="86px" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="500px" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CommandArgument='<%# Eval("CveEntregaAlmacenDetalle") %>' CssClass="btn btn-circle btn-xs red" OnClick="LnkModalGvModalPSRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
@@ -266,10 +272,7 @@
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">

View File

@@ -70,7 +70,7 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub CargaDatos()
Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetInvEntregaAlmacenRuta(-1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 2, -1) Then
If ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then
GvR.DataSource = ObjGeneral.DtResultados
End If
ObjGeneral.Dispose()
@@ -82,20 +82,20 @@ Partial Class Acumuladores_RepRecolecciones
Protected Sub gvR_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
If e.Row.DataKey("Estatus") = "0" OrElse e.Row.DataKey("Estatus") = "" Then
If e.Row.DBCampo("CveMovimientoEntrada") = "" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCLabel("LblRef").ToolTip = e.Row.DBCampo("CveEntregaAlmacen")
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
End If
If e.Row.DBCampo("CveMovimientoEntrada") <> "" AndAlso e.Row.DBCampo("CveMovimientoTraslado") = "" Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
'If e.Row.DBCampo("Estatus") = "0" OrElse e.Row.DBCampo("Estatus") = "" Then
LnkEditar.Visible = True
'End If
End If
' If e.Row.DataKey("Estatus") = "1" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
'End If
If e.Row.DataKey("CveTimbre") <> "" Then
e.Row.FCCheckBox("Chk").Visible = False
End If
End If
End Sub
@@ -105,7 +105,6 @@ Partial Class Acumuladores_RepRecolecciones
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero()
Dim CveDireccionOrigen As Integer = GvRow.DataKey("CveDireccionOrigen").ToEntero()
CargaDatosRecoleccionDetallePS()
LtlModalRecoleccionTitulo.Text = "Definición de tamaños"
BtnModalRecoleccionGuardar.Text = "Guardar"
@@ -117,7 +116,6 @@ Partial Class Acumuladores_RepRecolecciones
ElProductoChange()
End Sub
Private Sub ElProductoChange()
DdlModalRecoleccionUnidad.Items.Clear()
DdlModalRecoleccionUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa)
@@ -138,7 +136,6 @@ Partial Class Acumuladores_RepRecolecciones
Next
LblProductosCargados.Text = Str.ToString
End If
ObjGenerales.Dispose()
GvModalPSRecoleccion.DataSource = DTRecoleccion
@@ -207,7 +204,6 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal
Dim CantidadDefinido As Decimal = 0
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
@@ -220,6 +216,7 @@ Partial Class Acumuladores_RepRecolecciones
Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
Dim ErrorMovInv As Boolean = False
Dim Fecha As DateTime = NowADS()
Dim Concepto As String = "Traspaso Recolección"
@@ -268,16 +265,19 @@ Partial Class Acumuladores_RepRecolecciones
ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
ObjGral.UpdateInvEntregaAlmacenEstatus(CveEntregaAlmacen, UsuarioActual.CveEmpresa, 1)
End If
End If
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
GvR.DataBind()
DTRecoleccion.Clear()
Dim MensajeAlert As New StringBuilder
MensajeAlert.Append("Se realizó con éxito el traspaso.")
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" class='Texto' target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
'MensajeAlert.AppendFormat("<br/><a target='_blank' class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
Alert(MensajeAlert.ToString)
@@ -286,4 +286,24 @@ Partial Class Acumuladores_RepRecolecciones
End If
End Sub
Protected Sub LnkModalGvModalPSRecoleccionEliminar_Click(sender As Object, e As EventArgs)
Dim LnkEliminar As LinkButton = CType(sender, LinkButton)
Dim GvRow As GridViewRow = CType(LnkEliminar.NamingContainer, GridViewRow)
Dim CveEntregaAlmacenDetalle = GvRow.DataKey("CveEntregaAlmacenDetalle").ToEntero()
Dim drss As DataRow() = DTRecoleccion.Select($"CveEntregaAlmacenDetalle = {CveEntregaAlmacenDetalle}")
If drss.Count > 0 Then
DTRecoleccion.Rows.Remove(drss(0))
End If
DTRecoleccion.AcceptChanges()
GvModalPSRecoleccion.DataSource = DTRecoleccion
GvModalPSRecoleccion.DataBind()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
End Class

View File

@@ -3151,105 +3151,105 @@ Public Class ClsAF
#End Region
#Region "ValesCombustible"
Public Function AddValesCombustible(FolioUsuario As Integer, CveCompra As Integer, CveProveedor As Integer, CveAF As Integer, CvePersonal As Integer, Fecha As Date, NombreRecibe As String, CveSubProyecto As Integer, Observaciones As String, Odometro As Integer, CveCombustible As Integer, Litros As Double, TipoVale As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional Recibo As Integer = -1, Optional Importe As Integer = -1) As Integer
Dim Retorno As Integer = -1
'Public Function AddValesCombustible(FolioUsuario As Integer, CveCompra As Integer, CveProveedor As Integer, CveAF As Integer, CvePersonal As Integer, Fecha As Date, NombreRecibe As String, CveSubProyecto As Integer, Observaciones As String, Odometro As Integer, CveCombustible As Integer, Litros As Double, TipoVale As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional Recibo As Integer = -1, Optional Importe As Integer = -1) As Integer
' Dim Retorno As Integer = -1
DataAdapter("PA_AF_ValesCombustibleAdd")
' DataAdapter("PA_AF_ValesCombustibleAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@FolioUsuario", SqlDbType.Int).Value = FolioUsuario
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Odometro", SqlDbType.Int).Value = Odometro
.Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@Recibo", SqlDbType.Float).Value = Recibo
.Add("@Importe", SqlDbType.Float).Value = Importe
.Add("@TipoVale", SqlDbType.Int).Value = TipoVale
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveVale", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
End With
' With SqlAdapter.SelectCommand.Parameters
' .Add("@FolioUsuario", SqlDbType.Int).Value = FolioUsuario
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@CveAF", SqlDbType.Int).Value = CveAF
' .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
' .Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
' .Add("@Fecha", SqlDbType.Date).Value = Fecha
' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
' .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
' .Add("@Odometro", SqlDbType.Int).Value = Odometro
' .Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@Recibo", SqlDbType.Float).Value = Recibo
' .Add("@Importe", SqlDbType.Float).Value = Importe
' .Add("@TipoVale", SqlDbType.Int).Value = TipoVale
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' .Add("@CveVale", SqlDbType.Int).Direction = ParameterDirection.Output
' .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
' End With
Try
SqlAdapter.Fill(Data)
FolioVale = SqlAdapter.SelectCommand.Parameters("@vFolio").Value.ToString.ToEntero
Retorno = SqlAdapter.SelectCommand.Parameters("@CveVale").Value.ToString.ToEntero
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Vale de Combustible con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al Guardar el Vale de Combustible.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
' Try
' SqlAdapter.Fill(Data)
' FolioVale = SqlAdapter.SelectCommand.Parameters("@vFolio").Value.ToString.ToEntero
' Retorno = SqlAdapter.SelectCommand.Parameters("@CveVale").Value.ToString.ToEntero
' Catch Ex1 As SqlException
' If Ex1.Message.Contains("Número: 2627;") Then
' Alert("Ya existe un Vale de Combustible con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia)
' Else
' Me.OnError("Ocurrió un error al Guardar el Vale de Combustible.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End If
' Catch ex As Exception
End Try
' End Try
Return Retorno
' Return Retorno
End Function
Public Function GetValesCombustible(CveCompra As Integer, CveValeCombustible As Integer, Folio As Integer, CveProveedor As Integer, CveAF As Integer, CveSubProyecto As Integer, Odometro As Integer, CveCombustible As Integer, Litros As Double, CvePersonal As Integer, CveUsuario As Integer, CveEmpresa As Integer, Recibo As Integer, Importe As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ValesCombustibleGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveValeCombustible", SqlDbType.Int).Value = CveValeCombustible
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Odometro", SqlDbType.Int).Value = Odometro
.Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Recibo", SqlDbType.Int).Value = Recibo
.Add("@Importe", SqlDbType.Int).Value = Importe
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Catálogo de Estatus de Vales Combustible.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
'End Function
'Public Function GetValesCombustible(CveCompra As Integer, CveValeCombustible As Integer, Folio As Integer, CveProveedor As Integer, CveAF As Integer, CveSubProyecto As Integer, Odometro As Integer, CveCombustible As Integer, Litros As Double, CvePersonal As Integer, CveUsuario As Integer, CveEmpresa As Integer, Recibo As Integer, Importe As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_AF_ValesCombustibleGet")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveValeCombustible", SqlDbType.Int).Value = CveValeCombustible
' .Add("@Folio", SqlDbType.Int).Value = Folio
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@CveAF", SqlDbType.Int).Value = CveAF
' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
' .Add("@Odometro", SqlDbType.Int).Value = Odometro
' .Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' .Add("@Recibo", SqlDbType.Int).Value = Recibo
' .Add("@Importe", SqlDbType.Int).Value = Importe
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al obtener el Catálogo de Estatus de Vales Combustible.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
Return Retorno
End Function
Public Function UpdateValeCombustible(CveVale As Integer, CveCompra As Integer, CveProveedor As Integer, NombreRecibe As String, Litros As Double, Recibo As Integer, Importe As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
' Return Retorno
'End Function
'Public Function UpdateValeCombustible(CveVale As Integer, CveCompra As Integer, CveProveedor As Integer, NombreRecibe As String, Litros As Double, Recibo As Integer, Importe As Integer, CveEmpresa As Integer) As Boolean
' Dim Retorno As Boolean = False
DataAdapter("PA_AF_ValesCombustibleUpdate")
' DataAdapter("PA_AF_ValesCombustibleUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVale", SqlDbType.Int).Value = CveVale
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@Recibo", SqlDbType.Int).Value = Recibo
.Add("@Importe", SqlDbType.Int).Value = Importe
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveVale", SqlDbType.Int).Value = CveVale
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@Recibo", SqlDbType.Int).Value = Recibo
' .Add("@Importe", SqlDbType.Int).Value = Importe
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch Ex1 As SqlException
' OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' Catch ex As Exception
' OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
Return Retorno
End Function
' Return Retorno
'End Function
#End Region
#Region "M E T R I C A S"

View File

@@ -3989,6 +3989,26 @@ Public Class ClsGenerales
Return Retorno
End Function
Public Function UpdateInvEntregaAlmacenEstatus(CveEntregaAlmacen As Integer, CveEmpresa As Integer, Estatus As Integer, Optional CveCompra As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar estatus entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, FechaLlegada As DateTime, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar")

View File

@@ -6275,14 +6275,17 @@ Namespace Modelos
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToString().ToEntero()
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10,4)")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToEntero()
'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
If Me.ServicioDomicilio Then
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToString().ToEntero()
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToEntero()
End If
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero()
If CveAlmacenExA <= 0 Then
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero()
End If
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()

View File

@@ -531,7 +531,7 @@
<asp:DropDownList ID="DdlRecoleccion" runat="server" AutoPostBack="true" DataTextField="Referencia" DataValueField="CveEntregaAlmacen" OnSelectedIndexChanged="DdlFolioGarantia_SelectedIndexChanged" CssClass="form-control input-sm input-small select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Button ID="BtnRecolecciónAplicar" runat="server" Text="Aplicar" CssClass="default" OnClick="BtnRecolecciónAplicar_Click" />
<asp:Button ID="BtnRecolecciónAplicar" runat="server" Text="Aplicar" CssClass="default" />
</div>
</div>
</div>
@@ -1186,7 +1186,7 @@
<asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall" Visible="false">
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
@@ -1205,7 +1205,7 @@
<asp:TextBox ID="TxtDividir" Visible="false" runat="server" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button Text="D" ID="BtnDividirCompra" runat="server" OnClick="BtnDividirCompra_Click" Style="display: none;" />
<asp:Button Text="SerieLote" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary" runat="server" />
<asp:Button Text="Serie" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary mysmallbtn" runat="server" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
@@ -3295,11 +3295,11 @@
</asp:GridView>
</td>
</tr>
<tr>
<%-- <tr>
<td colspan="2" align="center">
<asp:Button Text="Aplicar Vinculacion" CssClass="btn btn-primary" ID="BtnValesVincular" OnClick="BtnValesVincular_Click" runat="server" />
</td>
</tr>
</tr>--%>
<tr>
<td>
<br />

View File

@@ -1761,7 +1761,6 @@ Partial Class Compras_Compras
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
Case "T"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
@@ -4041,7 +4040,6 @@ Partial Class Compras_Compras
End If
End If
If CierrePeriodo Then
Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4139,7 +4137,7 @@ Partial Class Compras_Compras
End If
End If
If UsuarioActual.Empresa.Funcionalidad(538).ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
If TmpDT.MIN("CvePS").ToEntero <= 0 Then
Alert("Todos los Productos/Servicios deben estar registrados o aliados a un productos ya registrado.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4190,7 +4188,7 @@ Partial Class Compras_Compras
If GvInv.HeaderRow.FCCheckBox("cbAll").Checked = True Then
For Each Dr As DataRow In DtInv.Rows
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
If Dr("CveMetodoInventario").ToString = "5" Then
Cantidad = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS").ToString)).Rows.Count
If Cantidad < Dr("Cantidad").ToString.ToEntero Then
Alert("No hay productos a los que no se le ha asociado Serie", TipoMensaje.MsgError)
@@ -4347,7 +4345,7 @@ Partial Class Compras_Compras
UM.Dispose()
PSS.Dispose()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoCompra.SelectedValue.Contiene("12", "14") Then 'cuando es garantía, debe de especificar la salida de almacen
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoCompra.SelectedValue.Contiene("12") Then 'cuando es garantía, debe de especificar la salida de almacen
If Not GvInv.HeaderRow.FCCheckBox("cbAll").Checked OrElse GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToEntero <= 0 Then
Alert("No ha especificado la salida de almacen en la garantía.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4382,28 +4380,25 @@ Partial Class Compras_Compras
Dim EntradaComoGastoConAlmacen As Boolean = False
If GvInv.Rows.Count > 0 AndAlso GvInv.HeaderRow.FCCheckBox("cbAll").Checked Then
Dim CvealamcenSeleccionado As Integer = -1
Dim CvealmacenSeleccionado As Integer = -1
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
CvealamcenSeleccionado = GvRow.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
If CvealamcenSeleccionado > 0 Then
CvealmacenSeleccionado = GvRow.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
If CvealmacenSeleccionado > 0 Then
Exit For
End If
End If
Next
If CvealamcenSeleccionado > 0 Then
Dim ModalidadAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CvealamcenSeleccionado).FiltroPrimeroValor("CveModalidad").ToEntero
If CvealmacenSeleccionado > 0 Then
Dim ModalidadAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CvealmacenSeleccionado).FiltroPrimeroValor("CveModalidad").ToEntero
If ModalidadAlmacen = 0 Then
EntradaComoGastoConAlmacen = True
End If
End If
End If
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -4455,7 +4450,7 @@ Partial Class Compras_Compras
Dim ObjAcar As New ClsAcarreos(ObjCompras.IniciaTransacSQL())
Dim ObjCGame As New ClsCGame(ObjCompras.IniciaTransacSQL())
Dim ObjProductosServicios As New ClsProductosServicios(ObjCompras.IniciaTransacSQL())
Dim ObjGrales As New ClsGenerales(ObjCompras.IniciaTransacSQL())
Dim ObjContaAC As ClsContPAQi = Nothing
@@ -5103,13 +5098,19 @@ Partial Class Compras_Compras
End If
'Vincula Vales
If IdVale.Count > 0 Then
For Each cve As Integer In IdVale
If Not ObjAF.UpdateValeCombustible(cve, CveCompra, -1, "", -1, -1, -1, UsuarioActual.CveEmpresa) Then
ErrorAF = True
Exit For
End If
Next
'If IdVale.Count > 0 Then
' For Each cve As Integer In IdVale
' If Not ObjAF.UpdateValeCombustible(cve, CveCompra, -1, "", -1, -1, -1, UsuarioActual.CveEmpresa) Then
' ErrorAF = True
' Exit For
' End If
' Next
'End If
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
If Not ObjGrales.UpdateInvEntregaAlmacenEstatus(DdlRecoleccion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2, CveCompra) Then
ErrorDetalles = True
End If
End If
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
@@ -5290,11 +5291,11 @@ Partial Class Compras_Compras
CveConceptoMovimiento = 13
tCveFolioGarantia = DdlFolioGarantia.SelectedValue.ToEntero
End If
'recolección
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
CveConceptoMovimiento = 42
tCveEntregaAlmacen = DdlRecoleccion.SelectedValue.ToEntero
End If
''recolección
'If DdlTipoCompra.SelectedValue = "14" Then 'recolección
' CveConceptoMovimiento = 42
' tCveEntregaAlmacen = DdlRecoleccion.SelectedValue.ToEntero
'End If
End If
If (DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0) OrElse CveConceptoMovimiento = 13 Then
@@ -6323,7 +6324,7 @@ Partial Class Compras_Compras
Dim RegistroCuentaPuente As Boolean = False
'NC CON PRODUCTOS - CUENTA PUENTE
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12", "14") Then
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12") Then
RegistraConcepto225 = True
End If
@@ -10229,7 +10230,7 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.UsaAC Then e.Row.FCCheckBox("cbInv").Enabled = False
Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12", "14") Then StrTipo = "CveTipoAlmacen IN (21)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)"
If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27"
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrTipo)
@@ -13553,44 +13554,23 @@ Partial Class Compras_Compras
Private Sub BtnValesCombustibleVer_Click(sender As Object, e As EventArgs) Handles BtnValesCombustibleVer.Click
'Private Sub BtnValesCombustibleVer_Click(sender As Object, e As EventArgs) Handles BtnValesCombustibleVer.Click
Dim AF As New ClsAF
' Dim AF As New ClsAF
If AF.GetValesCombustible(-1, -1, -1, CveProveedor, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, -1, -1) Then
GvVales.DataSource = AF.DtResultados
End If
' If AF.GetValesCombustible(-1, -1, -1, CveProveedor, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, -1, -1) Then
' GvVales.DataSource = AF.DtResultados
' End If
AF.Dispose()
GvVales.DataBind()
DivValesCombustible.Visible = True
RegistraScript(String.Format("$('#{0}').modal('show')", DivValesCombustible.ClientID))
UPPValesCombustible.Update()
End Sub
' AF.Dispose()
' GvVales.DataBind()
' DivValesCombustible.Visible = True
' RegistraScript(String.Format("$('#{0}').modal('show')", DivValesCombustible.ClientID))
' UPPValesCombustible.Update()
'End Sub
#End Region
#Region " VALES COMBUSTIBLES "
Protected Sub BtnValesVincular_Click(sender As Object, e As EventArgs)
IdVale = New List(Of Integer)
For Each row As GridViewRow In GvVales.Rows
If row.FCCheckBox("ChkVale").Checked Then
IdVale.Add(row.DataKey("CveVale").ToEntero)
End If
Next
If IdVale.Count <= 0 Then
Alert("Debe elegir por lo menos un vale de combustible. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Else
Alert("Los vales selecciondos están listos para vincular")
RegistraScript(String.Format("$('#{0}').modal('hide')", DivValesCombustible.ClientID))
'For Each cve In IdVale
' Alert(cve.ToString)
'Next
End If
End Sub
#End Region
#Region " VINCULAR OC "
Private Sub InicializaOC()
@@ -14286,7 +14266,7 @@ Partial Class Compras_Compras
If DrTipoGasto IsNot Nothing Then
CveTipoGasto = DrTipoGasto("CveTipoGasto").ToString.ToEntero
TipoGasto = DrTipoGasto("TipoGasto").ToString
End IfclsVa
End If
End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
@@ -16749,7 +16729,7 @@ Partial Class Compras_Compras
If DrPS IsNot Nothing Then
Row("PSCodigo") = If(PSCodigo = "", DrPS("PSCodigo").ToString, PSCodigo)
Row("CveMetodoInventario") = DrPS("Inv_CveMetodoInventario").ToString.ToEntero
If Not DdlTipoCompra.SelectedValue.Contiene("12", "14") AndAlso DrPS("AplicaSerie").ToString = "True" Then
If Not DdlTipoCompra.SelectedValue.Contiene("12") AndAlso DrPS("AplicaSerie").ToString = "True" Then
Row("CveMetodoInventario") = "1"
End If
Else
@@ -18969,42 +18949,40 @@ Partial Class Compras_Compras
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora
If DdlTipoCompra.SelectedValue.Contiene("9", "10", "12") Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
If DdlTipoCompra.SelectedValue.Contiene("9", "10", "12") Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
If DdlTipoCompra.SelectedValue = "12" Then 'cuando es emp acumuladora
divFolioGarantia.Visible = True
Using objAcum As New ClsAcumuladores
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
DdlFolioGarantia.DataBind()
End If
End Using
End If
'cambia si hay ps con uso de serie
For Each dr As DataRow In TmpDT.Rows
dr("CveMetodoInventario") = 1
Next
CargaGvInv()
Else
If DdlTipoCompra.SelectedValue.Contiene("14") Then 'Recolección
divRecoleccion.Visible = True
Using objAcum As New ClsGenerales
If objAcum.GetInvEntregaAlmacenRuta(-1, MinFecha, MaxFecha, UsuarioActual.Empresa.CveEmpresa, 2, Estatus:=0) Then
DdlRecoleccion.DataSource = objAcum.DtResultados.FiltraParametros("", "Referencia DESC")
DdlRecoleccion.DataBind()
End If
End Using
If DdlTipoCompra.SelectedValue = "12" Then
divFolioGarantia.Visible = True
Using objAcum As New ClsAcumuladores
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
DdlFolioGarantia.DataBind()
End If
End Using
End If
'cambia si hay ps con uso de serie
For Each dr As DataRow In TmpDT.Rows
dr("CveMetodoInventario") = 1
Next
CargaGvInv()
End If
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Fac") Then
If DdlTipoCompra.SelectedValue.Contiene("14") Then 'Recolección
divRecoleccion.Visible = True
Using objAcum As New ClsGenerales
If objAcum.GetInvEntregaAlmacenRuta(-1, MinFecha, MaxFecha, UsuarioActual.Empresa.CveEmpresa, 3, Estatus:=1) Then
DdlRecoleccion.DataSource = objAcum.DtResultados.FiltraParametros("", "Referencia DESC")
End If
End Using
DdlRecoleccion.DataBind()
CargaGvInv()
End If
End If
End If
End Sub
#End Region

View File

@@ -4575,32 +4575,32 @@ Partial Class PopUpVerFactura
#Region "OP = 'VAL' - IMPRIME PDF VAL"
Private Sub GenerarPDFVale(CveVale As Integer)
Dim ObjAF As New ClsAF
If ObjAF.GetValesCombustible(-1, CveVale, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
Dim dtVC As DataTable = ObjAF.DtResultados
Dim dr As DataRow = dtVC.Rows(0)
'Dim ObjAF As New ClsAF
'If ObjAF.GetValesCombustible(-1, CveVale, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' Dim dtVC As DataTable = ObjAF.DtResultados
' Dim dr As DataRow = dtVC.Rows(0)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Folio", dr("Folio").ToString))
params.Add(New ReportParameter("Proveedor", dr("RazonSocial").ToString))
params.Add(New ReportParameter("Obra", dr("SubProyecto").ToString))
params.Add(New ReportParameter("NoEconomico", dr("Codigo").ToString))
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString))
params.Add(New ReportParameter("Operador", dr("NombreCompleto").ToString))
params.Add(New ReportParameter("Combustible", dr("Combustible").ToString))
params.Add(New ReportParameter("LitrosCombustible", dr("Litros").ToString))
ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params)
' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("Folio", dr("Folio").ToString))
' params.Add(New ReportParameter("Proveedor", dr("RazonSocial").ToString))
' params.Add(New ReportParameter("Obra", dr("SubProyecto").ToString))
' params.Add(New ReportParameter("NoEconomico", dr("Codigo").ToString))
' params.Add(New ReportParameter("Fecha", dr("Fecha").ToString))
' params.Add(New ReportParameter("Operador", dr("NombreCompleto").ToString))
' params.Add(New ReportParameter("Combustible", dr("Combustible").ToString))
' params.Add(New ReportParameter("LitrosCombustible", dr("Litros").ToString))
' ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params)
'ImprimirPDFview(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), lrds, params, "formato", "pdf", ReportViewer1)
'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas\1\Formatos\ValesCombustible.rdlc", UsuarioActual.Empresa.Rulrdsta))
'If Archivo.Exists Then
' 'ImprimirPDFview(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), lrds, params, "formato", "pdf", ReportViewer1)
' 'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas\1\Formatos\ValesCombustible.rdlc", UsuarioActual.Empresa.Rulrdsta))
' 'If Archivo.Exists Then
'Else
' 'params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' ImprimirPDF("/Empresas/1/Formatos/ValesCombustible.rdlc", dtVC, params, "ValeCombustible")
'End If
End If
ObjAF.Dispose()
' 'Else
' ' 'params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' ' ImprimirPDF("/Empresas/1/Formatos/ValesCombustible.rdlc", dtVC, params, "ValeCombustible")
' 'End If
'End If
'ObjAF.Dispose()
End Sub
#End Region