This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-01-17 08:07:10 -07:00
34 changed files with 8572 additions and 7250 deletions

View File

@@ -928,7 +928,7 @@ Public Class ClsAcumuladores
#End Region #End Region
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer, Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, Optional CveMovimiento As Integer = -1) As Boolean CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
'Data = New DataTable 'Data = New DataTable
@@ -945,6 +945,7 @@ Public Class ClsAcumuladores
.Add("@ImporteCompras", SqlDbType.Money).Value = ImporteCompras .Add("@ImporteCompras", SqlDbType.Money).Value = ImporteCompras
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
End With End With
Try Try

View File

@@ -724,7 +724,7 @@ Public Class ClsVentas
Public Function UpdateEstatusFactura(Estatus As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveVenta As Integer, Public Function UpdateEstatusFactura(Estatus As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveVenta As Integer,
Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0,
Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1", Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1",
Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "") As Boolean Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional EstadoCancelacion As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasUpdateEstatus") DataAdapter("PA_VentasUpdateEstatus")
@@ -743,6 +743,7 @@ Public Class ClsVentas
.Add("@RFCReceptor", SqlDbType.VarChar).Value = RFCReceptor .Add("@RFCReceptor", SqlDbType.VarChar).Value = RFCReceptor
.Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
.Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion .Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion
.Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion
End With End With
Try Try
@@ -833,7 +834,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) 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 = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasCancelacion") DataAdapter("PA_Vta_VentasCancelacion")
@@ -845,6 +846,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePAC", SqlDbType.SmallInt).Value = CvePAC .Add("@CvePAC", SqlDbType.SmallInt).Value = CvePAC
.Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion .Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion
.Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion
.Add("@Cancelada", SqlDbType.SmallInt).Direction = ParameterDirection.Output .Add("@Cancelada", SqlDbType.SmallInt).Direction = ParameterDirection.Output
End With End With
@@ -1603,7 +1605,7 @@ Public Class ClsVentas
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer,
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = -1, Optional CveUsuarioConsulta As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional TipoDocto As String = "-1", Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional TipoDocto As String = "-1", Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1,
Optional CveMarca As Integer = -1, Optional MostrarLitraje As Boolean = False, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean Optional CveMarca As Integer = -1, Optional MostrarLitraje As Boolean = False, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False, Optional EsGarantia As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_GetRepPS") DataAdapter("PA_Vta_GetRepPS")
@@ -1634,7 +1636,7 @@ Public Class ClsVentas
.Add("@MostrarLitraje", SqlDbType.Bit).Value = MostrarLitraje .Add("@MostrarLitraje", SqlDbType.Bit).Value = MostrarLitraje
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
.Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia
End With End With
@@ -1653,7 +1655,7 @@ Public Class ClsVentas
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1,
Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1,
Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1,
Optional CveClasificacionDetalle As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean Optional CveClasificacionDetalle As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False, Optional EsGarantia As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_GetRepPSDetalle") DataAdapter("PA_Vta_GetRepPSDetalle")
@@ -1687,7 +1689,7 @@ Public Class ClsVentas
.Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
.Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia
End With End With
Try Try

View File

@@ -2078,7 +2078,7 @@ Namespace Modelos
For Each RowSalida As DataRow In DtMovimientos.Rows For Each RowSalida As DataRow In DtMovimientos.Rows
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1 Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
Retorno = False Retorno = False
Exit For Exit For
End If End If
@@ -2100,7 +2100,7 @@ Namespace Modelos
For Each drow As DataRow In factura.DtDetalle.Rows For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario, If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0D, "") Then UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
Resultado = False Resultado = False
Exit For Exit For
End If End If
@@ -2159,7 +2159,7 @@ Namespace Modelos
If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, factura.Fecha, CveMovimiento:=CveMovimiento) Then
' Mensaje = "Error al guardar Movimientos de distribuidor" ' Mensaje = "Error al guardar Movimientos de distribuidor"
Resultado = False Resultado = False
Exit For Exit For
@@ -4763,6 +4763,7 @@ Namespace Modelos
Dim CancelacionFecha As Date Dim CancelacionFecha As Date
Dim FolioFiscal As String = ObjFactura.FolioFiscal Dim FolioFiscal As String = ObjFactura.FolioFiscal
Dim CancelacionAcuse As String = "" Dim CancelacionAcuse As String = ""
Dim EstadoCancelacion As String = ""
Dim MensajeError As String = "" Dim MensajeError As String = ""
Dim ObjCancelacion As New Timbrado Dim ObjCancelacion As New Timbrado
Dim TotalT As Decimal = ObjFactura.Total Dim TotalT As Decimal = ObjFactura.Total
@@ -4810,6 +4811,9 @@ Namespace Modelos
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion) Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion)
If Vigencia IsNot Nothing Then If Vigencia IsNot Nothing Then
EstadoCancelacion = Vigencia.EsCancelable
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
Retorno.Mensaje = "Esta factura no es cancelable." Retorno.Mensaje = "Esta factura no es cancelable."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
@@ -5508,13 +5512,13 @@ Namespace Modelos
If CveEstatus.Contiene(4, 5) Then If CveEstatus.Contiene(4, 5) Then
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion) Then If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion, EstadoCancelacion:=EstadoCancelacion) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al guardar el estatus de cancelación." MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
End If End If
Else Else
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=MotivoCancelacion) Then CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=MotivoCancelacion, EstadoCancelacion:=EstadoCancelacion) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al guardar el estatus de cancelación." MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
End If End If

View File

@@ -434,7 +434,7 @@ Public Class Timbrado
End If End If
#End Region #End Region
Dim conector As New Profact.TimbraCFDI33.Conector(AmbienteProductivo) Dim conector As New Profact.TimbraCFDI40.Conector(AmbienteProductivo)
If Not AmbienteProductivo Then If Not AmbienteProductivo Then
conector.EstableceCredenciales("mvpNUXmQfK8=") conector.EstableceCredenciales("mvpNUXmQfK8=")
@@ -442,8 +442,8 @@ Public Class Timbrado
conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654") conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
End If End If
MsgCancelacion.AppendFormat("-3.2") MsgCancelacion.AppendFormat("-3.2")
Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacionAck Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacion
resultadoCancelacion = conector.CancelaCFDIAck(RFCEmisor, FolioFiscal) resultadoCancelacion = conector.CancelaCFDI40(RFCEmisor, FolioFiscal, CodigoSATMotivoCancelacion, FolioSustitucion)
CancelacionFecha = Now CancelacionFecha = Now
Dim resp As Profact.TimbraCFDI.ResultadoConsulta Dim resp As Profact.TimbraCFDI.ResultadoConsulta
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal) resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
@@ -474,7 +474,7 @@ Public Class Timbrado
Else Else
MsgCancelacion.AppendFormat("-3.5") MsgCancelacion.AppendFormat("-3.5")
CancelacionAcuse = resp.NumeroError CancelacionAcuse = resp.NumeroError
CancelacionMensaje = resultadoCancelacion.Xml CancelacionMensaje = resultadoCancelacion.Descripcion
Retorno = False Retorno = False
End If End If
@@ -488,7 +488,8 @@ Public Class Timbrado
Dim UrlServicio As String = "" ' Produccion Dim UrlServicio As String = "" ' Produccion
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL" 'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno 'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
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"
@@ -704,14 +705,14 @@ Public Class Timbrado
Dim XMLString As String = $"<Envelope xmlns=""http://schemas.xmlsoap.org/soap/envelope/""> Dim XMLString As String = $"<Envelope xmlns=""http://schemas.xmlsoap.org/soap/envelope/"">
<Body> <Body>
<cancelarConOpciones xmlns=""timbrado.ws.pade.mx""> <cancelarConOpciones xmlns=""timbrado.ws.pade.mx"">
<contrato xmlns="""">{contrato}</contrato> <contrato xmlns="""">{contrato}</contrato>
<usuario xmlns="""">{UsuarioServicio}</usuario> <usuario xmlns="""">{UsuarioServicio}</usuario>
<passwd xmlns="""">{PassServicio}</passwd> <passwd xmlns="""">{PassServicio}</passwd>
<rfcEmisor xmlns="""">{rfcEmisor}</rfcEmisor> <rfcEmisor xmlns="""">{rfcEmisor}</rfcEmisor>
<arregloUUID xmlns="""">{arregloUUID}|{rfcReceptor}|{rfcEmisor}|{Total}</arregloUUID> <arregloUUID xmlns="""">{arregloUUID}|{rfcReceptor}|{rfcEmisor}|{Total}</arregloUUID>
<cert xmlns="""">{certBase64}</cert> <cert xmlns="""">{certBase64}</cert>
<key xmlns="""">{keyBase64}</key> <key xmlns="""">{keyBase64}</key>
<keyPass xmlns="""">{keyPass}</keyPass> <keyPass xmlns="""">{keyPass}</keyPass>
<opciones xmlns="""">{If(TimbraProduccion, "", "MODO_PRUEBA:3")}</opciones> <opciones xmlns="""">{If(TimbraProduccion, "", "MODO_PRUEBA:3")}</opciones>
</cancelarConOpciones> </cancelarConOpciones>
</Body> </Body>
@@ -1905,7 +1906,8 @@ Public Class Timbrado
UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL" 'productivo UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL" 'productivo
Case 4 Case 4
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL" 'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno 'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
End Select End Select
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then

View File

@@ -174,6 +174,16 @@ Public Class Timbres
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
If drT("ClaveTipoRemolque1").ToString <> "" Then
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
End If
If drT("ClaveTipoRemolque2").ToString <> "" Then
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString, DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,

View File

@@ -667,9 +667,9 @@ Partial Class Bancos_ConciliacionesBancariasaspx
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If
Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/Conciliacion.rdlc" Dim Archivo As String = $"{UsuarioActual.Empresa.Ruta}Formatos/Conciliacion.rdlc"
If Not IO.File.Exists($"{Server.MapPath("~")}/{Archivo}") Then If Not IO.File.Exists(Archivo) Then
Archivo = "Empresas/Grales/Formatos/Conciliacion.rdlc" Archivo = "Empresas/Grales/Formatos/Conciliacion.rdlc"
End If End If

View File

@@ -44,7 +44,7 @@ Partial Class Bancos_FluctuacionCambiaria
'Año actual 'Año actual
DdlAnio.Items.Add(New ListItem(Now.Year.ToString(), Now.Year.ToString())) DdlAnio.Items.Add(New ListItem(Now.Year.ToString(), Now.Year.ToString()))
'Año Anterior 'Año Anterior
DdlAnio.Items.Add(New ListItem(Now.AddYears(-1).Year.ToString(), Now.AddYears(1).Year.ToString())) DdlAnio.Items.Add(New ListItem(Now.AddYears(-1).Year.ToString(), Now.AddYears(-1).Year.ToString()))
For i = 1 To 12 For i = 1 To 12
Dim fecha = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1) Dim fecha = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1)

View File

@@ -49,9 +49,11 @@
<li> <li>
<asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton> <asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton>
</li> </li>
<li>
<%--<li>
<asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton>
</li> </li>--%>
<li> <li>
<asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-btn-ok-label="si" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento y Complemento" > <i class="fa fa-pencil"></i> Cancelar Movimiento y Complemento</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-btn-ok-label="si" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento y Complemento" > <i class="fa fa-pencil"></i> Cancelar Movimiento y Complemento</asp:LinkButton>
@@ -1215,29 +1217,30 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtFechaCancelacion" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtFechaCancelacion" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:CheckBox ID="ChkGeneraCancelacion" CssClass="md-checksd2" Text="Genera Devolución" TextAlign="Right" runat="server" AutoPostBack="true" OnCheckedChanged="ChkGeneraCancelacion_CheckedChanged" /> <asp:CheckBox ID="ChkGeneraCancelacion" CssClass="md-checksd2" Text="Genera Devolución" TextAlign="Right" runat="server" AutoPostBack="true" OnCheckedChanged="ChkGeneraCancelacion_CheckedChanged" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12" id="DVTipoTransacciónCancelar" runat="server" visible ="false"> <div class="col-md-12" id="DVTipoTransacciónCancelar" runat="server" visible="false">
Movimiento:
Movimiento: <asp:DropDownList ID="DdlTipoTransaccionCancelacion" CssClass="form-control input-sm select2me" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpCancelarIE">
<asp:DropDownList ID="DdlTipoTransaccionCancelacion" CssClass="form-control input-sm select2me" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpCancelarIE"> <asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem> </asp:DropDownList>
</asp:DropDownList> <asp:RequiredFieldValidator ID="RFVDdlTipoTransaccionCancelacion" runat="server" ControlToValidate="DdlTipoTransaccionCancelacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Transaccion''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCancelarIE"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVDdlTipoTransaccionCancelacion" runat="server" ControlToValidate="DdlTipoTransaccionCancelacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Transaccion''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCancelarIE"></asp:RequiredFieldValidator> <ajax:ValidatorCalloutExtender ID="VCEDdlTipoTransaccionCancelacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoTransaccionCancelacion" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCEDdlTipoTransaccionCancelacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoTransaccionCancelacion" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:Button ID="BtnCancelarIE" OnClick="BtnCancelarIE_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Movimiento" ValidationGroup="GrpCancelarIE" /> <asp:Button ID="BtnCancelarIE" OnClick="BtnCancelarIE_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Movimiento" ValidationGroup="GrpCancelarIE" />
@@ -1367,6 +1370,12 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Motivo" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
<ItemTemplate>
<asp:DropDownList runat="server" id="DdlMotivoCancelacion" DataTextField="CodigoSATDescripcion" DataValueField="CveMotivoCancelacion" CssClass="select2me" Visible ="false">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cancelar" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%"> <asp:TemplateField HeaderText="Cancelar" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
<ItemTemplate> <ItemTemplate>
@@ -1574,6 +1583,25 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row" runat="server" id="DVmotivoCancelacion" visible="false">
<div class="col-md-2">
Motivo de Cancelación:
</div>
<div class="col-md-10">
<asp:DropDownList runat="server" id="DdlMotivoCancelacion" DataTextField="CodigoSATDescripcion" DataValueField="CveMotivoCancelacion" CssClass="select2me" Width="100%" >
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlMotivoCancelacion" runat="server" ControlToValidate="DdlMotivoCancelacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo de Cancelación''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCancelarComplemento"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlMotivoCancelacion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMotivoCancelacion" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>

View File

