diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index d33475899..4a306f502 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1855,15 +1855,15 @@ Public Class ClsInventarios Return Retorno End Function - Public Function RepAlmacenCompras(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean + Public Function RepAlmacenCompras(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_RepAlmacenCompras") - With SqlAdapter.SelectCommand.Parameters .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With @@ -4997,7 +4997,7 @@ Public Class ClsInventarios Public Function GetFletesRep(CveEmpresa As Integer, Optional CveFlete As Integer = -1, Optional Folio As String = "-1", Optional CveProveedor As Integer = -1, Optional CveOC As Integer = -1, Optional CveCompra As Integer = -1, Optional FechaInicio As Date = MinFecha, - Optional FechaFin As Date = MaxFecha, Optional TipoGasto As Integer = -1) As Boolean + Optional FechaFin As Date = MaxFecha, Optional TipoGasto As Integer = -1, Optional CveEstatus As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_FletesRep") With SqlAdapter.SelectCommand.Parameters @@ -5010,6 +5010,7 @@ Public Class ClsInventarios .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveFlete", SqlDbType.Int).Value = CveFlete .Add("@TipoGasto", SqlDbType.Int).Value = TipoGasto + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 309a3d465..ae57244f9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3297,13 +3297,14 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetCortesDetalleVentasResumen(CveCorte As Integer, CveEmpresa As Integer) As Boolean + Public Function GetCortesDetalleVentasResumen(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_CortesDetalleVentasResumenGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCorte", SqlDbType.Int).Value = CveCorte + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index f91f6b6b1..b49be482e 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4816,7 +4816,7 @@ Namespace Modelos Dim MensajeError As String = "" Dim ObjCancelacion As New Timbrado Dim TotalT As Decimal = ObjFactura.Total - Dim RFCReceptor As String = ObjFactura.Cliente.RFC + Dim RFCReceptor As String = If(String.IsNullOrEmpty(ObjFactura.RFCReceptor), ObjFactura.Cliente.RFC, ObjFactura.RFCReceptor) Dim CvePACCancelacion As Integer = ObjFactura.CvePAC If CvePACCancelacion <= 0 Then @@ -4917,7 +4917,7 @@ Namespace Modelos CancelacionFecha = ObjCancelacion.CancelacionFecha CveEstatus = 5 End If - CancelacionAcuse = ObjCancelacion.CancelacionAcuse + CancelacionAcuse = Resp.CancelacionAcuse SolicitudCancelacionAcuse = Resp.SolicitudCancelacionAcuse Else Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
Origen del error: WebService www.sat.gob.mx" @@ -5000,7 +5000,7 @@ Namespace Modelos 'End If CveEstatus = Resp.CveEstatus CancelacionFecha = Resp.CancelacionFecha - CancelacionAcuse = ObjCancelacion.CancelacionAcuse + CancelacionAcuse = Resp.CancelacionAcuse SolicitudCancelacionAcuse = Resp.SolicitudCancelacionAcuse Else Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
Origen del error: WebService www.sat.gob.mx" @@ -5042,7 +5042,13 @@ Namespace Modelos Dim msgBitacora As String = "Solicitud de cancelación de factura" If EsRefacturacion Then - msgBitacora = "Solicitud de cancelación por refacturación" + If Not String.IsNullOrEmpty(CancelacionAcuse) Then + msgBitacora = $"Solicitud de cancelación por refacturación. SelloSAT: {CancelacionAcuse}" + ElseIf Not String.IsNullOrEmpty(SolicitudCancelacionAcuse) Then + msgBitacora = $"Solicitud de cancelación por refacturación. SelloSAT: {SolicitudCancelacionAcuse}" + Else + msgBitacora = "Solicitud de cancelación por refacturación." + End If End If Dim ObjE As New ClsOIEventos() @@ -5154,7 +5160,7 @@ Namespace Modelos Dim EstatusDevolucion = 1 If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then ErrorCancelar = True - MensajeError = "Ocurrió un error al solicitar la devolucion de almacen." + MensajeError = "Ocurrió un error al solicitar la devolución de almacen." End If End If diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 466e394c5..7fc90d47b 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -775,22 +775,29 @@ Public Class Timbrado End Select 'valida que si se halla cancelado - Dim VigenciaExtra = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True) - If Retorno.Verificado AndAlso VigenciaExtra IsNot Nothing Then - If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso Not VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then - Retorno.Estado = "VIGENTE" - Retorno.CveEstatus = 23 - End If - If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then - Retorno.Estado = "EN PROCESO" - Retorno.CveEstatus = 20 - Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse - End If - If VigenciaExtra.Estado.ToUpper = "CANCELADO" Then - Retorno.Estado = "CANCELADO" - Retorno.CveEstatus = 5 - End If + If Retorno.Verificado Then + Dim VigenciaExtra = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True) + If VigenciaExtra IsNot Nothing Then + If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then + Retorno.Estado = "EN PROCESO" + Retorno.CveEstatus = 20 + 'CUANDO ESTA EN PROCESO EL ACUSE DEBE SER DE SOLICITUD DE CANCELACION + Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse + Retorno.CancelacionAcuse = "" + ElseIf VigenciaExtra.Estado.ToUpper = "CANCELADO" Then + Retorno.Estado = "CANCELADO" + Retorno.CveEstatus = 5 + Else + Retorno.Estado = "VIGENTE" + Retorno.CveEstatus = 23 + 'SI HAY UN ACUSE, GUARDARLO COMO ACUSE DE SOLICITUD + If Not String.IsNullOrEmpty(Retorno.CancelacionAcuse) Then + Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse + Retorno.CancelacionAcuse = "" + End If + End If + End If End If If Not Retorno.Verificado Then diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index dc2e3754d..ba0735df4 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1568,6 +1568,7 @@ Partial Class Bancos_ProveedoresAbonar End If If gvr.FCTextBox("TxtComision").Text.ToDecimal < 0 Then + ConceptoContable = 78 TipoMovimiento = True ImporteMovimiento = ImporteMovimiento * -1 importeMX = importeMX * -1 @@ -1577,8 +1578,8 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToEntero() End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = TipoCambioPago End If @@ -2862,14 +2863,20 @@ Partial Class Bancos_ProveedoresAbonar End If Saldo = Saldo - IEPS - End If ' se manda al ot ingresos, los impuestos por acreditar - If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then - MsgError = "Ocurrio un error al saldar el movimiento" + If MsgError = "" Then + Dim tcvecon As Integer = 78 + If Saldo < 0 Then + tcvecon = 211 + End If + If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, tcvecon, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "Ocurrio un error al saldar el movimiento" + End If End If + 'fluctuación. If CveMoneda > 1 Then Dim ImporteFluctuacion As Decimal = 0 @@ -2879,7 +2886,6 @@ Partial Class Bancos_ProveedoresAbonar MsgError = "No se pudo obtener el sub proyecto o centro de costo" End If - If TCCompra > TCPago Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" @@ -2889,12 +2895,8 @@ Partial Class Bancos_ProveedoresAbonar MsgError = "Ocurrio un error al saldar el movimiento" End If End If - - End If - - If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If ObjConta.ValorPolizaDescuadre > 0 Then MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia @@ -2906,7 +2908,6 @@ Partial Class Bancos_ProveedoresAbonar If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) - Else 'Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico" diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index 3109668a4..7011c1ad2 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -151,11 +151,11 @@ Partial Class Bancos_RepCortes Nombre = gvr.DataKey("Nombre").ToString Dim Vent As New ClsPuntoVenta Dim Vn As New ClsVentas - If Vn.GetCortesDetalleVentasResumen(CveCorte, UsuarioActual.CveEmpresa) Then + If Vn.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then GvP.DataSource = Vn.DtResultados DtCortesVentasResumen = Vn.DtResultados End If - If Vent.GetCortesDetalleVentas(CveCorte, UsuarioActual.CveEmpresa) Then + If Vent.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then GvD.DataSource = Vent.DtResultados DtCortesVentas = Vent.DtResultados divDetalle.Visible = True diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index caed3305f..f3fd68e1b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2194,9 +2194,8 @@ Partial Class Compras_Compras DdlRetISRConcepto.Items.Clear() DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) - If UsuarioActual.CveEmpresa.Contiene(119, 7, 11, 12, 122, 145) Then - DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) - End If + DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) + End If UpPS.Update() End Sub @@ -14675,7 +14674,7 @@ Partial Class Compras_Compras Protected Sub BtnRefacturacionVer_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionVer.Click Dim Opcion As Integer = 1 - If UsuarioActual.CveEmpresa.Contiene(119, 1) Then Opcion = 2 + If UsuarioActual.CveEmpresa.Contiene(119, 1, 140) Then Opcion = 2 Dim ObjCompras As New ClsCompras @@ -20315,10 +20314,14 @@ Partial Class Compras_Compras ObjCompras.Dispose() Dim ObjInv As New ClsInventarios - If ObjInv.GetFletes(UsuarioActual.CveEmpresa, OpcionInventario:=1) Then - DdlFletes.DataSource = ObjInv.DtResultados + If ObjInv.GetFletesRep(UsuarioActual.CveEmpresa, -1, "-1", -1, -1, -1, MinFecha, MaxFecha, TipoGasto:=1, CveEstatus:=0) Then + DdlFletes.DataSource = ObjInv.DtResultados.FiltraParametros("CveFlete > 0") DdlFletes.Items.Insert(0, New ListItem("Seleccione", "-1")) End If + 'If ObjInv.GetFletes(UsuarioActual.CveEmpresa, OpcionInventario:=1) Then + ' DdlFletes.DataSource = ObjInv.DtResultados + ' DdlFletes.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If ObjInv.Dispose() DdlImportaciones.DataBind() diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index cc984ed03..589faafc2 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -1524,22 +1524,22 @@   - +   - +   - +   - +   @@ -1602,37 +1602,37 @@ - + - + - + - +   - +   - +   - +   diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 8763f2b39..06170b6ba 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -2613,12 +2613,6 @@ Partial Class Compras_Proveedores End If - e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right - - If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(6).ForeColor = Drawing.Color.Red If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxP" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index e66322f35..44944955e 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -546,7 +546,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - If dr("FolioPoliza").ToString = "" Then + If dr("FolioPoliza").ToString = "" OrElse dr("FolioPoliza").ToString = "0" Then BtnContabilizar.Visible = True End If @@ -1099,7 +1099,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - If gvr.DataKey("CveConcepto").ToEntero <> 30 Then + If Not gvr.DataKey("CveConcepto").Contiene("30", "10") Then ' 30-bancos, 10-anticipos proveedores If gvr.DataKey("CveConcepto").ToEntero = 41 Then CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero @@ -2696,7 +2696,12 @@ Partial Class ContabilidadC_RegPrePolizaS End If If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then - Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + Alert(String.Format("Prepóliza contabilizada.

