This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-02-10 21:01:27 -07:00
25 changed files with 547 additions and 284 deletions

View File

@@ -70,7 +70,7 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style=" width: 100%" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
@@ -122,7 +122,7 @@
<ajax:ValidatorCalloutExtender ID="VCMesAño" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesAño" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Meta Cantidad">
<asp:TemplateField HeaderText="Meta" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlMetaCantidad" runat="server" Text='<%# Eval("MetaCantidad", "{0}") %>'></asp:Literal>
</ItemTemplate>
@@ -132,9 +132,9 @@
<ajax:ValidatorCalloutExtender ID="VCMetaCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Meta Importe">
<asp:TemplateField HeaderText="$ Meta" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0}") %>'></asp:Literal>
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtMetaImporte" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaImporte") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>

View File

@@ -15,6 +15,7 @@ Partial Class CatMetasVendedores
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
txtMesAnio.Text = Now.FirstDayOfMonth.ToShortDateString
CargaDatosModal()
CargaCombos()
CargaDatos()
@@ -87,7 +88,7 @@ Partial Class CatMetasVendedores
Dim ObjVentas As New ClsVentas
If BtnAgregarMetaVendedor.Text = "Agregar" Then
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero) Then
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Alert("Se agregó la meta al vendedor")
Else
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
@@ -279,105 +280,75 @@ Partial Class CatMetasVendedores
Dim ProductosNoCargados As New StringBuilder()
Dim RowsCargados As Integer = 0
Dim RowsNoCargados As Integer = 0
Dim ObjMetas As New ClsVentas
'ObjPS.IniciaTransacSQL()
Dim ObjMetas As New ClsVentas
Dim Correcto As Boolean = True
ObjMetas.IniciaTransacSQL()
Try
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
For Each row As DataRow In dt.Rows
Dim Correcto As Boolean = False
Dim TieneError As Boolean = False
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("Vendedor LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
Dim FechaRef As New DateTime(Anio, Mes, 1)
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion)
If Correcto Then
RowsCargados += 1
End If
End If
If Not Correcto Then
RowsNoCargados += 1
End If
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
For Each row As DataRow In dt.Rows
If Correcto Then
Dim TieneError As Boolean = False
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
Dim FechaRef As New DateTime(Anio, Mes, 1)
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion, UsuarioActual.CveEmpresa)
If Correcto Then
RowsCargados += 1
End If
End If
If Not Correcto Then
RowsNoCargados += 1
End If
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al cargar los precios.", ex)
Finally
ObjMarcas.Dispose()
Dim MensajeFinal As New StringBuilder()
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
End If
If RowsCargados > 0 Then
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
End If
If RowsNoCargados > 0 Then
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
End If
Alert(MensajeFinal.ToString())
Dim MensajeFinal As New StringBuilder()
If Correcto Then
ObjMetas.Commit()
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
End If
If RowsCargados > 0 Then
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
End If
If RowsNoCargados > 0 Then
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
End If
Alert(MensajeFinal.ToString())
Else
ObjMetas.RollBack()
If RowsNoCargados > 0 Then
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
End If
Alert(MensajeFinal.ToString())
End If
End Try
End If
End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
End Sub
End Class

View File

@@ -4434,7 +4434,7 @@
<ContentTemplate>
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto,TipoEstatus"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>

View File

@@ -9420,7 +9420,7 @@ Partial Class Clientes
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("CveConcepto").ToEntero() = 1 Then
If e.Row.DataKey("CveConcepto").ToEntero() = 1 AndAlso e.Row.DataKey("TipoEstatus").ToEntero() <> 5 Then
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))

View File

@@ -144,59 +144,86 @@
CssClass="table table-advance Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left">
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="250px">
<ItemTemplate>
<asp:Label ID="HlkGrupo" runat="server" Target="_blank" Text='<%# Eval("Titulo").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Real Mes" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="Real" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label>
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Real Mes %" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
%Inte
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Año<br />Anterior
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label>
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Obj Mes" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Obj.<br />Mes
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label>
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Var Mes A.A" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Var <br />Mes A.A
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA").ToString() %>'> </asp:Label>
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Var Mes Obj" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Var <br />Obj.
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj").ToString() %>'> </asp:Label>
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Real<br/>Acum.
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label>
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Real Acumulado %" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
%Inte
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Acum<br />Año Ant
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado").ToString() %>'> </asp:Label>
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Obj Acumulado" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Obj.<br />Acum
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
@@ -204,14 +231,20 @@
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Var <br />vs AA
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Var vs ObjAcum" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Var<br /> Obj.
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum").ToString() %>'> </asp:Label>
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>

View File

