diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 1fd262498..c3cfb0f9b 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -965,7 +965,7 @@ Public Class ClsInventarios CveVenta As Integer, CveSubProyecto As Integer, CveActivoFijo As Integer, Optional CveOS As Integer = -1, Optional CvePersonal As Integer = -1, Optional IDPoliza As Integer = -1, Optional CveUsuarioResponsable As Integer = -1, Optional CveConsignacion As Integer = -1, Optional Guia As String = "", Optional CveAlmacenDestino As Integer = -1, Optional Observaciones As String = "", Optional Recibio As String = "", Optional CveMovimientoRelacionado As Integer = -1, Optional TipoCambio As Double = -1, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional MovimientoFijo As Boolean = False, Optional CveContrato As Integer = -1, - Optional CveProveedor As Integer = -1, Optional Remision As String = "", Optional CveClienteSucursal As Integer = -1, Optional DepartamentoEntrega As String = "", Optional PedidoContrato As String = "", Optional GastoIndirecto As Double = -1, Optional CveChofer As Integer = -1, Optional Placa As String = "", + Optional CveProveedor As Integer = -1, Optional Remision As String = "", Optional CveClienteSucursal As Integer = -1, Optional DepartamentoEntrega As String = "", Optional PedidoContrato As String = "", Optional GastoIndirecto As Double = -1, Optional CveChofer As Integer = -1, Optional CveCamion As Integer = -1, Optional Placa As String = "", Optional FechaEntrega As String = "", Optional EspecifUnidad As String = "", Optional ResponsableCarga As String = "", Optional ResponsableRecibio As String = "", Optional Identificacion As String = "", Optional Domicilio As String = "", Optional Telefono As String = "", Optional Ciudad As String = "", Optional Licencia As String = "", Optional Modulo As String = "", Optional CveOP As Integer = -1) As Integer @@ -973,12 +973,16 @@ Public Class ClsInventarios DataAdapter("PA_Inv_MovimientosAdd") + If FechaMovto.Hour = 0 AndAlso FechaMovto.Minute = 0 AndAlso FechaMovto.Second = 0 Then + FechaMovto = String.Format("{0} {1}:{2}:{3}", FechaMovto.ToShortDateString, Now.Hour, Now.Minute, Now.Second).ToDateTime + End If + With SqlAdapter.SelectCommand.Parameters .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda '.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) - .Add("@FechaMovto", SqlDbType.DateTime).Value = String.Format("{0} {1}:{2}:{3}", FechaMovto.ToShortDateString, Now.Hour, Now.Minute, Now.Second).ToDateTime + .Add("@FechaMovto", SqlDbType.DateTime).Value = FechaMovto .Add("@Folio", SqlDbType.Int).Value = tFolio .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -1010,6 +1014,7 @@ Public Class ClsInventarios .Add("@PedidoContrato", SqlDbType.VarChar).Value = PedidoContrato .Add("@GastoIndirecto", SqlDbType.Money).Value = GastoIndirecto .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@Placa", SqlDbType.VarChar).Value = Placa .Add("@FechaEntrega", SqlDbType.VarChar).Value = FechaEntrega .Add("@EspecifUnidad", SqlDbType.VarChar).Value = EspecifUnidad @@ -1640,7 +1645,8 @@ Public Class ClsInventarios End Function - Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean + Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer, + FiltroFecha As Integer, CvesAlmacenes As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ProductosCaducidadGet") @@ -1652,6 +1658,9 @@ Public Class ClsInventarios .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FiltroFecha", SqlDbType.SmallInt).Value = FiltroFecha + .Add("@CvesAlmacenes", SqlDbType.VarChar).Value = CvesAlmacenes + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index bd1832379..a2a007864 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -988,6 +988,24 @@ Public Class ClsOC End Try Return Retorno End Function + + Public Function UpdateOrdenCompraDetalleDivideCantidad(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Cantidad As Decimal, CveUsuarioModifico As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OC_OrdenesCompraDetalleDivideCantidadUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = CveOrdenCompraDetalle + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la Orden de Compra Detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function Public Function UpdateOrdenCompraMoneda(CveOrdenCompra As Integer, CveEmpresa As Integer, CveMoneda As Integer, CveUsuarioModifico As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraMonedaUpdate") diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 4c7177d1f..84d9822fa 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -912,7 +912,7 @@ Partial Class Bancos_PolizaCheque CveProveedor = gvr.DataKey("CveProveedor").ToEntero If HdnCveProveedor.Value.ToEntero > 0 Then CveProveedor = HdnCveProveedor.Value.ToEntero - If Importe > 0 Then + If Importe <> 0 Then 'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then ' If Not Conta.AddMovimiento(IDPoliza, gvr.DataKey("IDCuenta").ToEntero, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.FCTextBox("TxtConcepto").Text, 0, TxtFechaDocumento.Text.ToDate, "") Then ' MsgError = "No se pudo insertar movimiento contable" diff --git a/General/SaldosIniciales.aspx b/General/SaldosIniciales.aspx index 6d8b0d9b6..83a5f7055 100644 --- a/General/SaldosIniciales.aspx +++ b/General/SaldosIniciales.aspx @@ -50,7 +50,16 @@ - +
+
+ Fecha: +
+ Concepto: + + Carga Inicial + Salida Almacen + +
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index ca07acd2c..4d9c3b474 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1774,37 +1774,46 @@ Partial Class General_SaldosIniciales Dim contadorMovimientos As Integer = 0 Dim listadoMovimientos As String = "" Dim mensajeError As String = "" + Dim Fecha As DateTime = (TxtFecha.Text).ToDate Try For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows - Dim almacenActual As String = almacenSinRepetir("Almacen").ToString + Dim almacenActual As String = almacenSinRepetir("Almacen").ToString.Trim 'Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero - Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, 1, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1) - listadoMovimientos += $"movimiento con folio {ObjMovimientos.Folio}
" If CveAlmacen > 0 Then - contadorMovimientos += 1 - For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows - Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}") - If RowPS IsNot Nothing Then - Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero - Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero - If CveUM > 0 Then - Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal - Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal + Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, DdlConceptoAlmacen.SelectedValue.ToEntero, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1) + listadoMovimientos += $"movimiento con folio {ObjMovimientos.Folio}
" + If movimientoCabecera > 0 Then - If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1) Then - mensajeError = "No se logró generar el detalle del movimiento" + + contadorMovimientos += 1 + For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows + Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}") + If RowPS IsNot Nothing Then + Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero + Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero + If CveUM > 0 Then + Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal + Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal + + If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1) Then + mensajeError = "No se logró generar el detalle del movimiento" + Throw New Exception() + End If + Else + mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}" Throw New Exception() End If Else - mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}" + mensajeError = $"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}""" Throw New Exception() End If - Else - mensajeError = $"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}""" - Throw New Exception() - End If - Next + Next + Else + mensajeError = $"No se registró el encabezado ""{almacenActual}""" + Throw New Exception() + Exit For + End If Else mensajeError = $"No se encontró el almacén con nombre ""{almacenActual}""" Throw New Exception() diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index e9826cf74..3fa330bd6 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -200,7 +200,7 @@ Partial Class Inicio Dim EsDEV = Not UsuarioActual.Empresa.FacturaProduccion If Not EsDEV Then - If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100 + If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100, 1918) Then MuestraInconsistencias() '100 End If 'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD diff --git a/Inventarios/RepProductosPorCaducar.aspx.cs b/Inventarios/RepProductosPorCaducar.aspx.cs index 59ae587ea..d5e8b486c 100644 --- a/Inventarios/RepProductosPorCaducar.aspx.cs +++ b/Inventarios/RepProductosPorCaducar.aspx.cs @@ -44,7 +44,7 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas // aqui siempre se visualiza la caducidad, sin importar la condición, porque siempre se valida la caducidad ClsInventarios ObjInventarios = new ClsInventarios(); if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(), - DdlClasificacion.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa)) + DdlClasificacion.SelectedValue.ToEntero(), CvePS, 1,"1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { GvDatos.DataSource = ObjInventarios.DtResultados; DTDatos = ObjInventarios.DtResultados; diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 2dbb9bda8..35c32faf3 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -437,6 +437,7 @@ public partial class Nomina_Nomina2 : ClsPaginas LnkProvisionNomina.Visible = CvePrePolizaProvision > 0; LnkProvisionNomina.NavigateUrl = $"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaProvision}"; LnkProvisionNominaAsimilados.Visible = CvePrePolizaProvisionAsimilados > 0; + LnkProvisionNominaAsimilados.NavigateUrl = $"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaProvisionAsimilados}"; LnkProvisionProrrateo.NavigateUrl = $"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaProrrateo}"; LnkProvisionProrrateo.Visible = CvePrePolizaProrrateo > 0; UpAccciones.Update(); diff --git a/RH/Personal.aspx b/RH/Personal.aspx index b55013907..e69de49b8 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1474,13 +1474,13 @@ +
-
diff --git a/vwd.webinfo b/vwd.webinfo index 1b85ca648..2997fdae3 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -338,6 +338,8 @@ + +