This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2025-01-21 03:45:32 -07:00
46 changed files with 9064 additions and 5550 deletions

View File

@@ -111,8 +111,8 @@ Public Class ClsClientes
Public Property ExtOtros As String Public Property ExtOtros As String
Public Property CveUsoCFDI As Integer Public Property CveUsoCFDI As Integer
Public Property CveRegimenFiscal As Integer Public Property CveRegimenFiscal As Integer
Public Property CveFormaPago33 As Integer Public Property CveFormaPago As Integer
Public Property CveMetodoPago33 As Integer Public Property CveMetodoPago As Integer
Public Property CveClienteCorporativo As String Public Property CveClienteCorporativo As String
Public Property DesglosaIEPS As Boolean Public Property DesglosaIEPS As Boolean
Public Property NoDesglosaIVA As Boolean Public Property NoDesglosaIVA As Boolean
@@ -332,8 +332,6 @@ Public Class ClsClientes
_TipoPago = Data.Rows(0)("TipoPago").ToString _TipoPago = Data.Rows(0)("TipoPago").ToString
_FormaFacturacion = Data(0)("FormaFacturacion").ToString _FormaFacturacion = Data(0)("FormaFacturacion").ToString
_LimiteCredito = Data(0)("LimiteCredito").ToString.ToDouble _LimiteCredito = Data(0)("LimiteCredito").ToString.ToDouble
'_NumCtaPago = Data(0)("NumCtaPago").ToString
'_CveMetodoPago = Data(0)("CveMetodoPago").ToString.ToEntero
_AplicaFEMSA = CBool(Data(0)("AplicaFEMSA").ToString) _AplicaFEMSA = CBool(Data(0)("AplicaFEMSA").ToString)
_FEMSA_NumSociedad = Data(0)("FEMSA_NumSociedad").ToString _FEMSA_NumSociedad = Data(0)("FEMSA_NumSociedad").ToString
_FEMSA_NumProveedor = Data(0)("FEMSA_NumProveedor").ToString _FEMSA_NumProveedor = Data(0)("FEMSA_NumProveedor").ToString
@@ -375,8 +373,8 @@ Public Class ClsClientes
_CveUsoCFDI = Data(0)("CveUsoCFDI").ToString.ToEntero _CveUsoCFDI = Data(0)("CveUsoCFDI").ToString.ToEntero
_CveFormaPago33 = Data(0)("CveFormaPago").ToString.ToEntero _CveFormaPago = Data(0)("CveFormaPago").ToString.ToEntero
_CveMetodoPago33 = Data(0)("CveMetodoPago").ToString.ToEntero _CveMetodoPago = Data(0)("CveMetodoPago").ToString.ToEntero
_CveRegimenFiscal = Data(0)("CveRegimenFiscal").ToString.ToEntero _CveRegimenFiscal = Data(0)("CveRegimenFiscal").ToString.ToEntero

View File

@@ -594,7 +594,7 @@ Public Class ClsMovimientos
Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer, Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer,
CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer, CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer,
CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0, CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0,
Optional AgrupadoPorSubProyecto As Boolean = False) As Boolean Optional AgrupadoPorSubProyecto As Boolean = False, Optional VerEnPesos As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_Proveedores") DataAdapter("PA_Banc_Proveedores")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -617,6 +617,7 @@ Public Class ClsMovimientos
.Add("@CodigoProgramacion", SqlDbType.VarChar).Value = CodigoProgramacion .Add("@CodigoProgramacion", SqlDbType.VarChar).Value = CodigoProgramacion
.Add("@CveTipoProveedor", SqlDbType.TinyInt).Value = CveTipoProveedor .Add("@CveTipoProveedor", SqlDbType.TinyInt).Value = CveTipoProveedor
.Add("@AgrupadoPorSubProyecto", SqlDbType.Bit).Value = AgrupadoPorSubProyecto .Add("@AgrupadoPorSubProyecto", SqlDbType.Bit).Value = AgrupadoPorSubProyecto
.Add("@VerEnPesos", SqlDbType.Bit).Value = VerEnPesos
End With End With
Try Try

View File

@@ -131,6 +131,8 @@ Public Class ClsOC
End Get End Get
End Property End Property
Public Property DiasCreditoOC As Integer = 0
#End Region #End Region
@@ -695,6 +697,7 @@ Public Class ClsOC
CveProveedorContacto = If(Not IsDBNull(dr("CveProveedorContacto")), dr("CveProveedorContacto").ToString.ToEntero, -1) CveProveedorContacto = If(Not IsDBNull(dr("CveProveedorContacto")), dr("CveProveedorContacto").ToString.ToEntero, -1)
NumRemision = dr("NumRemision").ToString NumRemision = dr("NumRemision").ToString
PorcentajeProntoPago = dr("PorcentajeProntoPago").ToString.ToDecimal PorcentajeProntoPago = dr("PorcentajeProntoPago").ToString.ToDecimal
DiasCreditoOC = dr("DiasCreditoOC").ToString.ToEntero
Retorno = True Retorno = True
ElseIf Data.Rows.Count > 0 Then ElseIf Data.Rows.Count > 0 Then
@@ -715,7 +718,7 @@ Public Class ClsOC
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1", Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional DiasCreditoOC As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd") DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -763,10 +766,13 @@ Public Class ClsOC
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
.Add("@DiasCreditoOC", SqlDbType.Int).Value = DiasCreditoOC
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vSerieFolio", SqlDbType.VarChar, 25).Direction = ParameterDirection.Output .Add("@vSerieFolio", SqlDbType.VarChar, 25).Direction = ParameterDirection.Output
End With End With
Try Try
@@ -929,7 +935,7 @@ Public Class ClsOC
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "", Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1, Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1,
Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional DiasCreditoOC As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraUpdate") DataAdapter("PA_OC_OrdenesCompraUpdate")
@@ -967,6 +973,7 @@ Public Class ClsOC
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
.Add("@DiasCreditoOC", SqlDbType.Int).Value = DiasCreditoOC
End With End With

View File

@@ -1142,7 +1142,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional EstadoCancelacion As String = "", Optional CveEstadoCancelacion As Integer = 0) As Boolean Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional EstadoCancelacion As String = "", Optional CveEstadoCancelacion As Integer = 0, Optional CveEstatusFactura As Integer = 5) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasCancelacion") DataAdapter("PA_Vta_VentasCancelacion")
@@ -1156,6 +1156,7 @@ Public Class ClsVentas
.Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion .Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion
.Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion .Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion
.Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion .Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
.Add("@Cancelada", SqlDbType.SmallInt).Direction = ParameterDirection.Output .Add("@Cancelada", SqlDbType.SmallInt).Direction = ParameterDirection.Output
End With End With

View File

@@ -3574,21 +3574,6 @@ Namespace Modelos
End If End If
Next Next
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
'SIRVE PARA VER LA PREPOLIZA QUE SE VALIDA
'If ObjConta.GetPrePolizasDetalle(ObjFactura.CvePrePoliza) Then
' Dim DtTest = ObjConta.DtResultados
'End If
End If
importeMovimiento = 0
importeMX = 0
End If
If ErrorPrepoliza Then If ErrorPrepoliza Then
Exit For Exit For
End If End If
@@ -3651,15 +3636,12 @@ Namespace Modelos
End If End If
End If End If
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
End If
End If
End If End If
End If End If
importeMovimiento = 0
importeMX = 0
End If End If
End If End If
@@ -5656,7 +5638,7 @@ Namespace Modelos
''' <param name="FechaCancelacion"></param> ''' <param name="FechaCancelacion"></param>
''' <param name="AcuseCancelacion"></param> ''' <param name="AcuseCancelacion"></param>
''' <returns></returns> ''' <returns></returns>
Public Function EjecutarCancelacionPendiente(CveEstatus As Integer, FechaCancelacion As DateTime, AcuseCancelacion As String, Optional ValidarSAT As Boolean = True, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos) As MCancelacionVentaMensaje Public Function EjecutarCancelacionPendiente(CveEstatus As Integer, FechaCancelacion As DateTime, AcuseCancelacion As String, Optional ValidarSAT As Boolean = True, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos, Optional CvePACEspecifico As Integer = -1) As MCancelacionVentaMensaje
Dim ListaRemisionesCancelar As New List(Of Integer) Dim ListaRemisionesCancelar As New List(Of Integer)
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
If ObjVentas.GetRemisionesXCancelar(Me.CveVenta) Then If ObjVentas.GetRemisionesXCancelar(Me.CveVenta) Then
@@ -5666,7 +5648,7 @@ Namespace Modelos
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=Me.RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusFacturaAsignado:=CveEstatus, FechaCancelacion:=FechaCancelacion.ToString("dd/MM/yyyy hh:mm:ss"), AcuseCancelacion:=AcuseCancelacion, CveMotivoCancelacion:=Me.CveMotivoCancelacion, MotivoCancelacion:=Me.MotivoCancelacion, ValidarSAT:=ValidarSAT, CancelacionPagos:=CancelacionPagos) Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=Me.RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusFacturaAsignado:=CveEstatus, FechaCancelacion:=FechaCancelacion.ToString("dd/MM/yyyy hh:mm:ss"), AcuseCancelacion:=AcuseCancelacion, CveMotivoCancelacion:=Me.CveMotivoCancelacion, MotivoCancelacion:=Me.MotivoCancelacion, ValidarSAT:=ValidarSAT, CancelacionPagos:=CancelacionPagos, CvePACEspecifico:=CvePACEspecifico)
End Function End Function
''' <summary> ''' <summary>
''' Cancela la factura para poder realizar la refacturacion ''' Cancela la factura para poder realizar la refacturacion
@@ -5681,16 +5663,18 @@ Namespace Modelos
''' <param name="RealizarDevolucionAlmacen"></param> ''' <param name="RealizarDevolucionAlmacen"></param>
''' <param name="ListaRemisionesCancelar"></param> ''' <param name="ListaRemisionesCancelar"></param>
''' <returns></returns> ''' <returns></returns>
Public Function CancelarFactura(RealizarDevolucionAlmacen As Integer, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos) As MCancelacionVentaMensaje Public Function CancelarFactura(RealizarDevolucionAlmacen As Integer, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos, Optional CveEstatusFacturaAsignado As Integer = -1, Optional CvePACEspecifico As Integer = -1) As MCancelacionVentaMensaje
'Comprobante emitido con errores sin relación 'Comprobante emitido con errores sin relación
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, ForzarDevolucion:=ForzarDevolucion, CancelacionPagos:=CancelacionPagos) Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, ForzarDevolucion:=ForzarDevolucion, CancelacionPagos:=CancelacionPagos, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado, ValidarSAT:=ValidarSAT, CvePACEspecifico:=CvePACEspecifico)
End Function End Function
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Integer = 0, Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Integer = 0,
Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1", Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1",
Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "",
Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0,
Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos) As MCancelacionVentaMensaje Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos,
Optional CvePACEspecifico As Integer = -1) As MCancelacionVentaMensaje
Dim Retorno As New MCancelacionVentaMensaje() Dim Retorno As New MCancelacionVentaMensaje()
Dim ErrorList As New List(Of String) Dim ErrorList As New List(Of String)
@@ -5887,6 +5871,10 @@ Namespace Modelos
CvePACCancelacion = UsuarioActual.Empresa.CvePAC CvePACCancelacion = UsuarioActual.Empresa.CvePAC
End If End If
If CvePACEspecifico > 0 Then
CvePACCancelacion = CvePACEspecifico
End If
Dim CveEstatus As Integer = 4 Dim CveEstatus As Integer = 4
Dim IDPoliza As Integer = -1 Dim IDPoliza As Integer = -1
Dim CvePrePoliza As Integer Dim CvePrePoliza As Integer

View File

@@ -220,9 +220,6 @@ Public Class Timbrado
'dim Error 'dim Error
If CvePACCancelacion = 3 Then ValidaFactura = False If CvePACCancelacion = 3 Then ValidaFactura = False
'TEMPORAL. PARCHE PARA CANCELAR DOCUMENTOS EMITIDOS CON EL PAC 5
If CvePACCancelacion = 5 Then CvePACCancelacion = 4
If Not (Empresa.Funcionalidad(529) = "1") Then If Not (Empresa.Funcionalidad(529) = "1") Then
If ValidaFactura Then If ValidaFactura Then
Dim Vigencia As AcuseCancelacionSAT = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True) Dim Vigencia As AcuseCancelacionSAT = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True)
@@ -355,7 +352,7 @@ Public Class Timbrado
Dim UsuarioServicio As String = If(CvePACCancelacion = 2, Empresa.RFC, "rene.molina@adsistemas.mx") Dim UsuarioServicio As String = If(CvePACCancelacion = 2, Empresa.RFC, "rene.molina@adsistemas.mx")
Dim ClaveServicio As String = If(CvePACCancelacion = 2, Empresa.RFC.ToLower, "rene2018") Dim ClaveServicio As String = If(CvePACCancelacion = 2, Empresa.RFC.ToLower, "rene2018")
Dim Clave As String = Empresa.ContraseñaKey Dim Clave As String = Empresa.ContraseñaKey
Dim UrlServicio As String = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL" ' Produccion Dim UrlServicio As String = "https://cfdi.gofac.com.mx/timbrado.asmx" ' Produccion
If Not Empresa.FacturaProduccion Then If Not Empresa.FacturaProduccion Then
ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key" ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
@@ -363,6 +360,7 @@ Public Class Timbrado
UsuarioServicio = "UserTest" UsuarioServicio = "UserTest"
ClaveServicio = "1234567890" ClaveServicio = "1234567890"
UrlServicio = "https://servicios.gofac.com.mx/cancelacion.asmx" ' Produccion
End If End If
#Region "Valida" #Region "Valida"
If Not File.Exists(ArchivoCertificado) Then If Not File.Exists(ArchivoCertificado) Then
@@ -522,31 +520,33 @@ Public Class Timbrado
End Select End Select
'valida que si se halla cancelado 'valida que si se halla cancelado
If Not (Empresa.Funcionalidad(529) = "1") Then
If Retorno.Verificado Then If Retorno.Verificado Then
Dim VigenciaExtra As AcuseCancelacionSAT = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True) Dim VigenciaExtra As AcuseCancelacionSAT = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True)
If VigenciaExtra IsNot Nothing Then If VigenciaExtra IsNot Nothing Then
If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then
Retorno.Estado = "EN PROCESO" Retorno.Estado = "EN PROCESO"
Retorno.CveEstatus = 20 Retorno.CveEstatus = 20
'CUANDO ESTA EN PROCESO EL ACUSE DEBE SER DE SOLICITUD DE CANCELACION 'CUANDO ESTA EN PROCESO EL ACUSE DEBE SER DE SOLICITUD DE CANCELACION
Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse
Retorno.CancelacionAcuse = ""
ElseIf VigenciaExtra.Estado.ToUpper = "CANCELADO" Then
Retorno.Estado = "CANCELADO"
Retorno.CveEstatus = 5
Else
Retorno.Estado = "VIGENTE"
Retorno.CveEstatus = 23
'SI HAY UN ACUSE, GUARDARLO COMO ACUSE DE SOLICITUD
If Not String.IsNullOrEmpty(Retorno.CancelacionAcuse) Then
Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse
Retorno.CancelacionAcuse = "" Retorno.CancelacionAcuse = ""
ElseIf VigenciaExtra.Estado.ToUpper = "CANCELADO" Then
Retorno.Estado = "CANCELADO"
Retorno.CveEstatus = 5
Else
Retorno.Estado = "VIGENTE"
Retorno.CveEstatus = 23
'SI HAY UN ACUSE, GUARDARLO COMO ACUSE DE SOLICITUD
If Not String.IsNullOrEmpty(Retorno.CancelacionAcuse) Then
Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse
Retorno.CancelacionAcuse = ""
End If
End If End If
End If End If
End If End If
End If End If
If Not Retorno.Verificado Then If Not Retorno.Verificado Then
GuardaLog($"****** Error al cancelar factura ****** Estatus: {CancelacionState} | Mensaje: {CancelacionMensaje} | Mensaje SAT: {MsgCancelacion.ToString} ") GuardaLog($"****** Error al cancelar factura ****** Estatus: {CancelacionState} | Mensaje: {CancelacionMensaje} | Mensaje SAT: {MsgCancelacion.ToString} ")
End If End If
@@ -993,7 +993,7 @@ Public Class Timbrado
' Retorno = If(Ret = "", True, False) ' Retorno = If(Ret = "", True, False)
Case 3 Case 3
Retorno = TimbrarFacturaProFactV40(UsuarioActual, Ventas) Retorno = TimbrarFacturaProFactv40(UsuarioActual, Ventas)
Case 4 Case 4
Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial) Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial)
If Ret <> "" Then MensajeErrorCFDI = Ret If Ret <> "" Then MensajeErrorCFDI = Ret
@@ -2572,12 +2572,12 @@ concep.DescripcionesEspecificas.NumeroSerie)
If Carta.RegimenAduanero <> "" Then cfdi.CartaPorte31RegimenAduaneroCCP(Carta.RegimenAduanero) If Carta.RegimenAduanero <> "" Then cfdi.CartaPorte31RegimenAduaneroCCP(Carta.RegimenAduanero)
'UBICACIONES 'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
'origen 'origen
cfdi.CartaPorte31Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida) cfdi.CartaPorte31Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
cfdi.CartaPorte31Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP) cfdi.CartaPorte31Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
Next Next
End If End If
'MERCANCIAS 'MERCANCIAS
If Carta.Mercancias IsNot Nothing Then If Carta.Mercancias IsNot Nothing Then
@@ -2898,6 +2898,8 @@ concep.DescripcionesEspecificas.NumeroSerie)
UsuarioServicio = "UserTest" UsuarioServicio = "UserTest"
ClaveServicio = "1234567890" ClaveServicio = "1234567890"
UsuarioActual.Empresa.CodigoRegimenFiscal = "601" UsuarioActual.Empresa.CodigoRegimenFiscal = "601"
UrlServicio = "https://pruebas.gofac.com.mx/timbrado.asmx?WSDL"
End If End If
#Region "Valida" #Region "Valida"
@@ -2957,7 +2959,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
#Region "Timbra" #Region "Timbra"
If RespGeneracionXML = "" Then If RespGeneracionXML = "" Then
cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, TimbraProduccion) cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, TimbraProduccion, UrlServicio)
sw.Stop() sw.Stop()
swTiempo.AppendFormat("Timbrado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) swTiempo.AppendFormat("Timbrado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)

View File

@@ -269,6 +269,7 @@ Partial Class Bancos_DepositosCaja
Dim CveSubProyectoIntermediario As Integer Dim CveSubProyectoIntermediario As Integer
Dim CveClasificacionIntermediario As Integer Dim CveClasificacionIntermediario As Integer
Dim CveProveedorIntermediario As Integer = -1 Dim CveProveedorIntermediario As Integer = -1
Dim tSubProyectoDeposito As String = ""
If drOrigen IsNot Nothing Then If drOrigen IsNot Nothing Then
CveMoneda = drOrigen("CveMoneda").ToString.ToEntero CveMoneda = drOrigen("CveMoneda").ToString.ToEntero
@@ -347,13 +348,13 @@ Partial Class Bancos_DepositosCaja
'se saca de la cuenta de la caja chica 'se saca de la cuenta de la caja chica
CveSubProyecto = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, Estatus:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero() CveSubProyecto = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, Estatus:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
End If End If
End If End If
tSubProyectoDeposito = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto).FiltroPrimeroValor("SubProyecto")
If FolioIE <= 0 Then If FolioIE <= 0 Then
OcurrioError = True OcurrioError = True
End If End If
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario) CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, $"Depósito Bancario - {tSubProyectoDeposito}", TotalImporte, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a> &nbsp &nbsp <br/> ", CveIEOrigen, FolioIE) documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a> &nbsp &nbsp <br/> ", CveIEOrigen, FolioIE)
@@ -363,7 +364,7 @@ Partial Class Bancos_DepositosCaja
CveSubProyectoComision = DdlSubProyectoDeposito.SelectedValue.ToEntero CveSubProyectoComision = DdlSubProyectoDeposito.SelectedValue.ToEntero
CveClasificacionComision = DdlClasificacion.SelectedValue.ToEntero CveClasificacionComision = DdlClasificacion.SelectedValue.ToEntero
If Comision <> 0 Then If Comision <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, Comision * TipoCambio, 78, "Depósito Bancario", "Depósito Bancario", CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision) Then If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, Comision * TipoCambio, 78, $"Depósito Bancario - {tSubProyectoDeposito}", $"Depósito Bancario - {tSubProyectoDeposito}", CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -384,9 +385,9 @@ Partial Class Bancos_DepositosCaja
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
CveTransaccionBanco = 13 CveTransaccionBanco = 13
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco) FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco)
Dim CveIEOrigenRetorno As Integer = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CveIEOrigenRetorno As Integer = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, $"Retorno Depósito Bancario - {tSubProyectoDeposito}", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "Depósito Bancario", TxtCuentaRetornoObs.Text.Trim, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, $"Depósito Bancario - {tSubProyectoDeposito}", TxtCuentaRetornoObs.Text.Trim, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -531,10 +532,8 @@ Partial Class Bancos_DepositosCaja
End If End If
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0")
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") 'deben de estar consideradas las que están en proceso de cobro, por algún otro usuario.
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
If dtt.Rows.Count = 0 Then If dtt.Rows.Count = 0 Then
Respuesta = True Respuesta = True
Else Else
@@ -543,7 +542,7 @@ Partial Class Bancos_DepositosCaja
End If End If
Else Else
Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia) Alert("Error al consultar cobros pendientes.", TipoMensaje.MsgAdvertencia)
Respuesta = False Respuesta = False
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()

View File