@@ -837,6 +837,13 @@ Partial Class Bancos_IE
'End If 'End If
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa)
DdlMotivoCancelacion.DataBind()
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If End If
End Sub End Sub
@@ -1096,7 +1103,7 @@ Partial Class Bancos_IE
HplDepositado.NavigateUrl = $"/Bancos/IE.aspx?CveIE={CveIEDeposito2}" HplDepositado.NavigateUrl = $"/Bancos/IE.aspx?CveIE={CveIEDeposito2}"
End If End If
LnkCancelarComplemento.Visible = False 'LnkCancelarComplemento.Visible = False
LnkCancelarComplementoImporte.Visible = False LnkCancelarComplementoImporte.Visible = False
UppEliminarIE.Update() UppEliminarIE.Update()
@@ -1267,7 +1274,7 @@ Partial Class Bancos_IE
LnkEliminar.Visible = False LnkEliminar.Visible = False
'LnkCancelar.Visible = False 'LnkCancelar.Visible = False
LnkCancelarComplemento.Visible = True 'LnkCancelarComplemento.Visible = True
LnkCancelarComplementoImporte.Visible = True LnkCancelarComplementoImporte.Visible = True
End If End If
@@ -1275,7 +1282,7 @@ Partial Class Bancos_IE
Else Else
BtnEditar.Visible = False BtnEditar.Visible = False
LnkCancelarComplemento.Visible = False ' LnkCancelarComplemento.Visible = False
LnkCancelarComplementoImporte.Visible = False LnkCancelarComplementoImporte.Visible = False
DVGenerarComplementoModal.Visible = False DVGenerarComplementoModal.Visible = False
End If End If
@@ -4587,22 +4594,23 @@ Partial Class Bancos_IE
Dim ErrorCancelarComplemento As Boolean = True Dim ErrorCancelarComplemento As Boolean = True
If CancelarComplemento Then If CancelarComplemento Then
Dim ObjCancelacion As New Timbrado
'Dim ObjBanco As New ClsBancos
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then Dim CveMotivoCancelacion As Integer = DdlMotivoCancelacion.SelectedValue.ToEntero
CargaComplementosPago() Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveMotivoCancelacion:=CveMotivoCancelacion).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
ErrorCancelarComplemento = False
Alert("El complemento se cancelo correctamente.")
End If
Else If CveMotivoCancelacion <= 0 Or CveSATMotivoCancelacion <= 0 Then
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then Alert("Debe de elegir un motivo de cancelación.", TipoMensaje.MsgAdvertencia)
ErrorCancelarComplemento = True
End If
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
If Not ErrorCancelarComplemento Then
Dim ObjCancelacion As New Timbrado
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
CargaComplementosPago() CargaComplementosPago()
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');") RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
ErrorCancelarComplemento = False ErrorCancelarComplemento = False
@@ -4610,12 +4618,25 @@ Partial Class Bancos_IE
End If End If
Else Else
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia) If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
End If
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
CargaComplementosPago()
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
ErrorCancelarComplemento = False
Alert("El complemento se cancelo correctamente.")
End If
Else
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
End If
End If
End If End If
Else Else
ErrorCancelarComplemento = False ErrorCancelarComplemento = False
End If End If
@@ -5804,11 +5825,9 @@ Partial Class Bancos_IE
#End Region #End Region
#Region " COMPLEMENTOS PAGO " #Region " COMPLEMENTOS PAGO "
Private Sub CargaComplementosPago() Private Sub CargaComplementosPago()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If UsuarioActual.CveRol = 1 Then If UsuarioActual.CveRol = 1 Then
@@ -5823,9 +5842,7 @@ Partial Class Bancos_IE
GvComplementoPagos.DataSource = ObjBancos.DtResultados GvComplementoPagos.DataSource = ObjBancos.DtResultados
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 And ObjBancos.DtResultados.FiltraParametros(" CveIECancelacion > 0 ").Rows.Count = 0 Then
DVGenerarComplementoModal.Visible = True
End If
Else Else
GvComplementoPagos.DataSource = Nothing GvComplementoPagos.DataSource = Nothing
End If End If
@@ -5833,6 +5850,14 @@ Partial Class Bancos_IE
If CveIE > 0 Then If CveIE > 0 Then
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
DVGenerarComplementoModal.Visible = True
End If
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 1 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
DVmotivoCancelacion.Visible = True
End If
' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}) ' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"})
@@ -5844,11 +5869,14 @@ Partial Class Bancos_IE
End If End If
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
GvComplementoPagos.DataBind() GvComplementoPagos.DataBind()
UpComplementoPagos.Update() UpComplementoPagos.Update()
UpEliminarCotizacion.Update() 'Esto se ocupa para mostrar DVmotivoCancelacion
'ObjBancos.Dispose() 'ObjBancos.Dispose()
'GvComplementoPagos.DataBind() 'GvComplementoPagos.DataBind()
'UpComplementoPagos.Update() 'UpComplementoPagos.Update()
@@ -5863,9 +5891,16 @@ Partial Class Bancos_IE
e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
If e.Row.DataKey("Estatus").Contiene("1", "3") Then If e.Row.DataKey("Estatus").Contiene("1", "3") Then
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
e.Row.FCDropDownList("DdlMotivoCancelacion").Visible = True
e.Row.FCDropDownList("DdlMotivoCancelacion").DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlMotivoCancelacion").DataBind()
e.Row.FCDropDownList("DdlMotivoCancelacion").Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Else Else
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False
e.Row.FCDropDownList("DdlMotivoCancelacion").Visible = False
End If End If
ElseIf e.Row.DataKey("Tipo") = "Egs" Then ElseIf e.Row.DataKey("Tipo") = "Egs" Then
@@ -5876,6 +5911,7 @@ Partial Class Bancos_IE
GvComplementoPagos.Columns(6).Visible = False GvComplementoPagos.Columns(6).Visible = False
GvComplementoPagos.Columns(7).Visible = False GvComplementoPagos.Columns(7).Visible = False
GvComplementoPagos.Columns(8).Visible = False GvComplementoPagos.Columns(8).Visible = False
GvComplementoPagos.Columns(9).Visible = False
End If End If
@@ -5950,13 +5986,13 @@ Partial Class Bancos_IE
Return Retorno Return Retorno
End Function End Function
Protected Sub LnkCancelarComplemento_Click(sender As Object, e As EventArgs) 'Protected Sub LnkCancelarComplemento_Click(sender As Object, e As EventArgs)
If ChkConciliado.Checked Then ' If ChkConciliado.Checked Then
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError) ' Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If ' End If
Confirmacion("¿Seguro que desea Cancelar el documento por Sustitución?", "", String.Format("document.location.href=""/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}&CveMoneda={2}""", CveIE, CveCliente, CveMoneda), "") ' Confirmacion("¿Seguro que desea Cancelar el documento por Sustitución?", "", String.Format("document.location.href=""/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}&CveMoneda={2}""", CveIE, CveCliente, CveMoneda), "")
End Sub 'End Sub
#End Region #End Region
@@ -6126,6 +6162,9 @@ Partial Class Bancos_IE
CalendarioCancelacion.StartDate = fechaCancelacion.ToDate CalendarioCancelacion.StartDate = fechaCancelacion.ToDate
UpEliminarCotizacion.Update() UpEliminarCotizacion.Update()
End If End If
RegistraScript("ShowDivCancelarIE();") RegistraScript("ShowDivCancelarIE();")
End Sub End Sub
Protected Sub BtnDesconciliar_Click(sender As Object, e As EventArgs) Protected Sub BtnDesconciliar_Click(sender As Object, e As EventArgs)
@@ -6605,6 +6644,16 @@ Partial Class Bancos_IE
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
Dim CveMotivoCancelacion As Integer = GvRow.FCDropDownList("DdlMotivoCancelacion").SelectedValue.ToEntero
Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveMotivoCancelacion:=CveMotivoCancelacion).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
If CveMotivoCancelacion <= 0 Or CveSATMotivoCancelacion <= 0 Then
Alert("Debe de elegir un motivo de cancelación.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
CveComplementoPagoCancelar = GvRow.DataKey("CveComplementoPago").ToEntero CveComplementoPagoCancelar = GvRow.DataKey("CveComplementoPago").ToEntero
FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString
'' Dim RFCEmisor As String = UsuarioActual.Empresa.RFC '' Dim RFCEmisor As String = UsuarioActual.Empresa.RFC
@@ -6622,7 +6671,7 @@ Partial Class Bancos_IE
End If End If
Else Else
Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion:=2).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
@@ -6681,6 +6730,8 @@ Partial Class Bancos_IE
RegistraScript("$('#ModalCancelarComplemetno').modal('show');") RegistraScript("$('#ModalCancelarComplemetno').modal('show');")
DivFechaCancelación.Visible = True DivFechaCancelación.Visible = True
CargaComplementosPago()
UpModalCancelarComplemetno.Update() UpModalCancelarComplemetno.Update()
Else Else

View File

@@ -177,7 +177,7 @@
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="5%" /> <ItemStyle Width="5%" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="true"> <asp:TemplateField Visible="false">
<HeaderTemplate>Cancelar SAT</HeaderTemplate> <HeaderTemplate>Cancelar SAT</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkCancelarFolioFiscal" OnClick="LnkCancelaFolioFiscal" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" Visible="false" /> <asp:LinkButton ID="LnkCancelarFolioFiscal" OnClick="LnkCancelaFolioFiscal" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" Visible="false" />
@@ -189,49 +189,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="ModalDivMail" 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">Correo</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpSendMail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ID="HdnSerieFolioPago" runat="server" ClientIDMode="Static" Value="-1" />
<div class="row">
<div class="col-xs-4">Para:</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtParaMail" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-xs-4">
Con copia para:<br />
(Separar con: ;)
</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtCC" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnSendMail" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" ValidationGroup="GrpEnviarEmail" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>

View File

@@ -150,9 +150,9 @@ Partial Class Bancos_RepComplementoPago
e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("SerieFolioPago").ToString.Replace("&", "%26%"), e.Row.DBCampo("CveIE").ToString))) e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("SerieFolioPago").ToString.Replace("&", "%26%"), e.Row.DBCampo("CveIE").ToString)))
e.Row.FCLinkButton("LnkSendMail").Visible = True e.Row.FCLinkButton("LnkSendMail").Visible = True
If DdlOpcion.SelectedValue.ToEntero = 2 Then 'If DdlOpcion.SelectedValue.ToEntero = 2 Then
e.Row.FCLinkButton("LnkCancelarFolioFiscal").Visible = True ' e.Row.FCLinkButton("LnkCancelarFolioFiscal").Visible = True
End If 'End If
End If End If
@@ -529,7 +529,11 @@ Partial Class Bancos_RepComplementoPago
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub End Sub
End Class End Class

File diff suppressed because it is too large Load Diff

View File

