Compras RNC Multiseleccion

This commit is contained in:
rakcsle
2024-07-19 11:18:45 -07:00
parent 862040a16f
commit 76ba3cceee
4 changed files with 104 additions and 74 deletions

View File

@@ -1630,7 +1630,7 @@ Public Class ClsCompras
#Region "N O T A S - C R E D I T O" #Region "N O T A S - C R E D I T O"
Public Function GetNotasCreditoRep(CveProveedor As Integer, Opcion As Integer, FechaI As String, FechaF As String, CveEmpresa As Integer, Optional TipoReporte As Integer = 1) As Boolean Public Function GetNotasCreditoRep(CveProveedor As Integer, Opcion As Integer, FechaI As String, FechaF As String, CveEmpresa As Integer, Optional TipoReporte As Integer = 1, Optional CveComprasAmortizadas As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -1643,6 +1643,8 @@ Public Class ClsCompras
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF .Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte
.Add("@CveComprasAmortizadas", SqlDbType.VarChar).Value = CveComprasAmortizadas
End With End With

View File

@@ -540,15 +540,15 @@
</div> </div>
</div> </div>
<div class="form-group proveedoreespes" runat="server" id="DvDdlRemisionNotaCredito" visible="false" > <%--<div class="form-group proveedoreespes" runat="server" id="DvDdlRemisionNotaCredito" visible="false" >
<span class="whitoutcol proveedoreespes">Remisión Nota de Crédito</span> <span class="whitoutcol proveedoreespes">Remisión Nota de Crédito</span>
<div class="whitoutcol whitoutcol"> <div class="whitoutcol whitoutcol">
<asp:DropDownList ID="DdlRemisionNotaCredito" runat="server" DataTextField="SerieFolio" DataValueField="CveCompra" CssClass="form-control input-sm input-small select2me" AutoPostBack="true" > <asp:DropDownList ID="DdlRemisionNotaCredito" runat="server" DataTextField="SerieFolio" DataValueField="CveCompra" CssClass="form-control input-sm input-small select2me" AutoPostBack="true" >
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<%--<asp:Button ID="Button3" runat="server" Text="Resta" CssClass="default" OnClick="BtnFolioGarantiaRestantes_Click" />--%>
</div> </div>
</div>
</div>--%>
@@ -957,43 +957,46 @@
<asp:UpdatePanel ID="UpGVRemisionesNotaDeCredito" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpGVRemisionesNotaDeCredito" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div style="width:381px!important">
<asp:GridView ID="GVRemisionesNotaDeCredito" runat="server" CssClass="table table-striped table-hover ScrollAD" Width="380px" AutoGenerateColumns="False" Visible="false"
DataKeyNames="Tipo,CveCompra,Fecha,TipoDocto,SerieFolio,CveIE,Original,Abonado,Saldo,CveProveedor,RazonSocial,Descripcion,CveMoneda,Moneda,Abreviatura,Referencia,CvePersonal,TipoCambio,CveSubProyecto,CveTipoConcepto" ClientIDMode="Static" EmptyDataText="" data-height="200"
GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="40px">
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="80px">
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="60px">
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:GridView ID="GVRemisionesNotaDeCredito" runat="server" CssClass="table table-striped table-hover ScrollAD" Width="100%" AutoGenerateColumns="False" Visible="false"
DataKeyNames="Tipo,CveCompra,Fecha,TipoDocto,SerieFolio,CveIE,Original,Abonado,Saldo,CveProveedor,RazonSocial,Descripcion,CveMoneda,Moneda,Abreviatura,Referencia,CvePersonal,TipoCambio,CveSubProyecto,CveTipoConcepto" ClientIDMode="Static" EmptyDataText="" data-height="200"
GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="80px" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Mon</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -12,6 +12,7 @@ Imports Extensiones
Imports MoreLinq Imports MoreLinq
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports ClsPaginas Imports ClsPaginas
Imports System.Activities.Expressions
Partial Class Compras_Compras Partial Class Compras_Compras
Inherits ClsPaginas Inherits ClsPaginas
@@ -1225,6 +1226,17 @@ Partial Class Compras_Compras
#End Region #End Region
'Public Property ListaFacturasRealcionadasRNC As List(Of String)
' Get
' If ViewState("ListaFacturasRealcionadasRNC") Is Nothing Then
' ViewState("ListaFacturasRealcionadasRNC") = New List(Of String)
' End If
' Return DirectCast(ViewState("ListaFacturasRealcionadasRNC"), List(Of String))
' End Get
' Set(value As List(Of String))
' ViewState("ListaFacturasRealcionadasRNC") = value
' End Set
'End Property
@@ -1648,8 +1660,8 @@ Partial Class Compras_Compras
End If End If
'SE OCUPAN AFUERA DEL POSTBACK ?? 'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios() cargaddlVinculacionServcios()
If UsuarioActual.TienePermisoProceso(117) Then If UsuarioActual.TienePermisoProceso(117) Then
HplAddClasificacion.Visible = False HplAddClasificacion.Visible = False
@@ -1686,28 +1698,28 @@ Partial Class Compras_Compras
DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing) DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing)
For Each gvRow As GridViewRow In GvFacturaNC.Rows 'For Each gvRow As GridViewRow In GvFacturaNC.Rows
If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then ' If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio")) ' Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio"))
Dim seleccion As String = "" ' Dim seleccion As String = ""
For Each item As ListItem In DdlRemisionNotaCredito.Items ' For Each item As ListItem In DdlRemisionNotaCredito.Items
Dim serieFolioItem As String = ObtenerUltimaParte(item.Text) ' Dim serieFolioItem As String = ObtenerUltimaParte(item.Text)
If SerieFolioFacura = serieFolioItem Then ' If SerieFolioFacura = serieFolioItem Then
'seleccion = item.Value ' 'seleccion = item.Value
AutoSelRNC = True ' AutoSelRNC = True
DdlRemisionNotaCredito.SelectedValueExist(item.Value) ' DdlRemisionNotaCredito.SelectedValueExist(item.Value)
Exit For ' Exit For
End If ' End If
Next ' Next
If AutoSelRNC Then ' If AutoSelRNC Then
Exit For ' Exit For
End If ' End If
End If ' End If
Next 'Next
If AutoSelRNC Then If AutoSelRNC Then
'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing) 'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing)
@@ -19747,11 +19759,10 @@ Partial Class Compras_Compras
If DdlTipoComprobante.SelectedValue = "NC" Then If DdlTipoComprobante.SelectedValue = "NC" Then
CargaGVRemisionNotaCredito() CargaGVRemisionNotaCredito()
'bloquear la vinculación a la compra
HLAplicaNCFact.Visible = False HLAplicaNCFact.Visible = False
Else Else
Alert("Para elegir Remisión de Nota de Crédito el tipo de documento debe de ser Nota de Crédito.", TipoMensaje.MsgAdvertencia) Alert("Para elegir Remisión de Nota de Crédito el tipo de documento debe de ser Nota de Crédito.", TipoMensaje.MsgAdvertencia)
DdlRemisionNotaCredito.SelectedValueExist(-1) 'DdlRemisionNotaCredito.SelectedValueExist(-1)
DdlTipoCompra.SelectedValueExist(-1) DdlTipoCompra.SelectedValueExist(-1)
End If End If
End If End If
@@ -20414,6 +20425,7 @@ Partial Class Compras_Compras
End Function End Function
Private Sub NCSeleccionFacturasRelacionadas(UUIDSListRelacionados As List(Of String)) Private Sub NCSeleccionFacturasRelacionadas(UUIDSListRelacionados As List(Of String))
'ListaFacturasRealcionadasRNC.Clear()
If UUIDSListRelacionados.Count > 0 Then If UUIDSListRelacionados.Count > 0 Then
Dim SaldoNota As Decimal = TxtTotal.Text.ToDecimal Dim SaldoNota As Decimal = TxtTotal.Text.ToDecimal
@@ -20449,17 +20461,20 @@ Partial Class Compras_Compras
SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura
GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
Else Else
If SaldoFactura >= SaldoNotaPorAplicar Then If SaldoFactura >= SaldoNotaPorAplicar Then
GvRow.FCTextBox("TxtImporte").Text = SaldoNotaPorAplicar.FormatoNumero GvRow.FCTextBox("TxtImporte").Text = SaldoNotaPorAplicar.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
SaldoNotaPorAplicar = 0 SaldoNotaPorAplicar = 0
TeminarAmortizacion = True TeminarAmortizacion = True
Else Else
GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura
TeminarAmortizacion = True TeminarAmortizacion = True
@@ -21168,13 +21183,23 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub CargaGVRemisionNotaCredito() Private Sub CargaGVRemisionNotaCredito()
DvDdlRemisionNotaCredito.Visible = True 'DvDdlRemisionNotaCredito.Visible = True
DTRemisionesNotaDeCredito = New DataTable DTRemisionesNotaDeCredito = New DataTable
GVRemisionesNotaDeCredito.DataSource = Nothing GVRemisionesNotaDeCredito.DataSource = Nothing
GVRemisionesNotaDeCredito.Visible = False GVRemisionesNotaDeCredito.Visible = False
Dim CveComprasAmortizadas As New List(Of String)
For Each gvRow As GridViewRow In GvFacturaNC.Rows
If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
CveComprasAmortizadas.Add(gvRow.DataKey("CveCompra"))
gvRow.FCCheckBox("ChkFacturaNC").Checked = False
End If
Next
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2) Then If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2, String.Join(",", CveComprasAmortizadas)) Then
'DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados 'DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
DTRemisionesNotaDeCredito = ObjCompras.DtResultados DTRemisionesNotaDeCredito = ObjCompras.DtResultados
GVRemisionesNotaDeCredito.DataSource = DTRemisionesNotaDeCredito GVRemisionesNotaDeCredito.DataSource = DTRemisionesNotaDeCredito