@@ -951,7 +951,8 @@ Partial Class Bancos_IE
End If End If
End If End If
LblPagarA.Visible = True
LblPagarA.Text = ObjIE.PagueseA
If CveCliente > 0 Then If CveCliente > 0 Then
DdlCliente.SelectedText = ObjIE.PagueseA DdlCliente.SelectedText = ObjIE.PagueseA
DdlCliente.SelectedValue = CveCliente.ToString DdlCliente.SelectedValue = CveCliente.ToString
@@ -959,9 +960,6 @@ Partial Class Bancos_IE
DdlCliente.Visible = False DdlCliente.Visible = False
DdlCliente.Enabled = False DdlCliente.Enabled = False
LblPagarA.Visible = True
LblPagarA.Text = ObjIE.PagueseA
' LnkEmitirComplemento.Visible = True ' LnkEmitirComplemento.Visible = True
ElseIf CveProveedor > 0 Then ElseIf CveProveedor > 0 Then
DdlProveedores.SelectedText = ObjIE.PagueseA DdlProveedores.SelectedText = ObjIE.PagueseA
@@ -969,10 +967,6 @@ Partial Class Bancos_IE
DdlProveedores.Visible = False DdlProveedores.Visible = False
DdlProveedores.Enabled = False DdlProveedores.Enabled = False
LblPagarA.Visible = True
LblPagarA.Text = ObjIE.PagueseA
'Se prepara para la generacion del envio de correo con notificacion de pago 'Se prepara para la generacion del envio de correo con notificacion de pago
LnkEnviarMailPago.Attributes.Add("onclick", "$('#ModalDivMail').modal();") LnkEnviarMailPago.Attributes.Add("onclick", "$('#ModalDivMail').modal();")
LnkEnviarMailPago.Visible = True LnkEnviarMailPago.Visible = True
@@ -984,10 +978,10 @@ Partial Class Bancos_IE
End If End If
'SI TIENE EL DATO DEBE MOSTRALO 'SI TIENE EL DATO DEBE MOSTRALO
If UsuarioActual.CveEmpresa = 119 AndAlso LblPagueseA.Text = "Beneficiario" AndAlso Not String.IsNullOrEmpty(ObjIE.PagueseA) Then 'If UsuarioActual.CveEmpresa = 119 AndAlso LblPagueseA.Text = "Beneficiario" AndAlso Not String.IsNullOrEmpty(ObjIE.PagueseA) Then
LblPagarA.Visible = True ' LblPagarA.Visible = True
LblPagarA.Text = ObjIE.PagueseA ' LblPagarA.Text = ObjIE.PagueseA
End If 'End If
IDPoliza = ObjIE.IDPoliza IDPoliza = ObjIE.IDPoliza

View File

@@ -342,8 +342,9 @@
<asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" /> <asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" /> <asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" /> <asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
<asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup ="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox> <asp:CheckBox Text="Descuento Masivo" ID="chkaplicaDescuentoMasivo" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuentoMasivo_CheckedChanged" AutoPostBack="true" Visible="false" />
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" /> <asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" />
</td> </td>
</tr> </tr>
@@ -477,6 +478,15 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 14 --%> <%-- 14 --%>
<asp:TemplateField>
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>&nbsp;
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<%-- 15 --%>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Auxiliar</HeaderTemplate> <HeaderTemplate>Auxiliar</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
@@ -601,7 +611,6 @@
var Facturas = ''; var Facturas = '';
function FnSuma(t, txt, importe) { function FnSuma(t, txt, importe) {
debugger;
var chkPesosBancos = $get("ChkPagarPesos"); var chkPesosBancos = $get("ChkPagarPesos");
var chkDolaresBancos = $get("ChkPagarDolares"); var chkDolaresBancos = $get("ChkPagarDolares");
@@ -612,9 +621,9 @@
} }
if (chkPesosBancos && chkPesosBancos.checked) { if (chkPesosBancos && chkPesosBancos.checked) {
CambiaPesosDolares() CambiaPesosDolares();
} else if (chkDolaresBancos && chkDolaresBancos.checked) { } else if (chkDolaresBancos && chkDolaresBancos.checked) {
CambiaDolaresPesos() CambiaDolaresPesos();
} }
else { else {
var Suma = SumaValores(); var Suma = SumaValores();
@@ -622,7 +631,7 @@
} }
} }
function SumaValores(aplicaTC) { function SumaValores(aplicaTC, cveMonedaPago = 0) {
var Importe = 0; var Importe = 0;
var Comision = 0.00; var Comision = 0.00;
@@ -637,11 +646,43 @@
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', ''); idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText; Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
let importeFactura = 0; let importeFactura = 0;
if (aplicaTC && $get('TxtTC') != null) {
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join('')); if (cveMonedaPago == 0) {
if (aplicaTC && $get('TxtTC') != null) {
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
} else {
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
}
} else { } else {
importeFactura = parseFloat(textBoxes[i].value.split(',').join('')); let cveMonedaCompra = textBoxes[i].getAttribute("cvemoneda");
switch (cveMonedaPago) {
case 1: //PAGO CON PESOS
//SI SON DOLARES MULTIPLICAR POR TC
if (cveMonedaCompra == '2') {
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
//MISMA MONEDA DEBE SOLO SUMAR
} else if (cveMonedaCompra == '1') {
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
}
break;
case 2: //PAGO CON DOLARES
//MISMA MONEDA DEBE SOLO SUMAR
if (cveMonedaCompra == '2') {
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
//SI SON PESOS DIVIDIR ENTRE EL TC
} else if (cveMonedaCompra == '1') {
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) / parseFloat($get('TxtTC').value), 2).split(',').join(''));
}
break;
}
} }
Importe = parseFloat(Importe) + importeFactura; Importe = parseFloat(Importe) + importeFactura;
} }
} }
@@ -699,53 +740,91 @@
} }
if (chkPesosBancos && chkPesosBancos.checked) { if (chkPesosBancos && chkPesosBancos.checked) {
CambiaPesosDolares() CambiaPesosDolares();
} else if (chkDolaresBancos && chkDolaresBancos.checked) { } else if (chkDolaresBancos && chkDolaresBancos.checked) {
CambiaDolaresPesos() CambiaDolaresPesos();
} }
} }
function CambiaPesosDolares() { function CambiaPesosDolares() {
let ImporteDolares = SumaValores(true); if ('<%= Me.FiltrarCuentas.ToString() %>' == '1') {
let ImporteDolares = SumaValores(true);
$get('TxtImporte').value = FormatoNumero(ImporteDolares, 2); $get('TxtImporte').value = FormatoNumero(ImporteDolares, 2);
$('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2)) $('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2))
if ($("#LbImporteME").length) { if ($("#LbImporteME").length) {
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false), 2) + ' USD'; $get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false), 2) + ' USD';
$get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2); $get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2);
$get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2); $get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2);
}
if ($get('TxtTotal') != null) {
$get('TxtTotal').value = FormatoNumero(parseFloat($get('TxtImporte').value.replace(',', '')) + parseFloat($get('TxtOtrosImportes').value.replace(',', '') * -1), 2);
}
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
} else {
SumaDolaresPesos(1);
} }
if ($get('TxtTotal') != null) {
$get('TxtTotal').value = FormatoNumero(parseFloat($get('TxtImporte').value.replace(',', '')) + parseFloat($get('TxtOtrosImportes').value.replace(',', '') * -1), 2);
}
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
} }
function CambiaDolaresPesos() { function CambiaDolaresPesos() {
debugger; if ('<%= Me.FiltrarCuentas.ToString() %>' == '1') {
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2); $get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2)) $('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
if ($("#LbImporteMN").length) {
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) / ToDouble($get('TxtTC').value), 2);
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTC').value), 2);
}
if ($get('TxtTotal') != null) {
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) + (ToDouble($get('TxtOtrosImportes').value.replace(',', '') * -1)), 2);
}
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
} else {
SumaDolaresPesos(2);
}
}
function SumaDolaresPesos(cveMonedaPago) {
let ImporteSuma = parseFloat(SumaValores(false, cveMonedaPago));
$get('TxtImporte').value = FormatoNumero(ImporteSuma, 2);
$('#LtlTotalMXN').text(FormatoNumero(ImporteSuma, 2))
debugger;
if ($("#LbImporteMN").length) { if ($("#LbImporteMN").length) {
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) / ToDouble($get('TxtTC').value), 2); $get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')), 2);
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTC').value), 2); $get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value), 2);
switch (cveMonedaPago) {
case 1:
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(ImporteSuma, 2) + ' MXN';
break;
case 2:
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(ImporteSuma, 2) + ' USD';
break;
}
} }
if ($get('TxtTotal') != null) { if ($get('TxtTotal') != null) {
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) + (ToDouble($get('TxtOtrosImportes').value.replace(',', '') * -1)), 2); $get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) + (ToDouble($get('TxtOtrosImportes').value.replace(',', '') * -1)), 2);
} }
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2); if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(ImporteSuma, 2);
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2); if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(ImporteSuma - ((ImporteSuma / 1.16)), 2);
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000); if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
} }

View File

@@ -99,6 +99,14 @@ Partial Class Bancos_ProveedoresAbonar
End Set End Set
End Property End Property
Public Property FiltrarCuentas As Integer
Get
Return If(IsNothing(ViewState("FiltrarCuentas")), 1, ViewState("FiltrarCuentas").ToString.ToEntero)
End Get
Set(value As Integer)
ViewState("FiltrarCuentas") = value
End Set
End Property
Private Property CveMonedaFiltro As Integer Private Property CveMonedaFiltro As Integer
Get Get
Return ViewState("CveMonedaFiltro").ToString.ToEntero Return ViewState("CveMonedaFiltro").ToString.ToEntero
@@ -247,6 +255,7 @@ Partial Class Bancos_ProveedoresAbonar
CveClasificacionProveedor = IfNull(Request("CveClasificacion"), "-1").ToString.ToEntero CveClasificacionProveedor = IfNull(Request("CveClasificacion"), "-1").ToString.ToEntero
CveMoneda = IfNull(Request("CveMoneda"), "-1").ToString.ToEntero CveMoneda = IfNull(Request("CveMoneda"), "-1").ToString.ToEntero
CveMonedaFiltro = IfNull(Request("CveMoneda"), "-1").ToString.ToEntero CveMonedaFiltro = IfNull(Request("CveMoneda"), "-1").ToString.ToEntero
FiltrarCuentas = IfNull(Request("FiltrarCuentas"), "1").ToString.ToEntero
CveEstatus = IfNull(Request("CveEstatus"), "-1").ToString.ToEntero CveEstatus = IfNull(Request("CveEstatus"), "-1").ToString.ToEntero
Serie = IfNull(Request("Serie"), "").ToString Serie = IfNull(Request("Serie"), "").ToString
CveAplicaNC = IfNull(Request("CveAplicaNC"), "-1").ToString.ToEntero CveAplicaNC = IfNull(Request("CveAplicaNC"), "-1").ToString.ToEntero
@@ -254,7 +263,6 @@ Partial Class Bancos_ProveedoresAbonar
CodigoProgramacion = IfNull(Request("CodigoProgramacion"), "-1").ToString CodigoProgramacion = IfNull(Request("CodigoProgramacion"), "-1").ToString
CveSubProyectoFiltro = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero CveSubProyectoFiltro = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0)) TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0))
'proceso para que solo pague lo que este programada 'proceso para que solo pague lo que este programada
@@ -300,13 +308,25 @@ Partial Class Bancos_ProveedoresAbonar
LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda")) LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda"))
End If End If
If CveMoneda = 2 Then 'SI NO ES GDIAZ, NO PERMITIR LA MEZCLA DE CUENTAS
ChkPagarPesos.Visible = True If UsuarioActual.Empresa.Funcionalidad(382) <> "1" AndAlso FiltrarCuentas = 0 Then
TxtTC.Text = GlobalTipoCambio(NowADS()).FormatoNumero(4) FiltrarCuentas = 1
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") End If
If FiltrarCuentas = 0 Then
ChkPagarPesos.Visible = False
ChkPagarDolares.Visible = False
CveMonedaFiltro = -1
Else Else
ChkPagarDolares.Visible = True If CveMoneda = 2 Then
TxtTC.Text = GlobalTipoCambio(NowADS()).FormatoNumero(4) ChkPagarPesos.Visible = True
TxtTC.Text = GlobalTipoCambio(NowADS()).FormatoNumero(4)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
Else
ChkPagarDolares.Visible = True
TxtTC.Text = GlobalTipoCambio(NowADS()).FormatoNumero(4)
End If
End If End If
RegistraScript($"TipoCambioActual = {GlobalTipoCambio(NowADS()).FormatoNumero(4)}") RegistraScript($"TipoCambioActual = {GlobalTipoCambio(NowADS()).FormatoNumero(4)}")
@@ -324,7 +344,7 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.TienePermisoProceso(361) Then If UsuarioActual.TienePermisoProceso(361) Then
'GvCxP.Columns(11).Visible = True 'GvCxP.Columns(11).Visible = True
chkaplicaDescuento.Visible = True chkaplicaDescuento.Visible = True
'chkaplicaDescuentoMasivo.Visible = True chkaplicaDescuentoMasivo.Visible = True
End If End If
@@ -367,23 +387,34 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub CargaDatos(Optional tCveMoneda As Integer = -1) 'pCveProveedor As Integer, tCveMoneda As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveUsuarioRegistro As Integer, CveUsuarioPrograma As Integer, Serie As String) Private Sub CargaDatos(Optional tCveMoneda As Integer = -1) 'pCveProveedor As Integer, tCveMoneda As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveUsuarioRegistro As Integer, CveUsuarioPrograma As Integer, Serie As String)
If tCveMoneda = -1 Then tCveMoneda = CveMoneda If tCveMoneda = -1 Then tCveMoneda = CveMoneda
Dim Mov As New ClsMovimientos If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso FiltrarCuentas = 0 Then
tCveMoneda = -1
End If
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
TxtImporte.Text = "" TxtImporte.Text = ""
TxtTotal.Text = "" TxtTotal.Text = ""
If Mov.GetCxPProveedor(CveProveedor, FechaI, FechaF, CveUsuarioProgramo, CveUsuarioRegistro, CveUsuarioResponsable, CveClasificacionProveedor, tCveMoneda, CveEstatus, CveProveedorSucursal, CveAplicaNC, "-1", "-1", CodigoProgramacion, CveSubProyecto:=CveSubProyectoFiltro) Then Dim ObjMov As New ClsMovimientos
DtDatos = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") If ObjMov.GetCxPProveedor(CveProveedor, FechaI, FechaF, CveUsuarioProgramo, CveUsuarioRegistro, CveUsuarioResponsable, CveClasificacionProveedor, tCveMoneda, CveEstatus, CveProveedorSucursal, CveAplicaNC, "-1", "-1", CodigoProgramacion, CveSubProyecto:=CveSubProyectoFiltro) Then
If FiltrarCuentas = 1 Then
DtDatos = ObjMov.DtResultados.FiltraParametros("Tipo = 'Act' AND Saldo > 0", "Fecha,SerieFolio")
Else
DtDatos = ObjMov.DtResultados.FiltraParametros("CveCompra > 0 AND Saldo > 0", "Fecha,SerieFolio")
End If
GvCxP.DataSource = DtDatos GvCxP.DataSource = DtDatos
DtDatos.Columns.Add("Movimiento") DtDatos.Columns.Add("Movimiento")
If DtDatos.Rows.Count > 0 Then If DtDatos.Rows.Count > 0 Then
DVBusqueda.Visible = True DVBusqueda.Visible = True
DtDatos.Rows(0)("Movimiento") = "FACTURA DE ACREEDOR" DtDatos.Rows(0)("Movimiento") = "FACTURA DE ACREEDOR"
End If End If
End If End If
ObjMov.Dispose()
Mov.Dispose()
GvCxP.DataBind() GvCxP.DataBind()
UPCompras.Update() UPCompras.Update()
UpBusqueda.Update() UpBusqueda.Update()
@@ -449,7 +480,7 @@ Partial Class Bancos_ProveedoresAbonar
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"))) e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo")))
If e.Row.RowIndex = 0 Then If FiltrarCuentas = 1 AndAlso e.Row.RowIndex = 0 Then
e.Row.FCHyperLink("HplF").Text = (CType(GvCxP.DataSource, DataTable).Rows.Count - 1).ToString e.Row.FCHyperLink("HplF").Text = (CType(GvCxP.DataSource, DataTable).Rows.Count - 1).ToString
e.Row.BackColor = Drawing.Color.LightGray e.Row.BackColor = Drawing.Color.LightGray
End If End If
@@ -473,6 +504,8 @@ Partial Class Bancos_ProveedoresAbonar
e.Row.FCLiteral("LtlFactura").Text = e.Row.DBCampo("Folio") e.Row.FCLiteral("LtlFactura").Text = e.Row.DBCampo("Folio")
End If End If
e.Row.FCTextBox("TxtAbonar").Attributes.Add("CveMoneda", e.Row.DBCampo("CveMoneda"))
If e.Row.DBCampo("CveCompra").ToEntero > 0 Then If e.Row.DBCampo("CveCompra").ToEntero > 0 Then
Dim FiltroInv As String = "" Dim FiltroInv As String = ""
@@ -643,6 +676,10 @@ Partial Class Bancos_ProveedoresAbonar
Dim ValidaSAT As Boolean = True Dim ValidaSAT As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(529) = "1" OrElse ChkNoValidaSAT.Checked Then ValidaSAT = False If UsuarioActual.Empresa.Funcionalidad(529) = "1" OrElse ChkNoValidaSAT.Checked Then ValidaSAT = False
If Not EsProduccion Then
ValidaSAT = False
End If
If ValidaSAT Then If ValidaSAT Then
Dim Validada As Boolean = False Dim Validada As Boolean = False
Dim MsgValidadas As New StringBuilder Dim MsgValidadas As New StringBuilder
@@ -826,8 +863,19 @@ Partial Class Bancos_ProveedoresAbonar
Pago.TCPago = TxtTC.Text.ToDecimal Pago.TCPago = TxtTC.Text.ToDecimal
Pago.ImportePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal / TxtTC.Text.ToDecimal) Pago.ImportePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal / TxtTC.Text.ToDecimal)
End If End If
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / TxtTC.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = TxtTC.Text.ToDecimal If ChkPagarPesos.Checked Then
If CompraActual.CveMoneda = 1 Then
Pago.TCCambioMoneda = 1
Else
Pago.TCCambioMoneda = 1 / TxtTC.Text.ToDecimal
End If
End If
If ChkPagarDolares.Checked Then
Pago.TCCambioMoneda = TxtTC.Text.ToDecimal
End If
If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then
Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
@@ -1117,18 +1165,22 @@ Partial Class Bancos_ProveedoresAbonar
DdlCuenta.Items.Clear() DdlCuenta.Items.Clear()
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
If ChkPagarPesos.Checked Then If FiltrarCuentas = 1 Then
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) If ChkPagarPesos.Checked Then
RegistraScript("CambiaPesosDolares();") dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1))
ElseIf ChkPagarDolares.Checked Then RegistraScript("CambiaPesosDolares();")
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 2)) ElseIf ChkPagarDolares.Checked Then
RegistraScript("CambiaDolaresPesos();") dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 2))
Else RegistraScript("CambiaDolaresPesos();")
If CveMonedaFiltro > 0 Then Else
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMonedaFiltro)) If CveMonedaFiltro > 0 Then
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMonedaFiltro))
End If
End If End If
End If End If
If TipoPago = 3 Then If TipoPago = 3 Then
dt = dt.FiltraParametros("CveTipoCuenta = 7") dt = dt.FiltraParametros("CveTipoCuenta = 7")
End If End If
@@ -1148,8 +1200,32 @@ Partial Class Bancos_ProveedoresAbonar
End Sub End Sub
Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged
'recargo la moneda con la que se va a pagar
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)) Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue))
If FiltrarCuentas = 0 Then
If dr("CveMoneda").ToString() = "2" Then
ChkPagarDolares.Visible = True
ChkPagarDolares.Checked = True
ChkPagarDolares.Enabled = False
ChkPagarPesos.Visible = False
ChkPagarPesos.Checked = False
Else
ChkPagarPesos.Visible = True
ChkPagarPesos.Checked = True
ChkPagarPesos.Enabled = False
ChkPagarDolares.Visible = False
ChkPagarDolares.Checked = False
End If
TxtTC.Text = GlobalTipoCambio(NowADS()).FormatoNumero(4)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
End If
'recargo la moneda con la que se va a pagar
If dr IsNot Nothing Then If dr IsNot Nothing Then
TxtFechaDocumento.Attributes.Remove("onchange") TxtFechaDocumento.Attributes.Remove("onchange")
UpDatos.Update() UpDatos.Update()
@@ -1673,11 +1749,17 @@ Partial Class Bancos_ProveedoresAbonar
Protected Sub chkaplicaDescuento_CheckedChanged(sender As Object, e As EventArgs) Protected Sub chkaplicaDescuento_CheckedChanged(sender As Object, e As EventArgs)
GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked
TxtDescuenoMasivo.Visible = chkaplicaDescuento.Checked
UPCompras.Update() UPCompras.Update()
End Sub End Sub
Protected Sub chkaplicaDescuentoMasivo_CheckedChanged(sender As Object, e As EventArgs)
GvCxP.Columns(11).Visible = chkaplicaDescuentoMasivo.Checked
TxtDescuenoMasivo.Visible = chkaplicaDescuentoMasivo.Checked
UPCompras.Update()
End Sub
Private Sub tmpValida() Private Sub tmpValida()
Dim ValidaSAT As Boolean = True Dim ValidaSAT As Boolean = True

View File

