-- considerar los importes de educación del médico, desde la venta, si tiene dato

This commit is contained in:
2025-02-17 21:49:45 -07:00
parent 7e2aa39e8f
commit c412b16129
2 changed files with 19 additions and 18 deletions

View File

@@ -179,14 +179,16 @@
<asp:BoundField HeaderText="$ Gerente" DataField="ComisionGerente" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" Visible="false" />
<asp:BoundField HeaderText="$ E. Médica" DataField="ComisionMedico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" />
<asp:BoundField HeaderText="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" />
<asp:TemplateField HeaderText="Pagada" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="ChkPagada" Visible='<%# If(Eval("CveVenta").ToString <> "", True, False) %>' Checked='<%#If(Eval("Num1").ToString = "1", True, False) %>' AutoPostBack ="true" runat="server" OnCheckedChanged="ChkPagada_CheckedChanged"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -2,6 +2,7 @@
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
Partial Class Ventas_RepComisionesSMS
@@ -47,6 +48,7 @@ Partial Class Ventas_RepComisionesSMS
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
DdlVendedor.Enabled = False
GvDatos.Columns(16).Visible = False 'gerente
GvDatos.Columns(19).Visible = False 'pagada
End If
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
@@ -62,6 +64,7 @@ Partial Class Ventas_RepComisionesSMS
GvDatos.Columns(16).Visible = False 'gerente
GvDatos.Columns(17).Visible = False 'ed.medica
GvDatos.Columns(18).Visible = False 'fecha pago
GvDatos.Columns(19).Visible = False 'pagada
End If
End Sub
@@ -91,10 +94,8 @@ Partial Class Ventas_RepComisionesSMS
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#Region "EXCEL"
@@ -115,7 +116,6 @@ Partial Class Ventas_RepComisionesSMS
#End Region
Protected Sub LnkComisiones_Click(sender As Object, e As EventArgs)
CargaComisiones()
RegistraScript("$('#DvModalComisiones').modal('show');")
@@ -124,24 +124,18 @@ Partial Class Ventas_RepComisionesSMS
Private Sub CargaComisiones()
DTDatos = New DataTable
GvComisiones.DataSource = Nothing
Dim objVentas As New ClsVentas
If objVentas.GetComisionesMedicas(UsuarioActual.CveEmpresa) Then
GvComisiones.DataSource = objVentas.DtResultados
DTDatos = 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
@@ -162,7 +156,6 @@ Partial Class Ventas_RepComisionesSMS
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
If Not objVentas.AddUpdateComisionesMedicas(GvRow.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, ComisionMedicoGV, ComisionVendedorGV, ComisionTecnicoGV, ComisionGerenteGV) Then
TieneError = True
@@ -194,14 +187,12 @@ Partial Class Ventas_RepComisionesSMS
e.Row.FCTextBox("TxtComisionMedico").Text = e.Row.DataKey("ComisionMedico").ToDecimal.ToString("###.00")
End If
If e.Row.DataKey("ComisionGerente").ToDecimal = 0 Then
e.Row.FCTextBox("TxtComisionGerente").Text = ""
Else
e.Row.FCTextBox("TxtComisionGerente").Text = (e.Row.DataKey("ComisionGerente").ToDecimal * 100).ToString("###.00")
End If
If e.Row.DataKey("ComisionVendedor").ToDecimal = 0 Then
e.Row.FCTextBox("TxtComisionVendedor").Text = ""
Else
@@ -214,8 +205,6 @@ Partial Class Ventas_RepComisionesSMS
e.Row.FCTextBox("TxtComisionTecnico").Text = (e.Row.DataKey("ComisionTecnico").ToDecimal * 100).ToString("###.00")
End If
End If
End Sub
@@ -379,4 +368,14 @@ Partial Class Ventas_RepComisionesSMS
End If
End Sub
Protected Sub ChkPagada_CheckedChanged(sender As Object, e As EventArgs)
Dim chk As CheckBox = DirectCast(sender, CheckBox)
Dim gvr As GridViewRow = DirectCast(chk.NamingContainer, GridViewRow)
Using ObjVenta As New ClsVentas
If ObjVenta.UpdateVentaAdicional(gvr.DataKey("CveVenta").ToEntero, "NUM1", If(chk.Checked, "1", "0"), UsuarioActual.CveEmpresa) Then
CargaDatos()
End If
End Using
End Sub
End Class