merge -- Ventas

This commit is contained in:
2022-01-26 12:17:41 -07:00
31 changed files with 692 additions and 462 deletions

View File

@@ -1,5 +1,4 @@

Imports Extensiones
Imports Extensiones
Partial Class Ventas_CatAutorizacionLimites
Inherits ClsPaginas
@@ -70,7 +69,7 @@ Partial Class Ventas_CatAutorizacionLimites
If DdlClienteFiltro.SelectedValue.ToEntero() <= 0 Then
CveCliente = -1
Else
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
End If
Dim FechaI, FechaF As Date

View File

@@ -4359,6 +4359,11 @@ Partial Class PV
End If
End If
''condicion final, si es cambio de Vigencia, no aplica descuento
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20637) Then
Descuento = 0
End If
ObjDescuento.ImporteDescuento = Descuento
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then

View File

@@ -319,6 +319,16 @@
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
Garantía?:
</div>
<div class="col-md-2" id="divgarantia2" runat="server" visible="false">
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:Dropdownlist>
</div>
<label class="col-md-1 truncate">Lectura administrativa:</label>
<div class="col-md-2">
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />

View File

@@ -6,10 +6,10 @@ Imports Microsoft.Reporting.WebForms
Imports System.Data
Partial Class Ventas_RepProductosServicios
Inherits ClsPaginas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtVentas As DataTable
Get
Return DirectCast(ViewState("DtVentas"), DataTable)
@@ -52,27 +52,30 @@ Partial Class Ventas_RepProductosServicios
Set(value As Integer)
ViewState("TipoCambio") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
CargarMarcas()
SetValues()
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then
LblLitraje.Visible = True
DvLitraje.Visible = True
End If
SetValues()
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then
LblLitraje.Visible = True
DvLitraje.Visible = True
'garantia
divgarantia1.Visible = True
divgarantia2.Visible = True
End If
End If
End Sub
End Sub
#Region " CARGA DATOS INICIALES "
Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
DdlGrupo.Items.Insert(1, New ListItem("Clasificación", "4"))
@@ -241,18 +244,19 @@ Partial Class Ventas_RepProductosServicios
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
End If
If UsuarioActual.CveVendedor > 0 AndAlso Not UsuarioActual.TienePermisoProceso(263) Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
DdlVendedor.Attributes.Add("disabled", "disabled")
DdlVendedor.Enabled = False
End If
End Sub
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
@@ -279,8 +283,8 @@ Partial Class Ventas_RepProductosServicios
DdlPS.SelectedValue.ToEntero, FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente,
DdlSubProyectoEjecucion.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, "-1",
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante,
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveProveedorCompra:=CveProveedorCompra,
CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, MostrarLitraje:=ChkLitraje.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable) Then
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveProveedorCompra:=CveProveedorCompra,
CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, MostrarLitraje:=ChkLitraje.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, EsGarantia:=DdlGarantia.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtVentas = ObjVentas.DtResultados
Else
@@ -302,55 +306,55 @@ Partial Class Ventas_RepProductosServicios
DivMarca.Visible = True
LblMarca.Visible = True
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataBind()
End If
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataBind()
End If
End Using
End If
DdlMarcaPSDes.Items.Insert(0, New ListItem(" Todos ", "-1"))
End Sub
End Sub
#End Region
#Region " GV DATOS - PERSONALIZAR "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Css As String = "Texto"
Dim CveClasificacionDetalle As String = "-1"
Dim cveMarca As String = DdlMarcaPSDes.SelectedValue
If DdlGrupo.SelectedValue.ToEntero = 22 Then
Dim tipo As Integer = If(e.Row.DBCampo("CveClasificacionDetalle").ToEntero() > 0, 4, If(e.Row.DBCampo("CveMarca").ToEntero() > 0, 3, If(e.Row.DBCampo("CveClasificacion").ToEntero() > 0, 2, 1)))
Select Case tipo
Case 4
CveClasificacionDetalle = e.Row.DBCampo("CveClasificacionDetalle").ToString() ' String.Format("{0}&CveClasificacionDetalle={1}&CveMarca={2}", squery, e.Row.DBCampo("CveClasificacionDetalle").ToEntero(), e.Row.DBCampo("CveMarca").ToEntero())
cveMarca = e.Row.DBCampo("CveMarca").ToString()
Case 3
'squery = String.Format("{0}&CveMarca{1}", squery, e.Row.DBCampo("CveMarca").ToEntero())
cveMarca = e.Row.DBCampo("CveMarca").ToString()
e.Row.CssClass = "SubTotalesB"
Case 2
e.Row.CssClass = "SubTotales"
Case 1
e.Row.CssClass = "Totales"
End Select
Else
If e.Row.DBCampo("Orden") = "" Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).Width = Unit.Pixel(60)
e.Row.Cells(2).Width = Unit.Pixel(90)
e.Row.Cells(3).Width = Unit.Pixel(90)
e.Row.Cells(5).Width = Unit.Pixel(80)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.CssClass = "Totales"
Css = "Totales"
ElseIf DdlGrupo.SelectedValue.Contiene("20", "21") And Not e.Row.DBCampo("CvePS").ToEntero > 0 Then
e.Row.CssClass = "SubTotales"
End If
If DdlGrupo.SelectedValue.ToEntero = 22 Then
Dim tipo As Integer = If(e.Row.DBCampo("CveClasificacionDetalle").ToEntero() > 0, 4, If(e.Row.DBCampo("CveMarca").ToEntero() > 0, 3, If(e.Row.DBCampo("CveClasificacion").ToEntero() > 0, 2, 1)))
Select Case tipo
Case 4
CveClasificacionDetalle = e.Row.DBCampo("CveClasificacionDetalle").ToString() ' String.Format("{0}&CveClasificacionDetalle={1}&CveMarca={2}", squery, e.Row.DBCampo("CveClasificacionDetalle").ToEntero(), e.Row.DBCampo("CveMarca").ToEntero())
cveMarca = e.Row.DBCampo("CveMarca").ToString()
Case 3
'squery = String.Format("{0}&CveMarca{1}", squery, e.Row.DBCampo("CveMarca").ToEntero())
cveMarca = e.Row.DBCampo("CveMarca").ToString()
e.Row.CssClass = "SubTotalesB"
Case 2
e.Row.CssClass = "SubTotales"
Case 1
e.Row.CssClass = "Totales"
End Select
Else
If e.Row.DBCampo("Orden") = "" Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).Width = Unit.Pixel(60)
e.Row.Cells(2).Width = Unit.Pixel(90)
e.Row.Cells(3).Width = Unit.Pixel(90)
e.Row.Cells(5).Width = Unit.Pixel(80)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.CssClass = "Totales"
Css = "Totales"
ElseIf DdlGrupo.SelectedValue.Contiene("20", "21") And Not e.Row.DBCampo("CvePS").ToEntero > 0 Then
e.Row.CssClass = "SubTotales"
End If
End If
' PARA LIGA
@@ -413,10 +417,10 @@ Partial Class Ventas_RepProductosServicios
End If
UPDatos.Update()
End Sub
End Sub
#End Region
#Region " SELECTED INDEX CHANGED"
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaClientes()
@@ -468,8 +472,8 @@ Partial Class Ventas_RepProductosServicios
If DdlTipoComprobante.SelectedValue <> "-1" Then
DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(String.Format("TipoDocto = '{0}'", DdlTipoComprobante.SelectedValue))
Else
DdlEstatus.DataSource = GlobalDTEstatusFactura
DdlEstatus.DataSource = GlobalDTEstatusFactura
End If
DdlEstatus.Items.Add(New ListItem("Todos", "-1"))
DdlEstatus.DataBind()
@@ -487,10 +491,10 @@ Partial Class Ventas_RepProductosServicios
LiEspecifico.Visible = False
End If
UpBodyTipoCambio.Update()
End Sub
End Sub
#End Region
#Region " IMPRIMIR "
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
If GvDatos.Rows.Count > 0 Then
@@ -507,21 +511,21 @@ Partial Class Ventas_RepProductosServicios
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.ToDate, MinFecha)
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.ToDate, MaxFecha)
Dim Cliente = If(DdlClientes.SelectedText = "", "", $"&emsp;<b>Cliente:</b>&nbsp;{DdlClientes.SelectedText}")
Dim Proveedor = If(DdlProveedor.SelectedValue = "", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedor.SelectedText}")
Dim FechaInicio = If(txtFechaI.Text = "", "", $"&emsp;<b>Fecha Inicio:</b>&nbsp;{txtFechaI.Text}")
Dim FechaFin = If(txtFechaF.Text = "", "", $"&emsp;<b>Fecha Fin:</b>&nbsp;{txtFechaF.Text}")
Dim Grupo = If(DdlGrupo.SelectedValue = "-1", "", $"&emsp;<b>Agrupado por:</b>&nbsp;{DdlGrupo.SelectedItem.Text}")
Dim Categoria = If(DdlCategoria.SelectedValue = "-1", "", $"&emsp;<b>Categoria:</b>&nbsp;{DdlCategoria.SelectedItem.Text }")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlClasificacion.SelectedItem.Text}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b>&nbsp;{DdlPS.SelectedText}")
Dim Proyecto = If(DdlSubProyecto.SelectedValue = "-1", "", $"&emsp;<b>Proyecto:</b>&nbsp;{DdlSubProyecto.SelectedItem.Text}")
Dim Estatus = If(DdlEstatus.SelectedValue = "-1", "", $"&emsp;<b>Estatus:</b>&nbsp;{DdlEstatus.SelectedItem.Text}")
Dim Usuario = If(DdlUsuario.SelectedValue = "-1", "", $"&emsp;<b>Usuario:</b>&nbsp;{DdlUsuario.SelectedItem.Text}")
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.ToDate, MaxFecha)
Dim Cliente = If(DdlClientes.SelectedText = "", "", $"&emsp;<b>Cliente:</b>&nbsp;{DdlClientes.SelectedText}")
Dim Proveedor = If(DdlProveedor.SelectedValue = "", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedor.SelectedText}")
Dim FechaInicio = If(txtFechaI.Text = "", "", $"&emsp;<b>Fecha Inicio:</b>&nbsp;{txtFechaI.Text}")
Dim FechaFin = If(txtFechaF.Text = "", "", $"&emsp;<b>Fecha Fin:</b>&nbsp;{txtFechaF.Text}")
Dim Grupo = If(DdlGrupo.SelectedValue = "-1", "", $"&emsp;<b>Agrupado por:</b>&nbsp;{DdlGrupo.SelectedItem.Text}")
Dim Categoria = If(DdlCategoria.SelectedValue = "-1", "", $"&emsp;<b>Categoria:</b>&nbsp;{DdlCategoria.SelectedItem.Text }")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlClasificacion.SelectedItem.Text}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b>&nbsp;{DdlPS.SelectedText}")
Dim Proyecto = If(DdlSubProyecto.SelectedValue = "-1", "", $"&emsp;<b>Proyecto:</b>&nbsp;{DdlSubProyecto.SelectedItem.Text}")
Dim Estatus = If(DdlEstatus.SelectedValue = "-1", "", $"&emsp;<b>Estatus:</b>&nbsp;{DdlEstatus.SelectedItem.Text}")
Dim Usuario = If(DdlUsuario.SelectedValue = "-1", "", $"&emsp;<b>Usuario:</b>&nbsp;{DdlUsuario.SelectedItem.Text}")
If DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 Then
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -531,7 +535,7 @@ Partial Class Ventas_RepProductosServicios
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text <> "", FechaF.ToShortDateString, "")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", $"{Grupo}{Cliente}{FechaInicio}{FechaFin}{Categoria}{Clasificacion}{PS}{Proyecto}{Estatus}{Usuario}{Proveedor}"))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
@@ -543,12 +547,12 @@ Partial Class Ventas_RepProductosServicios
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Sub
#End Region
#Region "GRAFICA"
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
If Not DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 Then
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
@@ -678,9 +682,9 @@ Partial Class Ventas_RepProductosServicios
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
CambioGrafica()
End Sub
End Sub
#End Region
End Class