@@ -4,9 +4,9 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
.dashboard-stat2 { .dashboard-stat2 {
padding: 1px 2px 15px 10px; padding: 1px 2px 15px 10px;
} }
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
@@ -42,7 +42,7 @@
<div class="row"> <div class="row">
<div class="col-md-1">Proveedor:</div> <div class="col-md-1">Proveedor:</div>
<div class="col-md-2"> <div class="col-md-2">
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost> <ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor"></ADS:Dropdownlost>
<%--<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlProveedores" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"> <%--<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlProveedores" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>--%> </asp:DropDownList>--%>
@@ -194,6 +194,12 @@
<asp:ListItem Selected="False" Text="Ambos" Value="3"></asp:ListItem> <asp:ListItem Selected="False" Text="Ambos" Value="3"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-3" id="DivVerPesos" runat="server" visible="false">
<div style="display: flex; align-items: center;">
Ver en pesos:
<asp:CheckBox ID="ChkVerEnPesos" data-size="small" CssClass="chksino" Style="margin-top: -2px; background-color: #fff;" runat="server" Text=" " AutoPostBack="False" />&nbsp;
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -204,11 +210,12 @@
<ContentTemplate> <ContentTemplate>
<div class="row" runat="server" id="dvIndicadores" visible="false"> <div class="row" runat="server" id="dvIndicadores" visible="false">
<div class="col-lg-4 col-md-4"> <div class="col-lg-4 col-md-4">
<div class="dashboard-stat2 " style=" border-style: solid; border-color: whitesmoke; padding-top px;"> <div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
<div class="display" style="margin-bottom: 0px"> <div class="display" style="margin-bottom: 0px">
<div class="number"> <div class="number">
<h3 class="font-red-haze"> <h3 class="font-red-haze">
<span data-counter="counterup" data-value="1349"><asp:Literal runat="server" ID="LtlTotalOriginal"></asp:Literal></span> <span data-counter="counterup" data-value="1349">
<asp:Literal runat="server" ID="LtlTotalOriginal"></asp:Literal></span>
<small class="font-red-haze">$</small> <small class="font-red-haze">$</small>
</h3> </h3>
<small>TOTAL ORIGINAL</small> <small>TOTAL ORIGINAL</small>
@@ -218,21 +225,24 @@
</div> </div>
</div> </div>
<div class="progress-info"> <div class="progress-info">
<div class="status" style="font-size:12px"> <div class="status" style="font-size: 12px">
MXN: <asp:Literal Text="text" ID="LtlTotalMXN" runat="server" /> MXN:
<asp:Literal Text="text" ID="LtlTotalMXN" runat="server" />
</div> </div>
<div class="status" style="font-size:12px"> <div class="status" style="font-size: 12px">
Dólares: <asp:Literal Text="text" ID="LtlTotalDolares" runat="server" /> Dólares:
<asp:Literal Text="text" ID="LtlTotalDolares" runat="server" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-4"> <div class="col-lg-4 col-md-4">
<div class="dashboard-stat2 " style=" border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;"> <div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;">
<div class="display"> <div class="display">
<div class="number"> <div class="number">
<h3 class="font-green-sharp" > <h3 class="font-green-sharp">
<span data-counter="counterup" data-value="7800"><asp:Literal runat="server" ID="LtlTotalAbonado"></asp:Literal></span> <span data-counter="counterup" data-value="7800">
<asp:Literal runat="server" ID="LtlTotalAbonado"></asp:Literal></span>
<small class="font-green-sharp">$</small> <small class="font-green-sharp">$</small>
</h3> </h3>
<small>ABONADO</small> <small>ABONADO</small>
@@ -258,11 +268,12 @@
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-4"> <div class="col-lg-4 col-md-4">
<div class="dashboard-stat2 " style=" border-style: solid; border-color: whitesmoke;"> <div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke;">
<div class="display" style="margin-bottom: 0px"> <div class="display" style="margin-bottom: 0px">
<div class="number"> <div class="number">
<h3 class="font-blue-sharp"> <h3 class="font-blue-sharp">
<span data-counter="counterup" data-value="1349"><asp:Literal ID="TotalPendiente" runat="Server" ></asp:Literal></span> <span data-counter="counterup" data-value="1349">
<asp:Literal ID="TotalPendiente" runat="Server"></asp:Literal></span>
<small class="font-blue-sharp">$</small> <small class="font-blue-sharp">$</small>
</h3> </h3>
<small>SALDO PENDIENTE</small> <small>SALDO PENDIENTE</small>
@@ -272,11 +283,13 @@
</div> </div>
</div> </div>
<div class="progress-info"> <div class="progress-info">
<div class="status" style="font-size:12px"> <div class="status" style="font-size: 12px">
MXN: <asp:Literal Text="text" ID="LtlPendiente" runat="server" /> MXN:
<asp:Literal Text="text" ID="LtlPendiente" runat="server" />
</div> </div>
<div class="status" style="font-size:12px"> <div class="status" style="font-size: 12px">
DÓLARES <asp:Literal Text="text" ID="LtlPendienteDolares" runat="server" /> DÓLARES
<asp:Literal Text="text" ID="LtlPendienteDolares" runat="server" />
</div> </div>
</div> </div>
</div> </div>
@@ -303,7 +316,7 @@
<asp:HyperLink ID="Hpl" runat="server" NavigateUrl='<%#String.Format("/Compras/Proveedores.aspx?CveProveedor={0}&Opt=3&CveProveedorSucursal={1}&CveMoneda={2}", Eval("CveProveedor"), Eval("CveProveedorSucursal"), Eval("CveMoneda"))%>' Text='<%# Eval("RazonSocial") %>'></asp:HyperLink> <asp:HyperLink ID="Hpl" runat="server" NavigateUrl='<%#String.Format("/Compras/Proveedores.aspx?CveProveedor={0}&Opt=3&CveProveedorSucursal={1}&CveMoneda={2}", Eval("CveProveedor"), Eval("CveProveedorSucursal"), Eval("CveMoneda"))%>' Text='<%# Eval("RazonSocial") %>'></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ControlStyle CssClass="Texto" /> <ControlStyle CssClass="Texto" />
<ItemStyle HorizontalAlign="Left" width="300px"/> <ItemStyle HorizontalAlign="Left" Width="300px" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
@@ -312,16 +325,16 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitFact" runat="server" Text='<%# Bind("NumFacturas") %>'></asp:Literal> <asp:Literal ID="LitFact" runat="server" Text='<%# Bind("NumFacturas") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="60px" HorizontalAlign="Center" /> <ItemStyle Width="60px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
Venci. Venci.
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate > <ItemTemplate>
<asp:Literal ID="LitUltimoVencimiento" runat="server" Text='<%# Bind("UltimoVencimiento")%>'></asp:Literal> <asp:Literal ID="LitUltimoVencimiento" runat="server" Text='<%# Bind("UltimoVencimiento")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="70px" HorizontalAlign="Center" /> <ItemStyle Width="70px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
@@ -330,9 +343,9 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitOriginal" runat="server" Text='<%# Bind("Original", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LitOriginal" runat="server" Text='<%# Bind("Original", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Right"/> <ItemStyle Width="100px" HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField Datafield="Abreviatura" HeaderText="Moneda" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px"/> <asp:BoundField DataField="Abreviatura" HeaderText="Moneda" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" />
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
Abonado Abonado
@@ -349,7 +362,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitPorPagado" runat="server" Text='<%# Bind("PorPagado", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LitPorPagado" runat="server" Text='<%# Bind("PorPagado", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="40px" HorizontalAlign="Center" /> <ItemStyle Width="40px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="False"> <asp:TemplateField Visible="False">
<HeaderTemplate> <HeaderTemplate>
@@ -358,7 +371,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitImporteProgramo" runat="server" Text='<%# Bind("ImporteProgramo", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LitImporteProgramo" runat="server" Text='<%# Bind("ImporteProgramo", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Center" /> <ItemStyle Width="100px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
@@ -367,7 +380,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitSaldo" runat="server" Text='<%# Bind("Saldo", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LitSaldo" runat="server" Text='<%# Bind("Saldo", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="100px" Font-Bold="True" HorizontalAlign="Right" /> <ItemStyle Width="100px" Font-Bold="True" HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
@@ -376,20 +389,19 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitPorXPagar" runat="server" Text='<%# Bind("PorXPagar", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LitPorXPagar" runat="server" Text='<%# Bind("PorXPagar", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="40px" HorizontalAlign="Center" /> <ItemStyle Width="40px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="False" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField Visible="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>Abonar</HeaderTemplate> <HeaderTemplate>Abonar</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<%--<asp:Image ID="ImgAbonar" runat="server" ImageUrl="~/Imagenes/Money_add.png" AlternateText="Registrar Pago/Abono" Style="cursor:pointer;" />--%> <%--<asp:Image ID="ImgAbonar" runat="server" ImageUrl="~/Imagenes/Money_add.png" AlternateText="Registrar Pago/Abono" Style="cursor:pointer;" />--%>
<asp:HyperLink ID="ImgAbonar" CssClass="Texto" runat="server" NavigateUrl='<%# Eval("CveProveedor", "/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}") %>' ToolTip="Registrar Pago/Abono"><i class='fa fa-money font-green'></i></asp:HyperLink> <asp:HyperLink ID="ImgAbonar" CssClass="Texto" runat="server" NavigateUrl='<%# Eval("CveProveedor", "/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}") %>' ToolTip="Registrar Pago/Abono"><i class='fa fa-money font-green'></i></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="70px" HorizontalAlign="Center" /> <ItemStyle Width="70px" HorizontalAlign="Center" />
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField Datafield="Moneda" HeaderText="Moneda" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10px"/>--%> <%--<asp:BoundField Datafield="Moneda" HeaderText="Moneda" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10px"/>--%>
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />

View File

@@ -31,6 +31,11 @@ Partial Class Bancos_RepProveedoresPagos
GvCxP.Columns(10).Visible = True GvCxP.Columns(10).Visible = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
chkexpand.Checked = True
DivVerPesos.Visible = True
End If
End If End If
End Sub End Sub
@@ -103,7 +108,7 @@ Partial Class Bancos_RepProveedoresPagos
GvCxP.Columns(7).Visible = ChkProgramadas.Checked 'AndAlso DdlUsuarioProgramo.SelectedValue.ToEntero > 0 GvCxP.Columns(7).Visible = ChkProgramadas.Checked 'AndAlso DdlUsuarioProgramo.SelectedValue.ToEntero > 0
If Mov.GetCxPEmpresa(DdlProveedores.SelectedValue.ToEntero, FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero, -1, DdlUsuarioRegistro.SelectedValue.ToEntero, CveUsuarioProgramo, DdlUsuarioResponsable.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, -1, DdlEstatusCompra.SelectedValue.ToEntero, AplicaNC.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaVI, FechaVF, CodigoProgramacion, DdlTipoProveedor.SelectedValue.ToEntero) Then If Mov.GetCxPEmpresa(DdlProveedores.SelectedValue.ToEntero, FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero, -1, DdlUsuarioRegistro.SelectedValue.ToEntero, CveUsuarioProgramo, DdlUsuarioResponsable.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, -1, DdlEstatusCompra.SelectedValue.ToEntero, AplicaNC.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaVI, FechaVF, CodigoProgramacion, DdlTipoProveedor.SelectedValue.ToEntero, VerEnPesos:=ChkVerEnPesos.Checked) Then
GvCxP.DataSource = Mov.DtResultados GvCxP.DataSource = Mov.DtResultados
If Mov.DtResultados IsNot Nothing AndAlso Mov.DtResultados.Rows.Count > 0 Then If Mov.DtResultados IsNot Nothing AndAlso Mov.DtResultados.Rows.Count > 0 Then
@@ -162,7 +167,13 @@ Partial Class Bancos_RepProveedoresPagos
CveUsuarioProgramo = DdlUsuarioProgramo.SelectedValue.ToEntero CveUsuarioProgramo = DdlUsuarioProgramo.SelectedValue.ToEntero
End If End If
e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&TipoPago={4}&CveUsuarioRegistro={5}&CveUsuarioResponsable={6}&CveClasificacion={7}&CveMoneda={8}&CveEstatus={9}&CveProveedorSucursal={10}&CveAplicaNC={11}&CodigoProgramacion={12}&CveSubProyecto={13}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), CveUsuarioProgramo, -1, DdlUsuarioRegistro.SelectedValue, DdlUsuarioResponsable.SelectedValue, DdlProveedoresClasificaciones.SelectedValue, e.Row.DBCampo("CveMoneda"), DdlEstatusCompra.SelectedValue, e.Row.DBCampo("CveProveedorSucursal"), AplicaNC.SelectedValue, DdlCodigoProgramacion.SelectedValue, DdlSubProyecto.SelectedValue) Dim FiltrarCuentas As Integer = 1
If ChkVerEnPesos.Checked Then
FiltrarCuentas = 0
End If
e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&TipoPago={4}&CveUsuarioRegistro={5}&CveUsuarioResponsable={6}&CveClasificacion={7}&CveMoneda={8}&CveEstatus={9}&CveProveedorSucursal={10}&CveAplicaNC={11}&CodigoProgramacion={12}&CveSubProyecto={13}&FiltrarCuentas={14}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), CveUsuarioProgramo, -1, DdlUsuarioRegistro.SelectedValue, DdlUsuarioResponsable.SelectedValue, DdlProveedoresClasificaciones.SelectedValue, e.Row.DBCampo("CveMoneda"), DdlEstatusCompra.SelectedValue, e.Row.DBCampo("CveProveedorSucursal"), AplicaNC.SelectedValue, DdlCodigoProgramacion.SelectedValue, DdlSubProyecto.SelectedValue, FiltrarCuentas)
End If End If
End Sub End Sub

View File

