Correciones Presupuestos, comisiones modal de comisiones
This commit is contained in:
@@ -3201,7 +3201,7 @@ Public Class ClsContratos
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, Optional Opcion As Integer = 1) As Boolean
|
||||
Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, Opcion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Con_PresupuestosResumenGet")
|
||||
|
||||
@@ -10770,6 +10770,9 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/CatProcedimientoDetalle.aspx".ToUpper(), 1344)
|
||||
PaginaDict.Add("/Ventas/CatEspecialidadesSubEspecialidades.aspx".ToUpper(), 1346)
|
||||
PaginaDict.Add("/Ventas/FacturacionGlobal.aspx".ToUpper(), 546)
|
||||
PaginaDict.Add("/Ventas/RepComisionesSMS.aspx".ToUpper(), 1347)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6314,9 +6314,6 @@ Public Class ClsVentas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "S U B E S P E C I A L I D A D E S"
|
||||
|
||||
Public Function GetMedicosSubEspecialidades(CveMedicoSubEspecialidad As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean
|
||||
@@ -6740,6 +6737,80 @@ Public Class ClsVentas
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "VENTAS MEDICAS COMISIONES"
|
||||
|
||||
Public Function GetComisionesMedicas(CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ComisionesMedicasGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las comisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function AddUpdateComisionesMedicas(CvePS As Integer, CveEmpresa As Integer, ComisionMedico As Decimal, ComisionVendedor As Decimal, ComisionTecnico As Decimal) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ComisionesMedicasAddUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@ComisionMedico", SqlDbType.Money).Value = ComisionMedico
|
||||
.Add("@ComisionVendedor", SqlDbType.Money).Value = ComisionVendedor
|
||||
.Add("@ComisionTecnico", SqlDbType.Money).Value = ComisionTecnico
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar las comisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ComisionesMedicasRepGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el reporte comisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "DEVOLUICON"
|
||||
|
||||
@@ -20281,13 +20281,13 @@ Partial Class Compras_Compras
|
||||
Dim Autorizado As Double = 0
|
||||
Dim Ejercido As Double = 0
|
||||
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1) Then
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 1) Then
|
||||
|
||||
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
||||
|
||||
Dim resultadosFiltrados = From row In ObjCon.DtResultados.AsEnumerable()
|
||||
Where FechaCompra >= row.Field(Of Date)("FechaInicio") AndAlso
|
||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||
Select row
|
||||
|
||||
|
||||
@@ -20315,54 +20315,68 @@ Partial Class Compras_Compras
|
||||
|
||||
If Opcion = 1 Then
|
||||
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion AndAlso
|
||||
row.Field(Of Integer)("CveTipoGasto") = ValCveTipoGasto
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim TotalAcumuladoTabla As Decimal = (TmpDT.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} AND CveTipoGasto = {ValCveTipoGasto} "))
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b>. Se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b> ", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
Else
|
||||
For Each item In EnumAgrupado
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion AndAlso
|
||||
row.Field(Of Integer)("CveTipoGasto") = ValCveTipoGasto
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
Dim TotalAcumuladoTabla As Decimal = (TmpDT.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} AND CveTipoGasto = {ValCveTipoGasto} "))
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>. Se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b> ", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
For Each item In EnumAgrupado
|
||||
|
||||
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -20370,10 +20384,14 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
Else
|
||||
Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
ObjCon.Dispose()
|
||||
|
||||
@@ -1473,6 +1473,13 @@
|
||||
<asp:CompareValidator ID="cvFechaIAdd" runat="server" ControlToValidate="txtFechaIAdd" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddSolicitud"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaIAdd" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaIAdd" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<%-- <asp:CompareValidator ID="CvtxtFechaIAdd" ControlToCompare="txtFechaIAdd" ControlToValidate="txtFechaFAdd" Type="Date" Operator="GreaterThan" ValidationGroup="GrpAddSolicitud" Display="None"
|
||||
ErrorMessage="La Fecha Inicio no puede ser inferior que la Fecha Fin" runat="server"></asp:CompareValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VceCvtxtFechaIAdd" runat="server" HighlightCssClass="vco" TargetControlID="CvtxtFechaIAdd" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
|
||||
|
||||
<label for="<%= txtFechaIAdd.ClientID.ToString() %>" style="margin-top: -6px">Fecha Inicio:</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1487,6 +1494,12 @@
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtFechaFAdd" PopupButtonID="LnkFechaFAdd" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaFAdd" runat="server" ControlToValidate="txtFechaFAdd" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpAddSolicitud"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaFAdd" runat="server" ControlToValidate="txtFechaFAdd" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddSolicitud"></asp:CompareValidator>
|
||||
|
||||
<asp:CompareValidator ID="CvetxtFechaFAdd" ControlToCompare="txtFechaFAdd" ControlToValidate="txtFechaIAdd" Type="Date" Operator="LessThan" ValidationGroup="GrpAddSolicitud" Display="None"
|
||||
ErrorMessage="Fecha Fin no puede ser inferior que la Fecha Inicio" runat="server"></asp:CompareValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VceCvFechas" runat="server" HighlightCssClass="vco" TargetControlID="CvetxtFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= txtFechaFAdd.ClientID.ToString() %>" style="margin-top: -6px">Fecha Fin:</label>
|
||||
|
||||
@@ -2652,6 +2652,9 @@ Partial Class Compras_eFacturas
|
||||
'End Sub
|
||||
|
||||
Protected Sub LnkSolicitarSat_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
|
||||
Exit Sub
|
||||
|
||||
Dim sbResultado As StringBuilder = New StringBuilder()
|
||||
Dim idSolicitudCFDI As Integer = 0
|
||||
Dim idSolicitudMetadata As Integer = 0
|
||||
|
||||
@@ -9019,64 +9019,75 @@ Partial Class OC_OC
|
||||
|
||||
If Opcion = 1 Then
|
||||
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>. Se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
Else
|
||||
For Each item In EnumAgrupado
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>. Se excede por <b>{ Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
For Each item In EnumAgrupado
|
||||
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
' Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = True
|
||||
End If
|
||||
Else
|
||||
Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
ObjCon.Dispose()
|
||||
|
||||
300
Ventas/RepComisionesSMS.aspx
Normal file
300
Ventas/RepComisionesSMS.aspx
Normal file
@@ -0,0 +1,300 @@
|
||||
<%@ Page Title="Reporte de Comisiones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisionesSMS.aspx.vb" Inherits="Ventas_RepComisionesSMS" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
Reporte de Comisiones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Comisiones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar" UpdateMode="Always">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkComisiones" OnClick="LnkComisiones_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional" >
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="height: 32px;">
|
||||
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-1" style="min-width: 115px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
|
||||
</div>
|
||||
<div class="col-md-1" style="min-width: 115px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <label class="col-md-1 ">Cliente:</label>
|
||||
<div class="col-md-1">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1 ">Grupo:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlGrupo" CssClass="form-control input-sm select2me" runat="server" Width="100%">
|
||||
<asp:ListItem Value="1" Selected="True">Médico</asp:ListItem>
|
||||
<asp:ListItem Value="2" >Procedimiento</asp:ListItem>
|
||||
<asp:ListItem Value="3" >Clientes</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
|
||||
<%-- <label class="col-md-1 ">Médico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Procedimiento:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div> --%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveMedico,Nombre,APaterno,AMaterno,CedulaProfesional,FechaNacimiento,Notas,Estatus,CveUsuario,FechaIng,CveEmpresa,Telefono,Mail,CveMedicoEspecialidad,CveMedicoSubEspecialidad,Celular,Usuario,CveVendedor"
|
||||
data-sort="true"
|
||||
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Nombre" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Apellido Paterno" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAPaterno" runat="server" Text='<%# Eval("APaterno") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Apellido Materno" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAMaterno" runat="server" Text='<%# Eval("AMaterno") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cédula Profesional" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCedulaProfesional" runat="server" Text='<%# Eval("CedulaProfesional") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Nacimiento" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaNacimiento" runat="server" Text='<%# Eval("FechaNacimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Teléfono" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Correo" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Hospital" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlHospital" runat="server" Text='<%# Eval("Hospital") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Consultorio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlConsultorio" runat="server" Text='<%# Eval("Consultorio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Especialidad" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEspecialidad" runat="server" Text='<%# Eval("Especialidad") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("EstatusStr") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalComisiones" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 650px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpDvModalComisiones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal1" runat="server">Comisiones</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusquedaComiciones" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisiones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisiones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<asp:GridView ID="GvComisiones" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CvePS"
|
||||
data-sort="true" OnRowDataBound="GvComisiones_RowDataBound"
|
||||
EmptyDataText="No se encontraron Comisiones" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Codigo/Producto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Medico" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtComisionMedico" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionMedico")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtComisionVendedor" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionVendedor")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Técnico" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtComisionTecnico" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionTecnico")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardarComisiones" OnClick="BtnGuardarComisiones_Click" runat="server" class="btn btn-success" Text="Guardar" ValidationGroup="GrpGuardarEspecialidad" />
|
||||
<button id="BtnCerrar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
135
Ventas/RepComisionesSMS.aspx.vb
Normal file
135
Ventas/RepComisionesSMS.aspx.vb
Normal file
@@ -0,0 +1,135 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Extensions.Primitives
|
||||
|
||||
Partial Class Ventas_RepComisionesSMS
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub CargaDatos()
|
||||
|
||||
|
||||
'Dim ObjVentas As New ClsVentas
|
||||
|
||||
'If ObjVentas.GetMedicos(-1, UsuarioActual.CveEmpresa, -1) Then
|
||||
' GvDatos.DataSource = ObjVentas.DtResultados
|
||||
'Else
|
||||
' GvDatos.DataSource = Nothing
|
||||
'End If
|
||||
|
||||
'ObjVentas.Dispose()
|
||||
|
||||
'GvDatos.DataBind()
|
||||
|
||||
|
||||
|
||||
'UpDatos.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
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
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub LnkComisiones_Click(sender As Object, e As EventArgs)
|
||||
CargaComisiones()
|
||||
RegistraScript("$('#DvModalComisiones').modal('show');")
|
||||
End Sub
|
||||
|
||||
Private Sub CargaComisiones()
|
||||
|
||||
GvComisiones.DataSource = Nothing
|
||||
|
||||
Dim objVentas As New ClsVentas
|
||||
|
||||
If objVentas.GetComisionesMedicas(UsuarioActual.CveEmpresa) Then
|
||||
GvComisiones.DataSource = objVentas.DtResultados
|
||||
End If
|
||||
|
||||
objVentas.Dispose()
|
||||
|
||||
GvComisiones.DataBind()
|
||||
|
||||
UpDvModalComisiones.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnGuardarComisiones_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim objVentas As New ClsVentas
|
||||
objVentas.IniciaTransacSQL()
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvComisiones.Rows
|
||||
|
||||
If Not objVentas.AddUpdateComisionesMedicas(GvRow.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, GvRow.FCTextBox("TxtComisionMedico").Text.ToDecimal, GvRow.FCTextBox("TxtComisionVendedor").Text.ToDecimal, GvRow.FCTextBox("TxtComisionTecnico").Text.ToDecimal) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If TieneError Then
|
||||
objVentas.RollBack()
|
||||
Else
|
||||
objVentas.Commit()
|
||||
Alert("Comisiones Actualizadas correctamente")
|
||||
End If
|
||||
|
||||
objVentas.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvComisiones_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.FCTextBox("TxtComisionMedico").Text.ToDecimal = 0 Then
|
||||
e.Row.FCTextBox("TxtComisionMedico").Text = ""
|
||||
End If
|
||||
If e.Row.FCTextBox("TxtComisionVendedor").Text.ToDecimal = 0 Then
|
||||
e.Row.FCTextBox("TxtComisionVendedor").Text = ""
|
||||
End If
|
||||
If e.Row.FCTextBox("TxtComisionTecnico").Text.ToDecimal = 0 Then
|
||||
e.Row.FCTextBox("TxtComisionTecnico").Text = ""
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user