@@ -207,7 +207,7 @@
<asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-HorizontalAlign="Center" />
<asp:HyperLinkField HeaderText="Proveedor" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataTextField="RazonSocial" ControlStyle-CssClass="truncate2" /> <asp:HyperLinkField HeaderText="Proveedor" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataTextField="RazonSocial" ControlStyle-CssClass="truncate2" />
<asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="F.Compra" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Right" />
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" HeaderText="Folio" /> <asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" HeaderText="Folio" />
<asp:BoundField HeaderText="SubTotal 16%" DataField="valorActos1516" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="SubTotal 16%" DataField="valorActos1516" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="SubTotal 8%" DataField="valorActosImp8" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="SubTotal 8%" DataField="valorActosImp8" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
@@ -235,7 +235,7 @@
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C.P." DataField="TipoCambioPago" DataFormatString="{0:##.####}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="T.C.P." DataField="TipoCambioPago" DataFormatString="{0:##.####}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total ME." DataField="TotalME" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Total ME." DataField="TotalME" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="F.Compra" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Fecha Documento" DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" /> <asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" />
<%-- <asp:BoundField HeaderText="IEPS 3%" DataField="IEPS3" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <%-- <asp:BoundField HeaderText="IEPS 3%" DataField="IEPS3" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />

View File

@@ -524,7 +524,7 @@
<BreakLocation>Start</BreakLocation> <BreakLocation>Start</BreakLocation>
</PageBreak> </PageBreak>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Top>7.61812in</Top> <Top>7.49312in</Top>
<Left>0.20879in</Left> <Left>0.20879in</Left>
<Height>3.59384in</Height> <Height>3.59384in</Height>
<Width>7.78795in</Width> <Width>7.78795in</Width>
@@ -1058,7 +1058,7 @@
</Image> </Image>
</ReportItems> </ReportItems>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Top>3.95038in</Top> <Top>3.82538in</Top>
<Left>0.05395in</Left> <Left>0.05395in</Left>
<Height>1.21305in</Height> <Height>1.21305in</Height>
<Width>8.22763in</Width> <Width>8.22763in</Width>
@@ -1086,32 +1086,6 @@
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>BDH Baterias Distribuciones de Hermosillo SA de CV</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>6.7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>BBD021220APA</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>6.7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
@@ -1153,10 +1127,10 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox32</rd:DefaultName> <rd:DefaultName>Textbox32</rd:DefaultName>
<Top>2.84726cm</Top> <Top>3.48226cm</Top>
<Left>0.13011cm</Left> <Left>0.13011cm</Left>
<Height>2.40928cm</Height> <Height>2.1447cm</Height>
<Width>4.15958cm</Width> <Width>4.08234cm</Width>
<ZIndex>3</ZIndex> <ZIndex>3</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1178,7 +1152,7 @@
<Value>= IIF(Parameters!Tipo.Value = "INGRESO","FACTURA","NOTA DE CRÉDITO")</Value> <Value>= IIF(Parameters!Tipo.Value = "INGRESO","FACTURA","NOTA DE CRÉDITO")</Value>
<Style> <Style>
<FontFamily>Myriad Pro</FontFamily> <FontFamily>Myriad Pro</FontFamily>
<FontSize>14pt</FontSize> <FontSize>11pt</FontSize>
<FontWeight>SemiBold</FontWeight> <FontWeight>SemiBold</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
@@ -1198,7 +1172,7 @@
</Style> </Style>
</TextRun> </TextRun>
<TextRun> <TextRun>
<Value>Serie: </Value> <Value>Serie: </Value>
<Style> <Style>
<FontFamily>Myriad Pro</FontFamily> <FontFamily>Myriad Pro</FontFamily>
<FontSize>9.16pt</FontSize> <FontSize>9.16pt</FontSize>
@@ -1213,6 +1187,14 @@
<Color>Red</Color> <Color>Red</Color>
</Style> </Style>
</TextRun> </TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>Red</Color>
</Style>
</TextRun>
<TextRun> <TextRun>
<Value> Folio: </Value> <Value> Folio: </Value>
<Style> <Style>
@@ -1446,9 +1428,9 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName> <rd:DefaultName>Textbox4</rd:DefaultName>
<Top>0.05159in</Top> <Top>0.05022in</Top>
<Left>5.03983in</Left> <Left>5.03983in</Left>
<Height>1.74708in</Height> <Height>1.62345in</Height>
<Width>3.24175in</Width> <Width>3.24175in</Width>
<ZIndex>4</ZIndex> <ZIndex>4</ZIndex>
<Style> <Style>
@@ -1558,7 +1540,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox40</rd:DefaultName> <rd:DefaultName>Textbox40</rd:DefaultName>
<Top>4.5675cm</Top> <Top>4.25cm</Top>
<Left>13.31398cm</Left> <Left>13.31398cm</Left>
<Height>1.42163cm</Height> <Height>1.42163cm</Height>
<Width>7.72123cm</Width> <Width>7.72123cm</Width>
@@ -2217,7 +2199,7 @@
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DsOC</DataSetName> <DataSetName>DsOC</DataSetName>
<Top>2.38003in</Top> <Top>2.25503in</Top>
<Left>0.05854in</Left> <Left>0.05854in</Left>
<Height>0.34081in</Height> <Height>0.34081in</Height>
<Width>8.22304in</Width> <Width>8.22304in</Width>
@@ -2243,7 +2225,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>7.09581cm</Top> <Top>6.77831cm</Top>
<Left>0.14868cm</Left> <Left>0.14868cm</Left>
<Height>0.14316cm</Height> <Height>0.14316cm</Height>
<Width>20.88652cm</Width> <Width>20.88652cm</Width>
@@ -2274,7 +2256,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>7.86718cm</Top> <Top>7.54968cm</Top>
<Left>15.09838cm</Left> <Left>15.09838cm</Left>
<Height>0.14316cm</Height> <Height>0.14316cm</Height>
<Width>5.93682cm</Width> <Width>5.93682cm</Width>
@@ -2311,7 +2293,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>ImporteLetra</rd:DefaultName> <rd:DefaultName>ImporteLetra</rd:DefaultName>
<Top>3.18176in</Top> <Top>3.05676in</Top>
<Left>2.30237in</Left> <Left>2.30237in</Left>
<Height>0.18861in</Height> <Height>0.18861in</Height>
<Width>5.97921in</Width> <Width>5.97921in</Width>
@@ -2341,7 +2323,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>9.82898cm</Top> <Top>9.51148cm</Top>
<Left>0.13011cm</Left> <Left>0.13011cm</Left>
<Height>0.1cm</Height> <Height>0.1cm</Height>
<Width>20.88652cm</Width> <Width>20.88652cm</Width>
@@ -2372,7 +2354,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName> <rd:DefaultName>Textbox5</rd:DefaultName>
<Top>13.2915cm</Top> <Top>12.974cm</Top>
<Left>0.18043cm</Left> <Left>0.18043cm</Left>
<Height>0.14316cm</Height> <Height>0.14316cm</Height>
<Width>20.85477cm</Width> <Width>20.85477cm</Width>
@@ -2406,7 +2388,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Top>7.3448cm</Top> <Top>7.0273cm</Top>
<Left>5.62203cm</Left> <Left>5.62203cm</Left>
<Height>0.34219cm</Height> <Height>0.34219cm</Height>
<Width>9.30316cm</Width> <Width>9.30316cm</Width>
@@ -2524,7 +2506,7 @@
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>7.30953cm</Top> <Top>6.99203cm</Top>
<Left>15.09838cm</Left> <Left>15.09838cm</Left>
<Height>0.48004cm</Height> <Height>0.48004cm</Height>
<Width>5.93682cm</Width> <Width>5.93682cm</Width>
@@ -3022,7 +3004,7 @@
</Textbox> </Textbox>
</ReportItems> </ReportItems>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Top>15.84926cm</Top> <Top>15.53176cm</Top>
<Left>0.13702cm</Left> <Left>0.13702cm</Left>
<Height>2.97096cm</Height> <Height>2.97096cm</Height>
<Width>20.89818cm</Width> <Width>20.89818cm</Width>
@@ -3297,7 +3279,7 @@
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet3</DataSetName> <DataSetName>DataSet3</DataSetName>
<Top>2.88204in</Top> <Top>2.75704in</Top>
<Left>0.05854in</Left> <Left>0.05854in</Left>
<Height>0.34081in</Height> <Height>0.34081in</Height>
<Width>2.08542in</Width> <Width>2.08542in</Width>
@@ -3315,7 +3297,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>"REVISAR SU FACTURA Y SUS PRODUCTOS AL MOMENTO DE RECIBIRLAS, YA QUE NO SE REALIZARAN CAMBIOS EN FACTURA </Value> <Value>"REVISAR SU FACTURA Y SUS PRODUCTOS AL MOMENTO DE RECIBIRLAS, YA QUE NO SE REALIZARAN CAMBIOS EN FACTURA.</Value>
<Style> <Style>
<FontFamily>myriad pro</FontFamily> <FontFamily>myriad pro</FontFamily>
<FontSize>6.5pt</FontSize> <FontSize>6.5pt</FontSize>
@@ -3344,7 +3326,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Top>8.71223cm</Top> <Top>8.39473cm</Top>
<Height>1.07794cm</Height> <Height>1.07794cm</Height>
<Width>20.85477cm</Width> <Width>20.85477cm</Width>
<ZIndex>16</ZIndex> <ZIndex>16</ZIndex>
@@ -3467,7 +3449,7 @@
</Style> </Style>
</Textbox> </Textbox>
<Line Name="Line4"> <Line Name="Line4">
<Top>15.01864cm</Top> <Top>14.70114cm</Top>
<Left>14.38124cm</Left> <Left>14.38124cm</Left>
<Height>0cm</Height> <Height>0cm</Height>
<Width>6.65396cm</Width> <Width>6.65396cm</Width>
@@ -3498,7 +3480,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox39</rd:DefaultName> <rd:DefaultName>Textbox39</rd:DefaultName>
<Top>15.19503cm</Top> <Top>14.87753cm</Top>
<Left>14.38124cm</Left> <Left>14.38124cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>6.65396cm</Width> <Width>6.65396cm</Width>
@@ -3537,7 +3519,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox38</rd:DefaultName> <rd:DefaultName>Textbox38</rd:DefaultName>
<Top>13.57236cm</Top> <Top>13.25486cm</Top>
<Left>14.38124cm</Left> <Left>14.38124cm</Left>
<Height>0.67938cm</Height> <Height>0.67938cm</Height>
<Width>6.65396cm</Width> <Width>6.65396cm</Width>
@@ -3552,8 +3534,57 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox16">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>BDH</Value>
<Style>
<FontStyle>Normal</FontStyle>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
<TextDecoration>None</TextDecoration>
<Color>#000000</Color>
</Style>
</TextRun>
<TextRun>
<Value> Baterias Distribuciones de Hermosillo SA de CV</Value>
<Style>
<FontStyle>Normal</FontStyle>
<FontFamily>Calibri</FontFamily>
<FontWeight>Bold</FontWeight>
<TextDecoration>None</TextDecoration>
<Color>#000000</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox16</rd:DefaultName>
<Top>2.16641cm</Top>
<Left>0.13011cm</Left>
<Height>1.21002cm</Height>
<Width>4.23014cm</Width>
<ZIndex>22</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Height>28.47838cm</Height> <Height>28.16088cm</Height>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>

File diff suppressed because it is too large Load Diff

View File

@@ -41,12 +41,14 @@ Partial Class General_CatCategorias
If ObjCategorias.AddCategorias(TxtCategoria.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjCategorias.AddCategorias(TxtCategoria.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCategoria.Text = "" TxtCategoria.Text = ""
Alert("El nueva Categoría se guardó correctamente.", TipoMensaje.MsgInformacion) Alert("El nueva Categoría se guardó correctamente.", TipoMensaje.MsgInformacion)
GlobalDTGralCategorias(UsuarioActual.CveEmpresa) = Nothing
End If End If
ElseIf HdnModalidadCategoria.Value = "U" Then ElseIf HdnModalidadCategoria.Value = "U" Then
If ObjCategorias.UpdateCategoria(TxtCategoria.Text.Trim, ChkEstatus.Checked, HdnIDCategoria.Value.ToEntero) Then If ObjCategorias.UpdateCategoria(TxtCategoria.Text.Trim, ChkEstatus.Checked, HdnIDCategoria.Value.ToEntero) Then
TxtCategoria.Text = "" TxtCategoria.Text = ""
ChkEstatus.Checked = True ChkEstatus.Checked = True
Alert("La Categoría se actualizó correctamente.", TipoMensaje.MsgInformacion) Alert("La Categoría se actualizó correctamente.", TipoMensaje.MsgInformacion)
GlobalDTGralCategorias(UsuarioActual.CveEmpresa) = Nothing
End If End If
End If End If

View File

@@ -14,6 +14,9 @@
<li> <li>
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#RecepcionAlmacen">&nbsp;</a> <a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#RecepcionAlmacen">&nbsp;</a>
</li> </li>
<li>
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="true" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Cargar Excel</asp:HyperLink>
</li>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Recepción Almacén Recepción Almacén
@@ -811,7 +814,7 @@
<asp:Label Text="" ID="LbProducto" runat="server" /> <asp:Label Text="" ID="LbProducto" runat="server" />
</td> </td>
<td width="120px"><b>Cantidad:</b></td> <td width="120px"><b>Cantidad:</b></td>
<td colspan=""> <td >
<asp:Label Text="" ID="LbCantidad" runat="server" /> <asp:Label Text="" ID="LbCantidad" runat="server" />
</td> </td>
</tr> </tr>
@@ -827,15 +830,11 @@
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
</td> </td>
</tr> <td><asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarPS" OnClick="BtnAgregarPS_Click" ValidationGroup="GrpAgregaSerie" runat="server" /></td>
<tr> </tr>
<td colspan="4" align="right">
<asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarPS" OnClick="BtnAgregarPS_Click" ValidationGroup="GrpAgregaSerie" runat="server" />
</td>
</tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<asp:GridView ID="GvSerie" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="Serie" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="100" data-freezerows="1" GridLines="None"> <asp:GridView ID="GvSerie" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="Serie" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="250" data-freezerows="1" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Serie-Folio" DataField="Serie" ItemStyle-Width="40%" /> <asp:BoundField HeaderText="Serie-Folio" DataField="Serie" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
@@ -1091,6 +1090,74 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<div id="DivCargaExcel" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<asp:UpdatePanel ID="UpConcepto" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Conceptos</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cargar Plantilla </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<%-- <div class="row">
<div class="col-md-12" align="center">
<h4>Arraste o haga click para subir el archivo Excel</h4>
</div>
</div>--%>
<div class="row">
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px; margin-bottom: 20px;">
<asp:TextBox ID="TxtExcel" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-2" style="text-align: left">
<asp:LinkButton ID="LbDescargarExcelConceptos" runat="server" CssClass="btn btn-warning" Text="Descargar Plantilla" />
</div>
<div class="col-md-10" style="text-align: center">
<asp:Button ID="BtnCargaExcel" runat="server" CssClass="btn btn-success" Text="Procesar"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LbDescargarExcelConceptos" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -5,13 +5,12 @@ Imports Microsoft.Reporting.WebForms
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
Imports System.IO Imports System.IO
Imports GemBox.Spreadsheet
Partial Class Inventarios_RecepcionAlmacen Partial Class Inventarios_RecepcionAlmacen
Inherits ClsPaginas Inherits ClsPaginas
#Region "PROPIEDADES" #Region "PROPIEDADES"
Private Shared missing As Object = System.Reflection.Missing.Value
Private Property EstatusInicial As String Private Property EstatusInicial As String
Get Get
EstatusInicial = ViewState("EstatusInicial").ToString EstatusInicial = ViewState("EstatusInicial").ToString
@@ -44,9 +43,6 @@ Partial Class Inventarios_RecepcionAlmacen
Else Else
Return CType(ViewState("DtInv"), DataTable) Return CType(ViewState("DtInv"), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
ViewState("DtInv") = value ViewState("DtInv") = value
@@ -988,11 +984,15 @@ Partial Class Inventarios_RecepcionAlmacen
RecibidaCompleta = False RecibidaCompleta = False
'' carga desde excel
' HplCargaExcel.Enabled = True
Dim CargaSoloUsados As Boolean = False Dim CargaSoloUsados As Boolean = False
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy() Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy()
DtInv = DtRecepcion
Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero() Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero()
Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero() Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
Dim CveSubProyecto As Integer Dim CveSubProyecto As Integer
@@ -1869,7 +1869,8 @@ Partial Class Inventarios_RecepcionAlmacen
If MensajeSinExistencias.ToString <> "" Then If MensajeSinExistencias.ToString <> "" Then
Alert($"Las siguientes Series no cuentan con la existencia suficiente por lo cual se omitieron. <br?><br/> {MensajeSinExistencias.ToString}", TipoMensaje.MsgAdvertencia) Alert($"Las siguientes Series no cuentan con la existencia suficiente por lo cual se omitieron. <br?><br/> {MensajeSinExistencias.ToString}", TipoMensaje.MsgAdvertencia)
End If End If
RegistraScript("playsonidito('beep-07.wav')") RegistraScript("playsonidito('beep-07.wav')", "SoniditoSerie")
End If End If
End Sub End Sub
@@ -3226,7 +3227,7 @@ Partial Class Inventarios_RecepcionAlmacen
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC ''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
'If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If Not ErrorMovInv AndAlso RecibidaCompleta Then If Not ErrorMovInv AndAlso RecibidaCompleta AndAlso UsuarioActual.CveEmpresa <> 140 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then
Dim dtt As DataTable = ObjInventario.DtResultados Dim dtt As DataTable = ObjInventario.DtResultados
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal") + ImporteIngresoAdicional Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal") + ImporteIngresoAdicional
@@ -4794,6 +4795,147 @@ Partial Class Inventarios_RecepcionAlmacen
#End Region #End Region
#Region "CargaExcel"
Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path
Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV")
CargarArchivoExcel(Directorio, file.filename)
Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If
End Sub
Protected Sub CargarArchivoExcel(Ruta As String, FileName As String)
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim dt As DataTable = Nothing
Dim ErrorArchivo = False
Try
dt = ReadExcelFile(Ruta + FileName, True)
Catch ex As Exception
ErrorArchivo = True
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
End Try
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
If Not dt.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la primera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "Código" Then
Alert("El nombre de la segunda columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "Producto" Then
Alert("El nombre de la tercera columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "Serie" Then
Alert("El nombre de la cuarta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
'If Not dt.Columns(4).ColumnName = "Lote" Then
' Alert("El nombre de la cuarta columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
'End If
'If Not dt.Columns(5).ColumnName = "FechaCaducidad" Then
' Alert("El nombre de la cuarta columna debe ser 'Fecha Caducidad'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
'End If
dt.TableName = "Datos"
Dim ProductosNoCargados As New StringBuilder()
Dim RowsCargados As Integer = 0
Dim RowsNoCargados As Integer = 0
Dim NoPSConSerie As Integer = 0
If CveCompraSurtir > 0 Then
'DtRecepcion
Try
'Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
'If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
For Each RowExcel As DataRow In dt.Rows
If RowExcel("Código").ToString() <> "" Then
Dim RowPS = DtInv.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Código").ToString()))
If RowPS IsNot Nothing AndAlso RowPS("CvePS").ToString().ToEntero() > 0 Then
Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero()
Dim CveUnidadMedida As Integer = RowPS("CveUM").ToString().ToEntero()
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
Dim Serie As String = RowExcel("Serie").ToString()
Dim Lote As String '= RowExcel("Lote").ToString()
Dim FechaCaducidad As Date '= If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
Dim Observaciones As String '= If(dt.Columns.Contains("Observaciones"), RowExcel("Observaciones").ToString, "").ToString
Dim Valido As Boolean = True
If RowPS("AplicaSerie").ToString() = "True" And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
Valido = False
Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
End If
If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
NoPSConSerie = NoPSConSerie + 1
End If
If Valido Then
CveConsecSerie = RowPS("Consec").ToString.ToEntero
AgregaSerie(RowExcel("Serie").ToString, 1)
'AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False)
RowsCargados = RowsCargados + 1
Else
RowsNoCargados = RowsNoCargados + 1
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
End If
Else
RowsNoCargados = RowsNoCargados + 1
ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
End If
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex)
Finally
Dim MensajeFinal As New StringBuilder()
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
MensajeFinal.Append("Los productos se cargaron correctamente. <br/><br/>")
End If
If RowsCargados > 0 Then
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> productos correctamente.")
End If
If RowsNoCargados > 0 Then
MensajeFinal.Append("No se pudieron cargar <b>" & RowsNoCargados & "</b> productos. <br/>Los siguientes productos no se pudieron cargar: " & ProductosNoCargados.ToString())
End If
Alert(MensajeFinal.ToString())
End Try
Else
Alert("No hay seleccionada compra", TipoMensaje.MsgError)
End If
End If
End Sub
#End Region
'Protected Sub BtnGuardarDocumento_Click(sender As Object, e As EventArgs) 'Protected Sub BtnGuardarDocumento_Click(sender As Object, e As EventArgs)
' Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos ' Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
@@ -4898,31 +5040,5 @@ Partial Class Inventarios_RecepcionAlmacen
End Class End Class
'Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
' Dim Retorno = True
' Dim Archivo As System.IO.FileInfo = Nothing
' For Each Dr As DataRow In DtDocumentos.Rows
' If ObjEventoBitacora.AddEventoBitacora("Documento Relacionado", Dr("FileExtension").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then
' Try
' If Dr("Documento").ToString <> "" Then
' Archivo = New System.IO.FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, Dr("Documento").ToString))
' If Archivo.Exists() Then
' File.Move(Archivo.ToString, String.Format("{0}OI\OI{1}{2}", UsuarioActual.Empresa.Ruta, ObjEventoBitacora.CveEvento.ToString, Archivo.Extension))
' Else
' Retorno = False
' End If
' End If
' Catch ex As Exception
' Retorno = False
' Exit For
' End Try
' Else
' Retorno = False
' Exit For
' End If
' Next
' Return Retorno
'End Function
End Class End Class

View File

@@ -15,6 +15,15 @@ Partial Class Inventarios_RecepcionUsados
Private _dtDatos As DataTable Private _dtDatos As DataTable
Public Property DtClientes() As DataTable
Get
Return CType(ViewState("DtClientes"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtClientes") = value
End Set
End Property
Public Property DtMovimientos() As DataTable Public Property DtMovimientos() As DataTable
Get Get
Return CType(ViewState("DtMovimientos"), DataTable) Return CType(ViewState("DtMovimientos"), DataTable)
@@ -331,6 +340,7 @@ Partial Class Inventarios_RecepcionUsados
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargaInicial() CargaInicial()
GeneraRNCFromURL()
End If End If
End Sub End Sub
@@ -405,7 +415,76 @@ Partial Class Inventarios_RecepcionUsados
'DdlProducto2.setEsWebService(True) 'DdlProducto2.setEsWebService(True)
'DdlProducto2.Attributes.Add("data-metodo", "getpsusados") 'DdlProducto2.Attributes.Add("data-metodo", "getpsusados")
End Sub End Sub
Private Sub GeneraRNCFromURL()
Dim RFC As String = IfNull(Request("RFC"), "").ToString()
Dim CveAlmacen As Integer = IfNull(Request("CveAlmacen"), "-1").ToString().ToEntero()
Dim Cantidad As Decimal = IfNull(Request("Cantidad"), "0").ToString().ToDecimal()
Dim Fecha As DateTime = IfNull(Request("Fecha"), Now.ToString("dd/MM/yyyy")).ToString().ToDateTime()
If Not String.IsNullOrEmpty(RFC) Then
If DtClientes Is Nothing Then
Alert("No se encontraron clientes para filtrar", TipoMensaje.MsgError)
Exit Sub
End If
Dim RowCliente = DtClientes.FiltroPrimero(String.Format("RFC='{0}'", RFC))
If RowCliente Is Nothing Then
Alert("No se encontro el cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CveAlmacen <= 0 Then
Alert("Es necesario especificar el almacen", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Cantidad <= 0 Then
Alert("Es necesario especificar la cantidad", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
DdlClientes.SelectedValueExist(CveCliente)
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
DdlAlmacen.SelectedValueExist(CveAlmacen)
TxtFecha.Text = Fecha.ToString("dd/MM/yyyy")
Dim CvePS As Integer = 403591 'EXTRA CHICO
Dim CveTamanio As Integer = 1
Dim CveUM As Integer = -1
Dim PU As Decimal = 0
Dim RowTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo > 0 AND CvePSCargo={CvePS}")
Dim CodigoPS As String = ""
Dim UnidaMedida As String = ""
If RowTamanio IsNot Nothing Then
PU = RowTamanio("Cargo").ToString.ToDecimal()
CodigoPS = RowTamanio("CodigoPS").ToString()
CveTamanio = RowTamanio("CveTamaño").ToString().ToEntero()
CveUM = RowTamanio("CveUM").ToString().ToEntero()
UnidaMedida = "" 'RowTamanio("UnidadMedida").ToString()
AddNew(CvePS, CodigoPS, CveUM, UnidaMedida, Cantidad, PU, "", "-1", "-1", "-1", "", "", -1, "", "", CveTamanio)
Dim CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
CreaRemisionNC(CveCliente, CveSubProyecto, 1)
If Me.ObjRemisionNC IsNot Nothing Then
Guardar(True)
Else
Alert("No se pudo generar la RNC", TipoMensaje.MsgError)
End If
Else
Alert("No se encontro el tamaño", TipoMensaje.MsgError)
End If
End If
End Sub
#Region " PERMISOS PAGINAS " #Region " PERMISOS PAGINAS "
@@ -1165,7 +1244,7 @@ Partial Class Inventarios_RecepcionUsados
If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, Now, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor" Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
@@ -1850,9 +1929,11 @@ Partial Class Inventarios_RecepcionUsados
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED" #Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
Private Sub InicializaClientes(Todos As Boolean) Private Sub InicializaClientes(Todos As Boolean)
DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1"))
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1")) DdlClientes.DataSource = DtClientes
DdlClientes.DataBind() DdlClientes.DataBind()
DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClientes.SelectedValue = "-1" DdlClientes.SelectedValue = "-1"
@@ -2219,11 +2300,12 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.TipoDocto = "RNC" Me.ObjRemisionNC.TipoDocto = "RNC"
Me.ObjRemisionNC.RefDocto = "" Me.ObjRemisionNC.RefDocto = ""
Me.ObjRemisionNC.CveMesa = -1 Me.ObjRemisionNC.CveMesa = -1
Me.ObjRemisionNC.Fecha = Now Dim Fecha As DateTime = TxtFecha.Text.ToDateTime()
Me.ObjRemisionNC.Fecha = Fecha
Me.ObjRemisionNC.CvePrePoliza = -1 Me.ObjRemisionNC.CvePrePoliza = -1
Me.ObjRemisionNC.FechaPago = Now Me.ObjRemisionNC.FechaPago = Fecha
Me.ObjRemisionNC.MotivoDescuento = "" Me.ObjRemisionNC.MotivoDescuento = ""
Me.ObjRemisionNC.FechaEjecucion = Now Me.ObjRemisionNC.FechaEjecucion = Fecha
Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
Me.ObjRemisionNC.CveCondicionEntrega = -1 Me.ObjRemisionNC.CveCondicionEntrega = -1
Me.ObjRemisionNC.CondicionEntrega = "" Me.ObjRemisionNC.CondicionEntrega = ""

View File

@@ -119,7 +119,7 @@
<div class="row"> <div class="row">
<div class="col-md-1 truncate">Proveedor</div> <div class="col-md-1 truncate">Proveedor</div>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlProveedor" runat="server" CssClass="form-control input-sm select2me" Width="100%" DataValueField="CveProveedor" DataTextField="RazonSocial"></asp:DropDownList> <ADS:DropDownLost ID="DdlProveedor" runat="server" CssStyle="width: 100%;" data-metodo="getproveedores" CssClassDdl="select2me " Width="100%" DataValueField="CveProveedor" DataTextField="RazonSocial"></ADS:DropDownLost>
</div> </div>
<div class="col-md-1 truncate">Categoría</div> <div class="col-md-1 truncate">Categoría</div>
<div class="col-md-2"> <div class="col-md-2">
@@ -240,6 +240,7 @@
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="7.5%" HorizontalAlign="Right"></ItemStyle> <ItemStyle Width="7.5%" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField Visible="false" DataField="CantidadPendienteSurtir" HeaderText="Pte Surtir" DataFormatString="{0:#,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right"/>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Saldo Inicial"> <asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Saldo Inicial">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lbSaldoI2" runat="server" Text='<%# If(Eval("SaldoIniImp").ToString() = "0", "-", Eval("SaldoIniImp", "{0:N2}")) %>'></asp:Label> <asp:Label ID="lbSaldoI2" runat="server" Text='<%# If(Eval("SaldoIniImp").ToString() = "0", "-", Eval("SaldoIniImp", "{0:N2}")) %>'></asp:Label>

View File

@@ -94,11 +94,15 @@ Partial Class Inventarios_ReporteEntradasSalidas
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
dvImp.Visible = TienePermisoImportes dvImp.Visible = TienePermisoImportes
GvM.Columns(10).Visible = TienePermisoImportes
GvM.Columns(11).Visible = TienePermisoImportes GvM.Columns(11).Visible = TienePermisoImportes
GvM.Columns(12).Visible = TienePermisoImportes GvM.Columns(12).Visible = TienePermisoImportes
GvM.Columns(13).Visible = TienePermisoImportes GvM.Columns(13).Visible = TienePermisoImportes
GvM.Columns(14).Visible = TienePermisoImportes GvM.Columns(14).Visible = TienePermisoImportes
GvM.Columns(15).Visible = TienePermisoImportes
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
GvM.Columns(10).Visible = TienePermisoImportes
End If
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
@@ -126,9 +130,9 @@ Partial Class Inventarios_ReporteEntradasSalidas
DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1")) DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1"))
'Llenar dropdownlist de proveedores 'Llenar dropdownlist de proveedores
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedor.DataBind() 'DdlProveedor.DataBind()
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) 'DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
'CARGA CLASIFICACIONES 'CARGA CLASIFICACIONES
Dim ObjClasificaciones As New ClsClasificaciones Dim ObjClasificaciones As New ClsClasificaciones
@@ -139,7 +143,6 @@ Partial Class Inventarios_ReporteEntradasSalidas
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
DdlCategoria.DataBind() DdlCategoria.DataBind()
@@ -148,6 +151,9 @@ Partial Class Inventarios_ReporteEntradasSalidas
'Carga Productos 'Carga Productos
DdlPS.setEsWebService(True) DdlPS.setEsWebService(True)
DdlProveedor.setEsWebService(True)
DdlProveedor.SelectedText = ""
DdlProveedor.SelectedValue = "-1"
'If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then 'If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue) DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
@@ -160,7 +166,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
' DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1")) ' DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
'End If 'End If
DdlMovs.SelectedValue = "2" DdlMovs.SelectedValue = "3"
'Llenar dropdownlist de personal 'Llenar dropdownlist de personal
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
@@ -179,7 +185,6 @@ Partial Class Inventarios_ReporteEntradasSalidas
CargarMarcas() CargarMarcas()
DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1) DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1)
DdlTipoAlmacen.DataBind() DdlTipoAlmacen.DataBind()
DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -187,7 +192,8 @@ Partial Class Inventarios_ReporteEntradasSalidas
End Sub End Sub
Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaClasificaciones() CargaClasificaciones(DdlCategoria.SelectedValue.ToEntero)
End Sub End Sub
Private Sub CargaClasificaciones(CveCategoria As Integer) Private Sub CargaClasificaciones(CveCategoria As Integer)
@@ -354,7 +360,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
Dim TipoMov = If(DdlTipoMovimiento.SelectedValue = "-1", "", $"&emsp;<b>Tipo&nbsp;Movimiento:</b>&nbsp;{DdlTipoMovimiento.SelectedItem.Text}") Dim TipoMov = If(DdlTipoMovimiento.SelectedValue = "-1", "", $"&emsp;<b>Tipo&nbsp;Movimiento:</b>&nbsp;{DdlTipoMovimiento.SelectedItem.Text}")
Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $"&emsp;<b>Moneda:</b>&nbsp;{DdlMoneda.SelectedItem.Text}") Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $"&emsp;<b>Moneda:</b>&nbsp;{DdlMoneda.SelectedItem.Text}")
Dim SoloConMov = If(DdlMovs.SelectedValue = "-1", "", $"&emsp;<b>Solo&nbsp;Movimientos:</b>&nbsp;{DdlMovs.SelectedItem.Text}") Dim SoloConMov = If(DdlMovs.SelectedValue = "-1", "", $"&emsp;<b>Solo&nbsp;Movimientos:</b>&nbsp;{DdlMovs.SelectedItem.Text}")
Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedor.SelectedItem.Text}") Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedor.SelectedText}")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlClasificacion.SelectedItem.Text}") Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlClasificacion.SelectedItem.Text}")
Dim Familia = If(DdlCategoria.SelectedValue = "-1", "", $"&emsp;<b>Categoria:</b>&nbsp;{DdlCategoria.SelectedItem.Text}") Dim Familia = If(DdlCategoria.SelectedValue = "-1", "", $"&emsp;<b>Categoria:</b>&nbsp;{DdlCategoria.SelectedItem.Text}")
Dim SubFamilia = If(DdlSubFamilia.SelectedValue = "-1", "", $"&emsp;<b>SubFamilia:</b>&nbsp;{DdlSubFamilia.SelectedItem.Text}") Dim SubFamilia = If(DdlSubFamilia.SelectedValue = "-1", "", $"&emsp;<b>SubFamilia:</b>&nbsp;{DdlSubFamilia.SelectedItem.Text}")
@@ -419,8 +425,8 @@ Partial Class Inventarios_ReporteEntradasSalidas
GvM.Columns(3).Visible = ChkClasificacion2.Checked GvM.Columns(3).Visible = ChkClasificacion2.Checked
GvM.Columns(5).Visible = ChkSeccionAlmacen.Checked GvM.Columns(5).Visible = ChkSeccionAlmacen.Checked
GvM.Columns(15).Visible = ChkFechaUltimaCompra.Checked GvM.Columns(16).Visible = ChkFechaUltimaCompra.Checked
GvM.Columns(16).Visible = ChkFechaUltimaVenta.Checked GvM.Columns(17).Visible = ChkFechaUltimaVenta.Checked
'GvM.Columns(4).Visible = ChkSeccionAlmacen.Checked 'GvM.Columns(4).Visible = ChkSeccionAlmacen.Checked
If ChkSeccionAlmacen.Checked OrElse ChkCodigoBarras.Checked OrElse ChkCodigoAlterno.Checked Then If ChkSeccionAlmacen.Checked OrElse ChkCodigoBarras.Checked OrElse ChkCodigoAlterno.Checked Then

