diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index c4b2b01bc..0792aa609 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4160,14 +4160,15 @@ Public Class ClsGenerales End Function - Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer) As Boolean + Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, Optional ValidaEntrega As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleGet") With SqlAdapter.SelectCommand.Parameters - .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen + .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen + .Add("@ValidaEntrega", SqlDbType.Bit).Value = ValidaEntrega End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 21f150695..69de2e44a 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -6197,7 +6197,8 @@ Public Class ClsVentas End Function Public Function AddMedico(Nombre As String, Apellidos As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer, - CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Integer + CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, + Optional CveVendedor As Integer = -1, Optional CvePeriodoPago As Integer = 1) As Integer Dim Retorno As Boolean = False CveMedicoNuevo = -1 @@ -6218,6 +6219,7 @@ Public Class ClsVentas .Add("@Celular", SqlDbType.VarChar).Value = Celular .Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CvePeriodoPago", SqlDbType.Int).Value = CvePeriodoPago .Add("@CveMedicoNuevo", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -6234,7 +6236,8 @@ Public Class ClsVentas End Function Public Function UpdateMedico(CveMedico As Integer, Nombre As String, Apellidos As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer, - CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Boolean + CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, + Optional CveVendedor As Integer = -1, Optional CvePeriodoPago As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_MedicosUpdate") @@ -6259,6 +6262,7 @@ Public Class ClsVentas '.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio .Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CvePeriodoPago", SqlDbType.Int).Value = CvePeriodoPago '.Add("@Torre", SqlDbType.VarChar).Value = Torre @@ -6827,7 +6831,7 @@ Public Class ClsVentas End Function - Public Function AddUpdateComisionesMedicas(CvePS As Integer, CveEmpresa As Integer, ComisionMedico As Decimal, ComisionVendedor As Decimal, ComisionTecnico As Decimal) As Boolean + Public Function AddUpdateComisionesMedicas(CvePS As Integer, CveEmpresa As Integer, ComisionMedico As Decimal, ComisionVendedor As Decimal, ComisionTecnico As Decimal, ComisionGerente As Decimal) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ComisionesMedicasAddUpdate") @@ -6838,6 +6842,7 @@ Public Class ClsVentas .Add("@ComisionMedico", SqlDbType.Money).Value = ComisionMedico .Add("@ComisionVendedor", SqlDbType.Money).Value = ComisionVendedor .Add("@ComisionTecnico", SqlDbType.Money).Value = ComisionTecnico + .Add("@ComisionGerente", SqlDbType.Money).Value = ComisionGerente End With Try diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 41a5df462..3fa9b72ca 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1582,7 +1582,7 @@ Partial Class PopUpVerFactura End If End If - If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then If ObjPuntoVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then DtReporteCorte = ObjPuntoVenta.DtResultados.FiltraParametros("CveCorte > 0") End If @@ -1610,19 +1610,19 @@ Partial Class PopUpVerFactura If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'") End If - Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc" - If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then + Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc" + If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc" End If - Dim params As New List(Of ReportParameter) + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt"))) params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}")) params.Add(New ReportParameter("LogoPath", RutaImagenLogo)) - If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then If DtReporteCorte IsNot Nothing Then Dim DtTT = GenerateTransposedTable(DtReporteCorte) Dim DtDatosVentas As New DataTable() @@ -1756,32 +1756,48 @@ Partial Class PopUpVerFactura lrds.Add(rds5) - If UsuarioActual.CveEmpresa = 193 Then - Dim CveCuenta As Integer = 186367 - Using ObjConta As New ClsContabilidad - If ObjConta.GetAnexoCatalogo(CveCuenta, Fecha.ToDate(), Fecha.ToDate(), -1, -1, -1, UsuarioActual.CveEmpresa, 1) Then - Dim rdsConta As New ReportDataSource With {.Name = "DsContabilidad", .Value = ObjConta.DtResultados} - lrds.Add(rdsConta) - End If - End Using + If UsuarioActual.CveEmpresa.Contiene(197, 193) Then + Dim CveCuenta As Integer = -1 + If UsuarioActual.CveEmpresa = 193 Then + CveCuenta = 186367 + Else + CveCuenta = 0 - If DtDepositos IsNot Nothing Then - Dim rdsDepositos As New ReportDataSource With {.Name = "DsDepositos", .Value = DtDepositos} + If CveSubProyecto = 12756 Then 'nav + CveCuenta = 188796 + End If + + If CveSubProyecto = 12755 Then 'hillo + CveCuenta = 188795 + End If + End If + + If CveCuenta >= 0 Then + Using ObjConta As New ClsContabilidad + If ObjConta.GetAnexoCatalogo(CveCuenta, Fecha.ToDate(), Fecha.ToDate(), -1, -1, -1, UsuarioActual.CveEmpresa, 1) Then + Dim rdsConta As New ReportDataSource With {.Name = "DsContabilidad", .Value = ObjConta.DtResultados} + lrds.Add(rdsConta) + End If + End Using + End If + + If DtDepositos IsNot Nothing Then + Dim rdsDepositos As New ReportDataSource With {.Name = "DsDepositos", .Value = DtDepositos} lrds.Add(rdsDepositos) End If - End If + End If - 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) - 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) - 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) - 'params.Add(New ReportParameter("VentasCredito", RowCorte("VentasCorte").ToString())) - 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) - 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) - End If - End If + 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) + 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) + 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) + 'params.Add(New ReportParameter("VentasCredito", RowCorte("VentasCorte").ToString())) + 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) + 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) + End If + End If - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DtMetodosPago} + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DtMetodosPago} lrds.Add(rds) Dim rds2 As New ReportDataSource With {.Name = "DataSet2", .Value = DtCortesVentas} lrds.Add(rds2) @@ -6277,7 +6293,7 @@ Partial Class PopUpVerFactura DtPrecios.Columns.Add(New DataColumn("CBBase64", GetType(String))) For Each Row As DataRow In DtPrecios.Rows - Row("CBBase64") = system.Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True)) + Row("CBBase64") = System.Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True)) Next Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt" diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 7f1804feb..d89dcfd47 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1781,6 +1781,25 @@ Partial Class Inventarios_EntradasSalidas Exit Sub End If + If CveMovimiento <= 0 Then + If Request("CveEntregaAlmacen") IsNot Nothing AndAlso Request("CveEntregaAlmacen").ToString.ToEntero > 0 Then + Dim TieneRegistros As Boolean = False + + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetEntregaAlmacenRutaDetalle(Request("CveEntregaAlmacen").ToString.ToEntero, ValidaEntrega:=True) Then + If ObjGenerales.DtResultados.Rows.Count = 0 Then + TieneRegistros = True + End If + End If + ObjGenerales.Dispose() + + If TieneRegistros Then + Alert("La recolección ya ha sido realizada.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + End If + If GvM.Rows.Count > 0 Then 'Dim CveMovimiento As Integer diff --git a/UserControl/AddMedico.ascx b/UserControl/AddMedico.ascx index 500ff0a9c..f56e0b0b4 100644 --- a/UserControl/AddMedico.ascx +++ b/UserControl/AddMedico.ascx @@ -21,7 +21,7 @@