@@ -130,6 +130,20 @@
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpAccionesProrrateoGasolina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li style="text-align: left!important" >
<asp:LinkButton runat="server" ID="LnkProrrateoGasolina" CssClass="" data-toggle="tooltip" data-placement="left" title="Prorrateo" OnClick="LnkProrrateoGasolina_Click" Visible="false" >
<i class="fa fa-list" aria-hidden="true"></i> Prorrateo
</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
@@ -4576,7 +4590,6 @@
<label runat="server" id="LblSubProyectoEx" for="<%= DdlSubProyecto.ClientID.ToString()%>"> <label runat="server" id="LblSubProyectoEx" for="<%= DdlSubProyecto.ClientID.ToString()%>">
<asp:Label runat="server" id="LblSubProyecto"></asp:Label>: <asp:Label runat="server" id="LblSubProyecto"></asp:Label>:
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
@@ -5704,6 +5717,130 @@
<div id="DVModalProrrateoGasolina" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:UpdatePanel runat="server" ID="UpProrratearTitulo" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label runat="server" id="LblRiruloProrrareo">Prorratear</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalProrrateoGasolina" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPSProrrateoGasolina" CssStyle="width:100%" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<label for="<%= DdlPSProrrateoGasolina.ClientID.ToString()%>">
Productos / Servicio:
<label>
</div>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoProrrateoGasolina" CssClass=" form-control input-sm select2me" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RfvDdlSubProyectoProrrateoGasolina" runat="server" ControlToValidate="DdlSubProyectoProrrateoGasolina" CssClass="help-block errorimput" InitialValue="-1"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GprAgregaPSProrateo">
</asp:RequiredFieldValidator>--%>
<label runat="server" id="Label10" for="<%= DdlSubProyectoProrrateoGasolina.ClientID.ToString()%>">
<asp:Label runat="server" id="LblSubProyectoProrrateoGasolina"></asp:Label>:
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioProrrateoGasolina" ClientIDMode="Static" runat="server" CssClass=" form-control " CausesValidation="true" MaxLength="12" ValidationGroup="GprAgregaPS"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtPrecioProrrateoGasolina" runat="server" TargetControlID="TxtPrecioProrrateoGasolina" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RfvTxtPrecioProrrateoGasolina" runat="server" ControlToValidate="TxtPrecioProrrateoGasolina" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPSProrateo">
</asp:RequiredFieldValidator>
<label for="<%= TxtPrecioProrrateoGasolina.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-4" style="margin-top:10px;text-align:right">
<asp:LinkButton ID="LnkAgregarProrrateoGasolina" OnClick="LnkAgregarProrrateoGasolina_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GprAgregaPSProrateo" > </asp:LinkButton>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblTotalProrrateoGasolina" CssClass="form-control" ></asp:Label>
<label for="<%= LblTotalProrrateoGasolina.ClientID.ToString()%>">Total:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblRestoProrrateoGasolina" CssClass="form-control"></asp:Label>
<label for="<%= LblRestoProrrateoGasolina.ClientID.ToString()%>">Restante:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvProrrateoGasolina" runat="server" AutoGenerateColumns="false" GridLines="none" BorderWidth="0" Width="100%"
DataKeyNames=""
CssClass="table table-striped table-hover table-advance ScrollAD mysmallbtn">
<Columns>
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" />
<asp:BoundField DataField="Subtotal" HeaderText="Subtotal" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="IVA" HeaderText="IVA" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.######}" Visible="false" />
<asp:BoundField DataField="RetIVA" HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="RetISR" HeaderText="RetISR" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="Total" DataFormatString="{0:#,##0.00##}" HeaderText="Total" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Porcentaje" DataFormatString="{0:#,##0.00##}" HeaderText="%" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarProrrateoGasolina" runat="server" Width="22px"
CssClass="btn btn-circle btn-xs red" OnClick="LnkEliminarProrrateoGasolina_Click"
data-toggle="confirmation"
data-popout="true" data-original-title="¿Seguro que desea eliminar el prorrateo?" data-btn-ok-label="si">
<i style="margin-left:-2px!important" class='icon-trash'></i>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarProrrateoGasolina" OnClick="BtnGuardarProrrateoGasolina_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div style="display:none"> <div style="display:none">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>

View File

@@ -1662,9 +1662,12 @@ Partial Class Compras_Compras
End If End If
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlTipoComprobante.SelectedValue = "NC" Then If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlTipoComprobante.SelectedValue = "NC" Then
ConfiguraseleccionRemisionNotaCredito() ConfiguraseleccionRemisionNotaCredito()
End If
If Not CveCompra > 0 Then
LnkProrrateoGasolina.Visible = True
InicializaDTProrrateoGasolina()
End If End If
End If End If
@@ -14914,6 +14917,7 @@ Partial Class Compras_Compras
Private Sub VinculaOC() Private Sub VinculaOC()
CveIEAnticipo = -1 CveIEAnticipo = -1
Dim DiasCredito As Integer = 0
If TxtOC.Text <> "" Then If TxtOC.Text <> "" Then
'VARIABLES 'VARIABLES
@@ -14935,6 +14939,8 @@ Partial Class Compras_Compras
Dim FoliosOCAnticipo As String = "", FoliosOCAnticipoIE As String = "" Dim FoliosOCAnticipo As String = "", FoliosOCAnticipoIE As String = ""
Dim StrPromos As New StringBuilder Dim StrPromos As New StringBuilder
For Each CveOCItem As String In ArrayCveOC.Distinct For Each CveOCItem As String In ArrayCveOC.Distinct
If ObjOC.GetOrdenesDetalle(CveOCItem.ToEntero, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then If ObjOC.GetOrdenesDetalle(CveOCItem.ToEntero, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
If IsNothing(DTOCTemp) Then If IsNothing(DTOCTemp) Then
@@ -14943,6 +14949,14 @@ Partial Class Compras_Compras
DTOCTemp.Merge(ObjOC.DtResultados) DTOCTemp.Merge(ObjOC.DtResultados)
End If End If
Dim DiasCreditoOCActual As Integer = DTOCTemp.FiltroPrimeroValor("DiasCreditoOC").ToEntero
If DiasCreditoOCActual > DiasCredito Then
DiasCredito = DiasCreditoOCActual
End If
IvaAcumulado += ObjOC.DtResultados.Rows(0)("IVA").ToString.ToDouble IvaAcumulado += ObjOC.DtResultados.Rows(0)("IVA").ToString.ToDouble
TextoObservaciones += ObjOC.DtResultados.Rows(0)("Descripcion").ToString TextoObservaciones += ObjOC.DtResultados.Rows(0)("Descripcion").ToString
@@ -15063,9 +15077,16 @@ Partial Class Compras_Compras
DivOCPromocion.Visible = True DivOCPromocion.Visible = True
End If End If
If DiasCredito > 0 Then
TxtFechaPago.Text = Now.AddDays(DiasCredito).ToString("dd/MM/yyyy")
UPCondicionesPago.Update()
End If
'CARGA DATOS DE OC 'CARGA DATOS DE OC
CargaVinculacionOC(True) CargaVinculacionOC(True)
End If End If
End Sub End Sub
Protected Sub DdlOCVinculaInv_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlOCVinculaInv_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -15136,6 +15157,10 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub CargaGvsOC() Private Sub CargaGvsOC()
If Not TmpDT.Columns.Contains("NoIdentificacion") Then
TmpDT.Columns.Add("NoIdentificacion")
End If
'SI ES MAS DE UNA OC ORDENA POR PRODUCTO 'SI ES MAS DE UNA OC ORDENA POR PRODUCTO
Dim ArrayCveOC As String() = HdnVCveOC.Value.Split(New Char() {","c}) Dim ArrayCveOC As String() = HdnVCveOC.Value.Split(New Char() {","c})
'DTOCGV = If(ArrayCveOC.Length > 1, DTOCGV.FiltraParametros("", "Producto"), DTOCGV) 'DTOCGV = If(ArrayCveOC.Length > 1, DTOCGV.FiltraParametros("", "Producto"), DTOCGV)
@@ -22304,6 +22329,278 @@ Partial Class Compras_Compras
End Sub End Sub
#Region "PRORRATEO GASOLINA"
Property DTProrrateoGasolina As DataTable
Get
If ViewState("DTProrrateoGasolina") Is Nothing Then
ViewState("DTProrrateoGasolina") = New DataTable
End If
Return DirectCast(ViewState("DTProrrateoGasolina"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProrrateoGasolina") = value
End Set
End Property
Private Sub InicializaDTProrrateoGasolina()
Dim TmpDTProrrateoGasolina As New DataTable
TmpDTProrrateoGasolina.Columns.Add("CvePS", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("SubProyecto", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("SubTotal", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("IVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("RetIVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("RetISR", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("Total", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("CveUM", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("CveClasificacion", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("UM", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("Clasificacion", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("PS", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("Porcentaje", GetType(Decimal))
DTProrrateoGasolina = TmpDTProrrateoGasolina
End Sub
Protected Sub LnkProrrateoGasolina_Click(sender As Object, e As EventArgs)
InicializaDTProrrateoGasolina()
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoProrrateoGasolina,)
GvProrrateoGasolina.Columns(0).HeaderText = LblSubProyectoProrrateoGasolina.Text
LblRiruloProrrareo.Text = $"Prorratear por { LblSubProyectoProrrateoGasolina.Text}"
DdlSubProyectoProrrateoGasolina.Items.Clear()
DdlSubProyectoProrrateoGasolina.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveProyecto:=-1))
DdlSubProyectoProrrateoGasolina.DataBind()
DdlSubProyectoProrrateoGasolina.Items.Insert(0, New ListItem("Todos", "-1"))
LblTotalProrrateoGasolina.Text = TxtTotal.Text
CargaProrratePS(-1)
RegistraScript("$('#DVModalProrrateoGasolina').modal();")
UpModalProrrateoGasolina.Update()
UpProrratearTitulo.Update()
End Sub
Private Sub CargaProrratePS(CveClasificacion As Integer)
DdlPSProrrateoGasolina.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPSProrrateoGasolina.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
DdlPSProrrateoGasolina.SelectedText = ""
DdlPSProrrateoGasolina.SelectedValue = "-1"
Else
DdlPSProrrateoGasolina.ddl.Items.Clear()
'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion)
If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then
Dim DTTemp As New DataTable
DTTemp.Columns.Add("CvePS", GetType(Integer))
DTTemp.Columns.Add("PSCodigo", GetType(String))
DTTemp.Columns.Add("CveClasificacion", GetType(Integer))
For Each dRow As DataRow In GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).Rows
For Each drowCla As DataRow In DTClasificacionesComprobaciones.Rows
If drowCla("CveClasificacion").ToString.ToEntero = dRow("CveClasificacion").ToString.ToEntero Then
Dim InRow As DataRow = DTTemp.NewRow
InRow("CvePS") = dRow("CvePS").ToString.ToEntero
InRow("PSCodigo") = dRow("PSCodigo").ToString
InRow("CveClasificacion") = dRow("CveClasificacion").ToString.ToEntero
DTTemp.Rows.Add(InRow)
End If
Next
Next
DdlPSProrrateoGasolina.DataSource = If(CveClasificacion > 0, DTTemp.FiltraParametros($"CveClasificacion = {CveClasificacion}"), DTTemp)
Else
DdlPSProrrateoGasolina.DataSource = If(CveClasificacion > 0, GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros($"CveClasificacion = {CveClasificacion}"), GlobalDTPSSimplificado(UsuarioActual.CveEmpresa))
End If
DdlPSProrrateoGasolina.ddl.DataBind()
DdlPSProrrateoGasolina.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
End Sub
Private Sub GvProrrateoGasolinaBind()
GvProrrateoGasolina.DataSource = DTProrrateoGasolina
GvProrrateoGasolina.DataBind()
UpModalProrrateoGasolina.Update()
End Sub
Protected Sub LnkEliminarProrrateoGasolina_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
DTProrrateoGasolina.Rows.RemoveAt(GvRow.RowIndex)
DTProrrateoGasolina.AcceptChanges()
ProrateoCalculaRestante()
GvProrrateoGasolinaBind()
End Sub
Protected Sub LnkAgregarProrrateoGasolina_Click(sender As Object, e As EventArgs)
Dim CvePs As Integer = DdlPSProrrateoGasolina.SelectedValue.ToEntero
If Not CvePs > 0 Then
Alert("Debe seleccionar un producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim PsRow As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePs).FiltroPrimero("")
If PsRow Is Nothing Then
Alert("No se encontro el producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveUM As Integer = PsRow("CveUM").ToString.ToEntero
Dim UM As String = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $" CveUnidadMedida = {CveUM} ")
Dim CveClasificacion As Integer = PsRow("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $" CveClasificacion = {CveClasificacion} ")
If DdlSubProyectoProrrateoGasolina.SelectedValue.ToEntero > 0 Then
AgregarProrrateoGasolina(DdlSubProyectoProrrateoGasolina.SelectedValue.ToEntero, DdlSubProyectoProrrateoGasolina.SelectedItem.Text, CvePs, CveUM, UM, CveClasificacion, Clasificacion)
Else
DTProrrateoGasolina.Rows.Clear()
For Each item As ListItem In DdlSubProyectoProrrateoGasolina.Items
If item.Value.ToEntero > 0 Then
AgregarProrrateoGasolina(item.Value.ToEntero, item.Text, CvePs, CveUM, UM, CveClasificacion, Clasificacion)
End If
Next
End If
TxtPrecioProrrateoGasolina.Text = ""
DdlSubProyectoProrrateoGasolina.SelectedValueExist(-1)
UpModalProrrateoGasolina.Update()
End Sub
Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String)
Dim SubTotalOriginal As Decimal = TxtSubTotal.Text.ToDecimal
Dim IVAOriginal As Decimal = TxtIVA.Text.ToDecimal
Dim RetISROriginal As Decimal = TxtRetISR.Text.ToDecimal
Dim RetIVAOriginal As Decimal = TxtRetIVA.Text.ToDecimal
Dim TotalOriginal As Decimal = TxtTotal.Text.ToDecimal
Dim totalParcialDeseado As Decimal = TxtPrecioProrrateoGasolina.Text.ToDecimal
Dim PorcentajeCalculado As Decimal = totalParcialDeseado / TotalOriginal
Dim subtotalParcial As Decimal = SubTotalOriginal * PorcentajeCalculado
Dim ivaParcial As Decimal = IVAOriginal * PorcentajeCalculado
Dim retIsrParcial As Decimal = RetISROriginal * PorcentajeCalculado
Dim retIvaParcial As Decimal = RetIVAOriginal * PorcentajeCalculado
Dim nRow As DataRow = DTProrrateoGasolina.NewRow
nRow("CvePS") = DdlPSProrrateoGasolina.SelectedValue.ToEntero
nRow("CveSubProyecto") = CveSubProyecto
nRow("SubProyecto") = SubProyecto
If CveFactura > 0 Then
nRow("IVA") = ivaParcial.RoundSQL(4)
nRow("RetIVA") = retIvaParcial.RoundSQL(4)
nRow("RetISR") = retIsrParcial.RoundSQL(4)
Else
nRow("IVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
nRow("RetIVA") = (retIvaParcial / subtotalParcial).RoundSQL(4)
nRow("RetISR") = (retIsrParcial / subtotalParcial).RoundSQL(4)
End If
nRow("SubTotal") = subtotalParcial.RoundSQL(4)
nRow("Total") = totalParcialDeseado.RoundSQL(4)
nRow("PorcentajeIVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
nRow("Porcentaje") = ((totalParcialDeseado.RoundSQL(4) * 100) / TotalOriginal).RoundSQL(2)
nRow("CveUM") = CveUM
nRow("UM") = UM
nRow("CveClasificacion") = CveClasificacion
nRow("Clasificacion") = Clasificacion
nRow("PS") = DdlPSProrrateoGasolina.txtText.Value
DTProrrateoGasolina.Rows.Add(nRow)
ProrateoCalculaRestante()
GvProrrateoGasolinaBind()
End Sub
Function ProrateoCalculaRestante(Optional MostrarMensaje As Boolean = False) As Boolean
Dim Acumulado As Decimal = DTProrrateoGasolina.SUM("Total").RoundSQL(2)
Dim Total As Decimal = TxtTotal.Text.ToDecimal.RoundSQL(2)
Dim Respuesta As Boolean = False
LblRestoProrrateoGasolina.Text = (Total - Acumulado).ToString("###,###,###.00")
If Acumulado = Total Then
Respuesta = True
Else
Respuesta = False
If MostrarMensaje Then
If Acumulado <> Total Then
Alert($"El importe prorrateado es diferente del total, Diferencia: {(Acumulado - Total).Abs()}, Total:{Total.ToString("###,###,###.00")}, Prorrateado:{Acumulado.ToString("###,###,###.00")}", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Return Respuesta
End Function
Protected Sub BtnGuardarProrrateoGasolina_Click(sender As Object, e As EventArgs)
If Not ProrateoCalculaRestante(True) Then
Exit Sub
End If
If DTProrrateoGasolina.Rows.Count > 0 Then
TmpDT.Rows.Clear()
For Each dRow As DataRow In DTProrrateoGasolina.Rows
AddPS(1, dRow("CveUM").ToString.ToEntero, dRow("UM").ToString, dRow("CveClasificacion").ToString.ToEntero, dRow("Clasificacion").ToString, dRow("CvePS").ToString.ToEntero, dRow("PS").ToString, 1, dRow("CveSubProyecto").ToString, dRow("SubProyecto").ToString, "",
"-1", "", dRow("SubTotal").ToString.ToDecimal, dRow("Total").ToString.ToDecimal, dRow("PorcentajeIVA").ToString.ToDecimal, dRow("RetIVA").ToString.ToDecimal, dRow("RetISR").ToString.ToDecimal, 0, 0, 0, PorcentajeIVA:=dRow("PorcentajeIVA").ToString.ToDecimal)
Next
AddPS2()
RegistraScript("$('#DVModalProrrateoGasolina').modal('hide');")
End If
End Sub
#End Region
End Class End Class

View File

@@ -1425,9 +1425,14 @@ Partial Class PopUpVerFactura
'Imprime Movimiento de IE 'Imprime Movimiento de IE
If UrlParametros("OP").ToString = "ImprimeMov" Then If UrlParametros("OP").ToString = "ImprimeMov" Then
Dim ImportePagoTotal As Decimal = If(UrlParametros("IMPORTEPAGOTOTAL") IsNot Nothing AndAlso UrlParametros("IMPORTEPAGOTOTAL").ToString.ToDecimal > 0, UrlParametros("IMPORTEPAGOTOTAL").ToString.ToDecimal, -1)
Dim SaldoTotal As Decimal = If(UrlParametros("SALDO") IsNot Nothing AndAlso UrlParametros("SALDO").ToString.ToDecimal > 0, UrlParametros("SALDO").ToString.ToDecimal, -1)
If UrlParametros("CVEIE") IsNot Nothing AndAlso UrlParametros("CVEIE").ToString.ToEntero > 0 Then If UrlParametros("CVEIE") IsNot Nothing AndAlso UrlParametros("CVEIE").ToString.ToEntero > 0 Then
ImprimeMov(UrlParametros("CVEIE").ToString.ToEntero) ImprimeMov(UrlParametros("CVEIE").ToString.ToEntero, ImportePagoTotal, SaldoTotal)
End If End If
End If End If
'IMPRIME DEPOSITOS CAJA 'IMPRIME DEPOSITOS CAJA
@@ -1575,23 +1580,22 @@ Partial Class PopUpVerFactura
'Boleto 'Boleto
If UrlParametros("OP").ToString = "AMORTIZACIONHIS" Then If UrlParametros("OP").ToString = "AMORTIZACIONHIS" Then
'CveViajePasajero
Dim CVEIE As Integer = UrlParametros("CVEIE").ToString.ToEntero Dim CVEIE As Integer = UrlParametros("CVEIE").ToString.ToEntero
Dim CVEVENTAAMORTIZADA As Integer = UrlParametros("CVEVENTAAMORTIZADA").ToString.ToEntero Dim CVEVENTAAMORTIZADA As Integer = UrlParametros("CVEVENTAAMORTIZADA").ToString.ToEntero
Dim CVEVENTA As Integer = UrlParametros("CVEVENTA").ToString.ToEntero Dim CVEVENTA As Integer = UrlParametros("CVEVENTA").ToString.ToEntero
Dim CVECLIENTE As Integer = UrlParametros("CVECLIENTE").ToString.ToEntero Dim CVECLIENTE As Integer = UrlParametros("CVECLIENTE").ToString.ToEntero
Dim MONTO As Decimal = UrlParametros("MONTO").ToString.ToDecimal Dim MONTO As Decimal = UrlParametros("MONTO").ToString.ToDecimal
Dim SALDO As Decimal = UrlParametros("SALDO").ToString.ToDecimal
If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then
ImprimirSaldosAmortizacion(CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO, SALDO) ImprimirSaldosAmortizacion(CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO)
End If End If
End If End If
End Sub End Sub
Private Sub ImprimirSaldosAmortizacion(CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal, Saldo As Decimal) Private Sub ImprimirSaldosAmortizacion(CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal)
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
@@ -1599,6 +1603,7 @@ Partial Class PopUpVerFactura
Dim DatosSaldoAntNCDev As New DataTable Dim DatosSaldoAntNCDev As New DataTable
Dim TipoDocto As String = "" Dim TipoDocto As String = ""
Dim Folio As String = "" Dim Folio As String = ""
Dim Saldo As Decimal = 0D
Dim DTNCVinculadas As New DataTable Dim DTNCVinculadas As New DataTable
@@ -1623,10 +1628,15 @@ Partial Class PopUpVerFactura
If CveIE > 0 Then If CveIE > 0 Then
CveVenta = DatosSaldoAntNCDev.FiltroPrimeroValor("CveVenta", $"CveIE={CveIE}").ToEntero CveVenta = DatosSaldoAntNCDev.FiltroPrimeroValor("CveVenta", $"CveIE={CveIE}").ToEntero
Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveIE={CveIE}") Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveIE={CveIE}")
Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveIE={CveIE}").ToDecimal
Else Else
Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveVenta={CveVenta}") Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveVenta={CveVenta}")
Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveVenta={CveVenta}").ToDecimal
End If End If
End If End If
If TipoDocto.Contiene("Egs", "Dev", "Ant", "NC") Then If TipoDocto.Contiene("Egs", "Dev", "Ant", "NC") Then
@@ -1669,8 +1679,8 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString)) params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("Monto", Monto.ToString)) params.Add(New ReportParameter("Monto", Monto.ToString("###,###,###.00")))
params.Add(New ReportParameter("Saldo", Saldo.ToString)) params.Add(New ReportParameter("Saldo", Saldo.ToString("###,###,###.00")))
params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("Folio", Folio))
Dim NombreArchivo As String = "SaldoAntNCDev.rdlc" Dim NombreArchivo As String = "SaldoAntNCDev.rdlc"
@@ -3121,9 +3131,6 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
'params.Add(New ReportParameter("Descuentos", (dr("Descuentos").ToString.ToDouble).FormatoNumero(2)))
'params.Add(New ReportParameter("IVA", dr("IVA").ToString.FormatoNumero(2)))
'params.Add(New ReportParameter("Total", dr("Total").ToString.FormatoNumero(2)))
params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
@@ -5883,7 +5890,7 @@ Partial Class PopUpVerFactura
End Sub End Sub
Private Sub ImprimeMov(CveIE As Integer) Private Sub ImprimeMov(CveIE As Integer, Optional ImportePagoTotal As Decimal = 0, Optional SaldoTotal As Decimal = 0)
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
Dim DtGvRH As New DataTable Dim DtGvRH As New DataTable
Dim DtComprobacion As New DataTable Dim DtComprobacion As New DataTable
@@ -5967,6 +5974,16 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString)) params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString))
params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString)) params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString))
If UsuarioActual.CveEmpresa = 140 Then
Dim Aplicado As Decimal = 0
Dim ImporteDoc As Decimal = ParamComprobacion.Rows(0)("Importe").ToString.ToDecimal
Dim LeyendaSaldo As String = $"Folio #{ParamComprobacion.Rows(0)("Folio").ToString} con importe de ${ImporteDoc.ToString("###,###,###.00")} y saldo antes de la comprobación de ${SaldoTotal.ToString("###,###,###.00")}, Comprobaciones a la fecha {ParamComprobacion.Rows(0)("FechaDocumento").ToString().ToDate().ToString("dd/MM/yyyy")} ${ImportePagoTotal.ToString("###,###,###.00")} saldo después de la comprobación ${(SaldoTotal - ImportePagoTotal).ToString("###,###,###.00")} ."
params.Add(New ReportParameter("LeyendaSaldo", LeyendaSaldo))
End If
params.Add(New ReportParameter("LogoPath", RutaImagenLogo)) params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtComprobacion, params, String.Format("IE{0}", CveIE), Formato:="PDF") ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtComprobacion, params, String.Format("IE{0}", CveIE), Formato:="PDF")
@@ -6039,7 +6056,12 @@ Partial Class PopUpVerFactura
Dim rdsPrePoliza As New ReportDataSource("DSPrePoliza", dtPrePoliza) Dim rdsPrePoliza As New ReportDataSource("DSPrePoliza", dtPrePoliza)
reportDataSetsList.Add(rdsPrePoliza) reportDataSetsList.Add(rdsPrePoliza)
Dim lblSubProyecto As New Label
CargarCentrosDeCosto(Nothing, Nothing, Nothing, lblSubProyecto)
paramList.Add(New ReportParameter("TipoCentroCosto", lblSubProyecto.Text))
ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientosPrePoliza.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF") ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientosPrePoliza.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF")
Else Else
ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientos.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF") ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientos.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF")
End If End If

View File

@@ -387,6 +387,8 @@ Partial Class Compras_ReembolsosComprobaciones
Dim FoliosFechasValFechaDocumentoPagoMesSuperior As New StringBuilder Dim FoliosFechasValFechaDocumentoPagoMesSuperior As New StringBuilder
Dim FoliosFechasValFechaDocumentoMesInferior As New StringBuilder Dim FoliosFechasValFechaDocumentoMesInferior As New StringBuilder
Dim SaldoAntesPago As Decimal = TxtChequeSaldo.Text.ToDecimal
For Each gvRowVal As GridViewRow In GvCxP.Rows For Each gvRowVal As GridViewRow In GvCxP.Rows
If gvRowVal.FCCheckBox("Chk").Checked Then If gvRowVal.FCCheckBox("Chk").Checked Then
@@ -602,6 +604,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If End If
End If End If
Dim ImportePagoTotal As Decimal = 0
If CveIERegistrado > 0 Or CveIEExcedente > 0 Or ChkReembolsarSinBancos.Checked Then If CveIERegistrado > 0 Or CveIEExcedente > 0 Or ChkReembolsarSinBancos.Checked Then
'inserto los movimientos de la conta para abonar al saldo 'inserto los movimientos de la conta para abonar al saldo
If ((TxtImporte.Text.ToDecimal > 0 Or ChkReembolsarSinBancos.Checked) And CvePrePolizaIERegistrado > 0) Or ((TxtImporteVinculado.Text.ToDecimal > 0 And HdnCheque.Value.ToEntero > 0) Or ChkReembolsarSinBancos.Checked) Then If ((TxtImporte.Text.ToDecimal > 0 Or ChkReembolsarSinBancos.Checked) And CvePrePolizaIERegistrado > 0) Or ((TxtImporteVinculado.Text.ToDecimal > 0 And HdnCheque.Value.ToEntero > 0) Or ChkReembolsarSinBancos.Checked) Then
@@ -676,7 +679,7 @@ Partial Class Compras_ReembolsosComprobaciones
Pago.CveMonedaPago = CveMonedaPago Pago.CveMonedaPago = CveMonedaPago
Pago.TCPago = TipoCambioPago Pago.TCPago = TipoCambioPago
Pago.CvePersonal =CvePersonal Pago.CvePersonal =CvePersonal
ImportePagoTotal = ImportePagoTotal + ImporteMovto
'Otros Ingresos 'Otros Ingresos
If MsgError = "" AndAlso (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then If MsgError = "" AndAlso (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then
Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
@@ -819,7 +822,7 @@ Partial Class Compras_ReembolsosComprobaciones
Dim Mensaje As New StringBuilder Dim Mensaje As New StringBuilder
If CvePrePolizaExcedente > 0 Then If CvePrePolizaExcedente > 0 Then
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> Cheque: <a target='_blank' href=/Bancos/IE.aspx?CveIE={0}>{1}</a> <br/><br/> <a target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={2}"">Imprimir</a>", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIEExcedente))) Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> Cheque: <a target='_blank' href=/Bancos/IE.aspx?CveIE={0}>{1}</a> <br/><br/> <a target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={2}"">Imprimir</a>", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("OP=ImprimeMov&CveIE={0}&CvePrePoliza={1}", CveIEExcedente, CvePrePolizaIERegistrado)))
If UsuarioActual.Empresa.TipoContabilidad = 2 Then If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
Else Else
@@ -827,7 +830,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If End If
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
Else Else
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir</a>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIERegistrado))) Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir</a>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}&ImportePagoTotal={1}&Saldo={2}", CveIERegistrado, ImportePagoTotal, SaldoAntesPago)))
If CvePrePolizaIERegistrado > 0 Then If CvePrePolizaIERegistrado > 0 Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)

File diff suppressed because it is too large Load Diff

View File

@@ -188,10 +188,10 @@
<Width>1.40148cm</Width> <Width>1.40148cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>10.82525cm</Width> <Width>2.95567cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>3.03882cm</Width> <Width>10.82525cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.63389cm</Width> <Width>1.63389cm</Width>
@@ -365,14 +365,14 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox11"> <Textbox Name="Textbox1">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Descripción</Value> <Value># Parte</Value>
<Style> <Style>
<FontFamily>MYRIAd Pro</FontFamily> <FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -385,7 +385,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@@ -418,14 +418,14 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox1"> <Textbox Name="Textbox11">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value># Parte</Value> <Value>Descripción</Value>
<Style> <Style>
<FontFamily>MYRIAd Pro</FontFamily> <FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -438,7 +438,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox11</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@@ -683,6 +683,40 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>6.5pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Color>#0e2455</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(RowNumber(Nothing)=1,"1pt","0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="PS"> <Textbox Name="PS">
@@ -715,38 +749,6 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>6.5pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Color>#0e2455</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(RowNumber(Nothing)=1,"1pt","0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="PU"> <Textbox Name="PU">
@@ -848,7 +850,7 @@
<Top>0.17639cm</Top> <Top>0.17639cm</Top>
<Left>0.09756cm</Left> <Left>0.09756cm</Left>
<Height>0.74125cm</Height> <Height>0.74125cm</Height>
<Width>21.24632cm</Width> <Width>21.16317cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>

View File

