Combras bitacora inventario al eliminar compra con inventario, clientes cambiar vendedor.
This commit is contained in:
@@ -1289,7 +1289,8 @@
|
||||
|
||||
<div class="Widthall" style="overflow-x: auto;">
|
||||
|
||||
<asp:GridView ID="GvInvMov" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" GridLines="None" Visible="false">
|
||||
<asp:GridView ID="GvInvMov" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%"
|
||||
HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" GridLines="None" Visible="false">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -8537,7 +8537,8 @@ Partial Class Compras_Compras
|
||||
Dim Comp As New ClsCompras()
|
||||
Dim ObjEventos As New ClsOIEventos(Comp.IniciaTransacSQL())
|
||||
Dim ObjConta As New ClsContabilidad(Comp.IniciaTransacSQL())
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios(Comp.IniciaTransacSQL())
|
||||
Dim ObjGral As New ClsGenerales(Comp.IniciaTransacSQL())
|
||||
|
||||
Dim ErrorCompra = False
|
||||
|
||||
@@ -8564,6 +8565,64 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Try
|
||||
If ObjInventarios.GetInv_ComprasMov(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
Dim DTInventarios As DataTable = ObjInventarios.DtResultados
|
||||
If DTInventarios.Rows.Count > 0 Then
|
||||
|
||||
Dim DTMovimientos As DataTable = DTInventarios.FiltraParametros("", "", {"CVeMovimiento"})
|
||||
|
||||
For Each diRow As DataRow In DTMovimientos.Rows
|
||||
|
||||
Dim CveMovimientoActual As Integer = diRow("CveMovimiento").ToString.ToEntero
|
||||
|
||||
Dim DTMovimientoActual As DataTable = DTInventarios.FiltraParametros($"CveMovimiento = {CveMovimientoActual} ")
|
||||
|
||||
Dim detalleDescripcion As String = ""
|
||||
Dim Description As String = ""
|
||||
|
||||
Dim FolioMovimiento As String = ""
|
||||
Dim ConceptoMovimiento As String = ""
|
||||
|
||||
For Each dRowMovActual As DataRow In DTMovimientoActual.Rows
|
||||
|
||||
If dRowMovActual("UM").ToString = "" Then
|
||||
FolioMovimiento = dRowMovActual("Folio").ToString
|
||||
ConceptoMovimiento = dRowMovActual("Concepto").ToString
|
||||
|
||||
Description = String.Format("Eliminación Compra {6},Movimiento con Concepto: {0}, Almacen: {1}, Fecha: {2}, Folio: {3}, Usuario: {4}, Observaciones adicionales: {5}, Productos Información:<br/>",
|
||||
ConceptoMovimiento,
|
||||
dRowMovActual("Almacen").ToString,
|
||||
dRowMovActual("FechaMovto").ToString.ToDate.ToString("dd/MM/yyyy"),
|
||||
FolioMovimiento,
|
||||
dRowMovActual("Usuario").ToString,
|
||||
dRowMovActual("Observaciones").ToString,
|
||||
$"{TxtSerie.Text}-{TxtFolio.Text}")
|
||||
Else
|
||||
detalleDescripcion = String.Format("- Cant: {0}, PS: {1}, PU: {2}, UM: {3}<br/>", dRowMovActual("Cantidad").ToString.ToEntero, dRowMovActual("CodigoPS"), dRowMovActual("PU"), dRowMovActual("UM"))
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1,
|
||||
String.Format("{0}, Informacion = {1}", Description, detalleDescripcion),
|
||||
"Inventarios", FolioMovimiento + " / " + ConceptoMovimiento) Then
|
||||
ErrorCompra = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorCompra = True
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
|
||||
If Not ErrorCompra Then
|
||||
If Not Comp.DeleteCompra(CveCompra, False) Then
|
||||
ErrorCompra = True
|
||||
|
||||
Reference in New Issue
Block a user