This commit is contained in:
Rakcsle Supertramp
2020-11-07 14:01:56 -07:00
3 changed files with 30 additions and 9 deletions

View File

@@ -849,7 +849,7 @@ Partial Class Inventarios_Consignaciones
'AGREGAMOS MOVIMIENTO 'AGREGAMOS MOVIMIENTO
If MovtoNew Then If MovtoNew Then
Folio = ObjInventario.GetFolioSiguiente(ConceptoDevolucion, UsuarioActual.CveEmpresa) Folio = ObjInventario.GetFolioSiguiente(ConceptoDevolucion, UsuarioActual.CveEmpresa)
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, ConceptoDevolucion, DdlMoneda.SelectedValue.ToEntero, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveConsignacion:=CveConsignacion, Observaciones:=TxtObservacionesDevolucion.Text.Trim) CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, ConceptoDevolucion, DdlMoneda.SelectedValue.ToEntero, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveConsignacion:=CveConsignacion, Observaciones:=TxtObservacionesDevolucion.Text.Trim, Modulo:="Consig")
End If End If
If CveMovimiento > 0 Then If CveMovimiento > 0 Then

View File

@@ -2466,25 +2466,34 @@ Partial Class Inventarios_EntregaAlmacen
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato,
CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), Modulo:="RE/G8") CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), Modulo:="RE/G8")
FolioEntrada = ObjInventario.Folio FolioEntrada = ObjInventario.Folio
Dim ImporteAlmacen As Decimal = 0
If CveMovimientoEntrada <= 0 Then If CveMovimientoEntrada <= 0 Then
TextoError.AppendFormat("No se pudo generar el movimiento de entrada correctamente") TextoError.AppendFormat("No se pudo generar el movimiento de entrada correctamente")
ErrorMovInv = True ErrorMovInv = True
Else Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total")
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero()) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero()) Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada") TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada")
Exit For Exit For
End If End If
Next Next
Else Else
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada") TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada")
End If End If
End If End If
'se registra
If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then
ErrorMovInv = True
End If
Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimiento, TextoError) ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimiento, TextoError)
End If End If

View File

@@ -393,6 +393,7 @@ Partial Class Inventarios_KardexAlmacen
Private Sub AgregarProyeccion(dt As DataTable) Private Sub AgregarProyeccion(dt As DataTable)
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim StrCodigo As New StringBuilder
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
ObjInventarios.IniciaTransacSQL() ObjInventarios.IniciaTransacSQL()
@@ -400,25 +401,36 @@ Partial Class Inventarios_KardexAlmacen
Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
For Each dtRow As DataRow In dt.Rows For Each dtRow As DataRow In dt.Rows
Dim Codigo As String = dtRow("Código").ToString Dim Codigo As String = dtRow("Código").ToString
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo))
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal If Codigo <> "" Then
If Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo)).ToEntero
TieneError = True Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
Exit For If CvePS <= 0 Then
TieneError = True
StrCodigo.AppendFormat(" {0}<br/>", Codigo)
Exit For
ElseIf Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
TieneError = True
StrCodigo.Append("Ocurrio un error al registrar")
Exit For
End If
End If End If
Next Next
Else Else
TieneError = True TieneError = True
End If End If
If TieneError Then If TieneError Then
Alert("Ocurrio un error al registrar el Código no encontrado: " & StrCodigo.ToString, TipoMensaje.MsgError)
ObjInventarios.RollBack() ObjInventarios.RollBack()
Else Else
ObjInventarios.Commit() ObjInventarios.Commit()
Alert("Se ha agregado la proyección de productos correctamente")
End If End If
ObjInventarios.Dispose() ObjInventarios.Dispose()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion"))
Alert("Se ha agregado la proyección de productos correctamente")
End Sub End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable