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 @@ - @@ -74,15 +74,15 @@ -
-
- - - +
+ + + - -
-
+ +
+
@@ -93,7 +93,7 @@
- +
@@ -101,23 +101,23 @@ - +
-
-
- - - - +
+ + + + - -
-
+ +
+
@@ -145,20 +145,35 @@
+
+
+
+ + - + Mensual + Quincenal + Semanal + + +
+
+
+
+ + +
+
+ -
- -
- -
-
- -
-
+
+
+ +
+
@@ -171,7 +186,7 @@ - + @@ -186,26 +201,26 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - <%-- + <%-- diff --git a/UserControl/AddMedico.ascx.vb b/UserControl/AddMedico.ascx.vb index 1a0a18012..410e991a0 100644 --- a/UserControl/AddMedico.ascx.vb +++ b/UserControl/AddMedico.ascx.vb @@ -170,7 +170,7 @@ Partial Class UserControl_AddMedico TxtCelular.Text = "" DdlEspecialidad.SelectedValueExist(-1) DdlSubEspecialidad.SelectedValueExist(-1) - + DdlPeriodoPago.SelectedValueExist(-1) DVUsuarioFechaIng.Visible = False TxtFechaIng.Text = "" TxtUsuario.Text = "" @@ -209,7 +209,8 @@ Partial Class UserControl_AddMedico End Sub Public Sub PreparaEdicion(CveMedicoEditar As Integer, Nombre As String, Apellidos As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, - Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, FechaIng As DateTime, Usuario As String, CveVendedor As Integer) + Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, FechaIng As DateTime, Usuario As String, + CveVendedor As Integer, Optional CvePeriodoPago As Integer = -1) CargaCombos() CargaCombosMedicoClientesucursal() @@ -233,11 +234,15 @@ Partial Class UserControl_AddMedico TxtUsuario.Text = Usuario DdlVendedor.SelectedValueExist(CveVendedor) + DdlPeriodoPago.SelectedValueExist(CvePeriodoPago) DVEstatus.Visible = True LbAgregar.Text = "Actualizar" LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfesional.Text}" + + + UpModal.Update() CargaGVMedicoClienteSucursal(CveMedico, UsuarioActual.CveEmpresa) @@ -257,13 +262,15 @@ Partial Class UserControl_AddMedico If CveMedico > 0 Then If ObjVentas.UpdateMedico(CveMedico, TxtNombre.Text.Trim, TxtAPellidos.Text.Trim, TxtCedulaProfesional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, ChkEstatus.Checked, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero) Then + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, + DdlVendedor.SelectedValue.ToEntero, CvePeriodoPago:=DdlPeriodoPago.SelectedValue.ToEntero) Then ProcesoOK = True End If Else CveMedicoNuevo = ObjVentas.AddMedico(TxtNombre.Text.Trim, TxtAPellidos.Text.Trim, TxtCedulaProfesional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, ChkEstatus.Checked, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero) + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, + DdlVendedor.SelectedValue.ToEntero, CvePeriodoPago:=DdlPeriodoPago.SelectedValue.ToEntero) If CveMedicoNuevo > 0 Then diff --git a/Ventas/CatMedicos.aspx b/Ventas/CatMedicos.aspx index f66cc0647..186e273ff 100644 --- a/Ventas/CatMedicos.aspx +++ b/Ventas/CatMedicos.aspx @@ -228,7 +228,7 @@ <%--DataKeyNames="CveMedico,Medico,CedulaProfesional,FechaNacimiento,Notas,DiasAtencion,Horario,Lugar,Estatus,CveUsuario,FechaIng,CveEmpresa,Telefono,Mail,CveMedicoEspecialidad,CveMedicoSubEspecialidad,Celular,Consultorio,Torre,Usuario"--%> diff --git a/Ventas/CatMedicos.aspx.vb b/Ventas/CatMedicos.aspx.vb index 10e4e01b6..45c4a28f8 100644 --- a/Ventas/CatMedicos.aspx.vb +++ b/Ventas/CatMedicos.aspx.vb @@ -188,7 +188,7 @@ Partial Class Ventas_CatMedicos AddMedicoControl.PreparaEdicion(CveMedico, GvRow.DataKey("Nombre"), GvRow.DataKey("Apellidos"), GvRow.DataKey("CedulaProfesional"), GvRow.DataKey("FechaNacimiento").ToDate(), GvRow.DataKey("Notas"), Boolean.Parse(GvRow.DataKey("Estatus")), GvRow.DataKey("Mail"), GvRow.DataKey("Telefono"), GvRow.DataKey("Celular"), GvRow.DataKey("CveMedicoEspecialidad").ToEntero, GvRow.DataKey("CveMedicoSubEspecialidad").ToEntero, - GvRow.DataKey("FechaIng").ToDateTime, GvRow.DataKey("Usuario"), GvRow.DataKey("CveVendedor").ToEntero) + GvRow.DataKey("FechaIng").ToDateTime, GvRow.DataKey("Usuario"), GvRow.DataKey("CveVendedor").ToEntero, CvePeriodoPago:=GvRow.DataKey("CvePeriodoPago").ToEntero) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 3b7809560..83a8a4a08 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9587,13 +9587,26 @@ Partial Class Clientes Dim IVAFactura As Decimal = TmpDT.SUMD("ImporteIVA") Dim Folio As Integer = -1 - Dim Serie As String = "" - - 'If FolioNotaCredito(Tipo) Then - ' Folio = FolioNotaAcumulador - ' Serie = SerieNotaAcumulador - 'End If - + Dim Serie As String = "" + + If CveSubProyecto > 0 Then + Dim ObjFolios As New ClsGralFolios() + If ObjFolios.GetFolios("RNC", UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto) Then + Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros("Estado = 'Activo'") + If DT.Rows.Count > 0 Then + Serie = DT.Rows(0)("Serie").ToString() + End If + DT.Dispose() + End If + ObjFolios.Dispose() + End If + + + 'If FolioNotaCredito(Tipo) Then + ' Folio = FolioNotaAcumulador + ' Serie = SerieNotaAcumulador + 'End If + If ObjFactura IsNot Nothing Then ObjFactura.Dispose() ObjFactura = Nothing @@ -9678,9 +9691,9 @@ Partial Class Clientes End If ObjFactura.FechaEjecucion = NowADS() - ObjFactura.CveSubProyecto = UsuarioActual.CveSubProyecto - ObjFactura.CveSubProyectoCobranza = UsuarioActual.CveSubProyecto - ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto + ObjFactura.CveSubProyecto = CveSubProyecto + ObjFactura.CveSubProyectoCobranza = CveSubProyecto + ObjFactura.CveSubProyectoEjecucion = CveSubProyecto ObjFactura.SubTotal = SubTotalFactura diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 6f8561cf4..e9407e7b2 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -2169,7 +2169,7 @@ Partial Class PV If ObjPVenta.DtResultados.Rows.Count > 0 Then CveCorte = ObjPVenta.CveCorte Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-1) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then + If UsuarioActual.Empresa.Funcionalidad(180) = "1" AndAlso FechaICorte < NowADS().Date Then DebeCerrarCorte = True LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." Else diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 18674f73f..c42948839 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -143,7 +143,7 @@ Partial Class Ventas_PVCobranza If ObjPVenta.DtResultados.Rows.Count > 0 Then CveCorte = ObjPVenta.CveCorte Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5) - If FechaICorte < NowADS().Date Then + If UsuarioActual.Empresa.Funcionalidad(180) = "1" AndAlso FechaICorte < NowADS().Date Then DebeCerrarCorte = True LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." Else diff --git a/Ventas/RepComisionesSMS.aspx b/Ventas/RepComisionesSMS.aspx index d7122528f..d4aa631ed 100644 --- a/Ventas/RepComisionesSMS.aspx +++ b/Ventas/RepComisionesSMS.aspx @@ -164,7 +164,7 @@