@@ -593,7 +593,7 @@ iigAooooAKKKKAP/2Q==</ImageBytes>
<AllowHtmlTags>True</AllowHtmlTags> <AllowHtmlTags>True</AllowHtmlTags>
<Brush>Transparent</Brush> <Brush>Transparent</Brush>
<CanGrow>True</CanGrow> <CanGrow>True</CanGrow>
<ClientRectangle>0.12,2.4,9.62,2.28</ClientRectangle> <ClientRectangle>0.12,2.4,9.62,2.48</ClientRectangle>
<Conditions isList="true" count="0" /> <Conditions isList="true" count="0" />
<Expressions isList="true" count="0" /> <Expressions isList="true" count="0" />
<Font>Myriad Pro,9,Regular,Point,False,0</Font> <Font>Myriad Pro,9,Regular,Point,False,0</Font>
@@ -601,8 +601,8 @@ iigAooooAKKKKAP/2Q==</ImageBytes>
<Name>Textbox20</Name> <Name>Textbox20</Name>
<Page isRef="7" /> <Page isRef="7" />
<Parent isRef="8" /> <Parent isRef="8" />
<Text>&lt;div&gt;&lt;b&gt;Facturado a:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Cliente: &lt;/b&gt;{ClienteCodigo} - {ClienteNombre}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;RFC:&lt;/b&gt; {ClienteRFC} <Text>&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Facturado a:&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Cliente: &lt;/b&gt;{ClienteCodigo} - {ClienteNombre}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;RFC:&lt;/b&gt; {ClienteRFC}
&lt;b&gt;Colonia: &lt;/b&gt; {ClienteColonia}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Ciudad: &lt;/b&gt;{ClienteCiudad} &lt;b&gt;Estado: &lt;/b&gt; {ClienteEstado}&lt;/div&gt;&lt;div&gt;&lt;b&gt;Municipio y/o Delegación: &lt;/b&gt;{ClienteMunicipio}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Pais:&lt;/b&gt; {ClientePais} &lt;b&gt; CP: &lt;/b&gt;{ClienteCP}&lt;/div&gt;</Text> &lt;b&gt;Colonia: &lt;/b&gt; {ClienteColonia}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Ciudad: &lt;/b&gt;{ClienteCiudad} &lt;b&gt;Estado: &lt;/b&gt; {ClienteEstado}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Municipio y/o Delegación: &lt;/b&gt;{ClienteMunicipio}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Pais:&lt;/b&gt; {ClientePais} &lt;b&gt; CP: &lt;/b&gt;{ClienteCP}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="Myriad Pro" style="" size="8"&gt;&lt;b&gt;Régimen Fiscal:&lt;/b&gt; {ClienteRegimenFiscal}&lt;/font&gt;&lt;/div&gt;</Text>
<TextBrush>Black</TextBrush> <TextBrush>Black</TextBrush>
<TextQuality>Wysiwyg</TextQuality> <TextQuality>Wysiwyg</TextQuality>
<Type>Expression</Type> <Type>Expression</Type>
@@ -6326,8 +6326,8 @@ FUERO DE MI DOMICILIO. LA CANTIDAD DE $ {Total} SON: {(ImporteLetra)}.</Text>
<ReportAlias>Factura</ReportAlias> <ReportAlias>Factura</ReportAlias>
<ReportChanged>12/30/2024 5:44:19 PM</ReportChanged> <ReportChanged>12/30/2024 5:44:19 PM</ReportChanged>
<ReportCreated>7/11/2022 2:49:19 PM</ReportCreated> <ReportCreated>7/11/2022 2:49:19 PM</ReportCreated>
<ReportFile>C:\inetpub\WWWSigGit\Empresas\189\Formatos\Factura.mrt</ReportFile> <ReportFile>Factura.mrt</ReportFile>
<ReportGuid>e8b162183e2340d1bbaad55d91fb8962</ReportGuid> <ReportGuid>e849bb4463e44732ae40e92228d31a35</ReportGuid>
<ReportName>Factura</ReportName> <ReportName>Factura</ReportName>
<ReportUnit>Centimeters</ReportUnit> <ReportUnit>Centimeters</ReportUnit>
<ReportVersion>2022.4.5.0</ReportVersion> <ReportVersion>2022.4.5.0</ReportVersion>

View File

@@ -669,7 +669,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!Producto.Value</Value> <Value>=IIF(Fields!Producto.Value=".",Fields!Obs.Value,Fields!Producto.Value)</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -727,7 +727,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!Obs.Value</Value> <Value>=IIF(Fields!Producto.Value=".", "", Fields!Obs.Value)</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -745,6 +745,7 @@
</Border> </Border>
</Style> </Style>
</Textbox> </Textbox>
<rd:Selected>true</rd:Selected>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>

View File

@@ -121,6 +121,7 @@
<Style> <Style>
<FontFamily>MYRIAd Pro</FontFamily> <FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
<Format>dd/MM/yyyy</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -529,7 +530,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Facura:</Value> <Value>Factura:</Value>
<Style> <Style>
<FontWeight>Bold</FontWeight> <FontWeight>Bold</FontWeight>
</Style> </Style>
@@ -802,9 +803,7 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!FechaImpresion.Value</Value> <Value>=Parameters!FechaImpresion.Value</Value>
<Style> <Style />
<Format>D</Format>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />

File diff suppressed because it is too large Load Diff

View File

@@ -53,6 +53,10 @@
<DataField>Almacen</DataField> <DataField>Almacen</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="NumeroParte">
<DataField>NumeroParte</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>DsInventarios</rd:DataSetName> <rd:DataSetName>DsInventarios</rd:DataSetName>
@@ -81,7 +85,10 @@
<Width>2.35965cm</Width> <Width>2.35965cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>13.49625cm</Width> <Width>3.67771cm</Width>
</TablixColumn>
<TablixColumn>
<Width>9.81854cm</Width>
</TablixColumn> </TablixColumn>
</TablixColumns> </TablixColumns>
<TablixRows> <TablixRows>
@@ -220,6 +227,50 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox12">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value># Parte</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</BottomBorder>
<BackgroundColor>#e36c09</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox5"> <Textbox Name="Textbox5">
@@ -380,6 +431,40 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="PS"> <Textbox Name="PS">
@@ -525,6 +610,39 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox14">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox37"> <Textbox Name="Textbox37">
@@ -568,6 +686,7 @@
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember />
</TablixMembers> </TablixMembers>
</TablixColumnHierarchy> </TablixColumnHierarchy>
<TablixRowHierarchy> <TablixRowHierarchy>

File diff suppressed because it is too large Load Diff

View File

@@ -488,7 +488,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!Producto.Value</Value> <Value>=IIF(Fields!Producto.Value=".",Fields!Obs.Value,Fields!Producto.Value)</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>8.5pt</FontSize> <FontSize>8.5pt</FontSize>
@@ -521,7 +521,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!Obs.Value</Value> <Value>=IIF(Fields!Producto.Value=".", "", Fields!Obs.Value)</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>8.5pt</FontSize> <FontSize>8.5pt</FontSize>

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,10 @@
<DataField>Folio</DataField> <DataField>Folio</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="SubProyecto">
<DataField>SubProyecto</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Descripcion"> <Field Name="Descripcion">
<DataField>Descripcion</DataField> <DataField>Descripcion</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
@@ -280,19 +284,22 @@
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn> <TablixColumn>
<Width>3.28769cm</Width> <Width>2.30174cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>6.38658cm</Width> <Width>2.5cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.30262cm</Width> <Width>5.49301cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.03516cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.35633cm</Width> <Width>2.35633cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.36223cm</Width> <Width>1.96772cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.20167cm</Width> <Width>2.20167cm</Width>
@@ -342,6 +349,43 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!TipoCentroCosto.Value</Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>LightGrey</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox21"> <Textbox Name="Textbox21">
@@ -351,7 +395,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Descripción</Value> <Value>Descripcion</Value>
<Style> <Style>
<FontFamily>Verdana</FontFamily> <FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
@@ -602,6 +646,39 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="SubProyecto1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!SubProyecto.Value</Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>SubProyecto1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Descripcion"> <Textbox Name="Descripcion">
@@ -855,12 +932,13 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<ColSpan>4</ColSpan> <ColSpan>5</ColSpan>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell /> <TablixCell />
<TablixCell /> <TablixCell />
<TablixCell /> <TablixCell />
<TablixCell />
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Importe2"> <Textbox Name="Importe2">
@@ -985,6 +1063,7 @@
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember />
</TablixMembers> </TablixMembers>
</TablixColumnHierarchy> </TablixColumnHierarchy>
<TablixRowHierarchy> <TablixRowHierarchy>
@@ -1014,7 +1093,7 @@
<Top>2.18687cm</Top> <Top>2.18687cm</Top>
<Left>0.19063cm</Left> <Left>0.19063cm</Left>
<Height>1.42958cm</Height> <Height>1.42958cm</Height>
<Width>21.11455cm</Width> <Width>21.07307cm</Width>
<ZIndex>4</ZIndex> <ZIndex>4</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1787,7 +1866,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Sub Proyecto</Value> <Value>=Parameters!TipoCentroCosto.Value</Value>
<Style> <Style>
<FontFamily>Verdana</FontFamily> <FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
@@ -2494,7 +2573,6 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName> <rd:DefaultName>Textbox10</rd:DefaultName>
<Top>0cm</Top>
<Left>8.07914cm</Left> <Left>8.07914cm</Left>
<Height>0.50299cm</Height> <Height>0.50299cm</Height>
<Width>2.87394cm</Width> <Width>2.87394cm</Width>
@@ -2526,7 +2604,6 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName> <rd:DefaultName>Textbox11</rd:DefaultName>
<Top>0cm</Top>
<Left>10.95308cm</Left> <Left>10.95308cm</Left>
<Height>0.50299cm</Height> <Height>0.50299cm</Height>
<Width>4.58986cm</Width> <Width>4.58986cm</Width>
@@ -2623,6 +2700,12 @@
<AllowBlank>true</AllowBlank> <AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
<ReportParameter Name="TipoCentroCosto">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters> </ReportParameters>
<Variables> <Variables>
<Variable Name="SumNC"> <Variable Name="SumNC">

View File

@@ -287,24 +287,40 @@ Partial Class Inventarios_Kardex
GvM.DataSource = DtTemp GvM.DataSource = DtTemp
GvM.DataBind() GvM.DataBind()
UpAcciones.Update() UpAcciones.Update()
End If End If
If UsuarioActual.CveEmpresa <> 119 Then
Dim drPs As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "")
If drPs IsNot Nothing Then
Dim NumeroParte As String = drPs("NumeroParte").ToString
Dim Codigo As String = drPs("Codigo").ToString
Dim PS As String = drPs("PS").ToString
If CvePS > 0 Then If NumeroParte.Trim.Length > 0 Then
Dim NumeroParte As String = GlobalDTPS(UsuarioActual.CveEmpresa, ddlProducto2.SelectedValue.ToEntero).FiltroPrimeroValor("NumeroParte") If UsuarioActual.TienePermisoPagina(13) Then
If NumeroParte.Trim.Length > 0 Then LblNumeroParte.Text = $" Número de Parte: <a href='../Ventas/ProductosServicios.aspx?CvePS={CvePS}' class='Texto' target='_blank' >{NumeroParte} - {Codigo} - {PS}</a>"
LblNumeroParte.Text = $" Número de Parte: {NumeroParte}" Else
LblNumeroParte.Visible = True LblNumeroParte.Text = $" Número de Parte: {NumeroParte}"
End If
LblNumeroParte.Visible = True
End If
End If End If
End If End If
UpNumeroParte.Update()
Else Else
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia) Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
End If End If
UpNumeroParte.Update()
End Sub End Sub
Private Sub CargarOCPendientesCompra() Private Sub CargarOCPendientesCompra()

View File

@@ -513,7 +513,11 @@
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox> <asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." /> <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
</td> </td>
<td></td> <td><b>Días Crédito:</b></td>
<td>
<asp:TextBox runat="server" ID="TxtDiasCreditoOC" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDiasCreditoOC" FilterType="Custom" ValidChars="0123456789" />
</td>
</tr> </tr>
</table> </table>
</ContentTemplate> </ContentTemplate>
@@ -1767,8 +1771,6 @@
<ajax:ValidatorCalloutExtender ID="VCEGrid" runat="server" HighlightCssClass="vco" TargetControlID="RFVGrid" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEGrid" runat="server" HighlightCssClass="vco" TargetControlID="RFVGrid" Width="300px"></ajax:ValidatorCalloutExtender>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:CheckBox runat="server" ID="ChkEsTemporalRegistro" Text="Registrar Temporal" Visible="false" />
</td> </td>
</tr> </tr>

View File

@@ -739,10 +739,18 @@ Partial Class OC_OC
TdProyectoSubPrpyectoDdl.Visible = False TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False TdProyectoSubPrpyecto.Visible = False
GvD.Columns(4).Visible = False GvD.Columns(4).Visible = False
chkSubProyectoEntrega.Checked = True
DdlSubProyectoEntrega.Visible = chkSubProyectoEntrega.Checked
txtLugarEntrega.Visible = Not chkSubProyectoEntrega.Checked
UPPEmp.Update()
UPPDetalle.Update() UPPDetalle.Update()
End If End If
'CARGA YA REGISTRADO 'CARGA YA REGISTRADO
If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then
@@ -1073,9 +1081,6 @@ Partial Class OC_OC
TrDescuentoEscalonado.Visible = True TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True TrDescuentoProntoPago.Visible = True
If TipoOC = "OC" AndAlso UsuarioActual.TienePermisoProceso(401) AndAlso EsNuevo Then
ChkEsTemporalRegistro.Visible = True
End If
End If End If
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
@@ -1634,6 +1639,7 @@ Partial Class OC_OC
TxtLugarEntregaDirecta.Text = objOC.LugarEntrega TxtLugarEntregaDirecta.Text = objOC.LugarEntrega
DdlDireccionEnvio.SelectedValueExist(objOC.CveDireccionEnvio.ToString) DdlDireccionEnvio.SelectedValueExist(objOC.CveDireccionEnvio.ToString)
DdlUsoCFDI.SelectedValueExist(objOC.CveUsoCFDI.ToString) DdlUsoCFDI.SelectedValueExist(objOC.CveUsoCFDI.ToString)
TxtDiasCreditoOC.Text = objOC.DiasCreditoOC.ToString
If objOC.CveDireccionEnvio > 0 And DdlDireccionEnvio.SelectedValue.ToEntero <> objOC.CveDireccionEnvio Then If objOC.CveDireccionEnvio > 0 And DdlDireccionEnvio.SelectedValue.ToEntero <> objOC.CveDireccionEnvio Then
Alert("La dirección de envio no se pudo cargar correctamente. Por favor verifique que la dirección de envio aun este vigente.", TipoMensaje.MsgAdvertencia) Alert("La dirección de envio no se pudo cargar correctamente. Por favor verifique que la dirección de envio aun este vigente.", TipoMensaje.MsgAdvertencia)
@@ -2961,7 +2967,7 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.Toentero) Then
CveOrdenCompraPadre = OC.CveOrdenCompra CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then If CveOrdenCompraPadre > 0 Then
@@ -3005,7 +3011,7 @@ Partial Class OC_OC
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
PorcentajeProntoPago:=PorcentajeProntoPago) Then PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.Toentero) Then
CveOrdenCompra = OC.CveOrdenCompra CveOrdenCompra = OC.CveOrdenCompra
CveEstatus = CboE.SelectedValue.ToEntero CveEstatus = CboE.SelectedValue.ToEntero
@@ -3701,7 +3707,7 @@ Partial Class OC_OC
PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.Toentero) Then
'CREA POLIZA POR CADA PROVEEDOR 'CREA POLIZA POR CADA PROVEEDOR
@@ -3780,7 +3786,7 @@ Partial Class OC_OC
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.Toentero) Then
'USA AC 'USA AC
If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then ' AGREGAR POLIZA If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then ' AGREGAR POLIZA

View File

@@ -131,6 +131,16 @@
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkConvertirDeudor" OnClick="LnkConvertirDeudor_Click" runat="server" Visible="false">
<i class="fa fa-share-square-o" aria-hidden="true"></i> Convertir en Deudor
</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">

View File

@@ -998,6 +998,12 @@ Partial Class RH_Personal
CarcaConceptosNomina() CarcaConceptosNomina()
CargaFonacot() CargaFonacot()
End If End If
ValidaDeudorAcreedor()
Else Else
cargatipoTrabajador() cargatipoTrabajador()
MostrarOcultarFechasEstatus() MostrarOcultarFechasEstatus()
@@ -8188,6 +8194,57 @@ Partial Class RH_Personal
args.IsValid = retorno args.IsValid = retorno
End Sub End Sub
Private Sub ValidaDeudorAcreedor()
Dim RFCval As String = TxtRFC.Text.Trim
If CvePersonal > 0 AndAlso (RFCval <> "-1" And RFCval <> "") Then
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=TxtRFC.Text).FiltroPrimeroValor("CveProveedor").ToEntero
If Not CveProveedor > 0 Then
LnkConvertirDeudor.Visible = True
End If
End If
End Sub
Protected Sub LnkConvertirDeudor_Click(sender As Object, e As EventArgs)
Dim ProcesoOK = True
Dim ObjProveedores As New ClsCompProveedores()
Dim ObjCuentasDeposito As New ClsGenerales(ObjProveedores.IniciaTransacSQL())
Dim NuevoCveProveedor As Integer = -1
Dim CveProveedorClasificacion As Integer = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedorClasificacion").ToEntero
If ObjProveedores.AddProveedor(TxtCodigo.Text.Trim, TxtNombres.Text.Trim, TxtNombres.Text.Trim, TxtNombres.Text.Trim, TxtRFC.Text.Trim, $"{TxtCalle.Text} #{TxtNumExt.Text} {TxtColonia.Text}", TxtTelefono.Text.Trim.Replace("("c, "").Replace(")"c, "").Replace("-"c, "").Replace(" ", ""),
TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtCelularPersonal.Text.Trim.Replace("("c, "").Replace(")"c, "").Replace("-"c, "").Replace(" ", ""), 0, 0,
TxtObservaciones.Text.Trim, 0, 0, 0,
CveProveedorClasificacion, -1, TxtCorreo.Text.Trim, TxtCorreo.Text.Trim, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
2, 1, DIOTCveTipoTercero:=1, DIOTCveTipoOperacion:=3, CP:=TxtCP.Text.ToEntero, CveRegimenFiscal:=1) Then
NuevoCveProveedor = ObjProveedores.CveProveedor
Else
ProcesoOK = False
End If
If ProcesoOK Then
ObjCuentasDeposito.Commit()
GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
Alert($"Deudor Agregado Correctamente <b><a target='_blank' href='../Compras/Proveedores.aspx?CveProveedor={NuevoCveProveedor}' class='Texto'>{TxtCodigo.Text.Trim}</a></b>")
LnkConvertirDeudor.Visible = False
Else
ObjProveedores.RollBack()
End If
ObjProveedores.Dispose()
End Sub
End Class End Class

View File

@@ -123,30 +123,39 @@
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion,TipoDocumento"
EmptyDataText="No se encontraron autorizaciones" ToolTip="" EmptyDataText="No se encontraron autorizaciones" ToolTip=""
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None"> CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns> <Columns>
<%-- 0--%>
<asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%"> <asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label> <asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 1--%>
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%"> <asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label> <asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 2--%>
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" /> <asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<%-- 3--%>
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" /> <asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" />
<%-- 30--%> <%-- 4--%>
<asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" /> <asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" /> <asp:TemplateField ItemStyle-Width="7%">
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 45--%> <%-- 45--%>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
@@ -169,54 +178,6 @@
</div> </div>
</div> </div>
</div> </div>
<br />
<div class="portlet light xspadding traspasorow bordered" id="DivAntNCIxC" runat="server" visible="false">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1; color: #ff6000;">Anticipos, notas de crédito e ingresos por comprobar</span>
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaAnt" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVAnticipos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" GridLines="None" DataKeyNames="CveIE,Folio,Tipo,CveVenta,CveCliente" Style="text-align: center; min-width: 783px; width: 100%;">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" DataFormatString="{0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%">
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Tipo" DataField="Tipo" DataFormatString="{0}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("EstatusTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog"> <div id="DModal" class="modal ADS fade" role="dialog">

View File

@@ -37,6 +37,14 @@ Partial Class Ventas_CatAutorizacionLimites
DdlCliente.setEsWebService(True) DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True) DdlClienteFiltro.setEsWebService(True)
If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToString().ToEntero() > 0 Then
Dim CveCliente As Integer = Request("CveCliente").ToString().ToEntero()
Dim Cliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial")
DdlClienteFiltro.SelectedValue = CveCliente.ToString()
DdlCliente.SelectedText = Cliente
End If
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) 'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then 'If EsWS Then
' DdlCliente.setEsWebService(True) ' DdlCliente.setEsWebService(True)
@@ -62,8 +70,8 @@ Partial Class Ventas_CatAutorizacionLimites
DdlEstatus.SelectedValue = "0" DdlEstatus.SelectedValue = "0"
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then
DivAntNCIxC.Visible = True LnkAgregar.Visible = False
End If End If
UpModal.Update() UpModal.Update()
@@ -87,10 +95,6 @@ Partial Class Ventas_CatAutorizacionLimites
ObjGral.Dispose() ObjGral.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
If DivAntNCIxC.Visible Then
CargaAnticipos(CveCliente, FechaI, FechaF)
End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -198,6 +202,12 @@ Partial Class Ventas_CatAutorizacionLimites
e.Row.FCLabel("LblTipoAuto").CssClass = "badge badge-secondary" e.Row.FCLabel("LblTipoAuto").CssClass = "badge badge-secondary"
End If End If
If e.Row.DBCampo("CveIEAplicado").ToString().ToEntero() > 0 Then
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" target=""_blank"" href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", e.Row.DBCampo("CveIEAplicado"), e.Row.DBCampo("FolioIEAplicado"))
Else
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" target=""_blank"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVentaAplicada"), e.Row.DBCampo("FacturaAplicada"))
End If
'If e.Row.DBCampo("Estatus") = "True" Then 'If e.Row.DBCampo("Estatus") = "True" Then
' e.Row.Cells(1).ForeColor = Drawing.Color.Green ' e.Row.Cells(1).ForeColor = Drawing.Color.Green
' e.Row.Cells(1).Font.Bold = True ' e.Row.Cells(1).Font.Bold = True
@@ -225,6 +235,10 @@ Partial Class Ventas_CatAutorizacionLimites
'cuando es la modalidad 3, es autorización directa sobre la venta ya asociada a la solicitud. 'cuando es la modalidad 3, es autorización directa sobre la venta ya asociada a la solicitud.
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then CveEstatusAutorizacion = 2 If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then CveEstatusAutorizacion = 2
If gvRow.DataKey("TipoDocumento") = "Anticipo" Then
CveEstatusAutorizacion = 1
End If
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2) Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
'AUTORIZACION DE IMPORTE, 'AUTORIZACION DE IMPORTE,
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo) 'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
@@ -376,130 +390,4 @@ Partial Class Ventas_CatAutorizacionLimites
Public Overrides Sub VerifyRenderingInServerForm(control As Control) Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub End Sub
#End Region #End Region
Private Sub CargaAnticipos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCAutorizaciones(CveCliente, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
GVAnticipos.DataSource = ObjMovtos.DtResultados
End If
ObjMovtos.Dispose()
GVAnticipos.DataBind()
End Sub
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub GVAnticipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnticipos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
If AnticipoAutorizado Then
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
Else
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-danger"
End If
If e.Row.DataKey("CveIE").ToString().ToEntero() > 0 Then
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", e.Row.DataKey("CveIE"), e.Row.DataKey("Folio"))
Else
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DataKey("CveVenta"), e.Row.DataKey("Folio"))
End If
If UsuarioActual.TienePermisoProceso(379) Then
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
End If
End If
End Sub
End Class End Class