View File

@@ -376,7 +376,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
} }
else else
{ {
if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion)) { if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion,CveSATMotivoCancelacion: 3)) {
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -155,14 +155,16 @@ Partial Class Ventas_ClientesAbonar
ViewState("Mail") = value ViewState("Mail") = value
End Set End Set
End Property End Property
Private Property CveIESustitucion As Integer
Get 'Private Property CveIESustitucion As Integer
Return ViewState("CveIESustitucion").ToString.ToEntero ' Get
End Get ' Return ViewState("CveIESustitucion").ToString.ToEntero
Set(value As Integer) ' End Get
ViewState("CveIESustitucion") = value ' Set(value As Integer)
End Set ' ViewState("CveIESustitucion") = value
End Property ' End Set
'End Property
Private Property CFDIRelacionadoSustitucion As String Private Property CFDIRelacionadoSustitucion As String
Get Get
If ViewState("CFDIRelacionadoSustitucion") Is Nothing Then If ViewState("CFDIRelacionadoSustitucion") Is Nothing Then
@@ -244,9 +246,9 @@ Partial Class Ventas_ClientesAbonar
FechaCorteIE = DateTime.Now FechaCorteIE = DateTime.Now
If CveIESustitucion > 0 Then 'If CveIESustitucion > 0 Then
CargaIESustituir() ' CargaIESustituir()
End If 'End If
Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day) Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day)
Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate
@@ -334,7 +336,9 @@ Partial Class Ventas_ClientesAbonar
Retorno = True Retorno = True
CargaCuentas() CargaCuentas()
CargaTipoTransaccion() CargaTipoTransaccion()
TxtFechaDocumento.Text = IIf(CveIESustitucion > 0, FechaCorteIE.ToShortDateString, Now.ToShortDateString).ToString
'TxtFechaDocumento.Text = IIf(CveIESustitucion > 0, FechaCorteIE.ToShortDateString, Now.ToShortDateString).ToString
TxtFechaDocumento.Text = Now.ToShortDateString.ToString
TxtAboneA.Enabled = False TxtAboneA.Enabled = False
LbEncabezado.Text = String.Format("<a href='/Ventas/Clientes.aspx?CveCliente={0}' target='_blank' class='Texto'>{1}</a>", CveCliente, ObjCliente.NombreComercial) LbEncabezado.Text = String.Format("<a href='/Ventas/Clientes.aspx?CveCliente={0}' target='_blank' class='Texto'>{1}</a>", CveCliente, ObjCliente.NombreComercial)
@@ -372,10 +376,12 @@ Partial Class Ventas_ClientesAbonar
Dim FechaI As String = IfNull(Request("FechaI"), "-1") Dim FechaI As String = IfNull(Request("FechaI"), "-1")
Dim FechaF As String = IfNull(Request("FechaF"), "-1") Dim FechaF As String = IfNull(Request("FechaF"), "-1")
Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate 'Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate
Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate
Dim SumDescuentoProntoPago As Double = 0.0 Dim SumDescuentoProntoPago As Double = 0.0
If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then 'If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then
If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte) Then
Dim TmpCxCAux As DataTable Dim TmpCxCAux As DataTable
TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago") SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago")
@@ -385,6 +391,7 @@ Partial Class Ventas_ClientesAbonar
CveMoneda = pCveMoneda CveMoneda = pCveMoneda
End If End If
TxtImporte.Text = "" TxtImporte.Text = ""
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
If SumDescuentoProntoPago > 0.0 Then If SumDescuentoProntoPago > 0.0 Then
@@ -701,12 +708,12 @@ Partial Class Ventas_ClientesAbonar
'02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR '02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR
Dim ErrorCancelarIE As Boolean = False Dim ErrorCancelarIE As Boolean = False
If CveIESustitucion > 0 Then 'If CveIESustitucion > 0 Then
ErrorCancelarIE = CancelarIE() ' ErrorCancelarIE = CancelarIE()
If ErrorCancelarIE Then ' If ErrorCancelarIE Then
Exit Sub ' Exit Sub
End If ' End If
End If 'End If
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
@@ -761,7 +768,8 @@ Partial Class Ventas_ClientesAbonar
End If End If
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) 'CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario)
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=-1, CveProveedorIntermediario:=CveProvIntermediario)
Else Else
If RblTipoPago.SelectedValue.Contiene("3") Then If RblTipoPago.SelectedValue.Contiene("3") Then
CveIE = DdlIngreso.SelectedValue.ToEntero CveIE = DdlIngreso.SelectedValue.ToEntero
@@ -1726,16 +1734,18 @@ Partial Class Ventas_ClientesAbonar
End If End If
'BITACORA 'BITACORA
If MsgError = "" Then 'If MsgError = "" Then
If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio <a href='/Bancos/IE.aspx?CveIE={CveIE}' target='_blank' class='Texto'>{TxtFolio.Text}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then ' If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then
MsgError = "Ocurrió un error al agregar la bitacora" ' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio <a href='/Bancos/IE.aspx?CveIE={CveIE}' target='_blank' class='Texto'>{TxtFolio.Text}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then
End If ' MsgError = "Ocurrió un error al agregar la bitacora"
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de <a href='/Bancos/IE.aspx?CveIE={CveIESustitucion}' target='_blank' class='Texto'>{FolioIECancelado}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then ' End If
MsgError = "Ocurrió un error al agregar la bitacora" ' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de <a href='/Bancos/IE.aspx?CveIE={CveIESustitucion}' target='_blank' class='Texto'>{FolioIECancelado}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
End If ' MsgError = "Ocurrió un error al agregar la bitacora"
End If ' End If
End If ' End If
'End If
Catch ex As Exception Catch ex As Exception
MsgError = "Ocurrió un error al guardar el movimiento" MsgError = "Ocurrió un error al guardar el movimiento"
@@ -2269,7 +2279,7 @@ Partial Class Ventas_ClientesAbonar
DdlCuenta.SelectedValue = "-1" DdlCuenta.SelectedValue = "-1"
DdlTipoTransaccion.SelectedValue = "-1" DdlTipoTransaccion.SelectedValue = "-1"
CveIESustitucion = "-1" 'CveIESustitucion = "-1"
CFDIRelacionadoSustitucion = "-1" CFDIRelacionadoSustitucion = "-1"
FechaCorteIE = DateTime.Now.ToDate FechaCorteIE = DateTime.Now.ToDate
IDPoliza = -1 IDPoliza = -1
@@ -2500,7 +2510,8 @@ Partial Class Ventas_ClientesAbonar
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then 'If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then
If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
If Not ObjBancos.DtResultados.Rows.Count > 0 Then If Not ObjBancos.DtResultados.Rows.Count > 0 Then
ObjBancos.Dispose() ObjBancos.Dispose()
Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
@@ -2512,7 +2523,9 @@ Partial Class Ventas_ClientesAbonar
ObjBancos.IniciaTransacSQL() ObjBancos.IniciaTransacSQL()
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then
'If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=False) Then
ObjBancos.Commit() ObjBancos.Commit()
ComplementoSustitucionGenerado = True ComplementoSustitucionGenerado = True
@@ -2883,183 +2896,185 @@ Partial Class Ventas_ClientesAbonar
#End Region #End Region
#Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION" #Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION"
Protected Sub CargaIESustituir()
Dim ObjIE As New ClsBancos()
If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
FechaCorteIE = ObjIE.FechaDocumento
CveMoneda = ObjIE.CveMoneda
CveMonedaFiltro = CveMoneda
IDPoliza = ObjIE.IDPoliza
FolioIECancelado = ObjIE.Folio
End If
End If
ObjIE.Dispose()
UpDatos.Update()
End Sub
Function CancelarIE() As Boolean
Dim ErrorCancelar = False
If Not IsDate(TxtFechaDocumento.Text.ToDate) Then 'Protected Sub CargaIESustituir()
Alert("El campo fecha cancelación es incorrecto. Por favor verifique y vuelva a intentar") ' Dim ObjIE As New ClsBancos()
Return True ' If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) Then
End If ' If ObjIE.DtResultados.Rows.Count > 0 Then
' FechaCorteIE = ObjIE.FechaDocumento
' CveMoneda = ObjIE.CveMoneda
' CveMonedaFiltro = CveMoneda
' IDPoliza = ObjIE.IDPoliza
' FolioIECancelado = ObjIE.Folio
' End If
' End If
' ObjIE.Dispose()
' UpDatos.Update()
'End Sub
Dim Banc As New ClsBancos 'Function CancelarIE() As Boolean
Banc.IniciaTransacSQL() ' Dim ErrorCancelar = False
Dim ObjAC As ClsContPAQi = Nothing ' If Not IsDate(TxtFechaDocumento.Text.ToDate) Then
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then ' Alert("El campo fecha cancelación es incorrecto. Por favor verifique y vuelva a intentar")
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ' Return True
ObjAC.IniciaTransacSQL() ' End If
End If
Dim IdPolizaNueva = -1 ' Dim Banc As New ClsBancos
Dim FolioPolizaNueva = -1 ' Banc.IniciaTransacSQL()
Try ' Dim ObjAC As ClsContPAQi = Nothing
'CANCELA IE CONTABILIZADO ' If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad Then
If IDPoliza > 0 Then ' ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
If ObjAC Is Nothing Then ' ObjAC.IniciaTransacSQL()
ErrorCancelar = True ' End If
End If
If Not ErrorCancelar Then ' Dim IdPolizaNueva = -1
Dim dt As DataTable ' Dim FolioPolizaNueva = -1
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
dt = ObjAC.DtResultados
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS) ' Try
If dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaDocumento.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaDocumento.Text.ToDate.Year Then ' 'CANCELA IE CONTABILIZADO
IdPolizaNueva = ObjAC.AddPoliza(3, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate) ' If IDPoliza > 0 Then
' If ObjAC Is Nothing Then
' ErrorCancelar = True
' End If
If IdPolizaNueva > 0 Then ' If Not ErrorCancelar Then
FolioPolizaNueva = ObjAC.Folio ' Dim dt As DataTable
' If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
' dt = ObjAC.DtResultados
'CREA POLIZA NEGATIVA ' ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
For Each dr As DataRow In dt.Rows ' If dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaDocumento.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaDocumento.Text.ToDate.Year Then
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDocumento.Text.ToDate, "") Then ' IdPolizaNueva = ObjAC.AddPoliza(3, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate)
ErrorCancelar = True : Exit For
End If
Next
'AJUSTA POLIZA ' If IdPolizaNueva > 0 Then
If Not ErrorCancelar Then ' FolioPolizaNueva = ObjAC.Folio
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
ErrorCancelar = True
End If
End If
'CANCELA IE ' 'CREA POLIZA NEGATIVA
If Not ErrorCancelar Then ' For Each dr As DataRow In dt.Rows
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then ' If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDocumento.Text.ToDate, "") Then
ErrorCancelar = True ' ErrorCancelar = True : Exit For
End If ' End If
End If ' Next
Else ' 'AJUSTA POLIZA
ErrorCancelar = True ' If Not ErrorCancelar Then
End If ' If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
' ErrorCancelar = True
' End If
' End If
Else ' 'CANCELA IE
' If Not ErrorCancelar Then
' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
' ErrorCancelar = True
' End If
' End If
'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS ' Else
For Each dr As DataRow In dt.Rows ' ErrorCancelar = True
If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then ' End If
ErrorCancelar = True : Exit For
End If
Next
'AJUSTA POLIZA ' Else
If Not ErrorCancelar Then
If Not ObjAC.AjustaPoliza(IDPoliza) Then
ErrorCancelar = True
End If
End If
'CANCELA IE ' 'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS
If Not ErrorCancelar Then ' For Each dr As DataRow In dt.Rows
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then ' If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then
ErrorCancelar = True ' ErrorCancelar = True : Exit For
End If ' End If
End If ' Next
End If ' 'AJUSTA POLIZA
' If Not ErrorCancelar Then
' If Not ObjAC.AjustaPoliza(IDPoliza) Then
' ErrorCancelar = True
' End If
' End If
End If ' 'CANCELA IE
End If ' If Not ErrorCancelar Then
Else ' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
' ErrorCancelar = True
' End If
' End If
If FechaCorteIE.Month < TxtFechaDocumento.Text.ToDate.Month Or FechaCorteIE.Year < TxtFechaDocumento.Text.ToDate.Year Then ' End If
'CANCELA IE MES ANTERIOR
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
ErrorCancelar = True
End If
Else
'CANCELA IE MES ACTUAL
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
ErrorCancelar = True
End If
End If
End If ' End If
' End If
' Else
If Not ErrorCancelar Then ' If FechaCorteIE.Month < TxtFechaDocumento.Text.ToDate.Month Or FechaCorteIE.Year < TxtFechaDocumento.Text.ToDate.Year Then
If Banc.GetComplementoPagos(-1, CveIESustitucion, -1, UsuarioActual.CveEmpresa) Then ' 'CANCELA IE MES ANTERIOR
' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
' ErrorCancelar = True
' End If
' Else
' 'CANCELA IE MES ACTUAL
' If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIESustitucion, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaDocumento.Text.ToDate) > 0 Then
' ErrorCancelar = True
' End If
' End If
Dim CveComplementoPago As Integer = -1 ' End If
If Banc.DtResultados.Rows.Count > 0 Then ' If Not ErrorCancelar Then
'OBTENEMOS EL UUID DEL COMPLEMENTO A CANCELAR POR SUSTITUCION ' If Banc.GetComplementoPagos(-1, CveIESustitucion, -1, UsuarioActual.CveEmpresa) Then
CFDIRelacionadoSustitucion = Banc.DtResultados.Rows(0)("FolioFiscal")
CveComplementoPago = Banc.DtResultados(0)("CveComplementoPago").ToString().ToEntero
End If
'ACTUALIZA FOLIOS CANCELADOS ' Dim CveComplementoPago As Integer = -1
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
ErrorCancelar = True
Else
Dim FolioCancelado = $"{FolioIECancelado}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
If Not Banc.UpdateFolioCancelado(CveIESustitucion.ToEntero, Folio:=FolioCancelado) Then ' If Banc.DtResultados.Rows.Count > 0 Then
ErrorCancelar = True ' 'OBTENEMOS EL UUID DEL COMPLEMENTO A CANCELAR POR SUSTITUCION
End If ' CFDIRelacionadoSustitucion = Banc.DtResultados.Rows(0)("FolioFiscal")
End If ' CveComplementoPago = Banc.DtResultados(0)("CveComplementoPago").ToString().ToEntero
End If ' End If
'ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2 ' 'ACTUALIZA FOLIOS CANCELADOS
If Not ErrorCancelar And CveComplementoPago > 0 Then ' If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
If Not Banc.UpdateComplementoPagoCancelado(CveComplementoPago, 2, UsuarioActual.Empresa.CvePAC, UsuarioActual.CveEmpresa, DateTime.Now) Then ' If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
ErrorCancelar = True ' ErrorCancelar = True
End If ' Else
End If ' Dim FolioCancelado = $"{FolioIECancelado}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
End If
End If
Catch ex As Exception
ErrorCancelar = True
OnError("Ocurrió un error al cancelar el IE", ex)
End Try
If Not ErrorCancelar Then ' If Not Banc.UpdateFolioCancelado(CveIESustitucion.ToEntero, Folio:=FolioCancelado) Then
Banc.Commit() ' ErrorCancelar = True
If ObjAC IsNot Nothing Then ObjAC.Commit() ' End If
' End If
' End If
Dim Msg As New StringBuilder ' 'ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2
Msg.Append("El movimiento bancario quedó cancelado exitosamente.") ' If Not ErrorCancelar And CveComplementoPago > 0 Then
' If Not Banc.UpdateComplementoPagoCancelado(CveComplementoPago, 2, UsuarioActual.Empresa.CvePAC, UsuarioActual.CveEmpresa, DateTime.Now) Then
' ErrorCancelar = True
' End If
' End If
' End If
' End If
' Catch ex As Exception
' ErrorCancelar = True
' OnError("Ocurrió un error al cancelar el IE", ex)
' End Try
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva) ' If Not ErrorCancelar Then
Alert(Msg.ToString, TipoMensaje.MsgInformacion) ' Banc.Commit()
Else ' If ObjAC IsNot Nothing Then ObjAC.Commit()
Banc.RollBack()
If ObjAC IsNot Nothing Then ObjAC.RollBack()
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
If ObjAC IsNot Nothing Then ObjAC.Dispose() ' Dim Msg As New StringBuilder
Banc.Dispose() ' Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
Return ErrorCancelar
End Function ' If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
' Alert(Msg.ToString, TipoMensaje.MsgInformacion)
' Else
' Banc.RollBack()
' If ObjAC IsNot Nothing Then ObjAC.RollBack()
' Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' End If
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
' Banc.Dispose()
' Return ErrorCancelar
'End Function
Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click
RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal") RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal")

