This commit is contained in:
2024-07-20 07:24:26 -07:00
20 changed files with 663 additions and 173 deletions

View File

@@ -48,6 +48,8 @@ Public Class CalendarEvent
Public Property CveVenta As Integer
Public Property SerieFolioVenta As String
Public Property CveActivoFijo As Integer
Public Property CveTipoAF As Integer
Public Property AFCodigo As String
Public Property CveMovimiento As Integer
Public Property MovimientoFolio As String

View File

@@ -1630,7 +1630,7 @@ Public Class ClsCompras
#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
@@ -1643,6 +1643,8 @@ Public Class ClsCompras
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte
.Add("@CveComprasAmortizadas", SqlDbType.VarChar).Value = CveComprasAmortizadas
End With
@@ -1776,6 +1778,39 @@ Public Class ClsCompras
End Function
Public Function AddBitacoraFactura(ByVal Serie As String, ByVal Folio As String, ByVal RFCDe As String, ByVal Observacion As String, ByVal Estatus As Integer, ByVal CveUsuario As Integer, ByVal CveEmpresa As Integer, ByVal Correo As String, ByVal Proveedor As String, ByVal Importe As Decimal, ByVal TipoDeComprobante As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_FacturasBitacoraAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Folio", SqlDbType.VarChar).Value = Folio
.Add("@RFCDE", SqlDbType.VarChar).Value = If(RFCDe Is Nothing, "", RFCDe)
.Add("@Observacion", SqlDbType.VarChar).Value = Observacion
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Correo", SqlDbType.VarChar).Value = Correo
.Add("@Proveedor", SqlDbType.VarChar).Value = Proveedor
.Add("@Importe", SqlDbType.Decimal).Value = Importe
.Add("@TipoDeComprobante", SqlDbType.VarChar).Value = TipoDeComprobante
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al intentar Guardar la bitácora.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
'Public Function AddFactura(Serie As String, Folio As String, FechaFactura As DateTime, NombreProveedor As String, RFCDe As String, SubTotal As Double,
'IVA As Double, Total As Double, UUID As String, RFCPara As String, XML As String, PDF As String,
'VersionCFD As String, Descuento As Double, Moneda As String, TipodeComprobante As String, TipoCambio As Double, FueValidado As Integer,

View File

@@ -7776,7 +7776,7 @@ Public Class ClsPaginas
If CveSubProyectoEntrega > 0 Then
Dim DTSubProyectoEntrega As DataTable = GlobalDTSubProyectos(-1, CveSubProyectoEntrega)
Dim DTSubProyectoEntrega As DataTable = GlobalDTSubProyectos(-1, CveSubProyectoEntrega, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("SubProyectoEntrega", DTSubProyectoEntrega(0)("SubProyecto").ToString))

View File

@@ -2803,13 +2803,13 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function GetMotivoDevolucion(CveMotivoDevolucion As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean
Public Function GetMotivoDevolucion(CveMotivoDevolucion As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasMotivosDevolucionGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With

View File

@@ -518,7 +518,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.Dolares = dr("Importe").ToString.ToDecimal
cevent.Pesos = dr("ImporteMax").ToString.ToDecimal
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero
cevent.backgroundColor = dr("BackgroundColor").ToString
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
cevent.NumeroContrato = dr("NumeroContrato").ToString
@@ -581,6 +582,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.NombreComercial = dr("NombreComercial").ToString
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
@@ -607,6 +609,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.allDay = False

View File

@@ -540,15 +540,15 @@
</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>
<div class="whitoutcol whitoutcol">
<asp:DropDownList ID="DdlRemisionNotaCredito" runat="server" DataTextField="SerieFolio" DataValueField="CveCompra" CssClass="form-control input-sm input-small select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlRemisionNotaCredito_SelectedIndexChanged">
<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:DropDownList>
<%--<asp:Button ID="Button3" runat="server" Text="Resta" CssClass="default" OnClick="BtnFolioGarantiaRestantes_Click" />--%>
</asp:DropDownList>
</div>
</div>
</div>--%>
@@ -875,6 +875,7 @@
<div class="row">
<div class="col-md-6" style="min-height:200px">
<asp:UpdatePanel ID="UPPAnticiposSel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -954,6 +955,51 @@
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpGVRemisionesNotaDeCredito" runat="server" UpdateMode="Conditional">
<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>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -12,6 +12,7 @@ Imports Extensiones
Imports MoreLinq
Imports System.Data.SqlClient
Imports ClsPaginas
Imports System.Activities.Expressions
Partial Class Compras_Compras
Inherits ClsPaginas
@@ -1192,17 +1193,7 @@ Partial Class Compras_Compras
End Set
End Property
Private Property ImporteRNCSaldar As Decimal
Get
If ViewState("ImporteRNCSaldar") Is Nothing Then
ViewState("ImporteRNCSaldar") = 0D
End If
Return ViewState("ImporteRNCSaldar").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("ImporteRNCSaldar") = value
End Set
End Property
Private Property DTRemisionesNotaDeCredito As DataTable
Get
@@ -1220,53 +1211,10 @@ Partial Class Compras_Compras
End Property
Private Property SerieFolioProntoPago As String
Get
If ViewState("SerieFolioProntoPago") Is Nothing Then
ViewState("SerieFolioProntoPago") = ""
End If
Return ViewState("SerieFolioProntoPago").ToString
End Get
Set(value As String)
ViewState("SerieFolioProntoPago") = value
End Set
End Property
Private Property TipoCambioProntoPago As Decimal
Get
If ViewState("TipoCambioProntoPago") Is Nothing Then
ViewState("TipoCambioProntoPago") = 0D
End If
Return ViewState("TipoCambioProntoPago").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("TipoCambioProntoPago") = value
End Set
End Property
Private Property FechaProntoPago As Date
Get
If ViewState("FechaProntoPago") Is Nothing Then
ViewState("FechaProntoPago") = MinFecha
End If
Return ViewState("FechaProntoPago").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaProntoPago") = value
End Set
End Property
Private Property CveMonedaProntoPago As Integer
Get
If ViewState("CveMonedaProntoPago") Is Nothing Then
ViewState("CveMonedaProntoPago") = 0D
End If
Return ViewState("CveMonedaProntoPago").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMonedaProntoPago") = value
End Set
End Property
'ImporteRNCSaldar = 0
'SerieFolioProntoPago = ""
@@ -1278,6 +1226,17 @@ Partial Class Compras_Compras
#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
@@ -1687,6 +1646,18 @@ Partial Class Compras_Compras
DdlTipoComprobante.Items.Add(New ListItem("Devolución", "DEV"))
DdlTipoComprobante.SelectedValueExist("DEV")
End If
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlTipoComprobante.SelectedValue = "NC" Then
ConfiguraseleccionRemisionNotaCredito()
End If
End If
'SE OCUPAN AFUERA DEL POSTBACK ??
@@ -1719,6 +1690,56 @@ Partial Class Compras_Compras
End Sub
Private Sub ConfiguraseleccionRemisionNotaCredito()
Dim AutoSelRNC As Boolean = False
DdlTipoComprobante_SelectedIndexChanged(Nothing, Nothing)
DdlTipoCompra.SelectedValueExist(15)
DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing)
'For Each gvRow As GridViewRow In GvFacturaNC.Rows
' If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
' Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio"))
' Dim seleccion As String = ""
' For Each item As ListItem In DdlRemisionNotaCredito.Items
' Dim serieFolioItem As String = ObtenerUltimaParte(item.Text)
' If SerieFolioFacura = serieFolioItem Then
' 'seleccion = item.Value
' AutoSelRNC = True
' DdlRemisionNotaCredito.SelectedValueExist(item.Value)
' Exit For
' End If
' Next
' If AutoSelRNC Then
' Exit For
' End If
' End If
'Next
If AutoSelRNC Then
'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing)
End If
HLAplicaNCFact.Visible = True
UpPS.Update()
UpEstatus.Update()
End Sub
Public Function ObtenerUltimaParte(SerieFolioFactura As String) As String
Dim posicionUltimoGuion As Integer = SerieFolioFactura.LastIndexOf("-")
If posicionUltimoGuion <> -1 Then
Return SerieFolioFactura.Substring(posicionUltimoGuion + 1)
Else
Return SerieFolioFactura
End If
End Function
#Region "C A R G A S"
Private Sub MostrarOcultarColumnaIEPS()
@@ -7046,26 +7067,44 @@ Partial Class Compras_Compras
End If
End If
Next
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 AndAlso ImporteRNCSaldar > 0 Then
If Not ErrorPrepoliza Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 373, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
End If
For Each gvRow As GridViewRow In GVRemisionesNotaDeCredito.Rows
If gvRow.FCCheckBox("Chk").Checked Then
Dim ImporteRNCSaldar As Decimal = gvRow.DataKey("Saldo").ToDecimal
Dim CveCompraRNC As Integer = gvRow.DataKey("CveCompra").ToEntero
If Not ErrorPrepoliza Then
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, ConPrePNC.CveConcepto, Referencia, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 373, Referencia, Concepto, CveCompra:=CveCompraRNC, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
Exit For
End If
If Not ErrorPrepoliza Then
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, ConPrePNC.CveConcepto, Referencia, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
ErrorPrepoliza = True
Exit For
End If
End If
End If
End If
End If
Next
If ErrorPrepoliza Then
ErrorMovtosCxP = True
@@ -15688,7 +15727,7 @@ Partial Class Compras_Compras
Protected Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs)
CargarFacturas()
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
CargaDdlRemisionNotaCredito()
CargaGVRemisionNotaCredito()
End If
End Sub
@@ -16222,7 +16261,7 @@ Partial Class Compras_Compras
End If
Next
UpINV.Update()
UpInv.Update()
UpSerie.Update()
TxtSerieLote.Focus()
RegistraScript(String.Format("$('#DivSerie').on('shown.bs.modal', function () {{$('#DivSerie').focus(); $('#{0}').trigger(jQuery.Event('keypress', {{which: 13}})); }});$('#DivSerie').modal('show'); ", TxtSerieLote.ClientID))
@@ -18649,7 +18688,7 @@ Partial Class Compras_Compras
GvInvMov.Visible = True
ObjVentas.Dispose()
UpINV.Update()
UpInv.Update()
End Sub
Private Sub GvInvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInvMov.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -19719,12 +19758,11 @@ Partial Class Compras_Compras
If DdlTipoCompra.SelectedValue = "15" Then 'Remisión de nota de crédito
If DdlTipoComprobante.SelectedValue = "NC" Then
CargaDdlRemisionNotaCredito()
'bloquear la vinculación a la compra
CargaGVRemisionNotaCredito()
HLAplicaNCFact.Visible = False
Else
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)
End If
End If
@@ -20387,6 +20425,7 @@ Partial Class Compras_Compras
End Function
Private Sub NCSeleccionFacturasRelacionadas(UUIDSListRelacionados As List(Of String))
'ListaFacturasRealcionadasRNC.Clear()
If UUIDSListRelacionados.Count > 0 Then
Dim SaldoNota As Decimal = TxtTotal.Text.ToDecimal
@@ -20422,17 +20461,20 @@ Partial Class Compras_Compras
SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura
GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
Else
If SaldoFactura >= SaldoNotaPorAplicar Then
GvRow.FCTextBox("TxtImporte").Text = SaldoNotaPorAplicar.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
SaldoNotaPorAplicar = 0
TeminarAmortizacion = True
Else
GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero
GvRow.FCCheckBox("ChkFacturaNC").Checked = True
'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra"))
SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura
TeminarAmortizacion = True
@@ -21140,51 +21182,59 @@ Partial Class Compras_Compras
End Sub
Private Sub CargaDdlRemisionNotaCredito()
DvDdlRemisionNotaCredito.Visible = True
Private Sub CargaGVRemisionNotaCredito()
'DvDdlRemisionNotaCredito.Visible = True
DTRemisionesNotaDeCredito = New DataTable
GVRemisionesNotaDeCredito.DataSource = Nothing
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
If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2) Then
DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2, String.Join(",", CveComprasAmortizadas)) Then
'DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
DTRemisionesNotaDeCredito = ObjCompras.DtResultados
GVRemisionesNotaDeCredito.DataSource = DTRemisionesNotaDeCredito
GVRemisionesNotaDeCredito.Visible = True
End If
ObjCompras.Dispose()
DdlRemisionNotaCredito.DataBind()
DdlRemisionNotaCredito.Items.Insert(0, New ListItem("-", "-1"))
GVRemisionesNotaDeCredito.DataBind()
'DdlRemisionNotaCredito.DataBind()
'DdlRemisionNotaCredito.Items.Insert(0, New ListItem("-", "-1"))
UpPS.Update()
UpEstatus.Update()
End Sub
Protected Sub DdlRemisionNotaCredito_SelectedIndexChanged(sender As Object, e As EventArgs)
'Protected Sub DdlRemisionNotaCredito_SelectedIndexChanged(sender As Object, e As EventArgs)
ImporteRNCSaldar = 0
SerieFolioProntoPago = ""
TipoCambioProntoPago = 1
FechaProntoPago = MinFecha
CveMonedaProntoPago = 1
' ImporteRNCSaldar = 0
' SerieFolioProntoPago = ""
' TipoCambioProntoPago = 1
' FechaProntoPago = MinFecha
' CveMonedaProntoPago = 1
If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 Then
ImporteRNCSaldar = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
SerieFolioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("SerieFolio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ")
TipoCambioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("TipoCambio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
FechaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Fecha", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToString.ToDate
CveMonedaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("CveMoneda", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToEntero
End If
''Alert(ImporteRNCSaldar.ToString)
'CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
'CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
'CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
'CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
'CompraPago.Total = Gvr.DataKey("Total").ToDecimal
'CompraPago.CveTipoConceptoProveedor = CveTipoConcepto
' If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 Then
' ImporteRNCSaldar = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
' SerieFolioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("SerieFolio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ")
' TipoCambioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("TipoCambio", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
' FechaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Fecha", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToString.ToDate
' CveMonedaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("CveMoneda", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToEntero
' End If
End Sub
'End Sub
#End Region

View File

@@ -1513,6 +1513,11 @@ Partial Class Compras_eFacturas
DTLOG.Columns.Add("Proveedor", GetType(String))
DTLOG.Columns.Add("Importe", GetType(Decimal))
DTLOG.Columns.Add("Motivo", GetType(String))
DTLOG.Columns.Add("RFCde", GetType(String))
DTLOG.Columns.Add("Estatus", GetType(Integer))
DTLOG.Columns.Add("Tipo", GetType(String))
'Serie Folio Fecha Proveedor Importe Motivo
Dim sw As New Diagnostics.Stopwatch
@@ -1667,6 +1672,10 @@ Partial Class Compras_eFacturas
rowLog("Proveedor") = ""
rowLog("Importe") = 0
rowLog("Motivo") = ""
rowLog("RFCde") = ""
rowLog("Estatus") = 0
rowLog("Tipo") = ""
Dim fInfoXML As New FileInfo(filePathXML)
@@ -1884,10 +1893,13 @@ Partial Class Compras_eFacturas
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalFacturas"))
RegistraScript("$('#ModalBitacoraEfacturas').modal()")
CargaDatosBitacora()
mesajeFaturasSubidas(DTLOG)
CargaDatosBitacora()
'Alert(String.Format("Se cargaron {0} Facturas", Arreglo.Count), TipoMensaje.MsgInformacion)
End Sub
@@ -1900,6 +1912,7 @@ Partial Class Compras_eFacturas
Dim conta As Integer = 1
Str.Append("Se procesó la información con la siguiente información:<br/> <table width='900px'><tr class='Titulos'><td>Serie</td><td>Folio</td><td width='100px'>Fecha</td><td width='250px'>Proveedor</td><td>Importe</td><td width='250px'>Motivo</td></tr>")
Dim objCompra As New ClsCompras
For Each dr As DataRow In DTLOG.Rows
@@ -1909,13 +1922,18 @@ Partial Class Compras_eFacturas
Str.AppendFormat("<td style='width:80px'>{0}</td>", dr("Folio"))
Str.AppendFormat("<td style='width:400px'>{0}</td>", If(dr("Fecha").ToString <> "", dr("Fecha").ToString.ToDate.ToShortDateString, ""))
Str.AppendFormat("<td style='width:80px'>{0}</td>", dr("Proveedor"))
Str.AppendFormat("<td style='width:40px'>{0}</td>", dr("Importe").ToString.ToDouble.FormatoNumero)
Str.AppendFormat("<td style='width:40px'>{0}</td>", dr("Importe").ToString.ToDecimal.FormatoNumero)
Str.AppendFormat("<td style='width:40px'>{0}</td>", dr("Motivo"))
Str.Append("</tr>")
conta += 1
objCompra.AddBitacoraFactura(dr("Serie").ToString, dr("Folio").ToString, dr("RFCde").ToString, dr("Motivo").ToString, dr("Estatus").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "Modulo eFacturas",
dr("Proveedor").ToString, dr("Importe").ToString.ToDecimal, dr("Tipo").ToString)
Next
'RFCde,Estatus,Tipo
objCompra.Dispose()
If DTLOG.Rows.Count > 0 Then 'si las facturas no recividas son matores a cero se muestra el mensaje
Alert(Str.ToString, TipoMensaje.MsgInformacion)
@@ -7950,6 +7968,12 @@ Namespace ADS.eFacturas
rowLog("Importe") = Fact.Total
rowLog("Motivo") = ""
rowLog("RFCde") = Fact.EmisorRFC
rowLog("Estatus") = 0
rowLog("Tipo") = Fact.TipoComprobante
If Registrar Then
If Fact.ReceptorRFC = RFCEmpresa Then
@@ -7963,6 +7987,8 @@ Namespace ADS.eFacturas
If Fact.RespuestaInsert >= 0 Then
rowLog("Estatus") = 1
Dim Destino As String = $"{DirectorioEmpresa}\Compras\"
Try

View File

@@ -255,14 +255,14 @@ public partial class Contabilidad_RepIVA : ClsPaginas
Ruta = string.Format("{0}Formatos\\{1}", UsuarioActual.Empresa.Ruta, Formato);
//ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
if (UsuarioActual.Empresa.Funcionalidad(713).ToEntero() == 1)
if (UsuarioActual.Empresa.Funcionalidad(713).ToEntero() == 1 && !Ruta.Contains( "RepIVAAcreditable.rpt"))
{
ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, DtIEPSA, DtIVAA, "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
}
else
{
//ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, new DataTable(), new DataTable(), "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
//ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, new DataTable(), new DataTable(), "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
}
}else

View File

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

View File

@@ -4241,7 +4241,7 @@
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!CartaPorteVersion.Value</Value>
<Value>=IIF(Parameters!RFC.Value = "BBD021220APA", "3.1", Parameters!CartaPorteVersion.Value)</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>

View File

@@ -154,6 +154,7 @@ Partial Class RepContratoDetalle
TxtImporte.Text = Math.Round(Importe, 2).ToString
TxtAnticipo.Text = Math.Round(Anticipo, 2).ToString
CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
BtnDescargar.Visible = True
@@ -161,6 +162,7 @@ Partial Class RepContratoDetalle
BtnDescargar.Visible = False
A1.Visible = True
End If
'Boletos Vendidos
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
TabBoletos.Visible = True
@@ -215,7 +217,11 @@ Partial Class RepContratoDetalle
ViewState("extencion") = FileExtension
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", fileItem.filename)
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", $"{CveContrato.ToString}.{ FileExtension}")
If File.Exists(ViewState("FUrl").ToString) Then
File.Delete(ViewState("FUrl").ToString)
End If
File.Move(fileItem.FileUrl, ViewState("FUrl").ToString)
TxtArchivo.Text = tempArray(1)
@@ -260,14 +266,19 @@ Partial Class RepContratoDetalle
Dim ArchivoUpdate As String = "-1"
If Session("FileExtension").ToString <> "" Then
ArchivoUpdate = "." & Session("FileExtension").ToString
'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}"
ArchivoUpdate = $".{Session("FileExtension").ToString}"
Else
End If
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservacion.Text) Then
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservacion.Text) Then
Alert("Contrato actualizado correctamente")
End If
ObjContratos.Commit()
@@ -340,7 +351,7 @@ Partial Class RepContratoDetalle
Dim FileExtension As String = "-1"
If ObjEventoBitacora.AddEventoBitacora(Descripcion, FileExtension, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
Alert("Evento agregado a bitácora correctamente", TipoMensaje.MsgInformacion)
'Alert("Evento agregado a bitácora correctamente", TipoMensaje.MsgInformacion)
End If
ObjEventoBitacora.Dispose()

View File

@@ -146,6 +146,12 @@
<%-- Listado de Contratos --%>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, CveTipoAF, Importe, ImporteMin, ImporteMax,CveChofer, Observaciones, CveContratosEstatus, CveAF">

View File

@@ -119,7 +119,7 @@ Partial Class ListadoContratos
TxtObservaciones.Text = ""
TxtUbicacion.Text = ""
DdlClientes.SelectedText = ""
DdlTipoAF.SelectedValue = ""
DdlTipoAF.SelectedValueExist(-1)
TxtImporte.Text = ""
TxtAnticipo.Text = ""
TxtCantidadPasajeros.Text = ""

View File

@@ -199,6 +199,12 @@
<%-- Contratos --%>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
GridLines="None"
@@ -748,6 +754,9 @@
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
if (event.NombreComercial !== null) {
$('#HidModClienteNombre').val('');

View File

@@ -0,0 +1,93 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMotivosDevoluciones.aspx.vb" Inherits="Ventas_CatMotivosDevoluciones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de motivos de devolución
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkAgregar" data-toggle="tooltip" data-placement="left" title="Agregar un motivo" Text="<i class='fa fa-plus'></i>Agregar motivo" OnClick="LnkAgregar_Click"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<%--Seccion lista resultados--%>
<div class="row">
<div class="col-md-9">
<div class="portlet light ">
<div class="portlet-body">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" Width="100%" DataKeyNames="CveMotivoDevolucion,MotivoDevolucion,Estatus" CssClass=" table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" OnRowDeleting="GvDatos_RowDeleting">
<Columns>
<asp:BoundField DataField="MotivoDevolucion" HeaderText="Motivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50%" />
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="FechaIng" DataFormatString="{0:d}" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" OnClick="imgE_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveMotivoDevolucion")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este registro?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivMotivo" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal runat="server">Motivo de devolución</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMotivo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="TxtMotivo">Motivo:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="ChkEstatus">Activo:</label>&nbsp;
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
<i></i>
</div>
</div>
<br />
<div class="modal-footer">
<asp:Button ID="BtnGuardar" runat="server" class="btn btn-success" Text="Guardar" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,93 @@

Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Ventas_CatMotivosDevoluciones
Inherits ClsPaginas
Private Property CveMotivoDevolucion As Integer
Get
Return (IfNull(ViewState("CveMotivoDevolucion"), "-1", ViewState("CveMotivoDevolucion"))).ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("CveMotivoDevolucion") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
LimpiaDatos()
Using ObjVentas As New ClsVentas
If ObjVentas.GetMotivoDevolucion(-1, -1, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjVentas.DtResultados.Copy()
End If
End Using
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
Dim GvRow As GridViewRow = GvDatos.Rows(e.RowIndex)
CveMotivoDevolucion = GvRow.DataKey("CveMotivoDevolucion").ToEntero()
Using ObjVentas As New ClsVentas
If ObjVentas.RemoveMotivoDevolucion(CveMotivoDevolucion, UsuarioActual.CveEmpresa) Then
Alert("Se eliminó correctamente")
End If
End Using
CargaDatos()
End Sub
Protected Sub imgE_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveMotivoDevolucion = GvRow.DataKey("CveMotivoDevolucion").ToEntero()
TxtMotivo.Text = GvRow.DataKey("MotivoDevolucion")
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
UpModal.Update()
RegistraScript("$('#DivMotivo').modal('show');")
End Sub
Private Sub LimpiaDatos()
CveMotivoDevolucion = -1
TxtMotivo.Text = ""
ChkEstatus.Checked = True
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim Motivo As String = TxtMotivo.Text
'AGREGAR
Dim ObjVentas As New ClsVentas
If CveMotivoDevolucion = -1 Then
If ObjVentas.AddMotivoDevolucion(Motivo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("El motivo se agrego correctamente")
End If
Else
If ObjVentas.UpdateMotivoDevolucion(CveMotivoDevolucion, Motivo, ChkEstatus.Checked, UsuarioActual.CveEmpresa) Then
Alert("El motivo se actualizó correctamente")
End If
End If
ObjVentas.Dispose()
RegistraScript("$('#DivMotivo').modal('hide');")
CargaDatos()
End Sub
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
LimpiaDatos()
RegistraScript("$('#DivMotivo').modal('show');")
End Sub
End Class

View File

@@ -968,6 +968,11 @@
<asp:HyperLink runat="server" ID="HplPresupuesto" Target="_blank" Text="Ir a Presupuesto"></asp:HyperLink>
</td>
</tr>
<tr align="left" id="TrMotivoDev" runat="server" visible="false">
<td><b class="truncate">Motivo de devolución:</b>&nbsp;</td>
<td>
<asp:Label ID="lblMotivoDev" runat="server"></asp:Label></td>
</tr>
</table>
</div>
@@ -7611,6 +7616,16 @@
</div>
<div class="col-md-6"></div>
</div>
<div class="row" id="DivMotivoDevolucion" visible="false" runat="server">
<div class="col-md-2">
<label>Motivo:</label>
</div>
<div class="col-md-6">
<asp:DropDownList ID="DdlMotivoDevolucion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="MotivoDevolucion" DataValueField="CveMotivoDevolucion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" CssClass="help-block errorimput" Display="Dynamic" InitialValue="-1" ControlToValidate="DdlMotivoDevolucion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAplicaDevolucion"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="text-right col-md-offset-8 col-md-4">
<input type="text" id="TxtBusquedaDevolucion" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaDevolucion','{0}')", GvAplicaDevolucion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />

View File

@@ -5284,6 +5284,8 @@ Partial Class Ventas
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"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
TrMotivoDev.Visible = True
lblMotivoDev.Text = DbRowVenta("MotivoDevolucion").ToString()
Case "Ped"
DdlTipoComprobante.Items.Insert(0, New ListItem("Pedido", "Ped"))
CvePedido = CveVenta
@@ -5527,6 +5529,7 @@ Partial Class Ventas
TxtObsFact.Text = DbRowVenta("Observaciones").ToString()
LblUsuario.Text = DbRowVenta("Nombre").ToString().SubStringADS(30)
LblFechaRegistro.Text = DbRowVenta("FechaIng").ToString().ToDate.ToShortDateString
LblSeTimbro.Text = DbRowVenta("SeTimbro").ToString()
LblMail.Text = DbRowVenta("EnvioMail").ToString()
TxtFechaPago.Text = DbRowVenta("FechaVencimiento").ToString()
@@ -8881,11 +8884,20 @@ Partial Class Ventas
Dim DatarowPS As DataRow = Nothing
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If DdlTipoComprobante.SelectedValue = "Cot" Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Exit Sub
If DdlTipoComprobante.SelectedValue = "Ant" Then
Dim PSCodigoSAT As String = DatarowPS("SATClavePS").ToString
If PSCodigoSAT <> "84111506" Then
Alert($"El producto y/o servicio no es valido para generar anticipos", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
@@ -8957,7 +8969,7 @@ Partial Class Ventas
If ValidaExistencia AndAlso DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 153}) Then
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 153, 190, 192, 197}) Then
'SI ES VENTA NUEVA TOMA EN CUENTA LO DEL TMPDT
If CveVenta <= 0 Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
@@ -9752,13 +9764,13 @@ Partial Class Ventas
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, If(DdlTipoComprobante.SelectedValue = "Egs", "Egs", "Ing"), CveEstatus:=1) Then
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "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='{If(DdlTipoComprobante.SelectedValue = "Egs", "Egs", "Ing")}'", Orderby:="Importe DESC")
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='{If(DdlTipoComprobante.SelectedValue = "Egs", "Egs", "Ing")}'", Orderby:="Importe DESC")
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='{"Ing"}'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
@@ -9806,14 +9818,6 @@ Partial Class Ventas
End If
'If TipoAutorizacion = 2 Then
' If DiasVencidosCliente > DiasVencidosAutorizacion Then
' CveAutorizacion = -1
' Alert($"El crédito no esta autorizado. Los días vencidos del cliente son mayores a lo autorizado", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
'SI NO SE ENCONTRO NINGUA AUTORIZACION
If TipoAutorizacion = 0 Then
If TieneDiasVencidos Then
@@ -9824,21 +9828,57 @@ Partial Class Ventas
End If
End If
'If TieneDiasVencidos AndAlso DdlTipoComprobante.SelectedValue = "Egs" AndAlso CveAutorizacion <= 0 Then
' CveAutorizacion = -1
' Alert($"El crédito no esta autorizado. No tiene autorización para generar notas de crédito. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
End If
'If TipoDocumentoAutorizacion = "Egs" Then
' If TipoAutorizacion = 1 Then
' If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
' CveAutorizacion = -1
' Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' End If
'End If
'VALIDACION DE AUTORIZACION PARA NC, POR AHORA SOLO BDH
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs") Then
PermiteAutorizacion = False
'SI NO ES GENERADA CON REMISIONES DE NC, UTILIZAR LA AUTORIZACION
If (ListaRemisionesNC Is Nothing OrElse ListaRemisionesNC.Count = 0) Then
PermiteAutorizacion = True
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)
Exit Sub
End If
End If
End If
'VALIDAR LINEAS ADICIONALES
@@ -14008,6 +14048,11 @@ Partial Class Ventas
'CveAlmacenTraspasoDestino
End If
Dim CveMotivoDevolucion As Integer = -1
If DdlMotivoDevolucion.SelectedValue.ToEntero() > 0 Then
CveMotivoDevolucion = DdlMotivoDevolucion.SelectedValue.ToEntero()
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,
@@ -14027,7 +14072,7 @@ Partial Class Ventas
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta,
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir,
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text) Then
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -16702,6 +16747,13 @@ Partial Class Ventas
HdnTieneAnticipos.Value = "0"
If CveCliente > 0 Then
'QUE NO SE PUEDA REALIZAR AMORTIZACIÓN DE ANTICIPO POR DESCUENTO
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") IsNot Nothing Then
DdlTipoAmortizacionAnticipo.Items.Remove(DdlTipoAmortizacionAnticipo.Items.FindByValue("1"))
End If
End If
HdnIVACalculado.Value = "0"
'SI ES REFACTURACION NO LIMPIAR EL FOLIO FISCAL
If NuevaFactura <> 1 Then
@@ -18108,7 +18160,7 @@ Partial Class Ventas
End Sub
Protected Sub DdlNCFactura_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlNCFactura.SelectedIndexChanged
Dim objcompras As New ClsCompras
If objcompras.GetCompraDetallealmacen(0, DdlNCFactura.SelectedValue.ToEntero()) Then
If objcompras.GetCompraDetalleAlmacen(0, DdlNCFactura.SelectedValue.ToEntero()) Then
GvInvNC.DataSource = objcompras.DtResultados
If objcompras.DtResultados.Rows.Count > 0 Then
Tab.ActiveTabIndex = 1
@@ -18802,13 +18854,24 @@ Partial Class Ventas
Return False
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DatarowPS IsNot Nothing Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Return False
If DdlTipoComprobante.SelectedValue = "Cot" Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
If DdlTipoComprobante.SelectedValue = "Ant" Then
Dim PSCodigoSAT As String = DatarowPS("SATClavePS").ToString
If PSCodigoSAT <> "84111506" Then
Alert($"El producto y/o servicio '{DatarowPS("CodigoPS").ToString}' no es valido para generar anticipos", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
End If
End If
@@ -18887,7 +18950,7 @@ Partial Class Ventas
If ValidaExistencia Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140, 186, 190}) Then
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140, 186, 190, 192, 197}) Then
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
@@ -18899,7 +18962,14 @@ Partial Class Ventas
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1,
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
Else
Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
Dim CveAlmacenConsulta As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso DivAlmacen.Visible Then
CveAlmacenConsulta = ddlAlmacen.SelectedValue.ToEntero()
End If
Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenConsulta, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
End If
@@ -18907,7 +18977,19 @@ Partial Class Ventas
If CveVenta <= 0 OrElse Me.EsCreaApartirDe Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < (If(CantidadModal > 0, CantidadModal, TxtCantidad.Text.ToDouble)) Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
Dim CveAlmacenConsulta As Integer = -1
Dim StrAlmacen As New StringBuilder
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso DivAlmacen.Visible Then
CveAlmacenConsulta = ddlAlmacen.SelectedValue.ToEntero()
If CveAlmacenConsulta > 0 Then
Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenConsulta).FiltroPrimeroValor("Almacen")
StrAlmacen.AppendFormat("<br/>Almacén: {0}", Almacen)
End If
End If
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + "." + StrAlmacen.ToString(), TipoMensaje.MsgAdvertencia)
Return False
End If
Else
@@ -24047,9 +24129,9 @@ Partial Class Ventas
Dim AmortizacionNC As Decimal = 0
'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2", "4") Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3, 12) Then
AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
End If
Next
@@ -37389,6 +37471,22 @@ Partial Class Ventas
End If
If PuedeAplicarDevolucion Then
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DivMotivoDevolucion.Visible = True
Using ObjVenta As New ClsVentas
If ObjVenta.GetMotivoDevolucion(-1, 1, UsuarioActual.CveEmpresa) Then
DdlMotivoDevolucion.DataSource = ObjVenta.DtResultados.Copy()
End If
DdlMotivoDevolucion.DataBind()
DdlMotivoDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Using
UpDevolucion.Update()
End If
RegistraScript("$('#DivAplicaDevolucion').modal('show');")
End If
@@ -38405,9 +38503,12 @@ Partial Class Ventas
DdlTipoAmortizacionAnticipo.Items.Remove(DdlTipoAmortizacionAnticipo.Items.FindByValue("2"))
End If
Else
If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo en descuento", "1"))
If Not (UsuarioActual.Empresa.Funcionalidad(382) = "1") Then
If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo en descuento", "1"))
End If
End If
If DdlTipoAmortizacionAnticipo.Items.FindByValue("2") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo con nota de crédito", "2"))
End If