This commit is contained in:
rrene
2020-02-28 13:48:48 -07:00
25 changed files with 834 additions and 156 deletions

View File

@@ -166,32 +166,32 @@
<Columns>
<asp:TemplateField HeaderText="Titulo">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("ConceptoContable")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("ConceptoContable")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}&TipoAmortizacion={4}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"), IIf(Eval("CveEmpresa").ToString() = "72", Eval("TipoAmortizacion"), "-1"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Importe", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("Importe", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descuento" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Descuento", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("Descuento", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amortización" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Amortizacion", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("Amortizacion", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IVA", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("IVA", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("IEPS", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
<asp:HyperLink runat="server" Text='<%# Eval("IEPS", "${0:N2}")%>' NavigateUrl='<%# String.Format("/Ventas/RepIngresosDetalle.aspx?CveConceptoContable={0}&CveCuenta={1}&RsFechaI={2}&RsFechaF={3}", Eval("CveConceptoContable"), Eval("CveCuenta"), Eval("FechaInicio", "{0:yyyy/MM/dd}"), Eval("FechaFin", "{0:yyyy/MM/dd}"))%>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto Local" ItemStyle-HorizontalAlign="Right">

View File

@@ -60,7 +60,7 @@ Partial Class Ventas_RepIngresos
Set
ViewState("CveSubProyecto") = Value
End Set
End Property
End Property
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
@@ -69,9 +69,9 @@ Partial Class Ventas_RepIngresos
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CveSubProyecto = -1

View File

@@ -54,9 +54,20 @@ Partial Class Ventas_RepIngresosDetalle
Set
ViewState("CveCuenta") = Value
End Set
End Property
End Property
Private Property TipoAmortizacion() As Integer
Get
Return If(IsNothing(ViewState("TipoAmortizacion")), -1, ViewState("TipoAmortizacion").ToString().ToEntero())
End Get
Set
ViewState("TipoAmortizacion") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
@@ -67,18 +78,20 @@ Partial Class Ventas_RepIngresosDetalle
CveCuenta = If(IsNothing(Request("CveCuenta")), "", Request("CveCuenta").ToString())
CveSubProyecto = If(IsNothing(Request("CveSubProyecto")), 0, Request("CveSubProyecto").ToString().ToEntero())
CveConceptoContable = If(IsNothing(Request("CveConceptoContable")), -1, Request("CveConceptoContable").ToString().ToEntero())
TipoAmortizacion = If(IsNothing(Request("TipoAmortizacion")), -1, Request("TipoAmortizacion").ToString().ToEntero())
TxtFechaInicio.Text = If(RsFechaI.Length > 6, DateTime.ParseExact(RsFechaI, "yyyy/MM/dd", Nothing).ToString("dd/MM/yyyy"), "")
TxtFechaFin.Text = If(RsFechaF.Length > 6, DateTime.ParseExact(RsFechaF, "yyyy/MM/dd", Nothing).ToString("dd/MM/yyyy"), "")
DdlTipoDocto.SelectedValueExist(TipoDoc)
DdlSubProyecto.SelectedValueExist(CveSubProyecto.ToString())
'
CargaRepIngresosDetalle()
LnkFiltrar_Click(LnkFiltrar, EventArgs.Empty)
End If
End Sub
Protected Sub CargaRepIngresosDetalle()
Dim ObjRepI As New ClsVentas()
ObjRepI.RepIngresosDetalle(UsuarioActual.CveEmpresa, If(RsFechaI = "", MinFecha, RsFechaI.ToDate), If(RsFechaF = "", MaxFecha, RsFechaF.ToDate), TipoDoc, CveSubProyecto, CveConceptoContable, CveCuenta)
GVRepIngresos.DataSource = ObjRepI.DtResultados
If ObjRepI.RepIngresosDetalle(UsuarioActual.CveEmpresa, If(RsFechaI = "", MinFecha, RsFechaI.ToDate), If(RsFechaF = "", MaxFecha, RsFechaF.ToDate), TipoDoc, CveSubProyecto, CveConceptoContable, CveCuenta, TipoAmortizacion) Then
GVRepIngresos.DataSource = ObjRepI.DtResultados
End If
ObjRepI.Dispose()
GVRepIngresos.DataBind()
upDatosRepI.Update()
@@ -94,7 +107,7 @@ Partial Class Ventas_RepIngresosDetalle
End Sub
Protected Sub GVRepIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("GTipoDocto").ToString().ToEntero() = -1 Then
If e.Row.DBCampo("GTipoDocto").ToString().ToEntero() = -1 OrElse e.Row.DBCampo("SerieFolio").ToString() = "TOTAL" Then
e.Row.CssClass = "Totales"
End If
End If

View File

@@ -308,6 +308,9 @@
<%--<asp:LinkButton ID="LnkSaldarVenta" runat="server" CausesValidation="False" Text="<i class='fa fa-ban'></i> Saldar" data-toggle="confirmation" data-popout="true" data-original-title="¿Estás seguro que deseas saldar el Documento?" data-btn-ok-label="si" Visible="false" />--%>
<asp:HyperLink ID="HLSaldarVenta" NavigateUrl="#" Visible="false" data-toggle="modal" data-target="#ModalSaldarVenta" runat="server"><i class='fa fa-ban'></i> Saldar</asp:HyperLink>
</li>
<li id="LtGenerarOC" runat="server" visible="false">
<asp:LinkButton ID="LnkGenerarOC" OnClick="LnkGenerarOC_Click" title="Generar Orden de Compra!" runat="server"><i class="fa fa-tags"></i> Generar Orden de Compra</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UPPDescontabilizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -3541,7 +3544,7 @@
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago, CveMoneda,Fecha,SaldoSubTotal">
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal">
<Columns>
<asp:TemplateField>
<ItemTemplate>

View File

@@ -3543,6 +3543,7 @@ Partial Class Ventas
' LbCancelarDocumentoManual.Visible = True
'End If
If Not CveEstatus.Contiene(4, 5, 12, 13, 20) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -4362,6 +4363,19 @@ Partial Class Ventas
CargaCodigoUnico()
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
UpPS.Update()
UpContado.Update()
UpEstatus.Update()
@@ -11670,7 +11684,7 @@ Partial Class Ventas
If e.Row.DBCampo("Tipo").ToString = "NC" And e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then
If e.Row.DBCampo("CveMoneda").ToString.ToEntero = 2 Then
tipoCambio = e.Row.DataKey("TipoCambio").ToString.ToDecimal
tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString.ToDecimal
Else
tipoCambio = GlobalTipoCambio(e.Row.DataKey("Fecha").ToString.ToDate).ToDecimal
End If
@@ -11704,7 +11718,7 @@ Partial Class Ventas
maxsaldo = total
End If
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(4)
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2)
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo))
e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo))
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("CambioTipoMoneda({0},{1},{2},{3},{4});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, e.Row.DataKey("Saldo"), e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).ClientID, e.Row.DataKey("CveMoneda")))
@@ -11875,7 +11889,7 @@ Partial Class Ventas
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
tipoCambioPago = gvr.DataKey("TipoCambio").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioVenta = 1
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
@@ -14688,6 +14702,8 @@ Partial Class Ventas
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
TmpDT.Columns("EsOutSourcing").DefaultValue = False
End Sub
Private Sub CreaDTmpC()
DTmpC = New DataTable
@@ -24659,4 +24675,7 @@ Partial Class Ventas
' Return File
'End Function
Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs)
Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC")
End Sub
End Class