View File

@@ -494,7 +494,7 @@
<tr align="left" id="TrServicioDomicilio" runat="server" visible="false"> <tr align="left" id="TrServicioDomicilio" runat="server" visible="false">
<td><b>Servicio a Domicilio:</b>&nbsp;</td> <td><b>Servicio a Domicilio:</b>&nbsp;</td>
<td> <td>
<asp:CheckBox ID="ChkServicioDomicilio" runat="server" CssClass="make-switchsd" data-size="small" Text="" ClientIDMode="Static" /> <asp:CheckBox ID="ChkServicioDomicilio" runat="server" AutoPostBack="true" OnCheckedChanged="ChkServicioDomicilio_CheckedChanged" />
</td> </td>
</tr> </tr>
</table> </table>
@@ -928,7 +928,7 @@
</div> </div>
<div class=" col-sm-8"> <div class=" col-sm-8">
<div class="Widthall" style="overflow-x: auto;"> <div class="Widthall" style="overflow-x: auto;">
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen,CvePS" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None"> <asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Consec,Origen,CodigoPS,CvePS,Serie,AplicaSerie" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
@@ -2769,11 +2769,6 @@
<a href="javascript;" class="collapse" data-original-title="" title=""></a> <a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div> </div>
</div> </div>
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-body form"> <div class="portlet-body form">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
@@ -2795,16 +2790,15 @@
<div class="col-md-4"> <div class="col-md-4">
<label>Año:</label> <label>Año:</label>
<br /> <br />
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAnio" runat="server" ControlToValidate="TxtAnioVehiculo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año del vehiculo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label>Usado:</label> <label>Usado:</label>
<br /> <br />
<asp:DropDownList ID="DdlRecepcionUsados" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="CodigoPS" DataValueField="CvePSCargo" Width="100%" OnSelectedIndexChanged="DdlRecepcionUsados_SelectedIndexChanged" AutoPostBack="true"> <asp:DropDownList ID="DdlRecepcionUsados" CssClass="form-control input-sm select2me" runat="server" DataTextField="CodigoPS" DataValueField="CvePSCargo" Width="100%" OnSelectedIndexChanged="DdlRecepcionUsados_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -2820,6 +2814,7 @@
<asp:DropDownList ID="DdlMarcaUsado" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarcaUsado" Width="100%"> <asp:DropDownList ID="DdlMarcaUsado" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarcaUsado" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione la Marca" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione la Marca" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:CustomValidator ID="RFVMarcaUsado" runat="server" ClientValidationFunction="ValidaMarcaUsado" ControlToValidate="DdlMarcaUsado" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<label for="<%= DdlMarcaUsado.ClientID.ToString()%>">Marca:</label> <label for="<%= DdlMarcaUsado.ClientID.ToString()%>">Marca:</label>
</div> </div>
</div> </div>
@@ -2839,10 +2834,7 @@
</div> </div>
</div> </div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
@@ -3147,8 +3139,7 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%> <asp:Button ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" />
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" UseSubmitBehavior="false" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -3188,6 +3179,26 @@
} }
}); });
function ValidaMarcaUsado(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
} else {
args.IsValid = true;
}
}
function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
} else {
args.IsValid = true;
}
}
function ValidarCodigoEnsamble(source, arguments) { function ValidarCodigoEnsamble(source, arguments) {
let CveMarca = HdnPSAjusteMarca.value; let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value; let CveClasificacion = HdnPSAjusteClasificacion.value;

View File

@@ -3067,7 +3067,7 @@ Partial Class PV
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'SERIE ALMACEN 'SERIE ALMACEN
If e.Row.DBCampo("CveTipoInvPS").ToEntero = 5 Then If e.Row.DBCampo("CveTipoInvPS").ToEntero = 5 OrElse CBool(e.Row.DBCampo("AplicaSerie")) Then
If CveVenta > 0 Then If CveVenta > 0 Then
e.Row.FCLiteral("LtlSerie").Visible = True e.Row.FCLiteral("LtlSerie").Visible = True
Else Else
@@ -3198,6 +3198,27 @@ Partial Class PV
Exit Sub Exit Sub
End If End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar un almacen de servicio a domicilio.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) <= 0 Then
Alert("Debe tener producto seleccionados para servicio a domicilio.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If String.IsNullOrEmpty(GvRow.FCTextBox("TxtSerie").Text.Trim) AndAlso CBool(GvRow.DataKey("AplicaSerie")) Then
Alert(String.Format("El producto {0} requiere serie.", GvRow.DataKey("CodigoPS")), TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Next
End If
'VALIDA PRECIO AL AGREGAR A ALMACEN 'VALIDA PRECIO AL AGREGAR A ALMACEN
If Not UsuarioActual.TienePermisoProceso(169) Then If Not UsuarioActual.TienePermisoProceso(169) Then
If Not CveContrato > 0 Then If Not CveContrato > 0 Then
@@ -3463,255 +3484,278 @@ Partial Class PV
#Region "OBJETO VENTA" #Region "OBJETO VENTA"
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False) Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
Try
If Me.CveVenta > 0 Then If Me.CveVenta > 0 Then
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
Else Else
ObjFactura = New Modelos.Factura(UsuarioActual) ObjFactura = New Modelos.Factura(UsuarioActual)
ObjFactura.CvePrePoliza = -1 ObjFactura.CvePrePoliza = -1
End If
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
ObjFactura.TipoCambioDolares = TxtTipoCambioDlls.Text.Trim.ToDecimal
ObjFactura.ConvertirPesos = ChkConvertirDoctoPesos.Checked
ObjFactura.ConvertirDolares = ChkConvertirDolares.Checked
ObjFactura.CveMoneda = DdlMoneda.SelectedValue.ToEntero
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString.ToEntero > 0, "Ing", DdlTipoComprobante.SelectedValue)
'ObjFactura.RefDocto = TxtDocto.Text.Trim
ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero, -1)
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero
ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero
ObjFactura.MetodoPago33 = If(DdlMetodoPago33.SelectedValue.ToEntero > 0, DdlMetodoPago33.SelectedItem.Text, "")
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}")
ObjFactura.CveFormaPago33 = DdlFormaPago33.SelectedValue.ToEntero
ObjFactura.FormaPago33 = If(DdlFormaPago33.SelectedValue.ToEntero > 0, DdlFormaPago33.SelectedItem.Text, "")
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {DdlFormaPago33.SelectedValue}")
ObjFactura.CveUsoCFDI = DdlUsoCFDI.SelectedValue.ToEntero
ObjFactura.UsoCFDI = If(DdlUsoCFDI.SelectedValue.ToEntero > 0, DdlUsoCFDI.SelectedItem.Text, "")
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
ObjFactura.CveCondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedValue.ToEntero, -1)
ObjFactura.CondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedItem.Text, "")
ObjFactura.CondicionesPago = If(RBLPago.SelectedValue = "2", 0, If(RBLPago.SelectedValue = "1", 1, 2)) ' 0 - Contado, 1 - Credito, 2 - termianl
ObjFactura.FormaPago = DdlFormaPago.SelectedValue.ToEntero
Select Case ObjFactura.TipoDocto
Case "Ing"
ObjFactura.TipoDocumento = "Factura"
Case "Rem"
ObjFactura.TipoDocumento = "Remision"
Case "Cot"
ObjFactura.TipoDocumento = "Cotizacion"
Case "Egs"
ObjFactura.TipoDocumento = "Nota de Crédito"
Case "Dev"
ObjFactura.TipoDocumento = "Nota de Devolución"
Case Else
ObjFactura.TipoDocumento = ""
End Select
ObjFactura.Fech1 = Now
ObjFactura.Fech2 = Now
ObjFactura.Fech3 = Now
ObjFactura.Alfa1 = ""
ObjFactura.Alfa2 = ""
ObjFactura.Alfa3 = ""
ObjFactura.Num1 = 0
ObjFactura.Num2 = 0
ObjFactura.Num3 = DdlOrdenPago.SelectedValue.ToDouble
ObjFactura.FechaPago = TxtFechaPago.Text.ToDate
ObjFactura.CveCorte = CveCorte
ObjFactura.CveMesa = -1
ObjFactura.NumeroPersonas = 0
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
ObjFactura.Entrega = Entrega
ObjFactura.Vigencia = Now
ObjFactura.CveVentaPadre = If(CveDevolucion > 0, CveDevolucion, CvePedido)
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
ObjFactura.FechaEjecucion = Now
ObjFactura.CveSucursalEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSucursalCobranza = -1
ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSubProyectoEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSubProyectoCobranza = -1
ObjFactura.AtencionA = If(ObjFactura.TipoDocto = "Cot", TxtAtencionA.Text, "-1")
ObjFactura.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFactura.Observaciones = TxtObsFact.Text.Trim
ObjFactura.Det_OrdenCompra = ""
ObjFactura.Det_FechaOrdenCompra = MinFecha.ToShortDateString
ObjFactura.MonedaAbreviatura = ""
'Totales, Y se llena TmpDTImpuestos
ObjFactura.SubTotal = TxtSubTotal.Text.ToDecimal
ObjFactura.Descuento = LblDescuentos.Text.Trim.ToDecimal
ObjFactura.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
ObjFactura.IVA = TxtIVA.Text.ToDecimal
ObjFactura.RetIVA = TxtRetIVA.Text.ToDecimal
ObjFactura.RetISR = TxtRetISR.Text.ToDecimal
ObjFactura.IEPS = TxtIEPS.Text.ToDecimal
ObjFactura.Total = TxtTotal.Text.ToDecimal
ObjFactura.DtDeduccion = New DataTable
'OTROS
ObjFactura.Det_FechaOrdenCompra = ""
ObjFactura.Det_OrdenCompra = ""
ObjFactura.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero
If ObjFactura.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
ObjFactura.CveMoneda = 1
ObjFactura.Moneda = "Pesos"
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
End If
If ObjFactura.CveMoneda <> 2 AndAlso ChkConvertirDolares.Checked Then
ObjFactura.TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
ObjFactura.CveMoneda = 2
ObjFactura.Moneda = "Dólares"
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
End If
'Se agrega CveVenta -1
For Each Row As DataRow In TmpDT.Rows
Row("CveVenta") = ObjFactura.CveVenta
Next
'DETALLES
ObjFactura.DtDetalle = TmpDT
ObjFactura.DtFirmas = DTmpF
'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
'SUCURSAL
ObjFactura.CveSucursal = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.SetSubProyectoMatriz(Me)
ObjFactura.SetSubProyecto(Me)
ObjFactura.ClienteSucursal = New Modelos.SucursalModel
ObjFactura.ClienteSucursal.NoExt = CliNoExt
ObjFactura.ClienteSucursal.NoInt = CliNoInt
ObjFactura.ClienteSucursal.Localidad = CliLocalidad
ObjFactura.ClienteSucursal.Direccion = LblDireccion.Text
ObjFactura.ClienteSucursal.Colonia = LblColonia.Text
ObjFactura.ClienteSucursal.Municipio = LblCiudad.Text
ObjFactura.ClienteSucursal.Estado = LblEstado.Text
ObjFactura.ClienteSucursal.CP = LblCP.Text
ObjFactura.ClienteSucursal.Pais = CliPais
ObjFactura.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString
ObjFactura.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
ObjFactura.ClienteSucursal.Sucursal = DdlSucursalCliente.SelectedItem.Text
ObjFactura.DtDetalle = TmpDT
ObjFactura.DtPagos = DtPagos
ObjFactura.DtPromociones = DtPromociones
Dim FM As New Modelos.FemsaFactura
Dim TmpDT7Eleven As New DataTable
Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
ObjFactura.FemsaFactura = FM
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
ObjFactura.DtAjustes = TmpDTAjustes
ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados
ObjFactura.DtPolizasVirtuales = TmpDTPolizaVirtual
ObjFactura.GenerarPDFFactura = False
Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22)
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows.Count > 0 Then
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
End If
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
' ddlAlmacen.SelectedIndex = 1
'End If
If ddlAlmacen.SelectedValue.ToEntero > 0 Then
ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
If Not DtInv.Columns.Contains("Seleccionado") Then
DtInv.Columns.Add("Seleccionado", GetType(Integer))
End If End If
For Each Gvr As GridViewRow In GvInv.Rows ObjFactura.CveUsuario = UsuarioActual.CveUsuario
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0) ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
Dr("Seleccionado") = 1 ObjFactura.TipoCambioDolares = TxtTipoCambioDlls.Text.Trim.ToDecimal
Else ObjFactura.ConvertirPesos = ChkConvertirDoctoPesos.Checked
Dr("Seleccionado") = 0 ObjFactura.ConvertirDolares = ChkConvertirDolares.Checked
End If ObjFactura.CveMoneda = DdlMoneda.SelectedValue.ToEntero
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString.ToEntero > 0, "Ing", DdlTipoComprobante.SelectedValue)
'ObjFactura.RefDocto = TxtDocto.Text.Trim
ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero, -1)
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero
ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero
ObjFactura.MetodoPago33 = If(DdlMetodoPago33.SelectedValue.ToEntero > 0, DdlMetodoPago33.SelectedItem.Text, "")
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}")
ObjFactura.CveFormaPago33 = DdlFormaPago33.SelectedValue.ToEntero
ObjFactura.FormaPago33 = If(DdlFormaPago33.SelectedValue.ToEntero > 0, DdlFormaPago33.SelectedItem.Text, "")
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {DdlFormaPago33.SelectedValue}")
ObjFactura.CveUsoCFDI = DdlUsoCFDI.SelectedValue.ToEntero
ObjFactura.UsoCFDI = If(DdlUsoCFDI.SelectedValue.ToEntero > 0, DdlUsoCFDI.SelectedItem.Text, "")
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
ObjFactura.CveCondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedValue.ToEntero, -1)
ObjFactura.CondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedItem.Text, "")
ObjFactura.CondicionesPago = If(RBLPago.SelectedValue = "2", 0, If(RBLPago.SelectedValue = "1", 1, 2)) ' 0 - Contado, 1 - Credito, 2 - termianl
ObjFactura.FormaPago = DdlFormaPago.SelectedValue.ToEntero
Select Case ObjFactura.TipoDocto
Case "Ing"
ObjFactura.TipoDocumento = "Factura"
Case "Rem"
ObjFactura.TipoDocumento = "Remision"
Case "Cot"
ObjFactura.TipoDocumento = "Cotizacion"
Case "Egs"
ObjFactura.TipoDocumento = "Nota de Crédito"
Case "Dev"
ObjFactura.TipoDocumento = "Nota de Devolución"
Case Else
ObjFactura.TipoDocumento = ""
End Select
ObjFactura.Fech1 = Now
ObjFactura.Fech2 = Now
ObjFactura.Fech3 = Now
ObjFactura.Alfa1 = ""
ObjFactura.Alfa2 = ""
ObjFactura.Alfa3 = ""
ObjFactura.Num1 = 0
ObjFactura.Num2 = 0
ObjFactura.Num3 = DdlOrdenPago.SelectedValue.ToDouble
ObjFactura.FechaPago = TxtFechaPago.Text.ToDate
ObjFactura.CveCorte = CveCorte
ObjFactura.CveMesa = -1
ObjFactura.NumeroPersonas = 0
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
ObjFactura.Entrega = Entrega
ObjFactura.Vigencia = Now
ObjFactura.CveVentaPadre = If(CveDevolucion > 0, CveDevolucion, CvePedido)
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
ObjFactura.FechaEjecucion = Now
ObjFactura.CveSucursalEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSucursalCobranza = -1
ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSubProyectoEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSubProyectoCobranza = -1
ObjFactura.AtencionA = If(ObjFactura.TipoDocto = "Cot", TxtAtencionA.Text, "-1")
ObjFactura.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFactura.Observaciones = TxtObsFact.Text.Trim
ObjFactura.Det_OrdenCompra = ""
ObjFactura.Det_FechaOrdenCompra = MinFecha.ToShortDateString
ObjFactura.MonedaAbreviatura = ""
'Totales, Y se llena TmpDTImpuestos
ObjFactura.SubTotal = TxtSubTotal.Text.ToDecimal
ObjFactura.Descuento = LblDescuentos.Text.Trim.ToDecimal
ObjFactura.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
ObjFactura.IVA = TxtIVA.Text.ToDecimal
ObjFactura.RetIVA = TxtRetIVA.Text.ToDecimal
ObjFactura.RetISR = TxtRetISR.Text.ToDecimal
ObjFactura.IEPS = TxtIEPS.Text.ToDecimal
ObjFactura.Total = TxtTotal.Text.ToDecimal
ObjFactura.DtDeduccion = New DataTable
'OTROS
ObjFactura.Det_FechaOrdenCompra = ""
ObjFactura.Det_OrdenCompra = ""
ObjFactura.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero
If ObjFactura.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
ObjFactura.CveMoneda = 1
ObjFactura.Moneda = "Pesos"
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
End If
If ObjFactura.CveMoneda <> 2 AndAlso ChkConvertirDolares.Checked Then
ObjFactura.TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
ObjFactura.CveMoneda = 2
ObjFactura.Moneda = "Dólares"
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
End If
'Se agrega CveVenta -1
For Each Row As DataRow In TmpDT.Rows
Row("CveVenta") = ObjFactura.CveVenta
Next Next
DtInv.AcceptChanges()
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1") 'DETALLES
End If ObjFactura.DtDetalle = TmpDT
ObjFactura.DtFirmas = DTmpF
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked 'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
'VALIDA ENTREGA POR ADELANTADO 'SUCURSAL
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then ObjFactura.CveSucursal = DdlSubProyectoDatos.SelectedValue.ToEntero
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO ObjFactura.SetSubProyectoMatriz(Me)
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then ObjFactura.SetSubProyecto(Me)
If ObjFactura.ServicioDomicilio Then ObjFactura.ClienteSucursal = New Modelos.SucursalModel
ObjFactura.CveAlmacenServicioDomicilio = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero ObjFactura.ClienteSucursal.NoExt = CliNoExt
ObjFactura.DtInventario = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") ObjFactura.ClienteSucursal.NoInt = CliNoInt
ObjFactura.ClienteSucursal.Localidad = CliLocalidad
ObjFactura.ClienteSucursal.Direccion = LblDireccion.Text
ObjFactura.ClienteSucursal.Colonia = LblColonia.Text
ObjFactura.ClienteSucursal.Municipio = LblCiudad.Text
ObjFactura.ClienteSucursal.Estado = LblEstado.Text
ObjFactura.ClienteSucursal.CP = LblCP.Text
ObjFactura.ClienteSucursal.Pais = CliPais
ObjFactura.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString
ObjFactura.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
ObjFactura.ClienteSucursal.Sucursal = DdlSucursalCliente.SelectedItem.Text
ObjFactura.DtDetalle = TmpDT
ObjFactura.DtPagos = DtPagos
ObjFactura.DtPromociones = DtPromociones
Dim FM As New Modelos.FemsaFactura
Dim TmpDT7Eleven As New DataTable
Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
ObjFactura.FemsaFactura = FM
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
ObjFactura.DtAjustes = TmpDTAjustes
ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados
ObjFactura.DtPolizasVirtuales = TmpDTPolizaVirtual
ObjFactura.GenerarPDFFactura = False
Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22)
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows.Count > 0 Then
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
End If
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
' ddlAlmacen.SelectedIndex = 1
'End If
If ddlAlmacen.SelectedValue.ToEntero > 0 Then
ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
If Not DtInv.Columns.Contains("Seleccionado") Then
DtInv.Columns.Add("Seleccionado", GetType(Integer))
End If End If
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero For Each Gvr As GridViewRow In GvInv.Rows
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0)
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then
Dr("Seleccionado") = 1
Else
Dr("Seleccionado") = 0
End If
Next
DtInv.AcceptChanges()
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
End If End If
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.") 'VALIDA ENTREGA POR ADELANTADO
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
If ObjFactura.ServicioDomicilio Then
ObjFactura.CveAlmacenServicioDomicilio = ddlAlmacen.SelectedValue.ToEntero() 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
'PREPARA DT INVENTARIO
Dim DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Dim filtro = DtInv.Select(String.Format("CvePS = {0} AND Consec = {1}", GvRow.DataKey("CvePS"), GvRow.DataKey("Consec")))
If filtro IsNot Nothing AndAlso filtro.Length > 0 Then
Dim Row = filtro(0)
Row("Serie") = GvRow.FCTextBox("TxtSerie").Text.Trim
End If
End If
Next
ObjFactura.DtInventario = DtInv
End If
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
End If
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
End If
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.")
End If
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0 Then
ObjFactura.EsGarantia = True
End If
End If End If
Catch ex As Exception
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO OnError("Ocurrió un error al generar la venta", ex)
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then If ObjFactura IsNot Nothing Then
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.") ObjFactura.Dispose()
ObjFactura = Nothing
End If End If
End Try
End If
End Sub End Sub
#End Region #End Region
@@ -4133,6 +4177,8 @@ Partial Class PV
CambiaSucursal() CambiaSucursal()
End If End If
ObjSubProyectos.Dispose() ObjSubProyectos.Dispose()
ChkServicioDomicilio_CheckedChanged(ChkServicioDomicilio, EventArgs.Empty)
End Sub End Sub
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoComprobante.SelectedIndexChanged Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoComprobante.SelectedIndexChanged
CambiaTipoComprobante() CambiaTipoComprobante()
@@ -4310,6 +4356,8 @@ Partial Class PV
TmpDT.Columns.Add("EliminarDB", GetType(Boolean)) TmpDT.Columns.Add("EliminarDB", GetType(Boolean))
TmpDT.Columns("EliminarDB").DefaultValue = False TmpDT.Columns("EliminarDB").DefaultValue = False
TmpDT.Columns.Add("AplicaSerie", GetType(Boolean))
End Sub End Sub
Private Sub CreaDTmpC() Private Sub CreaDTmpC()
@@ -4346,6 +4394,8 @@ Partial Class PV
Exit Sub Exit Sub
End If End If
Dim AplicaSerie = CBool(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("AplicaSerie"))
If TmpDT.FiltraParametros("AsientoContableVentas <> '" & AsientoContableVentas.ToString & "'").Rows.Count = 0 Then If TmpDT.FiltraParametros("AsientoContableVentas <> '" & AsientoContableVentas.ToString & "'").Rows.Count = 0 Then
Dim Row As DataRow = Nothing Dim Row As DataRow = Nothing
Row = TmpDT.NewRow() Row = TmpDT.NewRow()
@@ -4380,6 +4430,7 @@ Partial Class PV
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("Serie") = Serie Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("AplicaSerie") = AplicaSerie
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False") GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False")
@@ -4596,6 +4647,7 @@ Partial Class PV
End If End If
End If End If
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
If Modalidad = "A" Then If Modalidad = "A" Then
@@ -4671,6 +4723,7 @@ Partial Class PV
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2 Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
Row("CuentaPredial") = CuentaPredial Row("CuentaPredial") = CuentaPredial
Row("EsCargo") = EsCargo Row("EsCargo") = EsCargo
Row("AplicaSerie") = DrPS("AplicaSerie")
If EsCargo AndAlso ConsecPSPadre >= 0 Then If EsCargo AndAlso ConsecPSPadre >= 0 Then
Row("ConsecPSPadre") = ConsecPSPadre Row("ConsecPSPadre") = ConsecPSPadre
@@ -5036,6 +5089,8 @@ Partial Class PV
End If End If
End If End If
Me.CveVentaDetalle = -1 Me.CveVentaDetalle = -1
UpAgregar.Update()
End Sub End Sub
Private Function AgregarPS() As Boolean Private Function AgregarPS() As Boolean
Dim CveVentaDetalle As Integer = Me.CveVentaDetalle Dim CveVentaDetalle As Integer = Me.CveVentaDetalle
@@ -5278,6 +5333,8 @@ Partial Class PV
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
CargaGVInv(DtInv) CargaGVInv(DtInv)
ChkServicioDomicilio_CheckedChanged(ChkServicioDomicilio, EventArgs.Empty)
UpContado.Update() UpContado.Update()
UpPS.Update() UpPS.Update()
RegistraScript("BorraDescuentos();", "BorraDescuentos") RegistraScript("BorraDescuentos();", "BorraDescuentos")
@@ -5864,24 +5921,23 @@ Partial Class PV
Dim Index = Row.RowIndex Dim Index = Row.RowIndex
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPSSerie("", ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString.Trim, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString)) ObjInventarios.Dispose()
'Valida Existencia 'Valida Existencia
If Existencia - ExistenciaActual <= 0 Then If Existencia <= 0 Then
Alert(String.Format("Not hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Row.FCTextBox("TxtSerie").Text.ToString), TipoMensaje.MsgAdvertencia) Alert(String.Format("Not hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Row.FCTextBox("TxtSerie").Text.ToString), TipoMensaje.MsgAdvertencia)
Row.FCTextBox("TxtSerie").Text = "" Row.FCTextBox("TxtSerie").Text = ""
Row.FCHiddenField("HdnSerie").Value = "" Row.FCHiddenField("HdnSerie").Value = ""
TmpDT.Rows(Index)("Serie") = "" DtInv.Rows(Index)("Serie") = ""
Else Else
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text
TmpDT.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text DtInv.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text
End If End If
TmpDT.AcceptChanges() DtInv.AcceptChanges()
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
ObjInventarios.Dispose()
End Sub End Sub
Private Function ValidaSerieINV() As Boolean Private Function ValidaSerieINV() As Boolean
@@ -6721,12 +6777,12 @@ Partial Class PV
DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}") DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}")
DdlBCIAjuste.DataBind() DdlBCIAjuste.DataBind()
DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
RFVAnio.Enabled = True
If CveTamanio = 16 Then 'motobaterias If CveTamanio = 16 Then 'motobaterias
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0")) DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
RFVAnio.Enabled = False
End If End If
UPPDatosUsado.Update() ''refresca el RFV
Else Else
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0")) DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
End If End If
@@ -7813,11 +7869,49 @@ Partial Class PV
Response.Redirect($"~/Ventas/PV.aspx") Response.Redirect($"~/Ventas/PV.aspx")
End Sub End Sub
Protected Sub DdlRecepcionUsados_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlRecepcionUsados_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}") If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then
Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño"))) DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño")))
Else
DdlBCIUsado.Items.Clear()
DdlBCIUsado.DataSource = Nothing
End If
DdlBCIUsado.DataBind() DdlBCIUsado.DataBind()
UpModalVenta.Update() UpAddVenta.Update()
End Sub
Protected Sub ChkServicioDomicilio_CheckedChanged(sender As Object, e As EventArgs)
If ChkServicioDomicilio.Checked Then
PreparaServicioDomicilio()
Else
ddlAlmacen.Items.Clear()
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}")
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
ddlAlmacen.DataBind()
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}").Rows.Count > 0 Then
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCCheckBox("cbInv").Enabled = True
End If
Next
End If
UpINV.Update()
End Sub
Private Sub PreparaServicioDomicilio()
ddlAlmacen.Items.Clear()
ddlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=29).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}")
ddlAlmacen.DataBind()
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCCheckBox("cbInv").Checked = True
GvRow.FCCheckBox("cbInv").Enabled = False
End If
Next
End Sub End Sub
End Class End Class

