-- movimiento de prepolizas
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
<asp:TemplateField ItemStyle-Width="7%">
|
||||
<ItemTemplate>
|
||||
<%--<asp:Literal ID="LtlExistencia" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>'></asp:Literal>--%>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="100%" />
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="35px" />
|
||||
<asp:RangeValidator ID="RVR" Display="Dynamic" ControlToValidate="TxtCantidad" runat="server" MinimumValue="0" Type="Double" ErrorMessage="No cumple con la cantidad especificada"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -65,11 +65,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
Private Sub BtnCambiarSeccion_Click(sender As Object, e As EventArgs) Handles BtnCambiarSeccion.Click
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL)
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
|
||||
Dim Dtt As DataTable = Nothing
|
||||
Dim CveMovimientoEntrada As Integer = 0
|
||||
Dim Folio = 0
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim TextoError = ""
|
||||
Dim Contador As Integer = 0
|
||||
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
|
||||
|
||||
|
||||
@@ -106,12 +108,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
Contador += 1
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
If Not ErrorMovInv AndAlso Contador > 0 Then
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
@@ -121,7 +124,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
For Each Row As DataRow In resultado.Rows
|
||||
Dim CvePS = Row("CvePS").ToString().ToEntero()
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
|
||||
Cantidad = Row("Cantidad").ToString.ToDecimal()
|
||||
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
|
||||
Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
|
||||
@@ -143,8 +146,23 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
End If
|
||||
ind += 1
|
||||
Next
|
||||
resultado.Dispose()
|
||||
|
||||
'inserto la prepoliza
|
||||
If CveMovimientoEntrada > 0 AndAlso CveMovimientoSalida > 0 Then
|
||||
Dim Concepto As String = "Ajuste Sección"
|
||||
Dim IdCtaContableOrigen As Integer = 0
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/AjusteAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim contabilizable As Boolean = False
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, Concepto, 68, Concepto, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, Concepto, 68, Concepto, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
resultado.Dispose()
|
||||
Else
|
||||
TextoError = "No se pudo registrar el movimiento"
|
||||
ErrorMovInv = True
|
||||
@@ -155,16 +173,25 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit()
|
||||
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
|
||||
CargaDatos()
|
||||
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
|
||||
|
||||
If Contador > 0 Then
|
||||
ObjInventario.Commit()
|
||||
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
|
||||
CargaDatos()
|
||||
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
Alert("No se especificaron productos", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click, BtnDescargar.Click
|
||||
|
||||
Reference in New Issue
Block a user