@@ -86,7 +86,7 @@ Partial Class MetasVendedores
Select Case e.Row.DBCampo("TipoFila")
Case "1"
e.Row.CssClass = "GrupoSuperior"
e.Row.CssClass = "Totales"
' e.Row.FCLabel("lblRealMes").Text = ""
' e.Row.FCLabel("lblVtaMesAA").Text = ""
' e.Row.FCLabel("lblObjMes").Text = ""
@@ -98,11 +98,11 @@ Partial Class MetasVendedores
' e.Row.FCLabel("lblVarVSAA").Text = ""
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
Case "2"
e.Row.CssClass = "Totales"
Case "3"
e.Row.CssClass = "SubTotales2"
Case "4"
Case "3"
e.Row.CssClass = "SubTotales"
Case "4"
e.Row.CssClass = "SubTotales3"
End Select
If e.Row.DataKey("Titulo") = "" Then

View File

@@ -1286,6 +1286,7 @@ Partial Class PV
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
DdlTipoComprobante.SelectedValueExist("Rem")
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty)
End If
DdlTipoDefecto.Width = New Unit(260%)
@@ -5964,7 +5965,7 @@ Partial Class PV
Case 1 'CREDITO
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
Case 2 'CONTADO
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
DivContado.Visible = True
TxtImporteContado.Text = TxtTotal.Text
End If
@@ -6165,6 +6166,11 @@ Partial Class PV
Retorno = True
End If
If DtPagos IsNot Nothing AndAlso DtPagos.SUM("Importe").ToString.ToDecimal() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
Alert("Los pagos no deben ser aplicados a una remisión.", TipoMensaje.MsgAdvertencia)
Retorno = True
End If
Return Retorno
End Function
@@ -7315,12 +7321,10 @@ Partial Class PV
TxtPrecio.Text = TxtPrecio.Text
TxtObsPS.Text = "Descuento por garantía"
Else
'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
' If Gvr.RowType = DataControlRowType.DataRow Then
' Gvr.FCTextBox("TxtCantidad").Text = ""
' Gvr.FCTextBox("TxtCantidad").Enabled = True
' End If
'Next
If TmpDTAjustes IsNot Nothing Then
TmpDTAjustes.Clear()
End If
TxtObsPS.Text = TxtObsPS.Text.Replace("Descuento por garantía", "")
DdlRecepcionUsados.SelectedValueExist("-1")
DdlRecepcionUsados.Enabled = True

View File

@@ -194,7 +194,7 @@ Partial Class Ventas_RepProductosServicios
DdlSubProyectoEjecucion.DataBind()
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,3)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
'CargaUsuarios

View File

@@ -180,15 +180,15 @@ Partial Class Ventas_RepRecuperacion
End If
End If
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion"))
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion"))
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5

View File

@@ -219,6 +219,12 @@
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<label id="Label2" class="col-md-1 truncate">Tipo Transacción:</label>
<div class="col-md-2" id="div1" >
<asp:DropDownList ID="DdlTipoTransaccion" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">F. Registro IE inicio:</div>
<div class="col-md-1" style="padding-left: 0px !important;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; ">
@@ -249,6 +255,7 @@
<ajax:ValidatorCalloutExtender ID="vcoFfvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>

View File

@@ -133,10 +133,11 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1"))
DdlMoneda.DataBind()
'txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
'txtFechaF.Text = Now.ToShortDateString
'Cargamos las fechas
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones().FiltraParametros("Tipo = 'Ing' and Estatus = True ")
DdlTipoTransaccion.DataBind()
DdlTipoTransaccion.Items.Insert(0, New ListItem("Todos", "-1"))
'Cargamos las fechas
FechaI = If(Request("FechaI") IsNot Nothing, Request("FechaI").ToString, "-1").ToString
FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString
If FechaF <> "-1" Then
@@ -186,6 +187,7 @@ Partial Class Ventas_RepRecuperacionDetalle
CveClienteClasificacion = IfNull(Request("CveClienteClasificacion"), "-1").ToString.ToEntero
Tipo = IfNull(Request("Tipo"), "-1").ToString.ToEntero
EsDistribuidor = IfNull(Request("EsDistribuidor"), "-1").ToString.ToEntero
Dim CveTipoTransaccion As Integer = IfNull(Request("CveTipoTransaccion"), "-1").ToString.ToEntero
'Carga Clasificacion Cliente'
Dim ObjCliente As New ClsClientes
@@ -230,6 +232,7 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
DdlClienteSucursal.SelectedValueExist(CveClienteSucursal)
DdlDistribuidor.SelectedValueExist(EsDistribuidor)
DdlTipoTransaccion.SelectedValueExist(CveTipoTransaccion)
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
lblEsDistribuidor.Visible = True
@@ -256,7 +259,8 @@ Partial Class Ventas_RepRecuperacionDetalle
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF) Then
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF,
CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados

View File

@@ -6602,6 +6602,30 @@ Partial Class Ventas
LnkOCs.Visible = False
End If
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
End If
End If
Else
@@ -6620,6 +6644,32 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
End If
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
If EsCotizacion AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
End If
End If
End If
@@ -6753,10 +6803,39 @@ Partial Class Ventas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Opcion > 0 AndAlso Autorizacion <= 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
Else
If Opcion > 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
End If
End If
End If