View File

@@ -2178,6 +2178,40 @@
<asp:Literal ID="LtlScripts" runat="server"></asp:Literal> <asp:Literal ID="LtlScripts" runat="server"></asp:Literal>
<%-- FIN MODAL PS ADICIONALES --%> <%-- FIN MODAL PS ADICIONALES --%>
<asp:UpdatePanel runat="server" ID="UPModalMensaje" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivModalMensaje" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header-warning">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="LblModalMensaje" runat="server" ClientIDMode="Static" Text="Atención"></asp:Label></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<asp:Label ID="LblModalMensajeCuerpo" runat="server" ClientIDMode="Static" Text="Atención"></asp:Label>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnmodalMensajeOK" runat="server" Text="Guardar" CssClass="btn btn-sm blue" OnClick="BtnmodalMensajeOK_Click" />
<asp:Button ID="BtnCerrarModalMensace" runat="server" Text="Corregir" CssClass="btn btn-sm green" data-dismiss="modal" />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -148,6 +148,29 @@ Partial Class ProductosyServicios
End Property End Property
#End Region #End Region
#Region "Material peligroso"
Property ValidaMaterialPeligrosoMensaje As Boolean
Get
If ViewState("ValidaMaterialPeligroso") Is Nothing Then
ViewState("ValidaMaterialPeligroso") = False
End If
Return Boolean.Parse(ViewState("ValidaMaterialPeligroso").ToString)
End Get
Set(value As Boolean)
ViewState("ValidaMaterialPeligroso") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -1213,6 +1236,15 @@ Partial Class ProductosyServicios
End Sub End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If DdlSATPS.txtValue.Value.ToEntero > 0 Then
If Not ValidaMaterialPeligrosoMensaje Then
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
Exit Sub
End If
End If
If DdlSATPS.SelectedValue.Contiene("46920", "0", "-1") AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158, 72, 80, 145) Then If DdlSATPS.SelectedValue.Contiene("46920", "0", "-1") AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158, 72, 80, 145) Then
Alert("El Producto Servicio SAT con clave '01010101' no es valido, por favor seleccione otro", TipoMensaje.MsgAdvertencia) Alert("El Producto Servicio SAT con clave '01010101' no es valido, por favor seleccione otro", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -3045,4 +3077,76 @@ Partial Class ProductosyServicios
End If End If
Return False Return False
End Function End Function
Sub ValidaMaterialPeligroso(CveSATPS As Integer)
Dim EsPeligroso As Boolean = False
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATProductosServicios(CveSATPS:=CveSATPS) Then
Dim DTDatos As New DataTable
DTDatos = ObjGrales.DtResultados.FiltraParametros($" CveSATPS= {CveSATPS}")
'Es material Peligros
If DTDatos.Rows(0)("EsPeligroso").ToString.ToEntero = 1 Then
If DdlMaterialPeligroso.txtValue.Value.ToEntero > 0 And DdlEmbalaje.txtValue.Value.ToEntero > 0 And TxtPesoKg.Text.Trim.Length > 0 Then
ValidaMaterialPeligrosoMensaje = True
Else
RegistraScript("$('#DivModalMensaje').modal('show');")
ValidaMaterialPeligrosoMensaje = False
LblModalMensajeCuerpo.Text = "El producto servicio del SAT seleccionado esta clasificado como material peligroso, favor de llenar los datos de la sección carta porte en la pestaña Contabilidad - Inventarios."
UPModalMensaje.Update()
End If
Else
'No es matgerial peligroso
If DdlMaterialPeligroso.txtValue.Value.ToEntero > 0 Or DdlEmbalaje.txtValue.Value.ToEntero > 0 Or TxtPesoKg.Text.Trim.Length > 0 Then
RegistraScript("$('#DivModalMensaje').modal('show');")
ValidaMaterialPeligrosoMensaje = False
LblModalMensajeCuerpo.Text = "El producto servicio del SAT seleccionado no esta clasificado como material peligroso, favor de limpiar los datos de la sección carta porte en la pestaña Contabilidad - Inventarios, el incluir estos datos en un material no peligroso generara errores al timbrar traslados."
UPModalMensaje.Update()
Else
ValidaMaterialPeligrosoMensaje = True
End If
End If
End If
ObjGrales.Dispose()
'Return Respuesta
End Sub
Protected Sub BtnmodalMensajeOK_Click(sender As Object, e As EventArgs)
ValidaMaterialPeligrosoMensaje = True
RegistraScript("$('#DivPersonalizar').modal('hide');")
BtnGuardar_Click(Nothing, Nothing)
End Sub
End Class End Class

View File

@@ -36,25 +36,25 @@
<div class="portlet light smmallpadding traspasorow bordered"> <div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 2;">Facturas Pendientes Por Respuesta</span> <span class="caption-subject bold uppercase" style="line-height: 1;">Facturas Pendientes Por Respuesta</span>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
</div> <div class="row" style="margin-left: 0px; text-align: right" align="left">
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px"> <div style="margin-right: 15px">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
</div> </div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente" DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%"> CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
@@ -84,25 +84,24 @@
<div id="DivRefacturar" runat="server" visible="false" class="portlet light smmallpadding traspasorow bordered"> <div id="DivRefacturar" runat="server" visible="false" class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 2;">Facturas Pendientes Por Refacturar</span> <span class="caption-subject bold uppercase" style="line-height: 2;">Facturas Pendientes de cancelar provenientes de refacturación</span>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
</div> <div class="row" style="margin-left: 0px; text-align: right" align="left">
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px"> <div style="margin-right: 15px">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvRefacturaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvRefacturaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefacturaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefacturaciones.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>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvRefacturaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación" <asp:GridView ID="GvRefacturaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente,FolioFiscalSustitucion" DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente,FolioFiscalSustitucion"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound"> CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
@@ -114,11 +113,9 @@
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Mon" DataField="Abreviatura" ItemStyle-Width="30px" /> <asp:BoundField HeaderText="Mon" DataField="Abreviatura" ItemStyle-Width="30px" />
<asp:BoundField HeaderText="Fecha Solicitud" DataField="FechaCambioEstatus" ItemStyle-Width="160px" /> <asp:BoundField HeaderText="Fecha Solicitud" DataField="FechaCambioEstatus" ItemStyle-Width="160px" />
<asp:BoundField HeaderText="Fecha Cancelacion" DataField="FechaCancelacion" ItemStyle-Width="160px" />
<asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" /> <asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" />
<asp:BoundField HeaderText="Serie Folio Nuevo" DataField="SerieFolioSustitucion" ItemStyle-Width="25%" /> <asp:HyperLinkField HeaderText="Folio Sustitución" DataTextField="SerieFolioSustitucion" DataNavigateUrlFields="CveVentaSustitucion" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:BoundField HeaderText="Folio Sustitucion" DataField="FolioFiscalSustitucion" ItemStyle-Width="25%" /> <asp:BoundField HeaderText="Motivo" DataField="MotivoCancelacion" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="Motivo" DataField="MotivoCancelacion" ItemStyle-Width="25%" />
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar"> <asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkValidarRefac" runat="server" OnClick="BtnValidarRefacturacion_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton> <asp:LinkButton ID="LnkValidarRefac" runat="server" OnClick="BtnValidarRefacturacion_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
@@ -129,7 +126,6 @@
<asp:LinkButton ID="LnkCancelar" Visible="false" runat="server" OnClick="BtnCancelarDocumento_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si"></asp:LinkButton> <asp:LinkButton ID="LnkCancelar" Visible="false" runat="server" OnClick="BtnCancelarDocumento_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:HyperLinkField HeaderText="Refacturación" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" /> <HeaderStyle CssClass="Titulos" />

View File

@@ -11,6 +11,7 @@ using System.Web.UI.WebControls;
using Extensiones; using Extensiones;
using static Extensiones.ModExtensiones; using static Extensiones.ModExtensiones;
using Microsoft.Reporting.WebForms; using Microsoft.Reporting.WebForms;
using System.Net.Http;
public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{ {
@@ -455,20 +456,20 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{ {
if (e.Row.RowType == DataControlRowType.DataRow) if (e.Row.RowType == DataControlRowType.DataRow)
{ {
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0) //if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0)
{ //{
e.Row.Cells[14].Text = ""; // e.Row.Cells[14].Text = "";
} //}
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) //if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
{ //{
e.Row.FCLinkButton("LnkValidarRefac").Visible = false; // e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
} //}
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0) if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{ {
e.Row.FCLinkButton("LnkCancelar").Visible = true; e.Row.FCLinkButton("LnkCancelar").Visible = true;
e.Row.FCLinkButton("LnkValidarRefac").Visible = false; //e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
} }
} }
} }
@@ -483,6 +484,32 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
Alert("No se encontro la factura para enviar el acuse", TipoMensaje.MsgAdvertencia); Alert("No se encontro la factura para enviar el acuse", TipoMensaje.MsgAdvertencia);
} }
} }
private byte[] DescargarPDF(string Parametros)
{
var Url = new Uri(string.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Parametros));
byte[] File = null;
try
{
using (var httpClient = new HttpClient())
{
httpClient.Timeout = new TimeSpan(0, 15, 0);
using (var request = new HttpRequestMessage(HttpMethod.Get, Url))
{
request.Headers.Add("ADSToken", Encripta(string.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", UsuarioActual.CveEmpresa, DateTime.UtcNow.Ticks, UsuarioActual.CveUsuario)));
var response = httpClient.SendAsync(request).Result;
if (response.StatusCode == System.Net.HttpStatusCode.OK)
File = response.Content.ReadAsByteArrayAsync().Result;
}
}
}
catch (Exception ex)
{
File = null;
this.OnError("Ocurrió un error al descargar la factura", ex);
}
return File;
}
public void ImprimeCancelacion(int CveVenta) public void ImprimeCancelacion(int CveVenta)
{ {
@@ -491,32 +518,34 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{ {
var ObjFactura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa); var ObjFactura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa);
string SelloCancelacion = ""; //string SelloCancelacion = "";
string FechaCancelacion = ""; //string FechaCancelacion = "";
DataTable DtDatos = null; //DataTable DtDatos = null;
using (ClsVentas ObjVentas = new ClsVentas()) //using (ClsVentas ObjVentas = new ClsVentas())
{ //{
if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) // if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa))
{ // {
DtDatos = ObjVentas.DtResultados.Copy(); // DtDatos = ObjVentas.DtResultados.Copy();
DataRow drv = DtDatos.Rows[0]; // DataRow drv = DtDatos.Rows[0];
SelloCancelacion = drv["SelloCancelacion"].ToString(); // SelloCancelacion = drv["SelloCancelacion"].ToString();
FechaCancelacion = drv["FechaCancelacion"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm:ss"); // FechaCancelacion = drv["FechaCancelacion"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm:ss");
} // }
} //}
List<ReportParameter> parametros = new List<ReportParameter>(); //List<ReportParameter> parametros = new List<ReportParameter>();
parametros.Add(new ReportParameter("FechaCancelacion", FechaCancelacion.ToString())); //parametros.Add(new ReportParameter("FechaCancelacion", FechaCancelacion.ToString()));
parametros.Add(new ReportParameter("FolioFiscal", ObjFactura.FolioFiscal)); //parametros.Add(new ReportParameter("FolioFiscal", ObjFactura.FolioFiscal));
parametros.Add(new ReportParameter("RFCEmisor", UsuarioActual.Empresa.RFC)); //parametros.Add(new ReportParameter("RFCEmisor", UsuarioActual.Empresa.RFC));
parametros.Add(new ReportParameter("SelloCancelacion", SelloCancelacion)); //parametros.Add(new ReportParameter("SelloCancelacion", SelloCancelacion));
byte[] ObjetoPDF = StreamPDF(@"Empresas\Grales\Formatos\AcuseCancelacion.rdlc", DtDatos, parametros, "AcuseCancelacion" + CveVenta); //byte[] ObjetoPDF = StreamPDF(@"Empresas\Grales\Formatos\AcuseCancelacion.rdlc", DtDatos, parametros, "AcuseCancelacion" + CveVenta);
byte[] ObjetoPDF = DescargarPDF(Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta)));
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>(); List <ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
string Asunto = string.Empty; string Asunto = string.Empty;
string Cuerpo = string.Empty; string Cuerpo = string.Empty;

