+
+
-
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--DataKeyNames="CveMedico,Medico,CedulaProfesional,FechaNacimiento,Notas,DiasAtencion,Horario,Lugar,Estatus,CveUsuario,FechaIng,CveEmpresa,Telefono,Mail,CveMedicoEspecialidad,CveMedicoSubEspecialidad,Celular,Consultorio,Torre,Usuario"--%>
+
+
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%--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 45c4a28f8..cbf1d8755 100644
--- a/Ventas/CatMedicos.aspx.vb
+++ b/Ventas/CatMedicos.aspx.vb
@@ -53,10 +53,6 @@ Partial Class Ventas_CatMedicos
CargaCombos()
- 'CargaEspecialidad()
- 'CargaSubEspecialidad(-1)
-
-
CargaDatos()
BtnConsultar_Click(Nothing, Nothing)
diff --git a/Ventas/RepComisionesSMS.aspx b/Ventas/RepComisionesSMS.aspx
index d4aa631ed..716a17efd 100644
--- a/Ventas/RepComisionesSMS.aspx
+++ b/Ventas/RepComisionesSMS.aspx
@@ -113,51 +113,98 @@
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ventas/RepComisionesSMS.aspx.vb b/Ventas/RepComisionesSMS.aspx.vb
index c1bf7fcc7..ebee4433a 100644
--- a/Ventas/RepComisionesSMS.aspx.vb
+++ b/Ventas/RepComisionesSMS.aspx.vb
@@ -65,7 +65,7 @@ Partial Class Ventas_RepComisionesSMS
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1) Then
+ If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 1) Then
GvDatos.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
@@ -81,26 +81,61 @@ Partial Class Ventas_RepComisionesSMS
UpDatos.Update()
+ End Sub
+
+ Public Sub CargaDatosEspeciales()
+ LnkExportar.Visible = False
+
+ Dim ObjVentas As New ClsVentas
+
+ If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 2) Then
+ GvDatosEspeciales.DataSource = ObjVentas.DtResultados
+
+ If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
+ LnkExportar.Visible = True
+ End If
+ Else
+ GvDatosEspeciales.DataSource = Nothing
+ End If
+
+ ObjVentas.Dispose()
+
+ GvDatosEspeciales.DataBind()
+
+ UpDatosEspeciales.Update()
+
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
- CargaDatos()
+
+ If Tabs.ActiveTabIndex = 0 Then
+ CargaDatos()
+ Else
+ CargaDatosEspeciales()
+ End If
+
End Sub
#Region "EXCEL"
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- GvDatos.Columns(10).Visible = False
+
Dim SbFiltros As New StringBuilder()
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
- GvDatos.ExportToExcelGembox("CatMedicos", UsuarioActual, "Catálogo de Médicos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
- GvDatos.Columns(10).Visible = True
+ If Tabs.ActiveTabIndex = 0 Then
+ GvDatos.Columns(10).Visible = False
+ GvDatos.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ GvDatos.Columns(10).Visible = True
+ Else
+ GvDatosEspeciales.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones Especiales", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ End If
+
End Sub
@@ -152,9 +187,9 @@ Partial Class Ventas_RepComisionesSMS
Dim ComisionGerenteDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionGerente", $"CvePS = {CvePS} ").ToDecimal
Dim ComisionMedicoGV As Decimal = GvRow.FCTextBox("TxtComisionMedico").Text.ToDecimal
- Dim ComisionGerenteGV As Decimal = (GvRow.FCTextBox("TxtComisionGerente").Text.ToDecimal / 100).RoundSQL(2)
- Dim ComisionVendedorGV As Decimal = (GvRow.FCTextBox("TxtComisionVendedor").Text.ToDecimal / 100).RoundSQL(2)
- Dim ComisionTecnicoGV As Decimal = (GvRow.FCTextBox("TxtComisionTecnico").Text.ToDecimal / 100).RoundSQL(2)
+ Dim ComisionGerenteGV As Decimal = (GvRow.FCTextBox("TxtComisionGerente").Text.ToDecimal / 100).RoundSQL(4)
+ Dim ComisionVendedorGV As Decimal = (GvRow.FCTextBox("TxtComisionVendedor").Text.ToDecimal / 100).RoundSQL(4)
+ Dim ComisionTecnicoGV As Decimal = (GvRow.FCTextBox("TxtComisionTecnico").Text.ToDecimal / 100).RoundSQL(4)
If ComisionMedicoDT <> ComisionMedicoGV Or ComisionVendedorDT <> ComisionVendedorGV Or ComisionTecnicoDT <> ComisionTecnicoGV Or ComisionGerenteDT <> ComisionGerenteGV Then
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 20cdcef53..e6dae90ad 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -9,6 +9,7 @@ Imports System.Diagnostics
Imports System.IO
Imports System.Net.Http
Imports System.Security.Cryptography.X509Certificates
+Imports System.ServiceModel.Security
Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
Imports ADSNetLibrary.SIGAPI.Services.CRM
Imports ADSTimbrado
@@ -22633,6 +22634,7 @@ Partial Class Ventas
DdlProcedimiento.Enabled = True
TxtPaciente.Enabled = True
TxtEpisodio.Enabled = True
+ TxtFolioRemision.Enabled = True
End If
@@ -22812,6 +22814,7 @@ Partial Class Ventas
FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime()
End If
+
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
@@ -22819,7 +22822,7 @@ Partial Class Ventas
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero,
- FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero()) Then
+ FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero(), FolioRemision:=TxtFolioRemision.Text.Trim) Then
OcurrioError = True
End If