View File

@@ -179,7 +179,7 @@
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
</div>
<div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
Garantía:
Garantía?:
</div>
<div class="col-md-2" id="divgarantia2" runat="server" visible="false">
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">

View File

@@ -6504,17 +6504,20 @@
<asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-4">
<div class="col-md-3">
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
</div>
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false" >
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div>
</div>
<div class="row form-group">
<div class="col-md-2">
Observaciones:
</div>
<div class="col-md-10">
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="3" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="2" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
</div>
</div>
<div class="row form-group">
@@ -6565,22 +6568,12 @@
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div id="DivBtnRemNC" runat="server" visible="false" class="row form-group">
<div class="col-md-2">
</div>
<div class="col-md-4">
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div>
<div class="col-md-6">
</div>
</div>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
</div>
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right">
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row" id="DivGvCxC" style="max-height: 10px" runat="server" visible="false">
<br />
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">

View File

@@ -2469,6 +2469,25 @@ Partial Class Ventas
HlFacturasRelaciondas.Visible = True
End If
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
DdlMoneda.SelectedValueExist(2)
Using ObjVentas As New ClsNominas
If ObjVentas.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, "", Request("CveEmbarqueManifiesto").ToEntero()) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
'IEPS A NIVEL DETALLE
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
End If
End Using
End If
'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
@@ -6628,7 +6647,7 @@ Partial Class Ventas
'RMF. validacion temporal
'verifica si tiene autorizaciones de Nota de crédito autorizadas
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, CveEstatus:=1) Then
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion")
If RowAutorizacion IsNot Nothing Then
DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos")
@@ -7971,7 +7990,7 @@ Partial Class Ventas
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
Dim ObjVentas As New ClsVentas
Try
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, CveEstatus:=1) Then
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, DdlTipoDocto.SelectedValue, CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
@@ -26965,15 +26984,47 @@ Partial Class Ventas
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
Dim Verificacion As Boolean = False
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
Verificacion = True
Else
If UsuarioActual.TienePermisoProceso(175) Then ' si es una nc, que se va a generar directa, el permiso de generar NC directas
Verificacion = True
Else
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
'verificar autorizaciones
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Egs", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL ", Orderby:="TipoAutorizacion")
If RowAutorizacion IsNot Nothing Then
Verificacion = True
End If
End If
ObjVentas.Dispose()
' si es una nc, que se va a generar directa, debe de revisar que tenga una autorización, o el permiso de generar NC directas
End If
End If
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
If Verificacion Then
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
Else
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
End If
Else
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
End If
Else
AplicarNotaCreditoDesdeVenta()
' si viene de remisiones, puede seguir adelante
If Verificacion Then
AplicarNotaCreditoDesdeVenta()
Else
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
End If
End If
Else
AplicarNotaCreditoDesdeVenta()
@@ -31593,6 +31644,7 @@ Partial Class Ventas
End If
ListaRemisionesNC.Add(RemNC)
BtnAplicarNC.Enabled = True
If TerminarCiclo Then
Exit For
@@ -31636,6 +31688,10 @@ Partial Class Ventas
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
'TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
If ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
BtnAplicarNC.Enabled = True
End If
UpModalRemisionesNC.Update()
UpAplicarNC.Update()