View File

@@ -1754,7 +1754,7 @@
<TextRun> <TextRun>
<Value xml:space="preserve"> </Value> <Value xml:space="preserve"> </Value>
<Style> <Style>
<FontFamily>Myriad Pro Light</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize> <FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight> <FontWeight>SemiBold</FontWeight>
</Style> </Style>
@@ -1762,7 +1762,7 @@
<TextRun> <TextRun>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value> <Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Style> <Style>
<FontFamily>Myriad Pro Light</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize> <FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight> <FontWeight>SemiBold</FontWeight>
</Style> </Style>
@@ -1770,7 +1770,7 @@
<TextRun> <TextRun>
<Value xml:space="preserve"> </Value> <Value xml:space="preserve"> </Value>
<Style> <Style>
<FontFamily>Myriad Pro Light</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize> <FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight> <FontWeight>SemiBold</FontWeight>
</Style> </Style>
@@ -1785,8 +1785,8 @@
<TextRun> <TextRun>
<Value>=Parameters!SubProyectoEntregaDir.Value</Value> <Value>=Parameters!SubProyectoEntregaDir.Value</Value>
<Style> <Style>
<FontFamily>Myriad Pro Light</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
@@ -1867,7 +1867,7 @@
<Value>=Parameters!RFC.Value</Value> <Value>=Parameters!RFC.Value</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
@@ -1884,7 +1884,7 @@
"(" &amp; Mid(Parameters!Telefono.Value, 1, 3) &amp; ") " &amp; Mid(Parameters!Telefono.Value, 4))</Value> "(" &amp; Mid(Parameters!Telefono.Value, 1, 3) &amp; ") " &amp; Mid(Parameters!Telefono.Value, 4))</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
@@ -1899,7 +1899,7 @@
<Value>USO CFDI: </Value> <Value>USO CFDI: </Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
@@ -1907,7 +1907,7 @@
<Value>=Parameters!UsoCFDI.Value</Value> <Value>=Parameters!UsoCFDI.Value</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>