Registro contable de traspaso
This commit is contained in:
@@ -3076,6 +3076,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios : ObjInventario.IniciaTransacSQL()
|
Dim ObjInventario As New ClsInventarios : ObjInventario.IniciaTransacSQL()
|
||||||
Dim ObjGeneral As New ClsGenerales(ObjInventario.IniciaTransacSQL())
|
Dim ObjGeneral As New ClsGenerales(ObjInventario.IniciaTransacSQL())
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||||
Dim CveMovimientoSalida As Integer
|
Dim CveMovimientoSalida As Integer
|
||||||
Dim ConceptoMovimiento = 0
|
Dim ConceptoMovimiento = 0
|
||||||
Dim FolioSalida As Integer
|
Dim FolioSalida As Integer
|
||||||
@@ -3223,34 +3224,35 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim ValorTraspaso As Decimal = 0
|
||||||
'ENTRADA POR TRASPASO
|
'ENTRADA POR TRASPASO
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
'sino es transitorio, los transitorios, ya no se hace otro movimiento
|
'sino es transitorio, los transitorios, ya no se hace otro movimiento
|
||||||
If Not ChkTransitorio.Checked Then
|
|
||||||
ConceptoMovimiento = 27 ' If(ChkTransitorio.Checked, 2, 27)
|
ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27)
|
||||||
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
||||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
||||||
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
|
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
|
||||||
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
|
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
|
||||||
FolioEntrada = ObjInventario.Folio
|
FolioEntrada = ObjInventario.Folio
|
||||||
If CveMovimientoEntrada > 0 Then
|
If CveMovimientoEntrada > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
Dim CveSeccionAlmacen As Integer = -1
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||||
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
|
||||||
CveSeccionAlmacen = -3
|
CveSeccionAlmacen = -3
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
|
||||||
Else
|
|
||||||
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
||||||
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -3263,16 +3265,16 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||||
'Paqueterias Guias
|
'Paqueterias Guias
|
||||||
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
||||||
Dim CveEstatus As Integer = 0 ' DdlEstatus.SelectedValue.ToEntero()
|
Dim CveEstatus As Integer = 0 ' DdlEstatus.SelectedValue.ToEntero()
|
||||||
Dim Fecha As String = Now.ToString() 'TxtFechaPaqInterna.Text
|
|
||||||
Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||||
Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero()
|
Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero()
|
||||||
Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text
|
Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text
|
||||||
Dim CvePaqueteria As Integer = GlobalDTPaqueterias(UsuarioActual.CveEmpresa, 0).FiltroPrimeroValor("CvePaqueteria", "").ToEntero()
|
Dim CvePaqueteria As Integer = GlobalDTPaqueterias(UsuarioActual.CveEmpresa, 0).FiltroPrimeroValor("CvePaqueteria", "").ToEntero()
|
||||||
|
|
||||||
Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, 9, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
|
Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, 9, CveEstatus, CveSubProyecto, Fecha.ToShortDateString, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
|
||||||
|
|
||||||
If CvePaqueteriaGuia > 0 Then
|
If CvePaqueteriaGuia > 0 Then
|
||||||
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
||||||
@@ -3288,6 +3290,24 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
||||||
|
|
||||||
|
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/GT", 53, 0, 0, 1, Fecha, "Traspaso", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
If CvePrePolizaTraspaso > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
ObjInventario.Commit()
|
ObjInventario.Commit()
|
||||||
ObjGeneral.Dispose()
|
ObjGeneral.Dispose()
|
||||||
|
|||||||
Reference in New Issue
Block a user