View File

@@ -351,10 +351,14 @@
<asp:LinkButton ID="LnkAgregarLineaAdicional" data-toggle="tooltip" runat="server" Text="<i class='fa fa-plus'></i> Agregar Linea Adicional" Visible="false" OnClick="LnkAgregarLineaAdicional_Click"></asp:LinkButton> <asp:LinkButton ID="LnkAgregarLineaAdicional" data-toggle="tooltip" runat="server" Text="<i class='fa fa-plus'></i> Agregar Linea Adicional" Visible="false" OnClick="LnkAgregarLineaAdicional_Click"></asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpdatePanel11" RenderMode="Inline">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkDevolucionMasiva" runat="server" OnClick="LnkDevolucionMasiva_Click"><i class="fa fa-minus"></i>Devolución</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
@@ -543,8 +547,6 @@
<i></i> <i></i>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input input-iconright" runat="server" visible="False" id="dvZH"> <div class="form-group form-md-line-input input-iconright" runat="server" visible="False" id="dvZH">
<asp:DropDownList ID="DdlZonaHoraria" DataTextField="DisplayText" DataValueField="CveZonaHoraria" runat="server" CssClass="form-control input-sm select2me"> <asp:DropDownList ID="DdlZonaHoraria" DataTextField="DisplayText" DataValueField="CveZonaHoraria" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
@@ -566,7 +568,6 @@
</div> </div>
<div class="row" id="divRegimen" runat="server" visible="false"> <div class="row" id="divRegimen" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlRegimenFiscal" DataTextField="CodigoRegimenFiscalTexto" AutoPostBack="true" Width="100%" DataValueField="CveRegimenFiscal" runat="server" CssClass="form-control input-sm select2me"> <asp:DropDownList ID="DdlRegimenFiscal" DataTextField="CodigoRegimenFiscalTexto" AutoPostBack="true" Width="100%" DataValueField="CveRegimenFiscal" runat="server" CssClass="form-control input-sm select2me">
@@ -590,12 +591,6 @@
<label for="<%= DdlGeneroCliente.ClientID.ToString()%>">Género:</label> <label for="<%= DdlGeneroCliente.ClientID.ToString()%>">Género:</label>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
@@ -2294,8 +2289,6 @@
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaAnticipos" runat="server" ClientIDMode="Static" Text="CargaAnt" Style="display: none;" OnClick="BtnCargaAnticipos_Click" /> <asp:Button ID="BtnCargaAnticipos" runat="server" ClientIDMode="Static" Text="CargaAnt" Style="display: none;" OnClick="BtnCargaAnticipos_Click" />
<div class="row col-md-12" align="right"> <div class="row col-md-12" align="right">
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
@@ -2310,6 +2303,9 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkAnticipoClientePDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkAnticipoClientePDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkAnticipoClienteExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkAnticipoClienteExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 125px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkAnticipoClientePDF" /> <asp:PostBackTrigger ControlID="LnkAnticipoClientePDF" />
@@ -2320,8 +2316,110 @@
</div> </div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div runat="server" id="divDevolverAnticipos" visible="False">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-4">
<label>Tipo Movimiento:</label>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoTransaccion" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar" Width="100%" >
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceTipoTransancion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" style="padding-bottom: 5px;">
<div class="col-md-4">
<label>Cuenta:</label>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlCuenta" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar" Width="100%" >
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row" style="padding-bottom: 5px;">
<div class="col-md-4">
<label>Fecha:</label>
</div>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="imgCalendarioDev" class="btn default" type="button">
<i class="fa fa-calendar"></i>
</asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" UserDateFormat="DayMonthYear" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="imgCalendarioDev" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:MaskedEditValidator ID="MEVCalendario" runat="server" ControlExtender="MEEFecha" ControlToValidate="TxtFechaDocumento" Display="None" IsValidEmpty="False" MaximumValueMessage="Fecha Excedida" ErrorMessage="*" InvalidValueMessage="Fecha Invalida" InvalidValueBlurredMessage="b" MinimumValueMessage="Fecha Menor a la permitida" Enabled="False" ValidationGroup="GrpGuardar"></ajax:MaskedEditValidator>
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha Documento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''Fecha Documento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="MEVCalendario" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" style="padding-bottom: 5px;">
<div class="col-md-4">
<label>Importe:</label>
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtImporteDev" runat="server" MaxLength="12" CssClass="input-sm" ClientIDMode="Static" Style="text-align: right;" AutoComplete="off" Width="145px"></asp:TextBox>
<%--<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="TxtImporteDev" FilterType="Custom, Numbers" ValidChars="+-.," />
<asp:RangeValidator ID="RVImporte" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtImporteDev" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>--%>
</div>
</div>
<div class="row" style="padding-bottom: 5px;" id="DivTotal" runat="server" visible="false">
<div class="col-md-4">
<label></label>
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtTotal" runat="server" MaxLength="12" CssClass="input-sm" ClientIDMode="Static" Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off" Width="145px"></asp:TextBox>
</div>
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-2">
<label>Observaciones:</label>
</div>
<div class="col-md-4">
<asp:TextBox ID="TxtDevObs" runat="server" MaxLength="500" CssClass="form-control input-sm" Rows="2" TextMode="MultiLine" ClientIDMode="Static" Width="100%"></asp:TextBox>
</div>
<div class="col-md-2">
<label>Redondeo:</label>
</div>
<div class="col-md-4">
<asp:TextBox ID="TxtDevRedondeo" runat="server" MaxLength="12" CssClass="input-sm" ClientIDMode="Static" Style="text-align: right;" onkeyup="FCSumaTotalesNCAnticipos()" AutoComplete="off" Width="125px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label>Cta Depósito:</label>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlCuentaDeposito" runat="server" DataTextField="CuentaDeposito" DataValueField="CveCuentaDeposito" CssClass="form-control input-sm select2me" Width="400px" AppendDataBoundItems="True"></asp:DropDownList>
<asp:LinkButton ID="LnkAplicaDevolucion" CssClass="btn btn-primary" runat="server" OnClick="LnkAplicaDevolucion_Click">Guardar Devolución</asp:LinkButton>
<asp:LinkButton ID="LnkDevolucionCerrar" CssClass="btn default" runat="server" OnClick="LnkDevolucionCerrar_Click">Cerrar </asp:LinkButton>
</div>
</div>
</div>
<div class="table-scrollable"> <div class="table-scrollable">
<asp:GridView ID="GVAnticipos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Anticipos del Cliente" ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" GridLines="None" DataKeyNames="ISTotal,Saldo,Total,CveIE,Folio,Tipo,CveVenta,CveConceptoContable" Style="text-align: center; min-width: 783px; width: 100%;"> <asp:GridView ID="GVAnticipos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Anticipos del Cliente" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" GridLines="None" DataKeyNames="ISTotal,Saldo,Total,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,IVA,IEPS,RetIVA,RetISR,PorcentajeIVA" Style="text-align: center; min-width: 783px; width: 100%;">
<Columns> <Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
@@ -2339,15 +2437,16 @@
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" Visible="false"> <asp:TemplateField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="chkDevolver" runat="server" Visible="false" CssClass="CssSelector" onclick="FCSumaTotalesNCAnticipos()" />
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" /> <asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false"> <%-- <asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" /> <asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" /> <asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>--%>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
@@ -2355,10 +2454,6 @@
</div> </div>
<br /> <br />
<div class="row col-md-12" align="right">
<input type="text" id="TxtBusquedaAnticiposHistorial" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticiposHistorial','{0}')", GVAnticiposHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticiposHistorial','{0}')", GVAnticiposHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
@@ -2372,6 +2467,8 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkAnticipoHistorialPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkAnticipoHistorialPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkAnticipoHistorialExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkAnticipoHistorialExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusquedaAnticiposHistorial" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticiposHistorial','{0}')", GVAnticiposHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 125px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticiposHistorial','{0}')", GVAnticiposHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkAnticipoHistorialPDF" /> <asp:PostBackTrigger ControlID="LnkAnticipoHistorialPDF" />
@@ -2408,8 +2505,8 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel>
</asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
@@ -3627,14 +3724,14 @@
<asp:UpdatePanel ID="UpContratosInactivos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpContratosInactivos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div id="dvCa" style="width: 100%; top: 30px"> <div id="dvCon" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall "> <table id="dTablecon" class="table Widthall ">
<tr> <tr>
<td width="40%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td> <td width="40%" id="THcon1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="10%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td> <td width="10%" id="THcon2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="20%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td> <td width="20%" id="THcon3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="20%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td> <td width="20%" id="THcon4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<td width="10%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td> <td width="10%" id="THcon5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -7979,7 +8076,30 @@
$("#BtnDirClienteValidar").click(); $("#BtnDirClienteValidar").click();
} }
function FCSumaTotalesNCAnticipos() {
var Total = 0.0;
debugger;
$(`.CssSelector input[type=checkbox]`).each(function () {
if ($(this).is(":checked")) {
Total += parseFloat($(this).attr("data-saldo"));
}
});
if (Total > 0) {
if ($(`#TxtDevRedondeo`).val() != '') {
Total += parseFloat($(`#TxtDevRedondeo`).val());
}
$(`#TxtImporteDev`).val(Total);
FormatoMoneda($get("TxtImporteDev"));
} else {
$(`#TxtImporteDev`).val("");
}
}
</script> </script>

View File