Folio: {0} ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + End If + Else Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 5c94f0643..2382051b3 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -70,7 +70,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If ObjConta.GetConta_ConceptosContables() Then DdlCconceptosContables.DataSource = ObjConta.DtResultados.FiltraParametros("EsSistema = True ") - DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True AND EsGlobal = True") + DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros(" EsSistema = True AND EsGlobal = True") End If If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then @@ -145,6 +145,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlCuentaBancaria.SelectedValueExist(GvRow.DataKey("CveBancoCuenta")) DdlSubProyectos.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero) DdlTipoGasto.SelectedValueExist(GvRow.DataKey("CveTipoGasto").ToEntero) + DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo").ToEntero) Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 8bc46cf4e..12c5b1dec 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -246,6 +246,10 @@ Partial Class RepCxCDetalle 'CargaClientes 'CargaClientes + 'txtFechaI.Text = Now.AddMonths(-12).FirstDayOfMonth.ToShortDateString + txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString + + If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then DdlClientesWS.setEsWebService(True) Else diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index a6a37b07d..ef5430e69 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -17,6 +17,13 @@
  • Cargar Excel
  • + + +
  • + Cargar Bitácora +
  • +
    + Recepción Almacén diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index fbdf9185a..39c4acfad 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -144,14 +144,7 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("CantidadTotal") = value End Set End Property - Private Property IndexSeccionAlmacen As Integer - Get - Return CType(ViewState("IndexSeccionAlmacen"), Integer) - End Get - Set(value As Integer) - ViewState("IndexSeccionAlmacen") = value - End Set - End Property + Private Property PUSerie As Decimal Get Return CType(ViewState("PUSerie"), Decimal) @@ -416,15 +409,22 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("ValidarRecepcionUsados") = Value End Set End Property - - 'Private Property DtDocumentos As DataTable - ' Get - ' Return CType(ViewState("DtDocumentos"), DataTable) - ' End Get - ' Set(value As DataTable) - ' ViewState("DtDocumentos") = value - ' End Set - 'End Property + Private Property ArchivoBitacora As String + Get + Return CType(ViewState("ArchivoBitacora"), String) + End Get + Set(value As String) + ViewState("ArchivoBitacora") = value + End Set + End Property + Private Property ArchivoBitacoraDetalle As String + Get + Return CType(ViewState("ArchivoBitacoraDetalle"), String) + End Get + Set(value As String) + ViewState("ArchivoBitacoraDetalle") = value + End Set + End Property #End Region @@ -480,7 +480,6 @@ Partial Class Inventarios_RecepcionAlmacen TipoMovimiento = 1 RealizarTraspasoAlmacenDevolucion = False CantidadTotal = 0 - IndexSeccionAlmacen = 0 ddlAlmacenAdd.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (9)") ddlAlmacenAdd.DataBind() @@ -549,15 +548,23 @@ Partial Class Inventarios_RecepcionAlmacen DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) DdlAlmacen.SelectedValue = "-1" DdlAlmacen.DataBind() - DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) + If UsuarioActual.CveAlmacen > 0 Then + DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) + RecargaporAlmacenes() + End If UpGenerales.Update() End Sub Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) + Recargaporalmacenes() + End Sub + + Private Sub RecargaporAlmacenes() + If DdlAlmacen.SelectedValue <> "-1" Then - Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero + Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero 'RMF condición temporal If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then ValidaLoteCaducidad = True @@ -754,7 +761,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjInventarios As New ClsInventarios If ddlProveedor.SelectedValue.ToEntero > 0 Then - If ObjInventarios.GetFletes(UsuarioActual.CveEmpresa, CveProveedor:=ddlProveedor.SelectedValue.ToEntero) Then + If ObjInventarios.GetFletes(UsuarioActual.CveEmpresa, CveProveedor:=ddlProveedor.SelectedValue.ToEntero, OpcionInventario:=1) Then DdlFletes.DataSource = ObjInventarios.DtResultados.FiltraParametros("CantRest > 0") Else Alert("Ocurrió un error al obtener las ordenes de compra pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError) @@ -997,6 +1004,16 @@ Partial Class Inventarios_RecepcionAlmacen Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero() Dim CveSubProyecto As Integer + ArchivoBitacora = String.Format("{0}Temp\RecepcionDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra) + ArchivoBitacoraDetalle = String.Format("{0}Temp\RecepcionDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra) + If ArchivoBitacora <> "" Then + Dim Archivo = New System.IO.FileInfo(ArchivoBitacora) + If Archivo.Exists() Then + HplCargaBitacora.Visible = True + uppCargaBitacora.Update() + End If + End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS If NumProductos > 0 AndAlso NumUsados > 0 Then @@ -1100,7 +1117,6 @@ Partial Class Inventarios_RecepcionAlmacen CveCliente = DtRecepcion.Rows(0)("CveCliente").ToString.ToEntero CveVendedor = DtRecepcion.Rows(0)("CveVendedor").ToString.ToEntero - If DtInv.COUNT("EntregaDirecta") <> DtInv.Rows.Count Then Alert("Todos los conceptos deben estar facturados.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False @@ -1166,8 +1182,6 @@ Partial Class Inventarios_RecepcionAlmacen End If End If - - DivBitacora.Visible = True If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then @@ -1181,7 +1195,6 @@ Partial Class Inventarios_RecepcionAlmacen BtnGuardar.Visible = False End If - ObjCompras.Dispose() ObjInventario.Dispose() @@ -1392,22 +1405,6 @@ Partial Class Inventarios_RecepcionAlmacen GvInv.Columns(14).Visible = True End If - 'For Each item As DataRow In DtInv.Rows - ' Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, item("CvePS").ToString.ToEntero).FiltroPrimero("") - ' If Dr IsNot Nothing Then - ' item("AplicaSeccion") = CBool(Dr("AplicaSeccion")) - ' If CBool(Dr("AplicaSeccion")) Then GvInv.Columns(10).Visible = True - ' item("AplicaSerie") = CBool(Dr("AplicaSerie")) - ' item("AplicaLote") = CBool(Dr("AplicaLote")) - ' If CBool(Dr("AplicaLote")) Then GvInv.Columns(11).Visible = True - ' item("AplicaCaducidad") = CBool(Dr("AplicaCaducidad")) - ' If CBool(Dr("AplicaCaducidad")) Then GvInv.Columns(12).Visible = True - ' If CBool(Dr("AplicaSeccion")) Or CBool(Dr("AplicaLote")) Or CBool(Dr("AplicaCaducidad")) Or CBool(Dr("AplicaSerie")) Then - ' GvInv.Columns(15).Visible = True - ' End If - ' End If - 'Next - GvInv.DataSource = DtInv GvInv.DataBind() UPInv.Update() @@ -1501,7 +1498,6 @@ Partial Class Inventarios_RecepcionAlmacen End If - e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID)) e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("CantidadF"), e.Row.FCButton("BtnDividir").ClientID)) @@ -1694,20 +1690,6 @@ Partial Class Inventarios_RecepcionAlmacen 'RegistraScript("document.getElementById(""TxtSerie"").focus();") RegistraScript("$('#DivSerie').modal();", "ModalLote") - 'Dim AplicaCaducidad = False - 'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then - ' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False) - 'End If - - 'If AplicaCaducidad Then - ' GvSerie.Columns(1).Visible = True - ' TdCaducidad1.Visible = True - ' TdCaducidad2.Visible = True - 'Else - ' GvSerie.Columns(1).Visible = False - ' TdCaducidad1.Visible = False - ' TdCaducidad2.Visible = False - 'End If GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC") GvSerie.DataBind() @@ -1859,6 +1841,7 @@ Partial Class Inventarios_RecepcionAlmacen Row("FechaCaducidad") = MinFecha.ToShortDateString DtDatosDetalle.Rows.Add(Row) + ActualizaBitacora() End If Next ObjInventarios.Dispose() @@ -1881,6 +1864,40 @@ Partial Class Inventarios_RecepcionAlmacen End Sub +#Region "Bitacora" + Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False) + If Not Eliminar Then + DtInv.TableName = "DtDatos" + DtDatosDetalle.TableName = "DtDatosDetalle" + DtInv.WriteXml(ArchivoBitacora, XmlWriteMode.WriteSchema) + DtDatosDetalle.WriteXml(ArchivoBitacoraDetalle, XmlWriteMode.WriteSchema) + Else + File.Delete(ArchivoBitacora) + End If + + End Sub + + Protected Sub HplCargaBitacora_Click(sender As Object, e As EventArgs) + + If IO.File.Exists(ArchivoBitacora) Then + 'DtInv.Clear() + 'DtDatosDetalle.Clear() + DtInv.ReadXml(ArchivoBitacora) + If IO.File.Exists(ArchivoBitacoraDetalle) Then + Dim dtt As New DataTable + dtt.ReadXml(ArchivoBitacoraDetalle) + DtDatosDetalle = dtt + Alert("Registro(s) Recuperados", TipoMensaje.ToastInformacion) + End If + CargaGVInv() + + Else + Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion) + End If + + End Sub +#End Region + Protected Sub GvSerie_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvSerie.RowDeleting Dim keySerieLote As String = e.Keys("Serie").ToString Try @@ -1894,6 +1911,7 @@ Partial Class Inventarios_RecepcionAlmacen End Try DtDatosDetalle.AcceptChanges() + ActualizaBitacora() CargaSerie(1) End Sub @@ -4971,68 +4989,6 @@ Partial Class Inventarios_RecepcionAlmacen #End Region - 'Protected Sub BtnGuardarDocumento_Click(sender As Object, e As EventArgs) - - ' Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos - ' If Filesgral Is Nothing OrElse Filesgral.Count = 0 Then - ' Alert("No se agregó ningun archivo", TipoMensaje.MsgAdvertencia) - ' Exit Sub - ' End If - - ' If DtDocumentos Is Nothing Then - ' DtDocumentos = New DataTable() - - ' Dim column As DataColumn = New DataColumn("No") - ' column.DataType = Type.GetType("System.Int32") - ' With column - ' .AutoIncrement = True - ' .AutoIncrementSeed = 1 - ' .AutoIncrementStep = 1 - ' End With - - ' DtDocumentos.Columns.Add(column) - ' DtDocumentos.Columns.Add("DocumentoOrignal", GetType(String)) - ' DtDocumentos.Columns.Add("Documento", GetType(String)) - ' DtDocumentos.Columns.Add("FileExtension", GetType(String)) - ' End If - - ' Dim row As DataRow = DtDocumentos.NewRow() - - ' Dim archivo = Filesgral.FirstOrDefault() - - ' row("DocumentoOrignal") = archivo.filenameO - ' row("Documento") = archivo.filename - ' row("FileExtension") = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, archivo.filename)) - - ' DtDocumentos.Rows.Add(row) - - ' 'GvDocumentos.DataSource = DtDocumentos - ' 'GvDocumentos.DataBind() - - ' UpDocumentos.Update() - - ' RegistraScript("$('#ModalBitacoraDoc').modal('hide');") - 'End Sub - 'Protected Sub LnkEliminarDoc_Click(sender As Object, e As EventArgs) - ' Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton) - - ' If DtDocumentos.Rows.Count > 0 And lnkRemove.CommandArgument.ToString.Length > 0 Then - ' Dim i As Integer - ' i = lnkRemove.CommandArgument.ToString.ToEntero - ' Dim Drs As DataRow() = DtDocumentos.Select(String.Format("No = {0}", i)) - ' If Drs.Count > 0 Then - - ' Drs(0).Delete() - ' End If - ' DtDocumentos.AcceptChanges() - ' End If - - ' 'GvDocumentos.EditIndex = -1 - - ' 'GvDocumentos.DataSource = DtDocumentos - ' 'GvDocumentos.DataBind() - 'End Sub - Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean Dim Retorno = True Dim Archivo As System.IO.FileInfo = Nothing diff --git a/Inventarios/RepAlmacenCompras.aspx b/Inventarios/RepAlmacenCompras.aspx index cf906aac8..f4bf3cd07 100644 --- a/Inventarios/RepAlmacenCompras.aspx +++ b/Inventarios/RepAlmacenCompras.aspx @@ -33,10 +33,18 @@
      +
    • SubProyecto:
    • + <%--SubProyecto--%> +
    • +
      + + +
      +
    • Almacén:
    • - +
    • FechaInicio:
    • @@ -93,7 +101,7 @@ - + diff --git a/Inventarios/RepAlmacenCompras.aspx.vb b/Inventarios/RepAlmacenCompras.aspx.vb index 7b62d23a6..b52d29f6c 100644 --- a/Inventarios/RepAlmacenCompras.aspx.vb +++ b/Inventarios/RepAlmacenCompras.aspx.vb @@ -70,10 +70,12 @@ Partial Class Inventarios_RepAlmacenCompras Private Sub CargaCombos() 'Llena Almacen - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen IN ( 1, 22, 27)") DdlAlmacen.DataBind() DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, Nothing) + End Sub #End Region @@ -90,7 +92,7 @@ Partial Class Inventarios_RepAlmacenCompras Dim FechaF As Date = If(TxtFechaFin.Text = "" Or TxtFechaFin.Text = "__/__/____", MaxFecha, TxtFechaFin.Text.ToDate) - If ObjInventarios.RepAlmacenCompras(DdlAlmacen.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then + If ObjInventarios.RepAlmacenCompras(DdlAlmacen.SelectedValue.ToEntero, FechaI, FechaF, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then DtDatos = ObjInventarios.DtResultados DtAlmacenCompra = ObjInventarios.DtResultados Else diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx b/Ventas/RepCancelacionesPorRespuesta.aspx index a71609e98..3c079264a 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx +++ b/Ventas/RepCancelacionesPorRespuesta.aspx @@ -56,7 +56,7 @@
      @@ -103,7 +103,7 @@
      diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index ac61af08b..f00369605 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -93,13 +93,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas string Total = GvRow.DataKey("Total"); string SubTotal = GvRow.DataKey("SubTotal"); string Uuid = GvRow.DataKey("FolioFiscal"); - string RFCCliente = GvRow.DataKey("RFCCliente"); + string RFCReceptor = GvRow.DataKey("RFCReceptor"); string Folio = GvRow.DataKey("Folio"); string TipoDocto = GvRow.DataKey("TipoDocto"); string Nombre = GvRow.DataKey("Nombre"); if (CveVenta > 0 && Uuid != "") { - var resp = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total); + var resp = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total); if (resp.EnviarAcuse) { Alert(resp.Mensaje, TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar"); @@ -124,7 +124,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas string Total = GvRow.DataKey("Total"); string SubTotal = GvRow.DataKey("SubTotal"); string Uuid = GvRow.DataKey("FolioFiscal"); - string RFCCliente = GvRow.DataKey("RFCCliente"); + string RFCReceptor = GvRow.DataKey("RFCReceptor"); string Folio = GvRow.DataKey("Folio"); string TipoDocto = GvRow.DataKey("TipoDocto"); string Nombre = GvRow.DataKey("Nombre"); @@ -133,7 +133,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas if (CveVenta > 0 && Uuid != "") { - var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusFactura: CveEstatusFactura); + var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusFactura: CveEstatusFactura); CargaDatos(); if (respuesta.CveEstatus.Contiene(4, 5)) { @@ -171,7 +171,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas string Total = GvRow.DataKey("Total"); string SubTotal = GvRow.DataKey("SubTotal"); string Uuid = GvRow.DataKey("FolioFiscal"); - string RFCCliente = GvRow.DataKey("RFCCliente"); + string RFCReceptor = GvRow.DataKey("RFCReceptor"); string Folio = GvRow.DataKey("Folio"); string TipoDocto = GvRow.DataKey("TipoDocto"); string Nombre = GvRow.DataKey("Nombre"); @@ -219,10 +219,32 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas sb.Append("Ocurrió un error al cambiar el estatus de la factura."); } ObjVentas.Dispose(); - + + if (respCancelacion.CveEstatus == 23) + { + var resp = Timbrado.VerificarVigenciaSAT(Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total, true); + if (resp != null) + { + sb.AppendFormat("
      Folio Fiscal: {0}
      ", Uuid); + sb.AppendFormat("Código Estado: {0}
      ", resp.CodigoEstatus); + sb.AppendFormat("Estado: {0}
      ", resp.Estado); + sb.AppendFormat("Es Cancelable: {0}
      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); + sb.AppendFormat("Estatus de Cancelación: {0}

      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); + } + } } else { + var resp = Timbrado.VerificarVigenciaSAT(Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total, true); + if (resp != null) + { + sb.AppendFormat("Folio Fiscal: {0}
      ", Uuid); + sb.AppendFormat("Código Estado: {0}
      ", resp.CodigoEstatus); + sb.AppendFormat("Estado: {0}
      ", resp.Estado); + sb.AppendFormat("Es Cancelable: {0}
      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); + sb.AppendFormat("Estatus de Cancelación: {0}

      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); + } + sb.Append(respCancelacion.Mensaje); } @@ -346,7 +368,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas } else if (respCancelacion.CveEstatus == 23) { - sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo."); + sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.
      "); + + sb.AppendFormat("Folio Fiscal: {0}
      ", uuid); + sb.AppendFormat("Código Estado: {0}
      ", resp.CodigoEstatus); + sb.AppendFormat("Estado: {0}
      ", resp.Estado); + sb.AppendFormat("Es Cancelable: {0}
      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); + sb.AppendFormat("Estatus de Cancelación: {0}

      ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); } else { @@ -496,14 +524,14 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas string Total = Row["Total"].ToString(); string SubTotal = Row["SubTotal"].ToString(); string Uuid = Row["FolioFiscal"].ToString(); - string RFCCliente = Row["RFCCliente"].ToString(); + string RFCReceptor = Row["RFCReceptor"].ToString(); string Folio = Row["Folio"].ToString(); string TipoDocto = Row["TipoDocto"].ToString(); string Nombre = Row["Nombre"].ToString(); int CveCliente = Row["CveCliente"].ToEntero(); if (CveVenta > 0) { - sb.AppendFormat("{0}
      ", VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, SubTotal)); + sb.AppendFormat("{0}
      ", VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, SubTotal)); } } Alert(sb.ToString()); diff --git a/Ventas/RepRemisiones.aspx b/Ventas/RepRemisiones.aspx index 926acd14c..d765228b8 100644 --- a/Ventas/RepRemisiones.aspx +++ b/Ventas/RepRemisiones.aspx @@ -190,6 +190,11 @@
      + +
      + + <%----%> +
      diff --git a/Ventas/RepRemisiones.aspx.vb b/Ventas/RepRemisiones.aspx.vb index 2d67f4de7..3789ff521 100644 --- a/Ventas/RepRemisiones.aspx.vb +++ b/Ventas/RepRemisiones.aspx.vb @@ -91,7 +91,7 @@ Partial Class RepRemisiones Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim ObjVentas As New ClsVentas - If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=UsuarioActual.TienePermisoProceso(201)) Then + If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked) Then DtVentas = ObjVentas.DtResultados.Copy() GvDatos.DataSource = DtVentas End If @@ -100,7 +100,7 @@ Partial Class RepRemisiones GvDatos.Columns(7).Visible = DtVentas.SUMD("Descuento") > 0 End If - GvDatos.Columns(10).Visible = UsuarioActual.TienePermisoProceso(201) + GvDatos.Columns(10).Visible = chkInv.Checked 'solo se visualiza si está selccionada ObjVentas.Dispose() GvDatos.DataBind() @@ -148,6 +148,11 @@ Partial Class RepRemisiones 'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) 'End If + If UsuarioActual.TienePermisoProceso(201) Then + divVerInv.Visible = True + End If + + End Sub Private Sub CargaSucursales() diff --git a/Ventas/RepRemisionesDetalle.aspx b/Ventas/RepRemisionesDetalle.aspx index f40f707ca..f8896d644 100644 --- a/Ventas/RepRemisionesDetalle.aspx +++ b/Ventas/RepRemisionesDetalle.aspx @@ -130,11 +130,11 @@
      - + <%--
      -
      +
    --%> @@ -187,6 +187,10 @@ +
    + + <%----%> +
    <%--
    diff --git a/Ventas/RepRemisionesDetalle.aspx.vb b/Ventas/RepRemisionesDetalle.aspx.vb index 9863874e9..190ae7986 100644 --- a/Ventas/RepRemisionesDetalle.aspx.vb +++ b/Ventas/RepRemisionesDetalle.aspx.vb @@ -114,7 +114,7 @@ Partial Class RepRemisionesDetalle If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then CveCliente = Request("CveCliente").ToEntero - Dim Cliente = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("NombreComercial", $"CveCliente ={CveCliente}") + Dim Cliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "") If Cliente <> "" Then DdlClientes.SelectedValue = CveCliente.ToString DdlClientes.SelectedText = Cliente @@ -122,14 +122,14 @@ Partial Class RepRemisionesDetalle Else CveCliente = -1 - End If - - If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then - CveContrato = Request("CveContrato").ToEntero - DdlContrato.SelectedValueExist(CveContrato) - Else - CveContrato = -1 - End If + End If + + 'If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then + ' CveContrato = Request("CveContrato").ToEntero + ' DdlContrato.SelectedValueExist(CveContrato) + 'Else + CveContrato = -1 + 'End If If Request("CveSubProyecto") IsNot Nothing Then CveSubProyecto = Request("CveSubProyecto").ToString DdlSubProyectos.SelectedValuesIfExistM(CveSubProyecto) @@ -155,10 +155,10 @@ Partial Class RepRemisionesDetalle FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaV = If(IsDate(TxtFechaVencimiento.Text.Trim()), TxtFechaVencimiento.Text.Trim(), "-1") CveCliente = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1) - CveContrato = If(DdlContrato.SelectedValue.ToEntero > 0, DdlContrato.SelectedValue.ToEntero, -1) + 'CveContrato = If(DdlContrato.SelectedValue.ToEntero > 0, DdlContrato.SelectedValue.ToEntero, -1) CveSubProyecto = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString - If ObjVentas.GetRepRemisionesSinFacturarDetalle(FechaI, FechaF, FechaV, CveCliente, CveContrato, CveVenta, UsuarioActual.CveEmpresa, CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=UsuarioActual.TienePermisoProceso(201)) Then + If ObjVentas.GetRepRemisionesSinFacturarDetalle(FechaI, FechaF, FechaV, CveCliente, CveContrato, CveVenta, UsuarioActual.CveEmpresa, CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked) Then If CveMoneda = 1 Or CveMoneda = 2 Then DtVentas = ObjVentas.DtResultados.FiltraParametros($"CveMoneda = {CveMoneda}") Else @@ -169,13 +169,13 @@ Partial Class RepRemisionesDetalle ObjVentas.Dispose() GvDatos.DataBind() - GvDatos.Columns(8).Visible = UsuarioActual.TienePermisoProceso(201) + GvDatos.Columns(8).Visible = chkInv.Checked UPDatos.Update() End Sub Public Sub CargaCombos() CargaCliente() - CargaContrato() + 'CargaContrato() CargaSucursales() End Sub Private Sub CargaCliente() @@ -191,20 +191,20 @@ Partial Class RepRemisionesDetalle End If End Sub - Private Sub CargaContrato() - Dim ObjContratos As New ClsContratos - DdlContrato.Items.Clear() - If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, -1, -1) Then - If ObjContratos.DtResultados.Rows.Count > 0 Then - DdlContrato.DataSource = ObjContratos.DtResultados - DdlContrato.DataBind() - End If + 'Private Sub CargaContrato() + ' Dim ObjContratos As New ClsContratos + ' DdlContrato.Items.Clear() + ' If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, -1, -1) Then + ' If ObjContratos.DtResultados.Rows.Count > 0 Then + ' DdlContrato.DataSource = ObjContratos.DtResultados + ' DdlContrato.DataBind() + ' End If - End If + ' End If - ObjContratos.Dispose() - DdlContrato.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub + ' ObjContratos.Dispose() + ' DdlContrato.Items.Insert(0, New ListItem("Todos", "-1")) + 'End Sub Private Sub CargaSucursales() DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) DdlSubProyectos.DataBind() @@ -233,7 +233,7 @@ Partial Class RepRemisionesDetalle If DdlSubProyectos.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Sucursal: {0}", DdlSubProyectos.GetSelectedText) If DdlClientes.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat(" Cliente: {0}", DdlClientes.SelectedText) - If DdlContrato.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Contrato: {0}", DdlContrato.SelectedItem.Text) + 'If DdlContrato.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Contrato: {0}", DdlContrato.SelectedItem.Text) If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", txtFechaI.Text.ToDate.ToShortDateString) If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", txtFechaF.Text.ToDate.ToShortDateString)