ajustes
This commit is contained in:
@@ -294,6 +294,11 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
If UsuarioActual.CveUsuario = 100 AndAlso IfNull(Request("Regenera"), "").ToString = "1" Then
|
||||
RegeneraRM(Request("CveMovimiento").ToString.ToEntero, 119)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
CveMovimiento = -1
|
||||
CveMovimientoRelacionado = -1
|
||||
TieneRelacionado = -1
|
||||
@@ -3593,6 +3598,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
|
||||
Contabilizable = False
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
If ObjInventario.Modulo = "ASA/G1" Then
|
||||
Contabilizable = False
|
||||
@@ -3636,6 +3647,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||
@@ -4840,6 +4852,76 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub RegeneraRM(CveMovD As Integer, CveMov2 As Integer)
|
||||
'Dim Retorno As Integer = -1
|
||||
'Dim ErrorMovInv As Boolean = False
|
||||
'Dim ObjConta As New ClsContabilidad
|
||||
'ObjConta.IniciaTransacSQL()
|
||||
'Dim ObjInventario As New ClsInventarios(ObjConta.IniciaTransacSQL)
|
||||
'Dim CveMovimientoInsertado As Integer = 0
|
||||
'Dim Fecha As Date
|
||||
'Dim Importe As Decimal
|
||||
|
||||
'If ObjInventario.GetMovimientosDetalleTransitorio(CveMovD, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
|
||||
' Fecha = ObjInventario.DtResultados.Rows(0)("FechaMovto").ToString.ToDate
|
||||
|
||||
' Dim dtvirtual As DataTable = ObjInventario.DtResultados
|
||||
|
||||
' If dtvirtual.Rows.Count > 0 Then
|
||||
' CveMovimientoInsertado = ObjInventario.AddMovimiento(352, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/VM")
|
||||
|
||||
' For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
' Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
' Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
' Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
|
||||
' Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
' Dim CveMovimientoDetalle As Integer = RowVirtual("CveMovimientoDetalle").ToString().ToEntero()
|
||||
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInsertado, CantidadUsado, CveUM, CvePS, PU, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
' ErrorMovInv = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoInsertado, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
' Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
' Importe = resultado.SUMD("Total").RoundSQL
|
||||
|
||||
' Dim Contabilizable As Boolean = False
|
||||
' Dim Concepto As String = "Traspaso"
|
||||
' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Manualx", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoInsertado, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovD, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
' If Not ErrorMovInv Then Retorno = CvePrePoliza
|
||||
|
||||
' End If
|
||||
' End If
|
||||
'Else
|
||||
' ErrorMovInv = True
|
||||
'End If
|
||||
|
||||
'If ErrorMovInv Then
|
||||
' ObjConta.RollBack()
|
||||
' Alert("No se aplico", TipoMensaje.MsgError)
|
||||
'Else
|
||||
' ObjConta.Commit()
|
||||
' Alert("Se aplico", TipoMensaje.MsgInformacion)
|
||||
'End If
|
||||
|
||||
'ObjConta.Dispose()
|
||||
'ObjInventario.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user