@@ -101,6 +101,19 @@ Partial Class Clientes
End Set End Set
End Property End Property
Property ModalidadSelecionDevAnticipos As Boolean
Get
If ViewState("ModalidadSelecionDevAnticipos") Is Nothing Then
Return False
Else
Return CBool(ViewState("ModalidadSelecionDevAnticipos").ToString())
End If
End Get
Set(value As Boolean)
ViewState("ModalidadSelecionDevAnticipos") = value
End Set
End Property
Private Property Existe As Boolean Private Property Existe As Boolean
Get Get
Return Convert.ToBoolean(ViewState("Existe")) Return Convert.ToBoolean(ViewState("Existe"))
@@ -1618,9 +1631,9 @@ Partial Class Clientes
ChkMuestraNombre.Checked = ObjClientes.ImprimeNombreSucursal ChkMuestraNombre.Checked = ObjClientes.ImprimeNombreSucursal
DdlUsoCFDI.SelectedValueExist(ObjClientes.CveUsoCFDI.ToString()) DdlUsoCFDI.SelectedValueExist(ObjClientes.CveUsoCFDI.ToString())
DdlMetodoPago33.SelectedValueExist(ObjClientes.CveMetodoPago33.ToString()) DdlMetodoPago33.SelectedValueExist(ObjClientes.CveMetodoPago.ToString())
'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString()) 'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString())
CargaFormaDePago(ObjClientes.CveFormaPago33) CargaFormaDePago(ObjClientes.CveFormaPago)
If ObjClientes.CveRegimenFiscal > 0 Then DdlRegimenFiscal.SelectedValueExist(ObjClientes.CveRegimenFiscal) If ObjClientes.CveRegimenFiscal > 0 Then DdlRegimenFiscal.SelectedValueExist(ObjClientes.CveRegimenFiscal)
ChkDesglosarIEPS.Checked = ObjClientes.DesglosaIEPS ChkDesglosarIEPS.Checked = ObjClientes.DesglosaIEPS
@@ -1946,9 +1959,9 @@ Partial Class Clientes
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then 'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
GVAnticipos.Columns(7).Visible = True ' GVAnticipos.Columns(7).Visible = True
End If 'End If
GVAnticipos.DataBind() GVAnticipos.DataBind()
GVAnticiposHistorial.DataBind() GVAnticiposHistorial.DataBind()
@@ -3007,9 +3020,6 @@ Partial Class Clientes
e.Row.BackColor = Drawing.Color.LightGray e.Row.BackColor = Drawing.Color.LightGray
End If End If
'If e.Row.DataKey("Saldo").ToDouble < 0 Then e.Row.Cells(2).ForeColor = Drawing.Color.Red
'If e.Row.DataKey("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAnticipos"), Literal).Text = ""
If e.Row.RowIndex > -1 Then If e.Row.RowIndex > -1 Then
If e.Row.DBCampo("Folio") = "N/D" Then If e.Row.DBCampo("Folio") = "N/D" Then
e.Row.FCLiteral("LtlFactura").Text = e.Row.DataKey("Folio") e.Row.FCLiteral("LtlFactura").Text = e.Row.DataKey("Folio")
@@ -3023,118 +3033,36 @@ Partial Class Clientes
End If End If
If UsuarioActual.TienePermisoProceso(247) Then If UsuarioActual.TienePermisoProceso(247) Then
If CType(sender, GridView).ID = "GVAnticipos" And e.Row.DBCampo("CveVenta").ToEntero() > 0 And e.Row.DBCampo("Tipo") = "NC" Then If CType(sender, GridView).ID = "GVAnticipos" Then ' And e.Row.DBCampo("CveVenta").ToEntero() > 0 And e.Row.DBCampo("Tipo") = "NC" Then
Dim Parametros As String = Encripta($"CveVenta={e.Row.DBCampo("CveVenta").ToEntero()}&SerieFolio={e.Row.DBCampo("Folio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveCliente={CveCliente}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}")
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
End If
End If
If (e.Row.DBCampo("CveVenta").ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").Contiene("Ant", "NC", "Dev")) OrElse (e.Row.DBCampo("CveIE").ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo") = "IxC") Then
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then 'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then ' If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then ' If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True ' If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCLinkButton("LnkCancelar").Visible = False ' e.Row.FCLinkButton("LnkAutorizar").Visible = True
Else ' e.Row.FCLinkButton("LnkCancelar").Visible = False
e.Row.FCLinkButton("LnkAutorizar").Visible = False ' Else
e.Row.FCLinkButton("LnkCancelar").Visible = True ' e.Row.FCLinkButton("LnkAutorizar").Visible = False
' e.Row.FCLinkButton("LnkCancelar").Visible = True
' End If
' End If
'End If
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
End If End If
End If End If
If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then
If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
End If End If
End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "R H"
Private Sub CargaPersonalAsignado()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, CveCliente, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
GVPersonal.DataSource = ObjPersonal.DtResultados
Else
GVPersonal.DataSource = Nothing
End If
ObjPersonal.Dispose()
GVPersonal.DataBind()
End Sub
Protected Sub GVPersonal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVPersonal.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(70)
e.Row.Cells(1).Width = Unit.Pixel(300)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(120)
e.Row.Cells(5).Width = Unit.Pixel(120)
e.Row.Cells(6).Width = Unit.Pixel(60)
End If
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Left
Dim Liga As String = "<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal=" & e.Row.DBCampo("CvePersonal") & """>"
e.Row.FCLiteral("LtlCodigo").Text = Liga & e.Row.FCLiteral("LtlCodigo").Text & "</a>"
e.Row.FCLiteral("LtlPersonal").Text = Liga & e.Row.FCLiteral("LtlPersonal").Text & "</a>"
End If
End Sub
Protected Sub BtnConsultarAsistencia_Click(sender As Object, e As System.EventArgs) Handles BtnConsultarAsistencia.Click
Dim objpersonal As New ClsRH
If objpersonal.GetAsistencias(-1, CveCliente, -1, -1, -1, 1, -1, txtFechaI.Text.Trim.ToDate(), txtFechaF.Text.Trim.ToDate(), UsuarioActual.CveEmpresa) Then
GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
Else
GVAsistencia.DataSource = Nothing
End If
objpersonal.Dispose()
GVAsistencia.DataBind()
UpDatos.Update()
End Sub
Protected Sub GVAsistencia_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAsistencia.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(75)
e.Row.Cells(1).Width = Unit.Pixel(145)
e.Row.Cells(2).Width = Unit.Pixel(70)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(145)
e.Row.Cells(6).Width = Unit.Pixel(220)
End If
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Left
If IsDate(e.Row.DBCampo("Fecha")) Then e.Row.FCLiteral("LtlFecha").Text = e.Row.DBCampo("Fecha").ToDate().ToShortDateString()
If e.Row.DBCampo("SeModifico") = "0" Then
e.Row.BackColor = Drawing.Color.LightBlue
ElseIf e.Row.DBCampo("SeModifico") = "1" Then
e.Row.ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
#Region "S U C U R S A L E S" #Region "S U C U R S A L E S"
Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click
@@ -4908,8 +4836,8 @@ Partial Class Clientes
If Not TieneError Then If Not TieneError Then
If IVA > 0 Then If IVA > 0 Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -IVA, -IVA, 13, "Traspaso de saldos de anticipos.IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, Contabilizable:=False) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -IVA, -IVA, 13, "Traspaso de saldos de anticipos.IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, CveVenta:=CveVenta, Contabilizable:=False) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, "Traspaso de saldos de anticipos. IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=CveCliente, CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, Contabilizable:=False) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, "Traspaso de saldos de anticipos. IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=CveCliente, CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, CveVenta:=CveVenta, Contabilizable:=False) Then
TieneError = True TieneError = True
End If End If
Else Else
@@ -10753,82 +10681,302 @@ Partial Class Clientes
End Function End Function
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs) 'Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) ' Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero() ' Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero() ' Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then ' If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False ' Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas ' Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then ' If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then ' If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente") ' Alert("El anticipo se autorizó correctamente")
Actualizo = True ' Actualizo = True
End If ' End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then ' ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then ' If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente") ' Alert("El anticipo se autorizó correctamente")
Actualizo = True ' Actualizo = True
End If ' End If
End If ' End If
End Using ' End Using
If Actualizo Then ' If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos ' Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then ' If ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados ' GvEB.DataSource = ObjEventoBitacora.DtResultados
End If ' End If
ObjEventoBitacora.Dispose() ' ObjEventoBitacora.Dispose()
GvEB.DataBind() ' GvEB.DataBind()
UPEventoBitacora.Update() ' UPEventoBitacora.Update()
CargaEventoBitacora() ' CargaEventoBitacora()
End If ' End If
End If ' End If
' CargaAnticipos()
'End Sub
'Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
' Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
' Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
' Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
' If CveVenta > 0 OrElse CveIE > 0 Then
' Dim Actualizo As Boolean = False
' Using ObjVentas As New ClsVentas
' If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
' If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
' Alert("El anticipo se desautorizó correctamente")
' Actualizo = True
' End If
' ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
' If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
' Alert("El anticipo se desautorizó correctamente")
' Actualizo = True
' End If
' End If
' End Using
' CargaAnticipos()
' If Actualizo Then
' Dim ObjEventoBitacora As New ClsOIEventos
' If ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
' GvEB.DataSource = ObjEventoBitacora.DtResultados
' End If
' ObjEventoBitacora.Dispose()
' GvEB.DataBind()
' UPEventoBitacora.Update()
' CargaEventoBitacora()
' End If
' End If
'End Sub
#Region "D E V O L U C I O N D E D I N E R O "
Protected Sub LnkDevolucionMasiva_Click(sender As Object, e As EventArgs)
TxtFechaDocumento.Text = Now.ToShortDateString
ModalidadSelecionDevAnticipos = True
divDevolverAnticipos.Visible = True
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlCuenta.DataBind()
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1 ")
DdlTipoTransaccion.DataBind()
TxtImporteDev.Attributes.Add(“readonly”, “readonly”)
TxtImporteDev.Text = ""
TxtDevRedondeo.Text = ""
DdlCuentaDeposito.DataSource = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente)
DdlCuentaDeposito.DataBind()
'Dim Dep As New ClsGenerales
'If Dep.GetCuentasDepositos(CveCliente:=CveCliente, CveEmpresa:=UsuarioActual.CveEmpresa) Then
' DdlCuentaDeposito.DataSource = Dep.DtResultados
'End If
'Dep.Dispose()
DdlCuentaDeposito.Items.Insert(Opcion, New ListItem("-", "-1"))
CargaAnticipos()
End Sub
Protected Sub LnkDevolucionCerrar_Click(sender As Object, e As EventArgs)
ModalidadSelecionDevAnticipos = False
divDevolverAnticipos.Visible = False
CargaAnticipos() CargaAnticipos()
End Sub End Sub
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs) Protected Sub LnkAplicaDevolucion_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
End Using
CargaAnticipos()
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados
End If
ObjEventoBitacora.Dispose()
GvEB.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End If
If TxtImporteDev.Text.ToDecimal <= 0 Then
Alert("No se tiene importe a devolver.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If End If
Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim CveIE, CvePrePoliza As Integer
Dim tCveMoneda As Integer = 1
Dim tTipoCambio As Decimal = 1
Dim PagueseA As String = TxtNombre.Text
Dim MsgError As String = ""
Dim tImporteDev As Decimal = TxtImporteDev.Text.ToDecimal
Dim tCveCorte As Integer = -1
Dim tFolio As String = "1"
Dim tObs As String = TxtDevObs.Text.Trim
tCveMoneda = GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveMoneda", $"CveCuenta={DdlCuenta.SelectedValue}").ToEntero
CvePrePoliza = ObjMov.AddPrePolizas("Clientes/IE/DEV ", 1, tImporteDev, tImporteDev, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=2)
'valida prepoliza
If CvePrePoliza > 0 Then
tFolio = ObjIE.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero).ToString
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, tFolio, PagueseA, tImporteDev, tCveMoneda,
tTipoCambio, tObs, "", False, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero)
If CveIE > 0 Then
Dim ImporteAplicar As Decimal = 0.0D
Dim ImporteAplicarMN As Decimal = 0.0D
Dim ImporteAplicarME As Decimal = 0.0D
Dim ReferenciaAplicar As String = ObjIE.Folio
Dim ConceptoAplicar As String = $"Devolución al cliente {PagueseA} {tImporteDev} "
ImporteAplicar = tImporteDev
ImporteAplicarME = ImporteAplicar
'CONSIDERA COMPLEMENTARIA
If tCveMoneda > 1 Then
ImporteAplicarMN = ImporteAplicar
Else
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)).RoundSQL()
End If
'BANCOS
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ImporteAplicarMN, 30, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=-1, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución"
End If
'BANCOS COMPLEMENTARIAs
If tCveMoneda > 1 Then
ImporteAplicarMN = ((ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)) - ImporteAplicar).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ImporteAplicarMN, 204, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=-1, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If
End If
'OTROS INGRESOS/EGRESOS
Dim ImpOtros As Decimal = TxtDevRedondeo.Text.ToDecimal
If ImpOtros <> 0 Then
Dim TipoMovtoIE As Boolean = False
Dim CveConcIE As Integer = 78
Dim tCveSub As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero
If ImpOtros < 0 Then
TipoMovtoIE = True : ImpOtros = Math.Abs(ImpOtros) : CveConcIE = 78
Else
TipoMovtoIE = False : ImpOtros = Math.Abs(ImpOtros) : CveConcIE = 211
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, ImpOtros, ImpOtros, CveConcIE, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCliente:=CveCliente, ImporteME:=0, CveSubProyecto:=tCveSub) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
End If
End If
Dim tImporte As Decimal = 0
Dim tTipoMovto As Boolean = True
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("chkDevolver").Checked Then
Dim PorcentajePagoDevDin As Decimal = (gvr.DataKey("Saldo").ToDecimal / gvr.DataKey("Total").ToDecimal).RoundSQL(6)
Dim tCveConcepto As Integer
ImporteAplicar = gvr.DataKey("Saldo").ToDecimal
If gvr.DataKey("Tipo") = "IxC" Then
tCveConcepto = 92 : tTipoMovto = False
ElseIf gvr.DataKey("Tipo").Contiene("Dev", "NC") Then
tCveConcepto = 12 : ImporteAplicar = -ImporteAplicar : tTipoMovto = True
ElseIf gvr.DataKey("Tipo").Contiene("Ant") Then
tCveConcepto = 11 : ImporteAplicar = ImporteAplicar : tTipoMovto = False
End If
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tCveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit For
End If
'IMPUESTOS
If gvr.DataKey("IVA").ToDecimal > 0 Then
tImporte = -(gvr.DataKey("IVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 13, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=gvr.DataKey("PorcentajeIVA").ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 61, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=gvr.DataKey("PorcentajeIVA").ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For
End If
End If
If gvr.DataKey("IEPS").ToDecimal > 0 Then
tImporte = (gvr.DataKey("IEPS").ToDecimal * PorcentajePagoDevDin).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 39, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For
End If
End If
If gvr.DataKey("RetIVA").ToDecimal > 0 Then
tImporte = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 62, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For
End If
End If
If gvr.DataKey("RetISR").ToDecimal > 0 Then
tImporte = (gvr.DataKey("RetISR").ToDecimal * PorcentajePagoDevDin).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 63, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For
End If
End If
End If
Next
If MsgError = "" Then
If ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
' MsgError = ObjMov.MensajePolizaDescuadre
GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
Else
MsgError = "No se pudo validar la prepoliza de cuadre."
End If
End If
If MsgError = "" Then
ObjIE.Commit()
Dim Msg As New StringBuilder
If Msg.ToString = "" Then
Msg.Append("El Documento se guardo correctamente")
End If
Dim Archivo As System.IO.FileInfo = Nothing
'VERIFICA SI EXISTE EL FORMATO
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then
Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta))
ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then
Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero))
If Not Archivo.Exists Then
Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", ModExtensiones.DirectorioBaseEmpresas))
End If
'ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then
' Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero))
End If
If Archivo IsNot Nothing AndAlso Archivo.Exists Then
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">{1}</a> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem))
End If
ModalidadSelecionDevAnticipos = False
divDevolverAnticipos.Visible = False
CargaAnticipos()
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
End If
Alert(Msg.ToString)
Else
ObjIE.RollBack()
Alert(MsgError, TipoMensaje.MsgAdvertencia)
End If
End If
End If
ObjIE.Dispose()
ObjMov.Dispose()
End Sub End Sub
#End Region
End Class End Class

View File

@@ -6624,7 +6624,7 @@ Partial Class PV
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero,
TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista, DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", DdlMetodoCliente.SelectedValue.ToEntero(), DdlFormaCliente.SelectedValue.ToEntero(), CvePrecioLista:=CvePrecioLista,
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI, Genero:=GeneroCliente) Then RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI, Genero:=GeneroCliente) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then

View File

@@ -4,6 +4,7 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.IO Imports System.IO
Imports System.Net.Http Imports System.Net.Http
Imports CrystalDecisions.CrystalReports.Engine
Imports Extensiones Imports Extensiones
Imports Modelos.Factura Imports Modelos.Factura
@@ -25,6 +26,18 @@ Partial Class Ventas_PVCobranza
End Set End Set
End Property End Property
Private Property CveVendedor As Integer
Get
If ViewState("CveVendedor") Is Nothing Then
ViewState("CveVendedor") = -1
End If
Return ViewState("CveVendedor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveVendedor") = value
End Set
End Property
Private Property CveVentaCancelacion As Integer Private Property CveVentaCancelacion As Integer
Get Get
If ViewState("CveVentaCancelacion") Is Nothing Then If ViewState("CveVentaCancelacion") Is Nothing Then
@@ -459,6 +472,28 @@ Partial Class Ventas_PVCobranza
End If End If
End If End If
If e.Row.DBCampo("Fecha").ToDate.ToShortDateString <> Now.ToShortDateString Then
e.Row.FCLinkButton("BtnPagar").Enabled = False
e.Row.FCLinkButton("BtnPagar").Text = "Cobrar"
'e.Row.FCLinkButton("BtnPagar").CssClass = "btn btn-xs default"
e.Row.FCLinkButton("BtnPagar").OnClientClick =
"bootbox.dialog({" &
"message: 'No se puede realizar un cobro a una remisión de días anteriores.<br/> Favor de cancelar la remisión y generarla con fecha actual. ', " &
"className: 'header-yellow', " &
"onEscape: function() {}, " &
"title: '<i class=""fa fa-warning""></i> Advertencia', " &
"buttons: { " &
"success: { label: '', className: 'hide', callback: function() {} }, " &
"danger: { label: '', className: 'hide', callback: function() {} }, " &
"main: { label: 'Aceptar', className: 'yellow', callback: function() {} } " &
"} " &
"});" &
"return false;"
'e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc")
'e.Row.CssClass = "blue-madison"
End If
End If End If
End Sub End Sub
@@ -808,7 +843,7 @@ Partial Class Ventas_PVCobranza
End Try End Try
If MsgError = "" Then If MsgError = "" Then
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=respFactura.CveVenta) Then If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If End If
@@ -818,96 +853,109 @@ Partial Class Ventas_PVCobranza
If MsgError = "" Then If MsgError = "" Then
ObjVentas2.Commit() ObjVentas2.Commit()
Dim msBuild As New StringBuilder() Dim msBuild As New StringBuilder()
Dim MsgTimbrado As String = ""
Dim DebeTimbrar As Boolean = True Try
Dim SeTimbro As Boolean = False Dim MsgTimbrado As String = ""
Dim SeTimbroNC As Boolean = False
Dim DebeTimbrar As Boolean = True
Dim SeTimbro As Boolean = False
Dim SeTimbroNC As Boolean = False
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
Try
'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else
AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
MsgTimbrado = StrEr
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End Try
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else
AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then If respFactura IsNot Nothing Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>" If RegistrarPago Then
MsgTimbrado = StrEr msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If End If
End If msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
If respFactura IsNot Nothing Then If SeTimbro Then
If RegistrarPago Then Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If
msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
If SeTimbro Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdf)
If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If
If respNC IsNot Nothing Then
msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
If SeTimbroNC Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml) msBuild.AppendFormat("{0}", xml)
End If End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta))) Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC) msBuild.AppendFormat("{0}", pdf)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado) msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If End If
If respNC IsNot Nothing Then
msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
If SeTimbroNC Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC)
End If
If respNC IsNot Nothing Then
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respNC.Factura.CveCliente,
respNC.CveVenta,
respNC.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next
End If
Else
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respFactura.Factura.CveCliente,
respFactura.CveVenta,
respFactura.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next
End If
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
If respNC IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respNC.Factura.CveCliente,
respNC.CveVenta,
respNC.Factura.Total,
(respNC.Factura.Total - respNC.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
Next
Else Else
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respFactura.Factura.CveCliente,
respFactura.CveVenta,
respFactura.Factura.Total,
(respFactura.Factura.Total - respFactura.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
Next
End If End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
msBuild.Append("Ocurrio un error posterior al pago")
End Try
Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If
Alert(msBuild.ToString(), TipoMensaje.MsgInformacion) Alert(msBuild.ToString(), TipoMensaje.MsgInformacion)
Else Else
ObjVentas2.RollBack() ObjVentas2.RollBack()
@@ -925,6 +973,18 @@ Partial Class Ventas_PVCobranza
ImpresionDirectaPDF(CveVenta) ImpresionDirectaPDF(CveVenta)
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
'ENVIO DE CORREO
Try
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing Then
Dim EnviarMail As Boolean = respFactura.Factura.Cliente.EnviarFactura = "Si"
Dim Hilo As New System.Threading.Thread(Sub() EnviarMailFactura(EnviarMail, respFactura.Factura, UsuarioActual))
Hilo.Start()
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
End Try
End If
LimpiarDatos() LimpiarDatos()
CargaDatos() CargaDatos()
@@ -945,12 +1005,10 @@ Partial Class Ventas_PVCobranza
Dim Actualizo As Boolean = False Dim Actualizo As Boolean = False
If Tipo.Contiene("NC", "Ant") Then If Tipo.Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True Actualizo = True
End If End If
ElseIf Tipo.Contiene("IxC") Then ElseIf Tipo.Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True Actualizo = True
End If End If
End If End If
@@ -978,6 +1036,8 @@ Partial Class Ventas_PVCobranza
LtlTipoAnticipo.Text = "" LtlTipoAnticipo.Text = ""
HdnTipoAmortizacion.Value = "" HdnTipoAmortizacion.Value = ""
CveCliente = -1 CveCliente = -1
CveVendedor = -1
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
TmpDTAnticiposNCIxCCliente.Clear() TmpDTAnticiposNCIxCCliente.Clear()
@@ -1967,17 +2027,16 @@ Partial Class Ventas_PVCobranza
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty) DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
End If End If
If CveCliente <= 0 Then Dim DbRowVenta As DataRow = Nothing
Dim DbRowVenta As DataRow = Nothing Dim ObjVentas As New ClsVentas
Dim ObjVentas As New ClsVentas If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") End If
End If ObjVentas.Dispose()
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero() CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
End If End If
If CveCliente > 0 Then If CveCliente > 0 Then
@@ -2091,11 +2150,14 @@ Partial Class Ventas_PVCobranza
End Sub End Sub
Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs) Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs)
Dim CveCliente As Integer = -1
'falta sacar a los usuarios a notificar. 'falta sacar a los usuarios a notificar.
Dim gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
Dim CveCliente As Integer = gvr.DataKey("CveCliente").ToEntero()
Dim Folio As String = gvr.DataKey("Folio") Dim Folio As String = gvr.DataKey("Folio")
Dim Importe As Decimal = gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal Dim Importe As Decimal = gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
Dim Saldo As Decimal = gvr.DataKey("Saldo").ToDecimal()
Dim dtt As DataTable = Nothing Dim dtt As DataTable = Nothing
Dim ObjProceso As New ClsSisProcesos Dim ObjProceso As New ClsSisProcesos
@@ -2117,22 +2179,33 @@ Partial Class Ventas_PVCobranza
If EsProduccion Then If EsProduccion Then
NumeroTelefono = String.Format("52{0}", dr("Celular").ToString()) NumeroTelefono = String.Format("52{0}", dr("Celular").ToString())
End If End If
Dim Arr As New ArrayList Dim Arr As New ArrayList
Arr.Add(DdlSucursalCorte.SelectedItem.Text) Arr.Add(DdlSucursalCorte.SelectedItem.Text)
Arr.Add(NombreCliente) Arr.Add(NombreCliente)
Arr.Add(Folio) Arr.Add(Folio)
Arr.Add($"$ {Importe}") Arr.Add($"$ {Importe}")
EnvioMsg = EnviarNotificacionWhatsAppPlantilla(NumeroTelefono, "solicitud_autorizacion_anticipo", Arr, $"https://grupodiaz.adssistemas.mx.com/Clientes/Clientes.aspx?CveCliente={CveCliente}")
'EnvioMsg = ModExtensiones.EnviarNotificacionWhatsApp2(NumeroTelefono, "", $"Solicitud de activación de anticipo.\\nFolio: {Folio}.\\nCliente: {NombreCliente}.") If NumeroTelefono.Length = 12 Then
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB) EnvioMsg = EnviarNotificacionWhatsAppPlantilla(NumeroTelefono, "solicitud_autorizacion_anticipo", Arr, $"https://grupodiaz.adssistemas.mx.com/Ventas/CatAutorizacionLimites.aspx?CveCliente={CveCliente}")
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/CatAutorizacionLimites.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
End If
Next Next
If EnvioMsg Then
Alert("Se envió una solicitud de autorización", TipoMensaje.ToastInformacion)
'Else
' Alert("No se envió la solicitud de autorización", TipoMensaje.MsgAdvertencia)
End If
End If End If
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, Saldo, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
If EnvioMsg Then
msgAlert = $"{msgAlert} Se envió una notificación de autorización a los usuarios"
End If
Alert(msgAlert, TipoMensaje.ToastInformacionB)
End If
ObjVta.Dispose()
UpAnticipos.Update() UpAnticipos.Update()
End Sub End Sub
@@ -2299,20 +2372,19 @@ Partial Class Ventas_PVCobranza
DivConceptoNC.Visible = False DivConceptoNC.Visible = False
End If End If
If CveCliente <= 0 Then Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero Dim DbRowVenta As DataRow = Nothing
Dim DbRowVenta As DataRow = Nothing Dim ObjVentas As New ClsVentas
Dim ObjVentas As New ClsVentas If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
End If
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If End If
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
End If
If CveCliente > 0 Then If CveCliente > 0 Then
CargaAnticipos(CveCliente) CargaAnticipos(CveCliente)
@@ -2733,6 +2805,131 @@ Partial Class Ventas_PVCobranza
#End Region #End Region
Private Sub EnviarMailFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario)
'GUARDA PDF
Dim LocalSerieFolio As String = Factura.SerieFolio
Dim LocalTipoDocto As String = Factura.TipoDocto
Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
'TIMBRADO NUEVO
Try
If Not File.Exists(ArchivoPDF) Then
GenerarPDFVenta(Factura.CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
End Try
Dim ErrorCorreo As Boolean = False
If EnviaCorreo Then
If Factura IsNot Nothing Then
Dim ArchivoXML As String = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
Try
Dim FIXML As New FileInfo(ArchivoXML)
Dim FIPDF As New FileInfo(ArchivoPDF)
If FIXML.Exists AndAlso FIPDF.Exists Then
MandaMails(UsuarioActual, Factura, Factura.TipoDocto, LocalSerieFolio, EnviaCorreo, ArchivoXML, ArchivoPDF)
Else
ErrorCorreo = True
End If
Catch ex As Exception
ErrorCorreo = True
End Try
Else
ErrorCorreo = True
End If
If ErrorCorreo Then
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
If EnviaCorreo Then
ObjVentas.UpdateVentaMail(3, Factura.CveVenta)
Else
ObjVentas.UpdateVentaMail(0, Factura.CveVenta)
End If
ObjVentas.Dispose()
End If
End If
End Sub
Private Sub MandaMails(UsuarioActual As Usuario, ObjFactura As Modelos.Factura, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
Dim CorreoDestino As String = ObjFactura.Cliente.Mail
Try
Dim Asunto As String = String.Empty
Dim Cuerpo As String = String.Empty
Dim TipoComprobante As String = ""
If TipoDocto = "Ing" Then TipoComprobante = "Factura"
If TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then
Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", ObjFactura.Cliente.NombreComercial)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total.ToString("N2"))
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", SerieFolio)
Asunto = Asunto.Replace("{""AtencionA""}", ObjFactura.AtencionA)
Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto)
Asunto = Asunto.Replace("{""DescripcionVenta""}", ObjFactura.DescripcionVenta)
Asunto = Asunto.Replace("{""FolioFactura""}", ObjFactura.SerieFolio)
End If
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
Asunto = Asunto.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Asunto = Asunto.Replace("{""NombreCliente""}", ObjFactura.Cliente.NombreComercial)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total.ToString("N2"))
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy"))
Asunto = Asunto.Replace("{""SerieFolio""}", SerieFolio)
Asunto = Asunto.Replace("{""AtencionA""}", ObjFactura.AtencionA)
Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto)
Asunto = Asunto.Replace("{""DescripcionVenta""}", ObjFactura.DescripcionVenta)
Asunto = Asunto.Replace("{""FolioFactura""}", ObjFactura.SerieFolio)
End If
If Not EnviarFactura Then
ResultadoMail = 0
End If
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = XML})
Dim DisplayName As String = ""
If ObjMail.SendMail(UsuarioActual.Empresa, CorreoDestino, Asunto, Cuerpo, "", LSRutasMail, Displayname:=DisplayName) Then
ResultadoMail = 1
Else
ResultadoMail = 3
End If
Catch ex As Exception
OnError("Ocurrió error al mandar el Mail", ex)
ResultadoMail = 3
Finally
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
ObjVentas.UpdateVentaMail(ResultadoMail, ObjFactura.CveVenta)
ObjVentas.Dispose()
End Try
End Sub
End Class End Class
Public Class MRespuestaSAT Public Class MRespuestaSAT

View File

@@ -425,8 +425,26 @@ Partial Class Ventas_Promociones
End If End If
End Sub End Sub
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
DdlTipoPromocion.Items.FindByValue("1").Enabled = True DdlTipoPromocion.Items.FindByValue("1").Enabled = True
DdlTipoPromocion.Items.FindByValue("3").Enabled = True DdlTipoPromocion.Items.FindByValue("3").Enabled = True
If EmpresaGrupoDiaz Then
BtnAgregar.Enabled = False
Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero
Dim TipCveTipoPS As Integer = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveTipoPS").ToEntero
If TipCveTipoPS = 1 Then
Alert("El producto esta registrado como servicio", TipoMensaje.MsgAdvertencia)
Else
BtnAgregar.Enabled = True
End If
UpAgregar.Update()
End If
End Sub End Sub
#End Region #End Region
@@ -1409,6 +1427,8 @@ Partial Class Ventas_Promociones
DTPlantilla.Columns.Add("CodigoPS", GetType(String)) DTPlantilla.Columns.Add("CodigoPS", GetType(String))
DTPlantilla.Columns.Add("RinTamaño", GetType(String)) DTPlantilla.Columns.Add("RinTamaño", GetType(String))
Dim HayServicios As Boolean = False
Dim SBServiciosEnconrtados As New StringBuilder
Dim DTPS As DataTable = New DataTable Dim DTPS As DataTable = New DataTable
Dim DTRines As DataTable = New DataTable Dim DTRines As DataTable = New DataTable
@@ -1499,16 +1519,32 @@ Partial Class Ventas_Promociones
dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS) dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS)
End If End If
If EmpresaGrupoDiaz AndAlso CvePS > 0 Then
Dim CveTipoPS As Integer = DTPS.FiltroPrimeroValor("CveTipoPS", $"Codigo = '{CodigoStr}'").ToString().ToEntero()
If CveTipoPS = 1 Then
HayServicios = True
SBServiciosEnconrtados.AppendLine($"{CodigoStr}<br>")
End If
End If
End If End If
RegistroActual = RegistroActual + 1 RegistroActual = RegistroActual + 1
Next Next
If Errores.ToString.Length = 0 Then If Errores.ToString.Length = 0 AndAlso Not HayServicios Then
DTPlantilla.AcceptChanges() DTPlantilla.AcceptChanges()
Return True Return True
Else Else
Alert(Errores.ToString, TipoMensaje.MsgAdvertencia)
If EmpresaGrupoDiaz AndAlso HayServicios Then
Alert($"{Errores.ToString} <br>Se detectaron productos que estan registrados como servicios:<br>{SBServiciosEnconrtados.ToString}", TipoMensaje.MsgAdvertencia)
Else
Alert(Errores.ToString, TipoMensaje.MsgAdvertencia)
End If
Return False Return False
End If End If

View File

@@ -249,8 +249,8 @@
<div class="col-md-1 truncate">Condiciones de Pago</div> <div class="col-md-1 truncate">Condiciones de Pago</div>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me"> <asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem> <asp:ListItem Selected="True" Text="Crédito" Value="1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem> <asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>

View File

@@ -107,6 +107,8 @@ Partial Class Ventas_RepRecuperacion
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If End If
If UsuarioActual.CveEmpresa = 119 Then DdlCondicionesPago.SelectedValue = "-1"
'Carga SubProyectos 'Carga SubProyectos
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
'DdlSubProyecto.DataBind() 'DdlSubProyecto.DataBind()

View File

@@ -8360,7 +8360,7 @@
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <%--<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>--%>
<asp:RegularExpressionValidator ID="RevTelefonoCliente" runat="server" CssClass="help-block errorimput" ValidationExpression="\d{10}" ControlToValidate="TxtTelefonoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ID="RevTelefonoCliente" runat="server" CssClass="help-block errorimput" ValidationExpression="\d{10}" ControlToValidate="TxtTelefonoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator>
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label> <label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
</div> </div>

View File

@@ -3641,7 +3641,7 @@ Partial Class Ventas
End If End If
If UsuarioActual.Empresa.CveEmpresa = 189 Then If UsuarioActual.Empresa.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If End If
InicializaDevolucionAlmacen() InicializaDevolucionAlmacen()
@@ -5489,7 +5489,7 @@ Partial Class Ventas
End If End If
If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
Else Else
ImgAntiPend.Visible = True ImgAntiPend.Visible = True
End If End If
@@ -5602,7 +5602,7 @@ Partial Class Ventas
If DbRowVenta("Saldo").ToString().ToDouble < 0.01 Then If DbRowVenta("Saldo").ToString().ToDouble < 0.01 Then
If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
Else Else
ImgAntiPend.Visible = True ImgAntiPend.Visible = True
End If End If
@@ -7034,8 +7034,8 @@ Partial Class Ventas
End If End If
Me.CveMetodoPago33Cliente = ObjCliente.CveMetodoPago33 Me.CveMetodoPago33Cliente = ObjCliente.CveMetodoPago
Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago33 Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago
CveUsoCFDICliente = ObjCliente.CveUsoCFDI CveUsoCFDICliente = ObjCliente.CveUsoCFDI
PlazoCobranza = ObjCliente.PlazoCobranza PlazoCobranza = ObjCliente.PlazoCobranza
@@ -8433,10 +8433,10 @@ Partial Class Ventas
If CveVenta <= 0 AndAlso CveCotizacion <= 0 Then If CveVenta <= 0 AndAlso CveCotizacion <= 0 Then
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago 'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33) DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago)
DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty)
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33) DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago)
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI) DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
@@ -9020,6 +9020,14 @@ Partial Class Ventas
If e.Row.DBCampo("TipoDocto").Contiene("Cot", "Rem") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then If e.Row.DBCampo("TipoDocto").Contiene("Cot", "Rem") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False e.Row.FCLinkButton("imgClone").Visible = False
End If End If
If e.Row.DBCampo("CvePromocionDetalle").ToEntero() > 0 Then
If DtPromociones IsNot Nothing Then
Dim NombrePromo As String = DtPromociones.FiltroPrimeroValor("NombrePromocion", $"CvePromocionDetalle={e.Row.DBCampo("CvePromocionDetalle")}")
e.Row.FCHtmlGenericControl("TagPromocion").Attributes.Add("title", NombrePromo)
End If
End If
End If End If
If CveVenta <= 0 Then If CveVenta <= 0 Then
@@ -12072,6 +12080,10 @@ Partial Class Ventas
ObjFacturaBonificacion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal ObjFacturaBonificacion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
ObjFacturaBonificacion.Cliente.RegimenFiscal = ClienteRegimenFiscal ObjFacturaBonificacion.Cliente.RegimenFiscal = ClienteRegimenFiscal
'CLIENTE
ObjFacturaBonificacion.CveCliente = CveCliente
ObjFacturaBonificacion.SetCliente()
ObjFacturaBonificacion.CveMetodoPago = 1 ObjFacturaBonificacion.CveMetodoPago = 1
ObjFacturaBonificacion.MetodoPago = "Pago en una sola exhibición" ObjFacturaBonificacion.MetodoPago = "Pago en una sola exhibición"
ObjFacturaBonificacion.ClaveMetodoPagoSAT = "PUE" ObjFacturaBonificacion.ClaveMetodoPagoSAT = "PUE"
@@ -12217,10 +12229,6 @@ Partial Class Ventas
ObjFacturaBonificacion.DtFirmas = DTmpF ObjFacturaBonificacion.DtFirmas = DTmpF
'CLIENTE
ObjFacturaBonificacion.CveCliente = CveCliente
ObjFacturaBonificacion.SetCliente()
''SUCURSAL ''SUCURSAL
'ObjFacturaBonificacion.CveSucursal = DdlSucursal.SelectedValue.ToEntero() 'ObjFacturaBonificacion.CveSucursal = DdlSucursal.SelectedValue.ToEntero()
'ObjFacturaBonificacion.SetSucursalMatriz(Me) 'ObjFacturaBonificacion.SetSucursalMatriz(Me)
@@ -12550,6 +12558,15 @@ Partial Class Ventas
ObjFactura.CvePrePoliza = -1 ObjFactura.CvePrePoliza = -1
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate
'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
ObjFactura.CveEmpresaCRM = CveEmpresaCRM
If CveCliente = -1 And CveEmpresaCRM > 0 Then
ObjFactura.Cliente.Nombre = LblEmpresaCRM.Text
ObjFactura.Cliente.RFC = LblRFCCRM.Text
End If
ObjFactura.CveMetodoPago = DdlMetodoPago33.SelectedValue.ToEntero() ObjFactura.CveMetodoPago = DdlMetodoPago33.SelectedValue.ToEntero()
ObjFactura.MetodoPago = If(DdlMetodoPago33.SelectedValue.ToEntero() > 0, DdlMetodoPago33.SelectedItem.Text, "") ObjFactura.MetodoPago = If(DdlMetodoPago33.SelectedValue.ToEntero() > 0, DdlMetodoPago33.SelectedItem.Text, "")
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}") 'ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}")
@@ -12996,15 +13013,6 @@ Partial Class Ventas
ObjFactura.DtDetalle = TmpDT.Copy ObjFactura.DtDetalle = TmpDT.Copy
ObjFactura.DtFirmas = DTmpF.Copy ObjFactura.DtFirmas = DTmpF.Copy
'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
ObjFactura.CveEmpresaCRM = CveEmpresaCRM
If CveCliente = -1 And CveEmpresaCRM > 0 Then
ObjFactura.Cliente.Nombre = LblEmpresaCRM.Text
ObjFactura.Cliente.RFC = LblRFCCRM.Text
End If
'SUCURSAL 'SUCURSAL
'ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero() 'ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
ObjFactura.SetSubProyectoMatriz(Me) ObjFactura.SetSubProyectoMatriz(Me)
@@ -13289,6 +13297,10 @@ Partial Class Ventas
ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal
'CLIENTE
ObjFacturaDevolucion.CveCliente = CveCliente
ObjFacturaDevolucion.SetCliente()
ObjFacturaDevolucion.CveMetodoPago = DdlMetodoPago33.SelectedValue.ToEntero() ObjFacturaDevolucion.CveMetodoPago = DdlMetodoPago33.SelectedValue.ToEntero()
ObjFacturaDevolucion.MetodoPago = If(DdlMetodoPago33.SelectedValue.ToEntero() > 0, DdlMetodoPago33.SelectedItem.Text, "") ObjFacturaDevolucion.MetodoPago = If(DdlMetodoPago33.SelectedValue.ToEntero() > 0, DdlMetodoPago33.SelectedItem.Text, "")
@@ -13479,10 +13491,6 @@ Partial Class Ventas
ObjFacturaDevolucion.DtDetalle = TmpDT ObjFacturaDevolucion.DtDetalle = TmpDT
ObjFacturaDevolucion.DtFirmas = DTmpF ObjFacturaDevolucion.DtFirmas = DTmpF
'CLIENTE
ObjFacturaDevolucion.CveCliente = CveCliente
ObjFacturaDevolucion.SetCliente()
'SUCURSAL 'SUCURSAL
ObjFacturaDevolucion.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero() ObjFacturaDevolucion.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
ObjFacturaDevolucion.SetSubProyectoMatriz(Me) ObjFacturaDevolucion.SetSubProyectoMatriz(Me)
@@ -17219,7 +17227,7 @@ Partial Class Ventas
Private Sub CargaAnticipos(CveCliente As Integer) Private Sub CargaAnticipos(CveCliente As Integer)
Dim CargaAnticipos As Boolean = True Dim CargaAnticipos As Boolean = True
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
CargaAnticipos = False CargaAnticipos = UsuarioActual.TienePermisoProceso(406)
End If End If
HdnTieneAnticipos.Value = "0" HdnTieneAnticipos.Value = "0"
If CveCliente > 0 AndAlso CargaAnticipos Then If CveCliente > 0 AndAlso CargaAnticipos Then
@@ -17287,7 +17295,7 @@ Partial Class Ventas
End If End If
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If End If
Else Else
GVAnticipos.DataSource = Nothing GVAnticipos.DataSource = Nothing
@@ -17463,11 +17471,11 @@ Partial Class Ventas
End If End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then 'If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False ' e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado" ' e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado"
e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True ' e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True
End If 'End If
End If End If
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then
@@ -18570,6 +18578,12 @@ Partial Class Ventas
If ObjDescuentoGral.CvePromocionDetalle > 0 Then If ObjDescuentoGral.CvePromocionDetalle > 0 Then
TagPromocion.Visible = True TagPromocion.Visible = True
If UsuarioActual.CveEmpresa = 189 Then
If DtPromociones IsNot Nothing Then
Dim NombrePromo As String = DtPromociones.FiltroPrimeroValor("NombrePromocion", $"CvePromocionDetalle={ObjDescuentoGral.CvePromocionDetalle}")
TagPromocion.Attributes.Add("title", NombrePromo)
End If
End If
End If End If
If Me.ObjDescuentoGral.EsPUModificado Then If Me.ObjDescuentoGral.EsPUModificado Then
@@ -18733,7 +18747,22 @@ Partial Class Ventas
End Sub End Sub
Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
Dim ActualizarPrecios As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
ActualizarPrecios = true
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
ActualizarPrecios = True
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
ActualizarPrecios = True
End If
If ActualizarPrecios Then
Dim EditarPrecio As Boolean = True Dim EditarPrecio As Boolean = True
If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then
@@ -18747,25 +18776,40 @@ Partial Class Ventas
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero() Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit") Dim CveClasificacion As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimeroValor("CveClasificacion").ToEntero()
If UsuarioActual.CveEmpresa = 189 Then If CveClasificacion > 0 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then Dim DdlCla As DropDownList = GvRow.FCDropDownList("DdlClasificacion")
Using ObjVta As New ClsVentas DdlCla.SelectedValueExist(CveClasificacion)
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, UsuarioActual.CveEmpresa) Then End If
Dim Dt As DataTable = Nothing
If UsuarioActual.TienePermisoProceso(384) Then Dim CvePrecioListaSugerido As Integer = -1
Dt = ObjVta.DtResultados.Copy()
Else If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'") Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
If UsuarioActual.CveEmpresa = 189 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then
Using ObjVta As New ClsVentas
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, UsuarioActual.CveEmpresa) Then
Dim Dt As DataTable = Nothing
If UsuarioActual.TienePermisoProceso(384) Then
Dt = ObjVta.DtResultados.Copy()
Else
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
End If
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
End If End If
End Using
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt End If
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
End If
End Using
End If End If
CvePrecioListaSugerido = DdlPrecioListaEdit.SelectedValue.ToEntero()
Else
CvePrecioListaSugerido = GvRow.DataKey("CvePrecioLista").ToEntero()
End If End If
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
@@ -18774,7 +18818,7 @@ Partial Class Ventas
Dim PrecioSugerido As Decimal = 0 Dim PrecioSugerido As Decimal = 0
Dim tPrecioSugerido As Decimal = 0 Dim tPrecioSugerido As Decimal = 0
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioListaEdit.SelectedValue.ToEntero()) Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=CvePrecioListaSugerido)
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
@@ -19007,7 +19051,7 @@ Partial Class Ventas
End If End If
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If End If
If ImgAntiPend.Visible Then If ImgAntiPend.Visible Then
@@ -19055,7 +19099,7 @@ Partial Class Ventas
End If End If
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If End If
If ImgAntiPend.Visible Then If ImgAntiPend.Visible Then
@@ -26750,96 +26794,104 @@ Partial Class Ventas
RFCReceptor = Me.RFCReceptorVenta RFCReceptor = Me.RFCReceptorVenta
End If End If
Dim SWatch As New Stopwatch If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
SWatch.Start() Dim SWatch As New Stopwatch
Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) SWatch.Start()
Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True)
SWatch.Stop() SWatch.Stop()
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
SegundosRespuesta = SegundosRespuesta.ToEntero SegundosRespuesta = SegundosRespuesta.ToEntero
If SegundosRespuesta >= 5 Then If SegundosRespuesta >= 5 Then
Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "") Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "")
End If End If
If Vigencia IsNot Nothing Then If Vigencia IsNot Nothing Then
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
DivRelacionadasCancelacion.Visible = True DivRelacionadasCancelacion.Visible = True
BtnCancelarDocumento.Visible = False BtnCancelarDocumento.Visible = False
DivMotivoCancelacion.Visible = False DivMotivoCancelacion.Visible = False
DivMotivoCancelacionTxt.Visible = False DivMotivoCancelacionTxt.Visible = False
DivCanRem.Visible = False DivCanRem.Visible = False
DivDevAlm.Visible = False DivDevAlm.Visible = False
Dim Relacionados As Timbrado.MRespUUIDRelacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) Dim Relacionados As Timbrado.MRespUUIDRelacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion)
If Relacionados IsNot Nothing Then If Relacionados IsNot Nothing Then
If Relacionados.Codigo = 500 Then If Relacionados.Codigo = 500 Then
sbExtra.Append("El servicio de verificación de documentos relacionados no esta disponible.") sbExtra.Append("El servicio de verificación de documentos relacionados no esta disponible.")
Else Else
sbExtra.Append(Relacionados.Mensaje) sbExtra.Append(Relacionados.Mensaje)
Dim SbHijos As New StringBuilder() Dim SbHijos As New StringBuilder()
Dim SbPadres As New StringBuilder() Dim SbPadres As New StringBuilder()
'If Relacionados.RelacionadosHijo IsNot Nothing Then 'If Relacionados.RelacionadosHijo IsNot Nothing Then
' For Each hijo In Relacionados.RelacionadosHijo ' For Each hijo In Relacionados.RelacionadosHijo
' SbHijos.AppendFormat("{0};", hijo.Uuid) ' SbHijos.AppendFormat("{0};", hijo.Uuid)
' Next ' Next
' If SbHijos.Length > 0 Then ' If SbHijos.Length > 0 Then
' SbHijos.Remove(SbHijos.Length - 1, 1) ' SbHijos.Remove(SbHijos.Length - 1, 1)
' End If
'End If
If Relacionados.RelacionadosPadre IsNot Nothing Then
For Each padre As Timbrado.RelacionadosPadre In Relacionados.RelacionadosPadre
SbPadres.AppendFormat("{0};", padre.Uuid)
Next
If SbPadres.Length > 0 Then
SbPadres.Remove(SbPadres.Length - 1, 1)
End If
End If
Using ObjVentas As New ClsVentas
'If SbHijos.Length > 0 Then
' If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbHijos.ToString(), UsuarioActual.CveEmpresa) Then
' GvFacturasHijosCancelar.DataSource = ObjVentas.DtResultados.Copy()
' End If ' End If
'End If 'End If
If SbPadres.Length > 0 Then
If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbPadres.ToString(), UsuarioActual.CveEmpresa) Then If Relacionados.RelacionadosPadre IsNot Nothing Then
GvFacturasPadreCancelar.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveVenta <> {CveVenta}") For Each padre As Timbrado.RelacionadosPadre In Relacionados.RelacionadosPadre
SbPadres.AppendFormat("{0};", padre.Uuid)
Next
If SbPadres.Length > 0 Then
SbPadres.Remove(SbPadres.Length - 1, 1)
End If End If
End If End If
End Using Using ObjVentas As New ClsVentas
'GvFacturasHijosCancelar.DataBind() 'If SbHijos.Length > 0 Then
GvFacturasPadreCancelar.DataBind() ' If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbHijos.ToString(), UsuarioActual.CveEmpresa) Then
' GvFacturasHijosCancelar.DataSource = ObjVentas.DtResultados.Copy()
' End If
'End If
If SbPadres.Length > 0 Then
If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbPadres.ToString(), UsuarioActual.CveEmpresa) Then
GvFacturasPadreCancelar.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveVenta <> {CveVenta}")
End If
End If
End Using
'GvFacturasHijosCancelar.DataBind()
GvFacturasPadreCancelar.DataBind()
End If
End If End If
End If End If
End If
If String.IsNullOrEmpty(Vigencia.EsCancelable) Then If String.IsNullOrEmpty(Vigencia.EsCancelable) Then
If UsuarioActual.Empresa.FacturaProduccion AndAlso Not String.IsNullOrEmpty(FolioFiscal) Then If UsuarioActual.Empresa.FacturaProduccion AndAlso Not String.IsNullOrEmpty(FolioFiscal) Then
Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia) Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If
MostrarRemisionesCancelar()
sb.Append("<b>No encontrado</b> <br/>")
sb.Append("Está seguro de cancelar el documento?.")
Else
'GUARDA EL ESTADO DE CANCELACION
If Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then
Me.CveEstadoCancelacion = 2
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
Me.CveEstadoCancelacion = 1
End If
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
If Vigencia.EsCancelable.ToUpper() <> "NO CANCELABLE" Then
MostrarRemisionesCancelar()
sb.Append("Está seguro de cancelar el documento?.")
End If
End If End If
Else
MostrarRemisionesCancelar() MostrarRemisionesCancelar()
sb.Append("<b>No encontrado</b> <br/>") sb.Append("<b>No encontrado</b> <br/>")
sb.Append("Está seguro de cancelar el documento?.") sb.Append("Está seguro de cancelar el documento?.")
Else
'GUARDA EL ESTADO DE CANCELACION
If Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then
Me.CveEstadoCancelacion = 2
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
Me.CveEstadoCancelacion = 1
End If
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
If Vigencia.EsCancelable.ToUpper() <> "NO CANCELABLE" Then
MostrarRemisionesCancelar()
sb.Append("Está seguro de cancelar el documento?.")
End If
End If End If
Else Else
MostrarRemisionesCancelar() MostrarRemisionesCancelar()
@@ -27073,12 +27125,17 @@ Partial Class Ventas
If EsRefacturacion Then If EsRefacturacion Then
Dim ValidarSAT As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
ValidarSAT = False
End If
'Dim msgBitacora As String = $"Motivo de refacturación: {TxtMotivoRefac.Text}" 'Dim msgBitacora As String = $"Motivo de refacturación: {TxtMotivoRefac.Text}"
'Dim ObjE As New ClsOIEventos() 'Dim ObjE As New ClsOIEventos()
'ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) 'ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta)
'ObjE.Dispose() 'ObjE.Dispose()
resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ValidarSAT:=ValidarSAT)
strMensaje.Append(resp.Mensaje) strMensaje.Append(resp.Mensaje)
Else Else
Dim ListaRemisionesCancelar As New List(Of Integer) Dim ListaRemisionesCancelar As New List(Of Integer)
@@ -27135,7 +27192,26 @@ Partial Class Ventas
End If End If
resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos) Dim ValidarSAT As Boolean = True
Dim CveEstatusFacturaAsignado As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
ValidarSAT = False
Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFacturaCancelacion.FechaCP, ClsPaginas.NowADS())
'CANCELACION SIN ACEPTACION
Me.CveEstadoCancelacion = 2
'CANCELACION CON ACEPTACION
If ObjFacturaCancelacion.Total < 1000D OrElse diasTimbrado <= 1 OrElse ObjFacturaCancelacion.Cliente.RFC.Contiene("XAXX010101000", "XEXX010101000") Then
Me.CveEstadoCancelacion = 1
End If
ObjFacturaCancelacion.CveEstadoCancelacion = Me.CveEstadoCancelacion
CveEstatusFacturaAsignado = 4
End If
resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos, ValidarSAT:=ValidarSAT, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado)
strMensaje.Append(resp.Mensaje) strMensaje.Append(resp.Mensaje)
Dim DtBonificaciones As DataTable = Nothing Dim DtBonificaciones As DataTable = Nothing
@@ -33036,7 +33112,7 @@ Partial Class Ventas
If DtMovtos.Rows.Count > 0 Then ImgAntiPend.Visible = True If DtMovtos.Rows.Count > 0 Then ImgAntiPend.Visible = True
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If End If
Else Else
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
@@ -39917,9 +39993,19 @@ Partial Class Ventas
Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim()
Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal()
Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString()
Dim CvePACCancelacion As Integer = 5
Dim ObjTimbrado As New Timbrado Dim ObjTimbrado As New Timbrado
Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=CvePACCancelacion, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
If resp IsNot Nothing Then If resp IsNot Nothing Then
If resp.Verificado Then
Dim CancelacionAcuse = resp.CancelacionAcuse
Using ObjVentas As New ClsVentas
If Not ObjVentas.UpdateCancelaVenta(CveVenta, Now, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, -1, EstadoCancelacion:="", CveEstadoCancelacion:=-1) Then
Alert("Ocurrió un error al guardar el estatus de cancelación")
End If
End Using
End If
Alert(resp.Estado) Alert(resp.Estado)
End If End If
@@ -40395,6 +40481,17 @@ Partial Class Ventas
Next Next
End If End If
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim Saldo As Decimal = gvr.DataKey("Saldo").ToDecimal()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), Saldo, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
Alert(msgAlert, TipoMensaje.ToastInformacionB)
End If
ObjVta.Dispose()
End Sub End Sub
#End Region #End Region
@@ -40681,14 +40778,9 @@ Partial Class Ventas
'GvExist.Columns(0).ItemStyle.Width = New Unit(200, UnitType.Pixel) 'GvExist.Columns(0).ItemStyle.Width = New Unit(200, UnitType.Pixel)
'ORDENA HACIA LA DERECHA LAS CANTIDAD - OJO!! NO SE USO GV.COLUMNS.COUNT PORQUE LAS COLUMNAS GENERADAS EN BEHIND NO LAS RECONOCE 'ORDENA HACIA LA DERECHA LAS CANTIDAD - OJO!! NO SE USO GV.COLUMNS.COUNT PORQUE LAS COLUMNAS GENERADAS EN BEHIND NO LAS RECONOCE
For index As Integer = 0 To DtExistencias.Columns.Count - 1 For index As Integer = 1 To DtExistencias.Columns.Count - 1
For Each gvr As GridViewRow In GvExist.Rows For Each gvr As GridViewRow In GvExist.Rows
If index = 0 Then gvr.Cells(index).HorizontalAlign = HorizontalAlign.Right
gvr.Cells(index).CssClass = "titulops"
Else
gvr.Cells(index).HorizontalAlign = HorizontalAlign.Right
End If
Next Next
Next Next
End If End If
@@ -40696,5 +40788,12 @@ Partial Class Ventas
RegistraScript("$('#DivModalExistenciaTotal').modal('show');") RegistraScript("$('#DivModalExistenciaTotal').modal('show');")
UPExist.Update() UPExist.Update()
End Sub End Sub
Protected Sub GvExist_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvExist.RowDataBound
If e.Row.RowType = DataControlRowType.Header OrElse e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Attributes.Add("colspan", "3")
End If
End Sub
End Class End Class