View File

@@ -164,7 +164,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
DtVentas = ObjVentas.DtResultados DtVentas = ObjVentas.DtResultados
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
GvDatos.DataBind() GvDatos.DataBind()
@@ -315,7 +315,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
Dim FechaInicio As String = txtFechaI.Text Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text Dim FechaFin As String = txtFechaF.Text

View File

@@ -178,7 +178,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, If(CveVenta = -1, Orden, CveVenta), DdlClientes.SelectedValue.ToEntero, Sucursales, If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, If(CveVenta = -1, Orden, CveVenta), DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
DtVentas = ObjVentas.DtResultados DtVentas = ObjVentas.DtResultados
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
GvDatos.DataBind() GvDatos.DataBind()
@@ -299,7 +299,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales, If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
Dim FechaInicio As String = txtFechaI.Text Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text Dim FechaFin As String = txtFechaF.Text
@@ -361,7 +361,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales, If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
Dim FechaInicio As String = txtFechaI.Text Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text Dim FechaFin As String = txtFechaF.Text

View File

@@ -3341,7 +3341,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<asp:DropDownList ID="DdlCuentaEfectivo" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaEfectivo" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuentaEfectivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:CustomValidator ID="RFVCuenta" runat="server" ClientValidationFunction="ValidaCuentaEfectivo" ControlToValidate="DdlCuentaEfectivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3349,7 +3349,7 @@
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Credito:</label> <label class="col-md-2">Crédito:</label>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i> <i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox> <asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
@@ -3357,7 +3357,7 @@
</div> </div>
<div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right: -40px"> <div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right: -40px">
<asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:CustomValidator ID="RequiredFieldValidator1" runat="server" ClientValidationFunction="ValidaCuentaCredito" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false" style="text-align: right;"> <div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false" style="text-align: right;">
@@ -3377,7 +3377,7 @@
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Debito:</label> <label class="col-md-2">Débito:</label>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i> <i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteDebito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox> <asp:TextBox ID="TxtImporteDebito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
@@ -3385,7 +3385,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<asp:DropDownList ID="DdlCuentaTarjetaDebito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaTarjetaDebito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="DdlCuentaTarjetaDebito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:CustomValidator ID="RequiredFieldValidator4" runat="server" ClientValidationFunction="ValidaCuentaDebito" ControlToValidate="DdlCuentaTarjetaDebito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3400,7 +3400,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<asp:DropDownList ID="DdlCuentaCheque" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaCheque" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DdlCuentaCheque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:CustomValidator ID="RequiredFieldValidator3" runat="server" ClientValidationFunction="ValidaCuentaCheque" ControlToValidate="DdlCuentaCheque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3416,7 +3416,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<asp:DropDownList ID="DdlCuentaTransferencia" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaTransferencia" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTransferencia" runat="server" ControlToValidate="DdlCuentaTransferencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:CustomValidator ID="RFVTransferencia" runat="server" ClientValidationFunction="ValidaCuentaTransferencia" ControlToValidate="DdlCuentaTransferencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCETransferencia" runat="server" HighlightCssClass="vco" TargetControlID="RFVTransferencia" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCETransferencia" runat="server" HighlightCssClass="vco" TargetControlID="RFVTransferencia" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3480,6 +3480,8 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<asp:HiddenField ID="HdnCambioFaltante" runat="server" Value="1" ClientIDMode="Static" />
<%--<asp:HiddenField ID="HdnPagadoContado" runat="server" Value="0" ClientIDMode="Static" />--%>
</div> </div>
<label id="lblCambio" class="col-md-2">Cambio:</label> <label id="lblCambio" class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
@@ -5723,7 +5725,7 @@
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" /> <asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" /> <asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" /> <asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
<asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" />
<%--FLETES--%> <%--FLETES--%>
<div id="ModalFletes" class="modal ADS fade" role="dialog"> <div id="ModalFletes" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpFletes" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpFletes" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
@@ -7078,10 +7080,10 @@
</div> </div>
<div class="row" id="DivRelacionadasCancelacion" runat="server" visible="false"> <div class="row" id="DivRelacionadasCancelacion" runat="server" visible="false">
<div class="col-md-6"> <div class="col-md-12">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
Facturas Padre Facturas que impiden su cancelación
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -7095,9 +7097,8 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> <%-- <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
Facturas Hijo Facturas Hijo
@@ -7115,7 +7116,7 @@
</div> </div>
</div> </div>
</div> </div>--%>
</div> </div>
<br /> <br />
<div class="row" id="DivMotivoCancelacion" runat="server"> <div class="row" id="DivMotivoCancelacion" runat="server">
@@ -7749,6 +7750,7 @@
<asp:ListItem Value="1" Text="Importe"></asp:ListItem> <asp:ListItem Value="1" Text="Importe"></asp:ListItem>
<asp:ListItem Value="2" Text="Vencimiento"></asp:ListItem> <asp:ListItem Value="2" Text="Vencimiento"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoAut" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlTipoAutorizacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
<label for="<%= DdlTipoAutorizacion.ClientID.ToString()%>">Tipo Autorización:</label> <label for="<%= DdlTipoAutorizacion.ClientID.ToString()%>">Tipo Autorización:</label>
</div> </div>
<div id="DivDiasVencidos" runat="server" visible="false" class="row"> <div id="DivDiasVencidos" runat="server" visible="false" class="row">
@@ -7800,24 +7802,54 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-12">
<label>Motivo:</label> <asp:Label ID="LbExtraRefacturacion" runat="server"></asp:Label>
</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlMotivoRefacturacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="MotivoCancelacion" DataValueField="CveMotivoCancelacion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlMotivoRefac" runat="server" CssClass="help-block errorimput" Display="Dynamic" InitialValue="-1" ControlToValidate="DdlMotivoRefacturacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMotivo"></asp:RequiredFieldValidator>
</div> </div>
</div> </div>
<div class="row"> <div class="row" id="DivRelacionadasRefacturacion" runat="server" visible="false">
<div class="col-md-2"> <div class="col-md-12">
<label>Descripción:</label> <div class="row">
</div> <div class="col-md-12">
<div class="col-md-10"> Facturas que impiden su cancelación
<asp:TextBox ID="TxtMotivoRefac" runat="server" Height="100" Width="100%" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox> </div>
<asp:RequiredFieldValidator ID="RFVTxtMotivoRefac" runat="server" Display="Dynamic" CssClass="help-block errorimput" ControlToValidate="TxtMotivoRefac" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMotivo"></asp:RequiredFieldValidator> </div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvFacturasPadreRefacturar" runat="server" DataKeyNames="CveVenta" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="" GridLines="None">
<Columns>
<asp:HyperLinkField DataTextField="SerieFolio" HeaderText="Serie Folio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
<asp:BoundField DataField="FolioFiscal" HeaderText="Folio Fiscal" />
</Columns>
</asp:GridView>
</div>
</div>
</div> </div>
</div> </div>
<div class="row" id="DivMotivoRefacturacionTexto" runat="server">
<div class="col-md-12">
<div class="row">
<div class="col-md-2">
<label>Motivo:</label>
</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlMotivoRefacturacion" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="MotivoCancelacion" DataValueField="CveMotivoCancelacion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlMotivoRefac" runat="server" CssClass="help-block errorimput" Display="Dynamic" InitialValue="-1" ControlToValidate="DdlMotivoRefacturacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMotivo"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label>Descripción:</label>
</div>
<div class="col-md-10">
<asp:TextBox ID="TxtMotivoRefac" runat="server" Height="100" Width="100%" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtMotivoRefac" runat="server" Display="Dynamic" CssClass="help-block errorimput" ControlToValidate="TxtMotivoRefac" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMotivo"></asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:LinkButton ID="BtnMotivoRefacturacion" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpMotivo"> Refacturar</asp:LinkButton> <asp:LinkButton ID="BtnMotivoRefacturacion" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpMotivo"> Refacturar</asp:LinkButton>
@@ -7836,6 +7868,61 @@
$("#BtnDirClienteValidar").click(); $("#BtnDirClienteValidar").click();
} }
function ValidaCuentaEfectivo(val, args) {
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
var totalPago = ToDouble($get("TxtImporteEfectivo").value);
if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
}else
{
args.IsValid = true;
}
}
function ValidaCuentaCredito(val, args) {
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
var totalPago = ToDouble($get("TxtImporteCredito").value);
if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
}else
{
args.IsValid = true;
}
}
function ValidaCuentaDebito(val, args) {
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
var totalPago = ToDouble($get("TxtImporteDebito").value);
if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
}else
{
args.IsValid = true;
}
}
function ValidaCuentaCheque(val, args) {
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
var totalPago = ToDouble($get("TxtImporteCheque").value);
if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
}else
{
args.IsValid = true;
}
}
function ValidaCuentaTransferencia(val, args) {
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
var totalPago = ToDouble($get("TxtImporteTransferencia").value);
if (totalPago > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
}else
{
args.IsValid = true;
}
}
//FUNCIONES PARA COMERCIO EXTERIOR //FUNCIONES PARA COMERCIO EXTERIOR
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) { function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2); TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
@@ -8868,14 +8955,16 @@
} catch (e) { } } catch (e) { }
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC + totalAmortizado + totalProntoPago; var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC + totalAmortizado + totalProntoPago;
var totalVenta = ToDouble($get('TxtTotal').value); var totalVenta = ToDouble($get('TxtTotal').value);// - ToDouble($get('HdnPagadoContado').value);
if (total > totalVenta) { if (total > totalVenta) {
lblCambio.innerHTML = "Cambio:" lblCambio.innerHTML = "Cambio:";
HdnCambioFaltante.value = "1";
$get("TxtCambio").value = FormatoNumero(total - totalVenta); $get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else { } else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(531) %>' == '1') { if ('<%= UsuarioActual.Empresa.Funcionalidad(531) %>' == '1') {
lblCambio.innerHTML = "Faltante:" lblCambio.innerHTML = "Faltante:";
HdnCambioFaltante.value = "2";
$get("TxtCambio").value = FormatoNumero(total - totalVenta, 2); $get("TxtCambio").value = FormatoNumero(total - totalVenta, 2);
} else { } else {
$get("TxtCambio").value = "$0.00" $get("TxtCambio").value = "$0.00"
@@ -9225,7 +9314,8 @@
$('#BtnMateriales').click(); $('#BtnMateriales').click();
} }
function BtnEnviarMailCancelacion() { function BtnEnviarMailCancelacion(CveVenta) {
HdnCveVentaAcuse.value = CveVenta;
$('#BtnEnviarMailCancelacion').click(); $('#BtnEnviarMailCancelacion').click();
} }
function BtnRefacturacionConfirmar() { function BtnRefacturacionConfirmar() {
@@ -9244,6 +9334,10 @@
$('#BtnAplicaNuevaNC').click(); $('#BtnAplicaNuevaNC').click();
} }
function BtnAplicaNuevaNC() {
$('#BtnAplicaNuevaNC').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });

File diff suppressed because it is too large Load Diff