diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index eacb04c20..e4b936d10 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -945,7 +945,7 @@ Public Class ClsBancos Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean - If FechaTimbrado = MinFecha Then FechaTimbrado = DateTime.Now + Dim Serie As String = "Pag" Dim Folio As Integer = -1 Dim Retorno As Boolean = False @@ -961,6 +961,33 @@ Public Class ClsBancos 'If EsCancelacion Then Estatus = 2 If EsRegeneracion Then Estatus = 3 + If FechaTimbrado = MinFecha Then + Dim RowFiltro As DataRow = Nothing + + RowFiltro = dttpagos.FiltroPrimero("") + + If RowFiltro IsNot Nothing Then + If Now.EsHorarioVerano Then + Dim UTCOffsetVerano As Integer = RowFiltro("UTCOffsetVerano").ToString().ToEntero() + If UTCOffsetVerano <> 0 Then + FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetVerano) + Else + FechaTimbrado = DateTime.Now + End If + Else + Dim UTCOffsetInvierno As Integer = RowFiltro("UTCOffsetInvierno").ToString().ToEntero() + If UTCOffsetInvierno <> 0 Then + FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetInvierno) + Else + FechaTimbrado = DateTime.Now + End If + End If + Else + FechaTimbrado = DateTime.Now + End If + + End If + Dim tCveComplementoPago As Integer = AddComplementoPago(If(CvePrePoliza > 0, CveIE, dr("CveIE").ToString.ToEntero), -1, Serie, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza, Estatus:=Estatus) If tCveComplementoPago > 0 Then @@ -4089,12 +4116,13 @@ Public Class ClsBancos #Region "CONCILIACIÓN BANCARIA" - Public Function UpdateConciliacionBancaria(CveIE As Integer, FechaAplicado As Date) As Boolean + Public Function UpdateConciliacionBancaria(CveIE As Integer, FechaAplicado As Date, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_ConciliacionBancariaUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@FechaAplicado", SqlDbType.Date).Value = FechaAplicado + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) @@ -4188,12 +4216,13 @@ Public Class ClsBancos Return Retorno End Function - Public Function DesconciliarIE(CveIE As Integer, FechaDesconciliado As Date) As Boolean + Public Function DesconciliarIE(CveIE As Integer, FechaDesconciliado As Date, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_IEDesconciliar") With SqlAdapter.SelectCommand.Parameters .Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@FechaDesconciliado", SqlDbType.Date).Value = FechaDesconciliado + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1fc7ddb54..0cceddab1 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1758,12 +1758,12 @@ Public Class ClsPaginas End Property Property GlobalDTContratosTipos(CveEmpresa As Integer) As DataTable Get - Dim AppNombre As String = String.Format("GlobalDTContratosTipos-{0}", CveEmpresa) + Dim AppNombre As String = "GlobalDTContratosTipos" 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjContratos As New ClsContratos - If ObjContratos.GetContratosTipos(CveEmpresa) Then Application(AppNombre) = ObjContratos.DtResultados + If ObjContratos.GetContratosTipos(-1) Then Application(AppNombre) = ObjContratos.DtResultados ObjContratos.Dispose() End If @@ -1771,7 +1771,7 @@ Public Class ClsPaginas End Get Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTContratosTipos-{0}", CveEmpresa) + Dim AppNombre As String = "GlobalDTContratosTipos" Application(AppNombre) = value End Set End Property diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index f809ab9d8..f58fdce07 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -494,7 +494,7 @@ Public Class ClsProductosServicios If Ex1.Message.Contains("Número: 2627;") Then Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) ElseIf Ex1.Message.Contains("Número: 2601;") Then - Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia) + Alert("El Nuevo Producto o Servicio tiene Codigo duplicado:" & Codigo, TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6a4739cf8..9e3fe70cf 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1346,7 +1346,7 @@ Public Class ClsVentas Public Function GetRepVentas(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, - Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1) As Boolean + Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRep") @@ -1373,6 +1373,7 @@ Public Class ClsVentas .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable End With Try @@ -1477,7 +1478,7 @@ Public Class ClsVentas Vendedor As String, CveUsuario As Integer, CveEstatus As String, FechaI As Date, FechaF As Date, CveCorte As Integer, TipoDocto As String, CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, - Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1) As Boolean + Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRepDetalle") @@ -1509,6 +1510,7 @@ Public Class ClsVentas .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 7ce9cd07e..d6b72340c 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4707,7 +4707,7 @@ Namespace Modelos If CveMovimientoDevolucion > 0 Then For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero) Then ErrorCancelar = True MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." Exit For @@ -4810,7 +4810,7 @@ Namespace Modelos 'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL - If Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowMovimiento("CveMovimiento").ToString().ToEntero(), ObjInventario) Then + If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowMovimiento("CveMovimiento").ToString().ToEntero(), ObjInventario) Then ErrorCancelar = True MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." End If @@ -4824,6 +4824,10 @@ Namespace Modelos End If End If + If ErrorCancelar Then + Exit For + End If + Next 'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN ORGINAL (GENERAL,SIN COSTO) @@ -4857,6 +4861,10 @@ Namespace Modelos End If Next + If ErrorCancelar Then + Exit For + End If + Next End If @@ -5297,7 +5305,7 @@ Namespace Modelos Exit For End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero()) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero(), CveSeccionAlmacen:=-3) Then ErrorCancelar = True Exit For End If @@ -5320,7 +5328,7 @@ Namespace Modelos If Not ErrorCancelar Then If DtEntradaDetalle IsNot Nothing Then For Each Dr As DataRow In DtEntradaDetalle.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=-3) Then ErrorCancelar = True Exit For End If @@ -6097,6 +6105,28 @@ Namespace Modelos Public Sub SetCliente() If CveCliente > 0 Then Cliente = New Modelos.ClienteModel(CveCliente, CveEmpresa) + If Me.CveClienteSucursal > 0 Then + Dim ObjCliente As New ClsClientes() + If ObjCliente.GetSucursales(CveCliente, Me.CveClienteSucursal) AndAlso ObjCliente.DtResultados.Rows.Count > 0 Then + Me.ClienteSucursal = New Modelos.SucursalModel(ObjCliente.DtResultados.Rows(0)) + End If + ObjCliente.Dispose() + Else + Me.ClienteSucursal = New Modelos.SucursalModel() + Me.ClienteSucursal.NoExt = Cliente.NoExt + Me.ClienteSucursal.NoInt = Cliente.NoInt + Me.ClienteSucursal.Localidad = Cliente.Localidad + Me.ClienteSucursal.Direccion = Cliente.Direccion + Me.ClienteSucursal.Colonia = Cliente.Colonia + Me.ClienteSucursal.Municipio = Cliente.Localidad + Me.ClienteSucursal.Estado = Cliente.Estado + Me.ClienteSucursal.CP = Cliente.CP + Me.ClienteSucursal.Pais = Cliente.Pais + Me.ClienteSucursal.CorreoSucursal = Cliente.CorreoCotizacion + Me.ClienteSucursal.TelefonoSucursal = Cliente.Telefono + Me.ClienteSucursal.Sucursal = Cliente.Sucursal + Me.ClienteSucursal.ImprimeNombreSucursal = Cliente.ImprimeNombreSucursal.ToString() + End If End If End Sub Public Sub SetMoneda() @@ -9435,7 +9465,8 @@ Namespace Modelos Public Property ClaveSATColonia As String Public Property ClaveSATCP As String Public Property EsDistribuidor As Boolean - + Public Property CorreoCotizacion As String + Public Property ImprimeNombreSucursal As Integer End Class diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index 62f9142a4..2ff487e3a 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -178,7 +178,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then For Each DrE As DataRow In DtDatosEdoCuenta.Rows If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then - If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate)) Or Not ObjBancos.UpdateIEEstadoCuenta(DrE("CveIEEstadoCuenta").ToString.ToEntero, DrE("Importe").ToString.ToDouble, True, Dr("CveIE").ToString.ToEntero, + If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Or Not ObjBancos.UpdateIEEstadoCuenta(DrE("CveIEEstadoCuenta").ToString.ToEntero, DrE("Importe").ToString.ToDouble, True, Dr("CveIE").ToString.ToEntero, DrE("Referencia").ToString, DrE("Tipo").ToString, DrE("FechaDocumento").ToString.ToDate, DrE("CveCuenta").ToString.ToEntero) Then ErrorTrans = True Else @@ -283,7 +283,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx Dim CveIE As Integer = 0 For Each Gvr As GridViewRow In GvDatos.Rows If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then - If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)) Then + If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Then ErrorTrans = True Else If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then @@ -350,7 +350,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx For Each Gvr As GridViewRow In GvDatos.Rows If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then Selecciono = True - If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)) Then + If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Then ErrorTrans = True Else If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then @@ -402,7 +402,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx Dim ErrorTrans As Boolean = False If ModalidadDesconciliar = "D" Then - If ObjBancos.DesconciliarIE(CveIEDesconciliar, TxtFechaDesconciliado.Text.ToDate()) Then + If ObjBancos.DesconciliarIE(CveIEDesconciliar, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario) Then If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIEDesconciliar) Then ErrorTrans = True End If @@ -412,7 +412,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx ElseIf ModalidadDesconciliar = "DT" Then For Each Gvr As GridViewRow In GvDatos.Rows If Gvr.FCCheckBox("ChkConciliado").Checked And Not Gvr.FCCheckBox("ChkConciliado").Enabled Then - If Not ObjBancos.DesconciliarIE(Gvr.DataKey("CveIE").ToEntero, TxtFechaDesconciliado.Text.ToDate()) Then + If Not ObjBancos.DesconciliarIE(Gvr.DataKey("CveIE").ToEntero, TxtFechaDesconciliado.Text.ToDate(), UsuarioActual.CveUsuario) Then ErrorTrans = True Else If Not ObjOI.AddEventoBitacora("El pago ha sido desconciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then diff --git a/Bancos/RepComplementoPago.aspx b/Bancos/RepComplementoPago.aspx index 9b28d447a..06af838af 100644 --- a/Bancos/RepComplementoPago.aspx +++ b/Bancos/RepComplementoPago.aspx @@ -114,7 +114,7 @@ diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb index bcfde9140..629fa321f 100644 --- a/Bancos/RepComplementoPago.aspx.vb +++ b/Bancos/RepComplementoPago.aspx.vb @@ -51,28 +51,44 @@ Partial Class Bancos_RepComplementoPago For Each gvr As GridViewRow In GvD.Rows - If gvr.FCCheckBox("Chk").Checked Then - Dim Banco As New ClsBancos - Banco.IniciaTransacSQL() - - - If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual) Then - If Banco.Mensaje = "" Then - Banco.Commit() - PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) - Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) - Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - Str.AppendFormat("{1}   {2}
", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente")) - MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo")) - End If - - Else - Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje) - Banco.RollBack() + If gvr.FCCheckBox("Chk").Checked Then + Dim FechaTimbrado As DateTime = DateTime.Now + + Dim UTCOffset As Integer = 0 + + If Now.EsHorarioVerano Then + If gvr.DataKey("UTCOffsetVerano").ToEntero() <> 0 Then + UTCOffset = gvr.DataKey("UTCOffsetVerano").ToEntero() + End If + Else + If gvr.DataKey("UTCOffsetInvierno").ToEntero() <> 0 Then + UTCOffset = gvr.DataKey("UTCOffsetInvierno").ToEntero() + End If End If + If UTCOffset <> 0 Then + FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffset) + End If + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + + If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then + If Banco.Mensaje = "" Then + Banco.Commit() + PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) + Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) + Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + Str.AppendFormat("{1}   {2}
", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente")) + MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo")) + End If + + Else + Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje) + Banco.RollBack() + End If + Banco.Dispose() End If Next diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 6bc7a4144..a9908b91c 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -6,6 +6,8 @@ Imports System.Data Imports Microsoft.Reporting.WebForms Imports System.Xml Imports System.IO +Imports iTextSharp.text +Imports iTextSharp.text.pdf Imports Stimulsoft.Report Imports Stimulsoft.Report.Components @@ -283,6 +285,12 @@ Partial Class PopUpVerFactura End If End If + If UrlParametros("OP").ToString = "Etiqueta" Then + If UrlParametros("CVEMOVIMIENTO") IsNot Nothing AndAlso UrlParametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then + ImprimirEtiqueta(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, UrlParametros("MODALIDAD").ToString) + End If + End If + 'IMPRIME OC If UrlParametros("OP").ToString = "OC" Then If UrlParametros("CVEOC") IsNot Nothing AndAlso UrlParametros("CVEOC").ToString.ToEntero > 0 Then @@ -4320,7 +4328,82 @@ Partial Class PopUpVerFactura ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios") End If - End Sub + End Sub #End Region - + +#Region "OP = Etiqueta - Etiquetas de recepcion" + Private Sub ImprimirEtiqueta(CveMovimiento As Integer, Modalidad As String) + + Dim ObjInventarios As New ClsInventarios + + Dim All As Byte() + Using ms As New MemoryStream + Using d As New Document + Using Copy As New PdfCopy(d, ms) + d.Open() + If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + If ObjInventarios.DtResultados IsNot Nothing Then + For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows + Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero + Dim Lote As String = DetalleRow.Item("Lote").ToString + Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate + Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString) + If Modalidad = "Individual" Then + Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS) + + Dim reader As New PdfReader(reporteByte) + Dim Paginas As Integer = reader.NumberOfPages + Dim Contador As Integer = 0 + While Contador < Paginas + Contador += 1 + Copy.AddPage(Copy.GetImportedPage(reader, Contador)) + End While + Else + Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1 + + For contador As Integer = 0 To Cant + Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS) + + Dim reader As New PdfReader(reporteByte) + Dim Paginas As Integer = reader.NumberOfPages + Dim Cont As Integer = 0 + While Cont < Paginas + Cont += 1 + Copy.AddPage(Copy.GetImportedPage(reader, Cont)) + End While + Next + End If + Next + End If + End If + d.Close() + + End Using + End Using + All = ms.ToArray() + End Using + ImprimirbytesPDF(All, "Etiquetas") + + + If Modalidad = "Individual" Then + Else + + End If + ObjInventarios.Dispose() + End Sub + + Private Function GenerarEtiqueta(CvePS As Integer, Lote As String, FechaCaducidad As Date, PS As String) As Byte() + Dim QrDescarga As String = "" + Dim Cfdi As New RVCFDI33.GeneraCFDI() + Dim b As Byte() = Cfdi.ConvertirQrCode(String.Format("?CvePS={0}&Lote={1}&Fecha={2}", CvePS, Lote, Format(FechaCaducidad, "dd/MM/yyyy").ToString())) + QrDescarga = Convert.ToBase64String(b) + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("QR", QrDescarga)) + params.Add(New ReportParameter("PS", PS)) + params.Add(New ReportParameter("Lote", Lote)) + params.Add(New ReportParameter("FechaCad", FechaCaducidad.ToString())) + Return StreamPDF("Empresas/Grales/Formatos/EtiquetaDeRecepcion.rdlc", New DataTable, params) + End Function +#End Region + End Class diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 76daa0c7d..5d6e0d999 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -335,6 +335,141 @@ + + true + true + true + + + + + Sonora: Veracruz (662) 210-0041 - Morelos (662) 211-0805 - Colosio (662) 2608088 - Colosio2 (662) 1189939 - Reforma (662) 213-8724 - Perisur (662) 254-4849 - Rodríguez (662) 213-0388 + + + + + + + + + Sahuaro (662) 2161471 - Solidaridad (662) 216-0935 - Palo Verde (662) 4363254 - Progreso (662) 3105781 - Quiroga (662) 261- 0838 - Caborca (637) 3724214 - Magdalena (632) 322-4080 + + + + + + + + + Nogales (631) 319-0093 - Cananea (645) 332 20 40 - Guaymas (622) 222-2417 - Obregón (644)412-2002 Obregón II (644) 413-1543- Obregón III (644) 4134501 - Navojoa (642) 422-9852 + + + + + + + + + Sinaloa: Los Mochis (668) 817-0209 - Los Mochis II (668) 176-5802 - Guasave (687) 871-5317 - Calzada (667) 729-2112 - Zapata (667) 992-0876 - Tierra Blanca (667) 716-6997 - Sanalona (667) 713-667 + + + + + + + + + Tres Ríos (667) 455-4621 - Mazatlán (669) 910-2122 - Baja California: Tijuana1 (664) 622-5221 - Tijuana3 (664) 626-2615 - Rosarito (661) 612-4461 - Mexicali (686) 567-6102 - Mexicali3 (686) 326 02 79 + + + + + + + + + Tecate (665) 5212080 - Ensenada (646) 172-4075 - Ensenada2 (646) 176-2703 - Baja California Sur: La Paz (612) 146-3656 - La Paz 2 (612) 121-3185 - Los Cabos (624) 688 3552 + + + + + + + Textbox4 + 9.91718cm + 0.22108cm + 2.03224cm + 20.79751cm + + + 2pt + 2pt + 2pt + 2pt + + @@ -477,10 +612,11 @@ true - 6.06618in + 6.31618in 0.06752in 1.42169in 8.23953in + 1 @@ -1275,7 +1411,7 @@ 0.09836in 0.36206in 8.16629in - 1 + 2 @@ -1297,11 +1433,11 @@ Textbox5 - 8.32309cm + 9.27559cm 0.28014cm 0.05496cm 20.88652cm - 2 + 3 @@ -1345,11 +1481,11 @@ Textbox1 - 8.41332cm + 9.36582cm 2.01402cm 0.51608cm 19.15264cm - 3 + 4 @@ -1368,7 +1504,7 @@ 1.15361cm 2.413cm 2.75323cm - 4 + 5 @@ -1448,7 +1584,7 @@ 4.32565cm 2.70968cm 7.93893cm - 5 + 6 @@ -1528,7 +1664,7 @@ 12.68838cm 2.70968cm 5.11312cm - 6 + 7 @@ -1562,7 +1698,7 @@ 18.23008cm 0.96018cm 2.79101cm - 7 + 8 @@ -1598,7 +1734,7 @@ 18.23008cm 0.6cm 2.79101cm - 8 + 9 @@ -1649,7 +1785,7 @@ 18.23008cm 0.86903cm 2.79101cm - 9 + 10 @@ -1740,7 +1876,7 @@ 0.28014cm 1.09007cm 9.71199cm - 10 + 11 @@ -1820,7 +1956,7 @@ 10.06268cm 0.7927cm 9.71199cm - 11 + 12 @@ -2001,7 +2137,7 @@ 0.25136cm 0.74611cm 13.82025cm - 12 + 13 @@ -2034,7 +2170,7 @@ 14.07729cm 0.57354cm 2.90753cm - 13 + 14 @@ -2068,11 +2204,11 @@ Textbox4 - 5.8751cm + 6.1926cm 1.74571cm 1.05328cm 17.71415cm - 14 + 15 =IIF((Sum(IIF(Fields!CveClasificacion.Value = 20345,1,0), "DsOC") > 0),false,true) @@ -2086,142 +2222,6 @@ 2pt - - true - true - true - - - - - Sonora: Veracruz (662) 210-0041 - Morelos (662) 211-0805 - Colosio (662) 2608088 - Colosio2 (662) 1189939 - Reforma (662) 213-8724 - Perisur (662) 254-4849 - Rodríguez (662) 213-0388 - - - - - - - - - Sahuaro (662) 2161471 - Solidaridad (662) 216-0935 - Palo Verde (662) 4363254 - Progreso (662) 3105781 - Quiroga (662) 261- 0838 - Caborca (637) 3724214 - Magdalena (632) 322-4080 - - - - - - - - - Nogales (631) 319-0093 - Cananea (645) 332 20 40 - Guaymas (622) 222-2417 - Obregón (644)412-2002 Obregón II (644) 413-1543- Obregón III (644) 4134501 - Navojoa (642) 422-9852 - - - - - - - - - Sinaloa: Los Mochis (668) 817-0209 - Los Mochis II (668) 176-5802 - Guasave (687) 871-5317 - Calzada (667) 729-2112 - Zapata (667) 992-0876 - Tierra Blanca (667) 716-6997 - Sanalona (667) 713-667 - - - - - - - - - Tres Ríos (667) 455-4621 - Mazatlán (669) 910-2122 - Baja California: Tijuana1 (664) 622-5221 - Tijuana3 (664) 626-2615 - Rosarito (661) 612-4461 - Mexicali (686) 567-6102 - Mexicali3 (686) 326 02 79 - - - - - - - - - Tecate (665) 5212080 - Ensenada (646) 172-4075 - Ensenada2 (646) 176-2703 - Baja California Sur: La Paz (612) 146-3656 - La Paz 2 (612) 121-3185 - Los Cabos (624) 688 3552 - - - - - - - Textbox4 - 8.96468cm - 0.22108cm - 2.03224cm - 20.79751cm - 15 - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -2237,7 +2237,7 @@ Textbox5 - 12.60759cm + 13.24259cm 0.24983cm 0.05496cm 20.88652cm @@ -2253,57 +2253,6 @@ 2pt - - Embedded - ID3 - FitProportional - 21.4598cm - 0.28014cm - 0.93046cm - 5.37042cm - 17 - - - - - - true - true - - - - - DESCARGA NUESTRA NUEVA APLICACIÓN - - - - - - - Textbox60 - 19.12502cm - 0.28014cm - 0.6882cm - 20.71217cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -2346,7 +2295,7 @@ 17.09066cm 0.64028cm 3.90165cm - 19 + 17 @@ -2509,11 +2458,11 @@ Textbox4 - 12.76838cm + 13.40338cm 0.16383cm 2.44366cm 15.51057cm - 20 + 18 @@ -2544,11 +2493,11 @@ Textbox19 - 5.01303in + 5.26303in 6.21617in 0.17708in 0.94607in - 21 + 19 @@ -2579,11 +2528,11 @@ Textbox19 - 5.2055in + 5.4555in 6.21616in 0.17966in 0.94607in - 22 + 20 @@ -2614,11 +2563,11 @@ Textbox19 - 5.40449in + 5.65449in 6.21616in 0.18819in 0.94607in - 23 + 21 @@ -2649,11 +2598,11 @@ Textbox19 - 5.61074in + 5.86074in 6.22658in 0.17119in 0.94607in - 24 + 22 @@ -2685,11 +2634,11 @@ Textbox19 - 5.80137in + 6.05137in 6.237in 0.19596in 0.94607in - 25 + 23 @@ -2721,11 +2670,11 @@ Textbox42 - 5.03803in + 5.28803in 7.16224in 0.17708in 0.98426in - 26 + 24 @@ -2756,11 +2705,11 @@ Textbox42 - 5.2305in + 5.4805in 7.16224in 0.17966in 0.98425in - 27 + 25 @@ -2791,11 +2740,11 @@ Textbox42 - 5.42949in + 5.67949in 7.17266in 0.18819in 0.98425in - 28 + 26 @@ -2827,11 +2776,11 @@ Textbox42 - 5.63574in + 5.88574in 7.17266in 0.17119in 0.98425in - 29 + 27 @@ -2863,11 +2812,11 @@ Textbox42 - 5.82637in + 6.07637in 7.18308in 0.19596in 0.98425in - 30 + 28 @@ -2904,7 +2853,7 @@ 6.75122cm 0.82021cm 5.51336cm - 31 + 29 @@ -2930,11 +2879,11 @@ Textbox5 - 15.2826cm + 15.9176cm 0.10579cm 0.05496cm 20.88652cm - 32 + 30 @@ -2946,55 +2895,6 @@ 2pt - - true - true - true - - - - - ** SI LAS LLANTAS NO SON INSTALADAS EN ECONOLLANTAS PIERDE SU GARANTÍA DE FABRICA ** - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -3018,11 +2918,249 @@ Textbox4 - 12.13048cm + 12.79723cm 0.19008cm 0.40655cm 12.88812cm + 31 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + + + Embedded + rockblade + FitProportional + 12.06211cm + 6.5919cm + 0.62223cm + 4.03523cm 34 + + + + + + Embedded + yokohama2 + FitProportional + 12.06211cm + 0.58737cm + 0.62223cm + 4.03523cm + 35 + + + + + + Embedded + mastercraft + FitProportional + 12.12228cm + 17.02729cm + 0.62223cm + 4.03523cm + 36 + + + + + + Embedded + coopertires + FitProportional + 12.18225cm + 11.79701cm + 0.62223cm + 4.03523cm + 37 + + + + + + true + true + true + + + + + ESTAS LLANTAS SOLO TENDRAN GARANTÍA DE POR VIDA CONTRA DEFECTO DE FABRICA. +*SI LAS LLANTAS NO SON INSTALADAS EN ECONOLLANTAS PIERDE SU GARANTÍA DE FABRICA*. + + + + =IIF(IIF((Sum(IIF(Fields!CveClasificacion.Value = 20345,1,0), "DsOC") = 0) and (Sum(IIF(Fields!CveClasificacion.Value = 20342 or Fields!CveClasificacion.Value = 20341,1,0), "DsOC") > 0),false,true),"","<br/>**EL CLIENTE NO ACEPTA PÓLIZA DE SEGURO**") + HTML + + + + + + + + + PARA UNA OPTIMA DURACION DE SUS LLANTAS, ESTAS DEBEN ALINEARSE BALANCEARSE Y ROTAR CADA 6 MESES O 1O MIL KILOMETROS. + + + + PARA HACER VALIDA UNA RECLAMACIÓN DEBERAN CUMPLIR CON EL ANTERIOR REQUISITO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + ID3 + FitProportional + 22.13416cm + 0.22725cm + 0.93046cm + 5.37042cm + 39 + + + + + + true + true + + + + + DESCARGA NUESTRA NUEVA APLICACIÓN + + + + + + + Textbox60 + 19.79938cm + 0.22725cm + 0.6882cm + 20.71217cm + 40 @@ -3038,11 +3176,11 @@ =System.Convert.FromBase64String(Parameters!QRDescarga.Value) image/png FitProportional - 8.0685in - 6.67743in + 8.33399in + 6.65661in 0.6035in 0.78275in - 35 + 41 @@ -3091,11 +3229,11 @@ Textbox60 - 19.5698cm - 0.28014cm + 20.24416cm + 0.22725cm 1.49135cm 5.37042cm - 36 + 42 @@ -3106,68 +3244,6 @@ 2pt - - true - true - - - - - - - - Black - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - Black - 2pt - 2pt - 2pt - 2pt - - true true @@ -3246,11 +3322,11 @@ Textbox60 - 19.5698cm - 7.45145cm + 20.24416cm + 7.39856cm 2.45709cm 6.56105cm - 39 + 43 @@ -3285,11 +3361,11 @@ Textbox60 - 19.56002cm - 14.67145cm + 20.23438cm + 14.61856cm 1.46939cm 6.32076cm - 40 + 44 @@ -3300,68 +3376,24 @@ 2pt - - Embedded - rockblade - FitProportional - 11.19428cm - 5.58835cm - 0.86918cm - 4.08628cm - 41 + + + Start + + true + 19.90494cm + 0cm + 3.07798cm + 21.09991cm + 45 - - - Embedded - yokohama2 - FitProportional - 11.33186cm - 0.58737cm - 0.65751cm - 4.35272cm - 42 - - - - - - Embedded - mastercraft - FitProportional - 11.30011cm - 17.06617cm - 0.93972cm - 3.99634cm - 43 - - - - - - Embedded - coopertires - FitProportional - 11.33186cm - 10.33489cm - 0.65751cm - 6.09184cm - 44 - - - - + - 22.57045cm + 23.17899cm