--Cambios en los tipos de venta
This commit is contained in:
@@ -6091,6 +6091,22 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacion(CveAutorizacion As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error la autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha, Optional CveUsuarioConsulta As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesGet")
|
||||
|
||||
@@ -202,8 +202,11 @@ Partial Class Ventas_RepVentas
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Giro", "22"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Giro", "22"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Insert(10, New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "23"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlGrupo.Items.Insert(13, New ListItem("Tipo Venta", "24"))
|
||||
|
||||
DdlGrupo.DataBind()
|
||||
DdlGrupo.SelectedValueExist("3")
|
||||
@@ -222,6 +225,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' ")
|
||||
DdlTipoVenta.DataBind()
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2"))
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
@@ -314,11 +318,15 @@ Partial Class Ventas_RepVentas
|
||||
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
|
||||
|
||||
Dim ModalidadContable As Boolean = Not ChkLecturaAdmin.Checked
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DivTipoVenta.Visible Then
|
||||
CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
||||
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable,
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Net.Http
|
||||
Imports DocumentFormat.OpenXml.Office2010.PowerPoint
|
||||
|
||||
Partial Class RepVentasDetalle
|
||||
Inherits ClsPaginas
|
||||
@@ -326,6 +327,7 @@ Partial Class RepVentasDetalle
|
||||
|
||||
DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs'")
|
||||
DdlTipoVenta.DataBind()
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2"))
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
@@ -461,6 +463,11 @@ Partial Class RepVentasDetalle
|
||||
ChkLecturaAdmin.Checked = Not ModalidadContable
|
||||
CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DivTipoVenta.Visible Then
|
||||
CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
|
||||
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
|
||||
@@ -468,7 +475,7 @@ Partial Class RepVentasDetalle
|
||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
||||
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(),
|
||||
ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then
|
||||
ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then
|
||||
DtVentas = AddRows(ObjVentas.DtResultados)
|
||||
ImgImprimir.Enabled = True
|
||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||
@@ -536,6 +543,7 @@ Partial Class RepVentasDetalle
|
||||
ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS
|
||||
GvDatos.Columns(9).Visible = ChkIEPS.Checked
|
||||
ChkKilometraje.Visible = UsuarioActual.Empresa.Funcionalidad(558) = "1" 'empresa llantera
|
||||
ChkTipoVenta.Visible = UsuarioActual.Empresa.Funcionalidad(531) = "1" 'empresa acumuladores
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -668,6 +676,11 @@ Partial Class RepVentasDetalle
|
||||
ChkEstatusFactura.Checked = True
|
||||
ChkCliente.Checked = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
ChkSucursal.Checked = False
|
||||
ChkTipoVenta.Checked = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
|
||||
@@ -781,6 +794,8 @@ Partial Class RepVentasDetalle
|
||||
|
||||
If ChkDescargarXML.Checked Then ListPersonalizada.Add("XML")
|
||||
|
||||
If ChkTipoVenta.Checked Then ListPersonalizada.Add("TipoVenta")
|
||||
|
||||
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then
|
||||
'Alert("Personalizacion guardada")
|
||||
End If
|
||||
@@ -841,6 +856,7 @@ Partial Class RepVentasDetalle
|
||||
ChkDescargarPDF.Checked = False
|
||||
ChkDescargarXML.Checked = False
|
||||
|
||||
ChkTipoVenta.Checked = False
|
||||
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
|
||||
|
||||
For Each personalizacion As String In Personalizaciones
|
||||
@@ -980,6 +996,9 @@ Partial Class RepVentasDetalle
|
||||
Case "PDF"
|
||||
ChkDescargarPDF.Checked = True
|
||||
Exit Select
|
||||
Case "TipoVenta"
|
||||
ChkTipoVenta.Checked = True
|
||||
Exit Select
|
||||
Case Else
|
||||
Exit Select
|
||||
End Select
|
||||
@@ -988,6 +1007,7 @@ Partial Class RepVentasDetalle
|
||||
Personaliza()
|
||||
Else
|
||||
PersonalizaDefault()
|
||||
Personaliza()
|
||||
End If
|
||||
|
||||
UPPersonalizar.Update()
|
||||
|
||||
@@ -417,9 +417,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LbVerificarExistencia" Visible="false" runat="server"><i class='fa fa-list-alt'></i>Verificar Existencias</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkEnvioDeCorreoFactura" runat="server" CausesValidation="False" OnClick="LnkEnvioDeCorreoFactura_Click" Visible="false" > <i class="fa fa-envelope-o" aria-hidden="true"></i> Envio De Correo</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkEnvioDeCorreoFactura" runat="server" CausesValidation="False" OnClick="LnkEnvioDeCorreoFactura_Click" Visible="false"> <i class="fa fa-envelope-o" aria-hidden="true"></i> Envio De Correo</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
@@ -654,7 +654,7 @@
|
||||
<td runat="server">
|
||||
<asp:Label runat="server" ID="LblTipoVenta"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -995,6 +995,11 @@
|
||||
<td>
|
||||
<asp:Label ID="lblMotivoDev" runat="server"></asp:Label></td>
|
||||
</tr>
|
||||
<tr align="left" id="TrTipoVentaEgs" runat="server" visible="false">
|
||||
<td><b class="truncate">Tipo Venta:</b> </td>
|
||||
<td>
|
||||
<asp:Label ID="LblTipoVentaEGS" runat="server"></asp:Label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1345,7 +1350,7 @@
|
||||
</span>
|
||||
<br />
|
||||
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Label>
|
||||
<asp:Hyperlink ID="HLPS" runat="server" Visible="false" Target="_blank" Text='<%# Eval("CodigoPS") %>'></asp:Hyperlink>
|
||||
<asp:HyperLink ID="HLPS" runat="server" Visible="false" Target="_blank" Text='<%# Eval("CodigoPS") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged1" CssClass="select2me">
|
||||
@@ -7357,7 +7362,14 @@
|
||||
<h4 class="modal-title">Aplicar NC</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row form-group" id="DivTipoVentaAsingado" runat="server" visible="false">
|
||||
<div class="col-md-2">
|
||||
Tipo Venta:
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:Label runat="server" ID="LblTipoVentaAsignado" ></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-2">
|
||||
Concepto:
|
||||
@@ -8847,6 +8859,11 @@
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSolCreditoTipoDocto.ClientID.ToString()%>">Tipo Documento:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivTipoVentaSol" runat="server">
|
||||
<asp:DropDownList ID="DdlTipoVentaSolCredito" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="TipoVenta" DataValueField="CveTipoVenta">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoVentaSolCredito.ClientID.ToString()%>">Tipo:</label>
|
||||
</div>
|
||||
<div id="DivAutorizacion" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoAutorizacion" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
@@ -9016,7 +9033,7 @@
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDvModalTipoVenta" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="width:650px;">
|
||||
<div class="modal-content" style="width: 650px;">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="LblDvModalTipoVentaTitulo" runat="server">Tipo de Venta</asp:Label>
|
||||
@@ -9114,11 +9131,11 @@
|
||||
<div class="row" runat="server" id="DVGvPSProced" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox ID="ChkVerTodosPS" runat="server" Text="Ver Todos los productos" AutoPostBack="true" OnCheckedChanged="ChkVerTodosPS_CheckedChanged" />
|
||||
<asp:CheckBox ID="ChkVerTodosPS" runat="server" Text="Ver Todos los productos" AutoPostBack="true" OnCheckedChanged="ChkVerTodosPS_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-md-4" style="text-align: right">
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="col-md-4" style="text-align: right">
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
@@ -9137,18 +9154,18 @@
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.00##}") %>' Style="text-align: right!important" Width="70px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Ed. Médica" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtEdMedica" runat="server" Style="text-align: right!important" Width="70px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtEdMedica" runat="server" Style="text-align: right!important" Width="70px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
@@ -9311,8 +9328,9 @@
|
||||
<asp:GridView ID="GvExist" runat="server" AutoGenerateColumns="true" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Producto">
|
||||
<ItemTemplate >
|
||||
<span style="width:400px; display:flex;"> <asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("Producto") %>'></asp:Literal> </span>
|
||||
<ItemTemplate>
|
||||
<span style="width: 400px; display: flex;">
|
||||
<asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("Producto") %>'></asp:Literal> </span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -9326,63 +9344,63 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="ModalDivMailFactura" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Envio de Correo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpSendMailFactura" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCveVentaFactura" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnFolioVenta" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTipoDocto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSerieFolio" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSubProyecto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Para:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtParaMailFactura" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Envio de Correo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpSendMailFactura" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCveVentaFactura" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnFolioVenta" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTipoDocto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSerieFolio" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSubProyecto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Para:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtParaMailFactura" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCCFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCCFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtBodyFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtBodyFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSendMailFactura" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnSendMailFactura_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSendMailFactura" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnSendMailFactura_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -5275,6 +5275,13 @@ Partial Class Ventas
|
||||
EsNCDevolucionEfectivo = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If Not String.IsNullOrEmpty(DbRowVenta("TipoVenta").ToString()) Then
|
||||
TrTipoVentaEgs.Visible = True
|
||||
LblTipoVentaEGS.Text = DbRowVenta("TipoVenta").ToString()
|
||||
End If
|
||||
End If
|
||||
|
||||
Case "Rem"
|
||||
Trsaldo.Visible = True
|
||||
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
||||
@@ -10210,45 +10217,10 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If PermiteAutorizacion Then
|
||||
|
||||
Dim ImporteAutorizacion As Decimal = 0
|
||||
Dim TipoAutorizacion As Integer = 0
|
||||
|
||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="Importe DESC")
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal()
|
||||
CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If TipoAutorizacion = 1 Then
|
||||
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
|
||||
Dim BloquearCredito As Boolean = True
|
||||
CveAutorizacion = -1
|
||||
|
||||
If BloquearCredito Then
|
||||
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
CveAutorizacion = -1
|
||||
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
||||
VerificaAutorizacionEgs(VerificarImportes:=True)
|
||||
If Me.CveAutorizacion <= 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -10532,6 +10504,50 @@ Partial Class Ventas
|
||||
EmitirImprimirNew(TipoDoctoViejo)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub VerificaAutorizacionEgs(Optional VerificarImportes As Boolean = True)
|
||||
Dim ImporteAutorizacion As Decimal = 0
|
||||
Dim TipoAutorizacion As Integer = 0
|
||||
|
||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="Importe DESC")
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal()
|
||||
CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If TipoAutorizacion = 1 Then
|
||||
If VerificarImportes Then
|
||||
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
|
||||
Dim BloquearCredito As Boolean = True
|
||||
CveAutorizacion = -1
|
||||
|
||||
If BloquearCredito Then
|
||||
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
CveAutorizacion = -1
|
||||
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " NNNNEEEEEEEWWWWWW "
|
||||
@@ -14644,31 +14660,49 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Not factura.EsGarantia Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
CveTipoVentaGuardar = -1
|
||||
|
||||
If NCDescuento Then
|
||||
If ListaNCDescuento IsNot Nothing AndAlso ListaNCDescuento.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BONIFICACION
|
||||
ElseIf ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS
|
||||
If factura.TipoDocto = "Egs" AndAlso Not factura.EsGarantia Then
|
||||
If NCDescuento Then
|
||||
If ListaNCDescuento IsNot Nothing AndAlso ListaNCDescuento.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BU - BONIFICACION DE USADO
|
||||
ElseIf ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CU - CANCELACION DE USADO
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BONIFICACION
|
||||
ElseIf ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS
|
||||
Else
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BU - BONIFICACION DE USADO
|
||||
ElseIf ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CU - CANCELACION DE USADO
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'GA - GARANTIAS Y AJUSTES
|
||||
If factura.TipoDocto = "Egs" AndAlso factura.EsGarantia Then CveTipoVentaGuardar = 11
|
||||
|
||||
'DM - DEVOLUCION DE MERCANCIA
|
||||
If factura.TipoDocto = "Dev" Then CveTipoVentaGuardar = 10
|
||||
|
||||
'SI TIENE TIPO VENTA LA AUTORIZACION TOMAR DE AHI
|
||||
If factura.TipoDocto = "Egs" AndAlso Me.CveAutorizacion > 0 Then
|
||||
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then CveTipoVentaGuardar = ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero()
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
|
||||
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
|
||||
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
|
||||
@@ -31844,6 +31878,18 @@ Partial Class Ventas
|
||||
BtnEmitirImprimir.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Me.CveAutorizacion > 0 Then
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacion(CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If Not String.IsNullOrEmpty(ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")) Then
|
||||
TrTipoVentaEgs.Visible = True
|
||||
TxtObsFact.Text = $"{ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")}"
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al aplicar NC", ex)
|
||||
End Try
|
||||
@@ -36380,10 +36426,19 @@ Partial Class Ventas
|
||||
Select Case RblRNCTipo.SelectedValue
|
||||
Case "1" 'CARGOS
|
||||
NCConcepto = ArrayNC(3).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "CU - CANCELACION DE USADO "
|
||||
End If
|
||||
Case "2" 'BONIFICACIONES
|
||||
NCConcepto = ArrayNC(4).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "BU - BONIFICACION DE USADO"
|
||||
End If
|
||||
Case "3" 'AJUSTE/GARANTIAS
|
||||
NCConcepto = ArrayNC(1).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "GA - GARANTIAS Y AJUSTES"
|
||||
End If
|
||||
End Select
|
||||
|
||||
'CARGOS/AJUSTES POR GARANTIA POR PRODUCTO
|
||||
@@ -36455,6 +36510,7 @@ Partial Class Ventas
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'CARGOS/AJUSTES POR GARANTIA POR TOTAL
|
||||
ElseIf RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso Not ChkMostarProductosRNC.Checked Then
|
||||
|
||||
@@ -36574,6 +36630,7 @@ Partial Class Ventas
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'BONIFICACIONES POR TOTAL
|
||||
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso Not ChkMostarProductosRNCBon.Checked Then
|
||||
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
|
||||
@@ -38385,6 +38442,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
TxtImporteSolicitud.Text = ""
|
||||
DdlSolCreditoTipoDocto_SelectedIndexChanged(Nothing, EventArgs.Empty)
|
||||
RegistraScript("$('#DivModalSolicitarCredito').modal('show')")
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
@@ -38427,9 +38485,18 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Dim Motivo As String = TxtMotivoAutorizacion.Text
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DdlTipoVentaSolCredito.SelectedValue.ToEntero() > 0 Then
|
||||
CveTipoVenta = DdlTipoVentaSolCredito.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
If CveTipoVenta <= 0 AndAlso TipoDocto = "Egs" Then
|
||||
Alert("Debe seleccionar un tipo de venta", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjPS As New ClsVentas
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo, CveTipoVenta:=CveTipoVenta) Then
|
||||
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
'signal
|
||||
@@ -38460,10 +38527,16 @@ Partial Class Ventas
|
||||
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
End If
|
||||
DivTipoVentaSol.Visible = False
|
||||
Case "Egs"
|
||||
'QUITAR LA DE VENCIMIENTO
|
||||
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
|
||||
DivTipoVentaSol.Visible = True
|
||||
DdlTipoVentaSolCredito.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' AND CveTipoVenta NOT IN (7,9,10,11) ")
|
||||
DdlTipoVentaSolCredito.DataBind()
|
||||
DdlTipoVentaSolCredito.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Select
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
@@ -40482,7 +40555,7 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub LBNotaCredito_Click(sender As Object, e As EventArgs)
|
||||
CargaDdlNCPS()
|
||||
|
||||
DivTipoVentaAsingado.Visible = False
|
||||
If CveVenta <= 0 Then 'cuando es nueva la factura
|
||||
DivGvCxC.Visible = True
|
||||
CargaCxC()
|
||||
@@ -40490,6 +40563,24 @@ Partial Class Ventas
|
||||
UpAplicarNC.Update()
|
||||
'CARGAR RNC
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
VerificaAutorizacionEgs(VerificarImportes:=True)
|
||||
If Me.CveAutorizacion <= 0 Then
|
||||
Exit Sub
|
||||
Else
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then
|
||||
DivTipoVentaAsingado.Visible = True
|
||||
LblTipoVentaAsignado.Text = ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")
|
||||
DdlNCPS.Enabled = True
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
End If
|
||||
|
||||
RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC")
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user