Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -469,6 +469,13 @@ Public Class CFDIComplementoPagos
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TotalPagos As Decimal
|
||||
Get
|
||||
Return (From c In DocumentosRelacionados
|
||||
Select c.ImpPagado).Sum()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
|
||||
DocumentosRelacionados = New List(Of CFDIComplementoPagosDocsRelacionados)
|
||||
@@ -476,6 +483,61 @@ Public Class CFDIComplementoPagos
|
||||
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Retenciones As List(Of CFDIRetenciones)
|
||||
Get
|
||||
Dim tRetorno As New List(Of CFDIRetenciones)
|
||||
Dim TRetenciones As New List(Of CFDIRetenciones)
|
||||
|
||||
For Each c As CFDIComplementoPagosDocsRelacionados In DocumentosRelacionados
|
||||
For Each imp As CFDIConceptosImpuestos In c.Impuestos
|
||||
If imp.TrasladooRetencion = "R" Then
|
||||
tRetorno.Add(New CFDIRetenciones With {.Impuesto = imp.Impuesto, .Importe = imp.Importe})
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
If tRetorno.Count > 0 Then
|
||||
TRetenciones = tRetorno.GroupBy(Function(t) New With {Key t.Impuesto}) _
|
||||
.Select(Function(t) New CFDIRetenciones With {.Impuesto = t.Key.Impuesto,
|
||||
.Importe = t.Sum(Function(tt) tt.Importe)}) _
|
||||
.OrderBy(Function(x) x.Impuesto).ToList
|
||||
End If
|
||||
|
||||
tRetorno = Nothing
|
||||
Return TRetenciones
|
||||
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Traslados As List(Of CFDITraslados)
|
||||
Get
|
||||
Dim tRetorno As New List(Of CFDITraslados)
|
||||
Dim TTraslados As New List(Of CFDITraslados)
|
||||
For Each c As CFDIComplementoPagosDocsRelacionados In DocumentosRelacionados
|
||||
For Each imp As CFDIConceptosImpuestos In c.Impuestos
|
||||
If imp.TrasladooRetencion = "T" Then
|
||||
tRetorno.Add(New CFDITraslados With {.Impuesto = imp.Impuesto, .Base = imp.Base, .Importe = imp.Importe, .TasaOCuota = imp.TasaOCuota, .TipoFactor = imp.TipoFactor})
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
'ya generado todos los registros posibles, los agrupo y los sumo
|
||||
If tRetorno.Count > 0 Then
|
||||
TTraslados = tRetorno.GroupBy(Function(t) New With {Key t.TipoFactor, Key t.Impuesto, Key t.TasaOCuota}) _
|
||||
.Select(Function(t) New CFDITraslados With {.Impuesto = t.Key.Impuesto,
|
||||
.TipoFactor = t.Key.TipoFactor,
|
||||
.TasaOCuota = t.Key.TasaOCuota,
|
||||
.Base = t.Sum(Function(tt) tt.Base),
|
||||
.Importe = t.Sum(Function(tt) tt.Importe)}) _
|
||||
.OrderBy(Function(x) x.Impuesto).ToList
|
||||
|
||||
End If
|
||||
tRetorno = Nothing
|
||||
Return TTraslados
|
||||
|
||||
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
<Serializable>
|
||||
@@ -487,9 +549,14 @@ Public Class CFDIComplementoPagosDocsRelacionados
|
||||
Public Property MetodoDePagoDR As String = ""
|
||||
Public Property TipoCambioDR As Decimal
|
||||
Public Property NumParcialidad As Integer = 1
|
||||
Public Property ImpSaldoAnt As Double
|
||||
Public Property ImpPagado As Double
|
||||
Public Property ImpSaldoInsoluto As Double
|
||||
Public Property ImpSaldoAnt As Decimal
|
||||
Public Property ImpPagado As Decimal
|
||||
Public Property ImpSaldoInsoluto As Decimal
|
||||
Public Property ObjetoImpuesto As String = "01"
|
||||
Public Property Impuestos As List(Of CFDIConceptosImpuestos)
|
||||
Sub New()
|
||||
Impuestos = New List(Of CFDIConceptosImpuestos)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -953,6 +953,7 @@ Public Class ClsBancos
|
||||
Dim Estatus As Integer = 1
|
||||
|
||||
Dim dttpagos As DataTable = Nothing
|
||||
Dim dttpagosimpuestos As DataTable = Nothing
|
||||
Dim dr As Data.DataRow = Nothing
|
||||
|
||||
If GetComplementoPagosRep(-1, Now.AddYears(-5), Now, If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then
|
||||
@@ -996,7 +997,6 @@ Public Class ClsBancos
|
||||
'ReceptorRFC = drr("RFC").ToString
|
||||
'ReceptorNombre = drr("NombreCliente").ToString
|
||||
|
||||
|
||||
Folio = FActual
|
||||
ComplementoSerieFolio = $"{Serie}-{Folio}"
|
||||
|
||||
@@ -1084,12 +1084,25 @@ Public Class ClsBancos
|
||||
Dim Timbre As CFDITimbre = Nothing
|
||||
Dim Timbrado As New Timbrado
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
|
||||
If GetComplementoPagosImpuestos(CveIE, UsuarioActual.CveEmpresa) Then
|
||||
dttpagosimpuestos = DtResultados
|
||||
End If
|
||||
|
||||
Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal,
|
||||
Timbre = Timbrado.PreparaTimbrePago40(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal,
|
||||
RFCCliente, dr("NombreCliente").ToString, RFCCliente, dr("NombreCliente").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago,
|
||||
dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal,
|
||||
UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, dttpagosimpuestos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False)
|
||||
|
||||
Else
|
||||
Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal,
|
||||
RFCCliente, dr("NombreCliente").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago,
|
||||
dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDouble,
|
||||
UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDouble, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False)
|
||||
dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal,
|
||||
UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
''PREPARA PARA CANCELACION POR SUSTITUCION DE COMPLEMENTO DE PAGO
|
||||
'If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then
|
||||
@@ -1365,6 +1378,26 @@ Public Class ClsBancos
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetComplementoPagosImpuestos(CveIE As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Banc_ComplementoPagoImpuestosGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveIE", SqlDbType.Int).Value = CveIE
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener informacion de complementos de pago en impuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetComplementoPagos(CveComplementoPago As Integer, CveIE As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ Public Class ClsNominas
|
||||
Return retorno
|
||||
|
||||
End Function
|
||||
Public Function SUAMovmientosAfiliatoriosGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer) As Boolean
|
||||
Public Function SUAMovmientosAfiliatoriosGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer, Optional CveRegistroPatronal As Integer = -1) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DTSet = New DataSet()
|
||||
DataAdapter("[PA_Nom_SUAMovmientosAfiliatoriosGET]", CommandType.StoredProcedure)
|
||||
@@ -347,6 +347,7 @@ Public Class ClsNominas
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
.Add("@TipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo
|
||||
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(DTSet)
|
||||
|
||||
@@ -5517,6 +5517,8 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/CatAutorizacionLimites.aspx".ToUpper(), 781)
|
||||
PaginaDict.Add("/Ventas/RepComisionesServec.aspx".ToUpper(), 782)
|
||||
PaginaDict.Add("/Ventas/RepComisionesServecDetalle.aspx".ToUpper(), 782)
|
||||
PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325)
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
@@ -1445,7 +1445,7 @@ Public Class ClsVentas
|
||||
CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
|
||||
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False,
|
||||
Optional EsDistribuidor As Integer = -1) As Boolean
|
||||
Optional EsDistribuidor As Integer = -1, Optional CveTipoRelacion As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasGetRep")
|
||||
|
||||
@@ -1474,6 +1474,7 @@ Public Class ClsVentas
|
||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||
.Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -1580,7 +1581,7 @@ Public Class ClsVentas
|
||||
CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1,
|
||||
Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False,
|
||||
Optional EsDistribuidor As Integer = -1) As Boolean
|
||||
Optional EsDistribuidor As Integer = -1, Optional CveTipoRelacion As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasGetRepDetalle")
|
||||
|
||||
@@ -1614,6 +1615,7 @@ Public Class ClsVentas
|
||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
|
||||
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||
.Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -5391,6 +5393,30 @@ Public Class ClsVentas
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetRepCancelacionVentas(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveCliente As Integer, CveMotivoCancelacion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepCancelacionesVentasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error obtener las ventas canceladas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "C L I E N T E S V E N D E D O R E S S U B P R O Y E C T O S"
|
||||
|
||||
Public Function GetClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
@@ -686,7 +686,7 @@ Namespace Modelos
|
||||
|
||||
Return Not ErrorPrePolizas
|
||||
End Function
|
||||
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing) As MMensajeFactura
|
||||
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") As MMensajeFactura
|
||||
Dim Retorno As New MMensajeFactura()
|
||||
|
||||
If Me.Version = "3.3" AndAlso Not Me.TipoDocto.Contiene("Ped", "PeC") Then
|
||||
@@ -782,7 +782,7 @@ Namespace Modelos
|
||||
Next
|
||||
End If
|
||||
|
||||
GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno)
|
||||
GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno, Modulo:=Modulo)
|
||||
|
||||
'SI ES REFACTURACION
|
||||
Dim ObjNC As List(Of Object) = Nothing
|
||||
@@ -1453,10 +1453,10 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing)
|
||||
Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM")
|
||||
Dim Msgok As New StringBuilder
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas("Modelos/GuardarVentaM", factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas(Modulo, factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
|
||||
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
|
||||
1048
App_Code/Timbrado.vb
1048
App_Code/Timbrado.vb
File diff suppressed because it is too large
Load Diff
@@ -4624,7 +4624,8 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
Else
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
Dim respCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
|
||||
If respCancelacion.Verificado Then
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
CargaComplementosPago()
|
||||
@@ -6695,8 +6696,8 @@ Partial Class Bancos_IE
|
||||
|
||||
Else
|
||||
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
Dim resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
|
||||
If resp.Verificado Then
|
||||
|
||||
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
<asp:CheckBox ID="ChkEmitirComplementoPago" CssClass="md-checksd" Text="Emitir Complemento de Pago" runat="server" align="Right" />
|
||||
<br />
|
||||
<asp:GridView ID="GvVentas" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron movimientos" DataKeyNames="CveVenta,Saldo,Folio,CveCliente,CveMoneda,RetISR,RetIVA,IVA,IEPS,TipoCambio,Total,PorcentajeIVA"
|
||||
ToolTip="Listado de Movimientos" data-height="300" Style="width: 100%; height: 100%; text-align: center;" GridLines="None" HeaderStyle-ForeColor="Black">
|
||||
ToolTip="Listado de Movimientos" data-height="200" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" HeaderStyle-ForeColor="Black">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -450,7 +450,7 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Folio</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("Folio") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -832,19 +832,21 @@ Partial Class Bancos_PopIECompras
|
||||
ObjMov.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaVentas(Optional CveMoneda As Integer = 1)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Protected Sub CargaVentas(Optional CveMoneda As Integer = 1)
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
Dim CveCliente As Integer = -1
|
||||
|
||||
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", ClienteRFC:=RFCProveedor, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||
If ObjVentas.DtResultados.FiltraParametros("Saldo > 0").Rows.Count > 0 Then
|
||||
CveCliente = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||
GvVentas.DataSource = ObjVentas.DtResultados.FiltraParametros($"Saldo > 0 AND CveMoneda = {CveMoneda}")
|
||||
GvVentas.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
|
||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", String.Format("RFC = '{0}'", RFCProveedor)).ToEntero
|
||||
|
||||
If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
GvVentas.DataSource = ObjMovtos.DtResultados.FiltraParametros($" Saldo > 0 AND CveVenta > 0 AND CveMoneda = {CveMoneda}")
|
||||
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
GvVentas.DataBind()
|
||||
|
||||
If CveCliente > 0 Then
|
||||
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("IdCuentaCliente") = ObjCliente.IdCtaContClientes
|
||||
@@ -854,10 +856,10 @@ Partial Class Bancos_PopIECompras
|
||||
ViewState("IdCtaContMonedaExtranjeraCliente") = ObjCliente.IdCtaContMonedaExtranjera
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjCliente.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
@@ -596,8 +596,8 @@ Partial Class Bancos_RepComplementoPago
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, Can_FolioFiscalCancelar, 0, Can_RFCReceptorCancelar, UsuarioActual.Empresa.RFC, Can_CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
Dim resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, Can_FolioFiscalCancelar, 0, Can_RFCReceptorCancelar, UsuarioActual.Empresa.RFC, Can_CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
|
||||
If resp.Verificado Then
|
||||
|
||||
If ObjBanco.UpdateComplementoPago(Can_CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, Can_CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
|
||||
Binary file not shown.
@@ -1504,27 +1504,27 @@
|
||||
<asp:LinkButton ID="LblB" runat="server" Style="color: aqua; font-weight: bold; font-size: x-large;" OnClick="LblB_Click"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Factura">
|
||||
<asp:TemplateField HeaderText="SerieFolio">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlFactura" runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Compra">
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Vencimiento">
|
||||
<asp:TemplateField HeaderText="F. Vencimiento">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Días Vencidos">
|
||||
<asp:TemplateField HeaderText="Días Venc.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDiasVencido" runat="server" Text='<%# Eval("DiasVencidos", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Monto Compra (Saldo Orig)">
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSaldoOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Concepto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtConcepto" runat="server" Width="150px" Text='<%# Eval("Concepto")%>'></asp:TextBox>
|
||||
<asp:TextBox ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto")%>'></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
<ItemStyle />
|
||||
</asp:TemplateField>
|
||||
@@ -622,8 +622,7 @@
|
||||
<HeaderTemplate>Cuenta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="DdlCtaContable" runat="server" Text='<%# Eval("CodigoNombreCuenta") %>'></asp:Literal><br />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" Width="300px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>TC</HeaderTemplate>
|
||||
|
||||
Binary file not shown.
@@ -88,8 +88,11 @@
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAddE" OnClientClick="javascript:$('#DivCrearApatir').modal({backdrop: 'static', keyboard: false}); return false;" Text="<i class='fa fa-plus'></i><span>Crear a partir de</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkAddE" OnClick="LnkAddE_Click" Text="<i class='fa fa-plus'></i><span>Crear a partir de</span>" runat="server"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
@@ -146,7 +149,7 @@
|
||||
<asp:CheckBox ID="ChkTimmer" OnCheckedChanged="ChkTimmer_CheckedChanged" AutoPostBack="true" Text=" " runat="server" CssClass="chksino" Checked="true"></asp:CheckBox>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:Timer runat="server" ID="TimmerRefresh" Interval="30000" OnTick="TimmerRefresh_Tick"></asp:Timer>
|
||||
<asp:Timer runat="server" ID="TimmerRefresh" Interval="120000" OnTick="TimmerRefresh_Tick"></asp:Timer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,9 +37,18 @@ Partial Class GPS_Trayectos
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPosiciones") = value
|
||||
End Set
|
||||
End Property
|
||||
End Property
|
||||
Private Property DtTrayectos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtTrayectos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtTrayectos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||
@@ -52,7 +61,6 @@ Partial Class GPS_Trayectos
|
||||
CargaDispositivos()
|
||||
CargaGeoReferencias()
|
||||
CargaEstatus()
|
||||
CargaDdlTrayectos()
|
||||
|
||||
CargaTrayectos()
|
||||
End Sub
|
||||
@@ -98,28 +106,32 @@ Partial Class GPS_Trayectos
|
||||
|
||||
Dim CveEstatus As Integer = -1
|
||||
If ChkActivas.Checked AndAlso DdlEstatusTrayecto.SelectedValue.ToEntero() <= 0 Then
|
||||
CveEstatus = -2
|
||||
CveEstatus = -2
|
||||
Else
|
||||
CveEstatus = DdlEstatusTrayecto.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectos(-1, DdlDispositivoFiltro.SelectedValue.ToEntero(), UsuarioActual.CveCliente, CveEstatus, FechaI, FechaF) Then
|
||||
GvBarra.DataSource = ObjGPS.DtResultados
|
||||
DtTrayectos = ObjGPS.DtResultados.Copy()
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
|
||||
GvBarra.DataSource = DtTrayectos
|
||||
GvBarra.DataBind()
|
||||
UPGV.Update()
|
||||
End Sub
|
||||
Public Sub CargaDdlTrayectos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectos(-1, -1, UsuarioActual.CveCliente) Then
|
||||
DdlTrayecto.DataSource = ObjGPS.DtResultados.FiltraParametros("EsFin = True")
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
Public Sub CargaDdlTrayectos()
|
||||
'Dim ObjGPS As New ClsGPS
|
||||
'If ObjGPS.GetTrayectos(-1, -1, UsuarioActual.CveCliente) Then
|
||||
' DdlTrayecto.DataSource = ObjGPS.DtResultados.FiltraParametros("EsFin = True")
|
||||
'End If
|
||||
'ObjGPS.Dispose()
|
||||
|
||||
DdlTrayecto.DataSource = DtTrayectos
|
||||
DdlTrayecto.DataBind()
|
||||
|
||||
UpAgregar.Update()
|
||||
UpDdlTrayecto.Update()
|
||||
End Sub
|
||||
Public Sub CargaEstatus()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
@@ -469,5 +481,9 @@ Partial Class GPS_Trayectos
|
||||
TimmerRefresh.Enabled = ChkTimmer.Checked
|
||||
|
||||
UPGV.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
Protected Sub LnkAddE_Click(sender As Object, e As EventArgs)
|
||||
CargaDdlTrayectos()
|
||||
RegistraScript("$('#DivCrearApatir').modal({backdrop: 'static', keyboard: false});")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -62,7 +62,8 @@ public partial class Inventarios_RepTraspasoEmitido : ClsPaginas
|
||||
}
|
||||
|
||||
protected void LnkCancelarTraspaso_Click(object sender, EventArgs e)
|
||||
{
|
||||
{
|
||||
GridViewRow Gvr = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
Timbrado ObjCancelacion = new Timbrado();
|
||||
DateTime CancelacionFecha=MinFecha;
|
||||
int CveEstatusTimbrado = 0;
|
||||
|
||||
@@ -24,6 +24,8 @@ Partial Class Nomina_CatPeriodos
|
||||
ViewState("Orden") = ""
|
||||
CargaTipoPeriodo()
|
||||
cargaEjercicios()
|
||||
CargaTurnos()
|
||||
|
||||
CargaDatos()
|
||||
|
||||
''Permiso Registro
|
||||
@@ -62,6 +64,8 @@ Partial Class Nomina_CatPeriodos
|
||||
|
||||
DdlTipoPeriodo.DataBind()
|
||||
DdlTipoPeriodoAdd.DataBind()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cargaEjercicios()
|
||||
@@ -76,6 +80,15 @@ Partial Class Nomina_CatPeriodos
|
||||
DdlEjercicio.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTurnos()
|
||||
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
DdlTurno.DataBind()
|
||||
DdlTurno.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "G V D A T O S"
|
||||
@@ -329,6 +342,7 @@ Partial Class Nomina_CatPeriodos
|
||||
TxtFechaInicioAdd.Text = ""
|
||||
TxtFechaFinAdd.Text = ""
|
||||
DdlEstatusAdd.SelectedValueExist(-1)
|
||||
DdlTurno.SelectedValueExist(-1)
|
||||
For Each item As ListItem In CBLchk.Items
|
||||
Select Case item.Value.ToEntero()
|
||||
Case 1
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-1">Tipo Período:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" CssClass="select2me" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 mediocol">del:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-1">
|
||||
<div class="form-group input-iconright">
|
||||
<asp:TextBox ID="TxtRpdFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtRpdFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-1 mediocol">al:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-1">
|
||||
<div class="form-group input-iconright">
|
||||
<asp:TextBox ID="TxtRpdFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="TxtRpdFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
@@ -56,7 +56,15 @@
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 mediocol truncate">Registro Patronal:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlRegistroPatronal" runat="server" Width="100%" DataTextField="RegistroPatronal" CssClass="form-control input-sm select2me" DataValueField="CveRegistroPatronal" >
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4" style="text-align:right!important">
|
||||
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" Visible="true" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,9 +27,33 @@ public partial class Nomina_MovimientosSUA : ClsPaginas
|
||||
{
|
||||
TxtRpdFechaInicio.Text = string.Format(" {0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).FirstDayOfMonth());
|
||||
TxtRpdFechaFin.Text = string.Format(" {0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth());
|
||||
CargaCombos();
|
||||
CargaTiposPeriodo();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaCombos()
|
||||
{
|
||||
|
||||
ClsRH ObjRH = new ClsRH();
|
||||
|
||||
|
||||
if (ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, -1))
|
||||
{
|
||||
DdlRegistroPatronal.DataSource = ObjRH.DtResultados;
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlRegistroPatronal.DataSource = null;
|
||||
}
|
||||
|
||||
ObjRH.Dispose();
|
||||
DdlRegistroPatronal.DataBind();
|
||||
|
||||
DdlRegistroPatronal.Items.Insert(0, new ListItem("Todos","-1"));
|
||||
|
||||
}
|
||||
|
||||
private void CargaTiposPeriodo()
|
||||
{
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
|
||||
@@ -45,7 +69,8 @@ public partial class Nomina_MovimientosSUA : ClsPaginas
|
||||
{
|
||||
using (ClsNominas onom = new ClsNominas())
|
||||
{
|
||||
if (onom.SUAMovmientosAfiliatoriosGET(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDateTime(), TxtRpdFechaFin.Text.ToDateTime(), DdlTipoPeriodo.SelectedValue.ToEntero())
|
||||
|
||||
if (onom.SUAMovmientosAfiliatoriosGET(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDateTime(), TxtRpdFechaFin.Text.ToDateTime(), DdlTipoPeriodo.SelectedValue.ToEntero(), CveRegistroPatronal:DdlRegistroPatronal.SelectedValue.ToEntero())
|
||||
&& onom.DTSetResultados.Tables.Count > 3)
|
||||
{
|
||||
GVAsistencia.DataSource = onom.DTSetResultados.Tables[0];
|
||||
|
||||
@@ -2064,20 +2064,25 @@ Partial Class Clientes
|
||||
DdlSucursalFormaPago33.DataSource = GlobalDTVtaFormaPago
|
||||
DdlSucursalFormaPago33.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaComboCFDI()
|
||||
Private Sub CargaComboCFDI()
|
||||
Dim RegimenFiscalCliente = DdlRegimenFiscal.SelectedValue.ToString()
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
|
||||
RegimenFiscalCliente = "-1"
|
||||
End If
|
||||
|
||||
DdlUsoCFDI.Items.Clear()
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||
DdlUsoCFDI.DataBind()
|
||||
DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
DdlSucursalUsoCFDI.Items.Clear()
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||
DdlSucursalUsoCFDI.DataBind()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "V E R M Á S"
|
||||
|
||||
|
||||
Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs)
|
||||
If BtnVerMasVentas.Text = "Ver Más" Then
|
||||
CargaHistorial(-1)
|
||||
|
||||
@@ -758,6 +758,15 @@ Partial Class PV
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CantidadAntesEdicion As Decimal
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CantidadAntesEdicion")), "0", ViewState("CantidadAntesEdicion").ToString()).ToDecimal()
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("CantidadAntesEdicion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "PROPIEDADES CONTRATOS"
|
||||
@@ -1071,6 +1080,7 @@ Partial Class PV
|
||||
ViewState("ClienteRetIVA") = 0
|
||||
ViewState("ClienteRetISR") = 0
|
||||
ViewState("EnviarCorreoCliente") = False
|
||||
Me.CantidadAntesEdicion = 0
|
||||
HdnPorcentajeDescuentoMaximo.Value = If(UsuarioActual.DescuentoAutorizado > 0, UsuarioActual.DescuentoAutorizado, 15).ToString()
|
||||
CveVentaDetalle = -1
|
||||
EstablecioFolio = False
|
||||
@@ -5125,7 +5135,15 @@ Partial Class PV
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||
'VALIDA EXISTENCIA
|
||||
If UsuarioActual.CveEmpresa.Contiene({1, 72, 80, 119, 140}) Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
|
||||
Dim CantidadAgregada As Decimal = TmpDT.SUMD("Cantidad", $"CvePS = {CvePS}")
|
||||
|
||||
If Modalidad = "U" Then
|
||||
CantidadAgregada = CantidadAgregada - CantidadAntesEdicion + TxtCantidad.Text.ToDecimal()
|
||||
Else
|
||||
CantidadAgregada = CantidadAgregada + TxtCantidad.Text.ToDecimal()
|
||||
End If
|
||||
|
||||
If Existencia < CantidadAgregada Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -5229,6 +5247,7 @@ Partial Class PV
|
||||
End Sub
|
||||
Private Sub CargaAgregar()
|
||||
Modalidad = "A"
|
||||
CantidadAntesEdicion = 0
|
||||
LnkAgregarPS.Text = "Agregar"
|
||||
CargaBCI()
|
||||
LimpiaAgregar()
|
||||
@@ -5268,6 +5287,7 @@ Partial Class PV
|
||||
End If
|
||||
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS)
|
||||
DdlUnidadMedida.SelectedValueExist(GvRow.DataKey("CveUM"))
|
||||
CantidadAntesEdicion = GvRow.DataKey("Cantidad").ToDecimal()
|
||||
TxtCantidad.Text = GvRow.DataKey("Cantidad")
|
||||
|
||||
'Dim TotalCargos As Decimal = 0
|
||||
@@ -5324,6 +5344,9 @@ Partial Class PV
|
||||
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
|
||||
End Sub
|
||||
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
If ChkAjuste.Checked Then
|
||||
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
|
||||
|
||||
@@ -5337,25 +5360,34 @@ Partial Class PV
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
|
||||
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DrPS IsNot Nothing Then
|
||||
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
|
||||
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
|
||||
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
|
||||
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
|
||||
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
|
||||
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
|
||||
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
|
||||
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If DrPS IsNot Nothing Then
|
||||
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
|
||||
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
|
||||
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
|
||||
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
|
||||
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If AgregarPS() Then
|
||||
|
||||
148
Ventas/RepCancelacionesVentas.aspx
Normal file
148
Ventas/RepCancelacionesVentas.aspx
Normal file
@@ -0,0 +1,148 @@
|
||||
<%@ Page Title="Rep. Cancelación Ventas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCancelacionesVentas.aspx.vb" Inherits="Compras_RepCancelacionesVentas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Rep. Cancelación Ventas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server" Visible="false"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</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 ID="UpFiltros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-1" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LBCalendarFiltrosFechaInicio" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LBCalendarFiltrosFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-1" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LBCalendarFiltrosFechaFin" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LBCalendarFiltrosFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<label class="col-md-1 truncate" title="Motivo Cancelación">Mto. Cancel.</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlMotivoCancelacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="MotivoCancelacion" DataValueField="CveMotivoCancelacion">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<label class="col-md-1 ">Cliente:</label>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD"
|
||||
DataKeyNames="CveCliente,Nombre,CveVenta,SerieFolio,Fecha,FechaCancelacion,CveSubProyecto,SubProyecto,CveMotivoCancelacion,MotivoCancelacion,MotivoCancelacionVenta,CveEstatusFactura"
|
||||
GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
|
||||
<asp:HyperLinkField HeaderText="Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:HyperLinkField HeaderText="Cliente" DataTextField="Nombre" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" ItemStyle-Width="20%" />
|
||||
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Fecha Cancelación" DataField="FechaCancelacion" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
|
||||
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
|
||||
<asp:BoundField HeaderText="Motivo Cancelacion" DataField="MotivoCancelacion" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Motivo Cancelación Venta" DataField="MotivoCancelacionVenta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
124
Ventas/RepCancelacionesVentas.aspx.vb
Normal file
124
Ventas/RepCancelacionesVentas.aspx.vb
Normal file
@@ -0,0 +1,124 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepCancelacionesVentas
|
||||
Inherits ClsPaginas
|
||||
|
||||
'Private Property DTComplemntos As DataTable
|
||||
' Get
|
||||
' If ViewState("DTComplemntos") Is Nothing Then
|
||||
' Return New DataTable
|
||||
' Else
|
||||
' Return DirectCast(ViewState("DTComplemntos"), DataTable)
|
||||
' End If
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DTComplemntos") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
TxtFiltrosFechaFin.Text = Now.ToShortDateString
|
||||
|
||||
|
||||
|
||||
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlClientes.setEsWebService(True)
|
||||
Else
|
||||
DdlClientes.setEsWebService(False)
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)")
|
||||
DdlMotivoCancelacion.DataBind()
|
||||
|
||||
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto)
|
||||
|
||||
GvDatos.Columns(4).HeaderText = LblSubProyecto.Text
|
||||
|
||||
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
|
||||
LnkExcel.Visible = False
|
||||
|
||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
|
||||
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
|
||||
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
|
||||
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetRepCancelacionVentas(FechaInicio, FechaFin, DdlSubProyecto.SelectedValue.ToEntero, CveCliente, DdlMotivoCancelacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
LnkExcel.Visible = True
|
||||
End If
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
UpAcciones.Update()
|
||||
UpDatos.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "IMPRESION"
|
||||
|
||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs)
|
||||
GeneraImpresion()
|
||||
End Sub
|
||||
|
||||
Private Sub GeneraImpresion()
|
||||
|
||||
GvDatos.ExportToExcel2("RepCancelacionVentas.xlsx")
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
@@ -205,8 +205,8 @@
|
||||
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" />
|
||||
<asp:BoundField HeaderText="Fecha Vencimiento" DataField="FechaVencimiento" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="CantidadOriginal" />
|
||||
<asp:BoundField HeaderText="Por Facturar" DataField="Cantidad" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="CantidadOriginal" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Por Facturar" DataField="Cantidad" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
|
||||
@@ -308,6 +308,11 @@
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Relación:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoRelacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,7 +125,7 @@ Partial Class RepVentaDetalle
|
||||
|
||||
|
||||
Private Sub InicializaValores()
|
||||
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion, CveCondicionesPago As String
|
||||
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion, CveCondicionesPago, CveTipoRelacion As String
|
||||
Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String
|
||||
Dim AnioEjec, MesEjec, AnioMesEjec, FechaEjec, FechaIEjec, FechaFEjec As String
|
||||
'Dim CveSubProyecto As Integer
|
||||
@@ -162,6 +162,8 @@ Partial Class RepVentaDetalle
|
||||
CveMoneda = If(Request("CveMoneda") IsNot Nothing, Request("CveMoneda").ToString.ToEntero, -1).ToString.ToEntero
|
||||
TipoCliente = If(Request("TipoCliente") IsNot Nothing, Request("TipoCliente").ToString.ToEntero, -1).ToString.ToEntero
|
||||
|
||||
CveTipoRelacion = If(Request("CveTipoRelacion") IsNot Nothing, Request("CveTipoRelacion").ToString, "-1").ToString
|
||||
|
||||
DdlTipoCliente.SelectedValueExist(TipoCliente)
|
||||
|
||||
'LISTBOXS
|
||||
@@ -184,6 +186,8 @@ Partial Class RepVentaDetalle
|
||||
DdlVendedor.SelectedValuesIfExistM(CveVendedor)
|
||||
|
||||
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
|
||||
DdlTipoRelacion.SelectedValueExist(CveTipoRelacion)
|
||||
|
||||
CargaClientes()
|
||||
DdlClientes.SelectedValue = CveCliente
|
||||
DdlUsuario.SelectedValueExist(CveUsuario)
|
||||
@@ -389,7 +393,12 @@ Partial Class RepVentaDetalle
|
||||
'Carga Clasificacion Cliente
|
||||
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClienteClasificacion.DataBind()
|
||||
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
|
||||
DdlTipoRelacion.DataBind()
|
||||
DdlTipoRelacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargaGrupo()
|
||||
CargaTipoCentroCosto()
|
||||
@@ -490,7 +499,7 @@ Partial Class RepVentaDetalle
|
||||
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
|
||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
||||
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked) Then
|
||||
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero()) Then
|
||||
DtVentas = AddRows(ObjVentas.DtResultados)
|
||||
ImgImprimir.Enabled = True
|
||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="divModalidadcontable" runat="server" visible="false">
|
||||
<div class="row">
|
||||
<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" />
|
||||
@@ -312,6 +312,11 @@
|
||||
<asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Relación:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoRelacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -520,7 +525,7 @@
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpHP" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<%-- <div class="row">
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:RadioButtonList ID="RblIntervaloHP" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" OnSelectedIndexChanged="RblIntervaloHP_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Semanal</b></label></asp:ListItem>
|
||||
|
||||
@@ -100,7 +100,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
'SI ES EL USUARIO SISTEMA MOSTRAR LA MODALIDAD CONTABLE (TEMPORAL)
|
||||
'If UsuarioActual.CveUsuario = 100 Then
|
||||
divModalidadcontable.Visible = True
|
||||
'divModalidadcontable.Visible = True
|
||||
'End If
|
||||
|
||||
'Modalidad Cotizacion
|
||||
@@ -268,7 +268,11 @@ Partial Class Ventas_RepVentas
|
||||
'Carga Clasificacion Cliente
|
||||
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClienteClasificacion.DataBind()
|
||||
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
|
||||
DdlTipoRelacion.DataBind()
|
||||
DdlTipoRelacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
@@ -321,7 +325,7 @@ Partial Class Ventas_RepVentas
|
||||
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
||||
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable,
|
||||
EsDistribuidor:=DdlDistribuidor.selectedvalue.toentero) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero()) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
@@ -507,7 +511,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
|
||||
'LIGA A DETALLE
|
||||
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaInicial}&FechaF={FechaFinal}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}&ModalidadContable={If(ChkLecturaAdmin.Checked, 0, 1)}"
|
||||
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaInicial}&FechaF={FechaFinal}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}&ModalidadContable={If(ChkLecturaAdmin.Checked, 0, 1)}&CveTipoRelacion={DdlTipoRelacion.SelectedValue}"
|
||||
|
||||
|
||||
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"
|
||||
|
||||
@@ -1080,7 +1080,7 @@
|
||||
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad") %>' Visible="false"></asp:Literal>
|
||||
<asp:Literal ID="LtlTipoDescuento" runat="server" Text='<%# Eval("TipoDescuento") %>' Visible="false"></asp:Literal>
|
||||
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento") %>' Visible="false"></asp:Literal>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Cantidad") %>' ValidationGroup="GprGV" Width="45px" Height="24px"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Cantidad", "{0:####.######}") %>' ValidationGroup="GprGV" Width="45px" Height="24px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:CustomValidator ID="CVCantidadEdit" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprGV"></asp:CustomValidator>
|
||||
@@ -1186,7 +1186,7 @@
|
||||
<asp:Literal ID="LtlDesc" runat="server" Text='<%# Eval("Descuento", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtDescuento" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Descuento") %>' ValidationGroup="GprGV" Width="60px" Height="24px"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtDescuento" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Descuento", "{0:0.00####}") %>' ValidationGroup="GprGV" Width="60px" Height="24px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTESoloNumeros" runat="server" TargetControlID="TxtDescuento" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVDescuento" runat="server" ControlToValidate="TxtDescuento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCDescuento" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescuento" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
@@ -2576,6 +2576,9 @@ Partial Class Ventas
|
||||
DdlSubProyectoDatos.Enabled = False
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnCrearApartirDe.Visible = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
BtnCrearApartirDe.Visible = False
|
||||
End If
|
||||
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then BtnEditar.Visible = True
|
||||
'DdlEstatus.Enabled = True
|
||||
|
||||
@@ -2863,6 +2866,9 @@ Partial Class Ventas
|
||||
|
||||
'DdlSucursal.Enabled = False
|
||||
BtnCrearApartirDe.Visible = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
BtnCrearApartirDe.Visible = False
|
||||
End If
|
||||
'DdlEstatus.Enabled = True
|
||||
|
||||
ImgAddObs.Visible = True
|
||||
@@ -15973,6 +15979,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.EstatusFacturacion Then
|
||||
|
||||
CreaObjetosVenta()
|
||||
|
||||
'PARA CUANDO YA ESTA GUARDADA LA VENTA
|
||||
ObjFactura.CveVenta = CveVenta
|
||||
ObjFactura.Serie = Serie
|
||||
@@ -16177,11 +16184,14 @@ Partial Class Ventas
|
||||
Dim RFCReceptor As String = GvRow.DataKey("RFCReceptor")
|
||||
Dim CvePACCancelacion As Integer = GvRow.DataKey("CvePAC").ToEntero()
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, 0, RFCReceptor, RFCEmisor, CvePACCancelacion) Then
|
||||
|
||||
Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, 0, RFCReceptor, RFCEmisor, CvePACCancelacion)
|
||||
|
||||
If RespCancelacion.Verificado Then
|
||||
|
||||
If ObjBanco.UpdateComplementoPago(CveComplementoPago, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||
CargaComplementosPago()
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
Alert("El complemento se canceló correctamente.")
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -16413,8 +16423,8 @@ Partial Class Ventas
|
||||
If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", Now, CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC) Then
|
||||
Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC)
|
||||
If RespCancelacion.Verificado Then
|
||||
'falta verificar traer el acuse y reenviarlo
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
@@ -17199,8 +17209,8 @@ Partial Class Ventas
|
||||
DdlIVA.SelectedValue = "1"
|
||||
PorcentajeIVA = ViewState("IVA").ToString().ToDecimal
|
||||
Case 0.08
|
||||
DdlIVA.SelectedValue = If(EsCreaApartirDe, $"{(TmpDT.MAX("PorcentajeIVA").ToDecimal + 1).ToString()}", "1.08")
|
||||
PorcentajeIVA = If(EsCreaApartirDe, TmpDT.MAX("PorcentajeIVA").ToDecimal, ViewState("IVA").ToString().ToDecimal)
|
||||
DdlIVA.SelectedValue = If(EsCreaApartirDe, $"{(TmpDT.MAX("PorcentajeIVA").ToDecimal() + 1).RoundSQL(2).ToString()}", "1.08")
|
||||
PorcentajeIVA = If(EsCreaApartirDe, TmpDT.MAX("PorcentajeIVA").ToDecimal, ViewState("IVA").ToString().ToDecimal).RoundSQL(2)
|
||||
DdlIVA.Visible = If(Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0, True, False)
|
||||
Case 0.16
|
||||
DdlIVA.SelectedValue = "1.16"
|
||||
@@ -23638,49 +23648,50 @@ Partial Class Ventas
|
||||
RegistraScript("$('#ModalCancelarDocumento').modal('hide');")
|
||||
End Sub
|
||||
|
||||
Private Sub CancelarRefacturada()
|
||||
Dim CancelacionFecha As Date
|
||||
Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
|
||||
Dim CancelacionAcuse As String = ""
|
||||
Dim Mensaje As String = ""
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = LblRFC.Text.Trim
|
||||
Dim CvePACCancelacion As Integer = CvePAC
|
||||
Dim CveEstatus As Integer = 4
|
||||
'Private Sub CancelarRefacturada()
|
||||
' Dim CancelacionFecha As Date
|
||||
' Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
|
||||
' Dim CancelacionAcuse As String = ""
|
||||
' Dim Mensaje As String = ""
|
||||
' Dim ObjCancelacion As New Timbrado
|
||||
' Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
' Dim RFCReceptor As String = LblRFC.Text.Trim
|
||||
' Dim CvePACCancelacion As Integer = CvePAC
|
||||
' Dim CveEstatus As Integer = 4
|
||||
|
||||
Try
|
||||
If FolioFiscal <> "" Then
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||
'Generamos el acuse y mandamos mail de con el acuse de cancelación - DF 13/01/2017
|
||||
CancelacionFecha = ObjCancelacion.CancelacionFecha
|
||||
CancelacionAcuse = ObjCancelacion.CancelacionAcuse
|
||||
CveEstatus = 5
|
||||
Else
|
||||
Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
CancelacionFecha = Now.Date
|
||||
CancelacionAcuse = ""
|
||||
End If
|
||||
' Try
|
||||
' If FolioFiscal <> "" Then
|
||||
' Dim resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion)
|
||||
' If resp.Verificado Then
|
||||
' 'Generamos el acuse y mandamos mail de con el acuse de cancelación - DF 13/01/2017
|
||||
' CancelacionFecha = ObjCancelacion.CancelacionFecha
|
||||
' CancelacionAcuse = ObjCancelacion.CancelacionAcuse
|
||||
' CveEstatus = 5
|
||||
' Else
|
||||
' Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' Else
|
||||
' CancelacionFecha = Now.Date
|
||||
' CancelacionAcuse = ""
|
||||
' End If
|
||||
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IdPoliza, CvePAC:=CvePACCancelacion) Then
|
||||
ObjVentas.Commit()
|
||||
Alert("El nuevo estatus se guardó correctamente")
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
Alert("Ocurrió un error al intentar cancelar la factura")
|
||||
End If
|
||||
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IdPoliza, CvePAC:=CvePACCancelacion) Then
|
||||
' ObjVentas.Commit()
|
||||
' Alert("El nuevo estatus se guardó correctamente")
|
||||
' Else
|
||||
' ObjVentas.RollBack()
|
||||
' Alert("Ocurrió un error al intentar cancelar la factura")
|
||||
' End If
|
||||
|
||||
Catch ex As Exception
|
||||
ObjVentas.RollBack()
|
||||
Mensaje = "Ocurrio un error al Cancelar la factura"
|
||||
GuardaLog($"{ex.Message}")
|
||||
End Try
|
||||
' Catch ex As Exception
|
||||
' ObjVentas.RollBack()
|
||||
' Mensaje = "Ocurrio un error al Cancelar la factura"
|
||||
' GuardaLog($"{ex.Message}")
|
||||
' End Try
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
' ObjVentas.Dispose()
|
||||
'End Sub
|
||||
Private Function DecodeBase64(ByVal strXMLCodificado As String) As String
|
||||
Try
|
||||
Dim decbuff As Byte() = Convert.FromBase64String(strXMLCodificado)
|
||||
@@ -23769,9 +23780,9 @@ Partial Class Ventas
|
||||
|
||||
Dim LigaRedirigir As String = ""
|
||||
'Si es cancelacion de una refactura ignoramos las condiciones
|
||||
If Me.CveEstatus = 13 Then
|
||||
CancelarRefacturada()
|
||||
End If
|
||||
'If Me.CveEstatus = 13 Then
|
||||
' CancelarRefacturada()
|
||||
'End If
|
||||
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True)
|
||||
Try
|
||||
|
||||
@@ -91,6 +91,25 @@ Public Class WSGPSApp
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
End If
|
||||
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
<SoapHeader("Credentials")>
|
||||
<WebMethod>
|
||||
Public Function Login(params As String) As String
|
||||
@@ -134,15 +153,22 @@ Public Class WSGPSApp
|
||||
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
Next
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'MARCA PARA EL RASTREO SOLO INICIO
|
||||
If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
|
||||
UsuarioRetorno.Clientes = Clientes
|
||||
DtClientes.Dispose()
|
||||
DtClientes = Nothing
|
||||
@@ -201,18 +227,25 @@ Public Class WSGPSApp
|
||||
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
|
||||
Next
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
End If
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
|
||||
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
|
||||
If UsuarioRetorno.CveCliente > 0 Then
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) OrElse UsuarioActual.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'MARCA PARA EL RASTREO SOLO INICIO
|
||||
If UsuarioRetorno.CveUsuario = 3612 Then
|
||||
UsuarioRetorno.RastreoSoloInicio = True
|
||||
End If
|
||||
|
||||
UsuarioRetorno.Clientes = Clientes
|
||||
DtClientes.Dispose()
|
||||
DtClientes = Nothing
|
||||
@@ -1005,13 +1038,6 @@ Public Class WSGPSApp
|
||||
End Function
|
||||
|
||||
#Region "F U N C I O N E S"
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
Private Function CargarEventos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime) As MWSDashboard2
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim dash As New MWSDashboard2
|
||||
@@ -1139,7 +1165,7 @@ Namespace ADGPSModels
|
||||
Public Property Contrasenia As String
|
||||
|
||||
Public Property TienePermisoOC As Boolean
|
||||
Public Property TienePermisoPS As Boolean
|
||||
Public Property TienePermisoPS As Boolean
|
||||
Public Property RastreoSoloInicio As Boolean = False
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user