diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 295d3bfcc..aae731e67 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -155,7 +155,7 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetCxCCliente(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveUsuarioRegistro As Integer, CveEmpresa As Integer, Optional TipoAgrupador As Integer = 1, Optional CveUsuarioConsulta As Integer = -1, Optional Cuenta As String = "-1") As Boolean + Public Function GetCxCCliente(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveUsuarioRegistro As Integer, CveEmpresa As Integer, Optional TipoAgrupador As Integer = 1, Optional CveUsuarioConsulta As Integer = -1, Optional Cuenta As String = "-1", Optional EstatusFactura As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_Clientes") @@ -169,8 +169,8 @@ Public Class ClsMovimientos .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@TipoAgrupador", SqlDbType.Int).Value = TipoAgrupador .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta - + .Add("@Cuenta", SqlDbType.NVarChar).Value = Cuenta + .Add("@EstatusFactura", SqlDbType.Int).Value = EstatusFactura End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 480f0dcaf..426f396e0 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5733,7 +5733,7 @@ Public Class ClsPaginas Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) 'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks) - Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(30), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache + Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(40), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache 'Session.Add(VSKey, pviewState) 'Store the ViewState on Cache ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 2c95cc3fd..fe307ce98 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -361,7 +361,8 @@ Public Class ClsVentas Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, - Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1", Optional DevolucionImportePagado As Decimal = 0) As Boolean + Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1", + Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -459,6 +460,7 @@ Public Class ClsVentas .Add("@Adjunto", SqlDbType.VarChar).Value = Adjunto .Add("@DevolucionImportePagado", SqlDbType.Money).Value = DevolucionImportePagado + .Add("@EsGarantia", SqlDbType.Bit).Value = EsGarantia .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -2870,7 +2872,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadGet") @@ -2885,6 +2887,7 @@ Public Class ClsVentas .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia End With Try @@ -2899,7 +2902,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadDetalleGet") With SqlAdapter.SelectCommand.Parameters @@ -2914,6 +2917,7 @@ Public Class ClsVentas .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia End With Try @@ -2931,7 +2935,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepVentasUtilidadGet") @@ -2947,6 +2951,7 @@ Public Class ClsVentas .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 233100246..ffd1c04a6 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1488,7 +1488,7 @@ Namespace Modelos PedidoContrato:=factura.PedidoContrato, ObservacionesAlmacen:=factura.ObservacionesAlmacen, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago33, CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal, CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), - CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor) Then + CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") @@ -6458,6 +6458,7 @@ Namespace Modelos End Property Public Property MotivoDescuento As String = "" + Public Property EsGarantia As Boolean #Region "Totales" diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index 8dfb746a1..fec0129a1 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -120,7 +120,7 @@ Public Class Timbres Dim ObjGrales As New ClsGenerales - If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then + If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then If ObjGrales.DtResultados.Rows.Count = 1 Then Dim DtMovimientos As DataTable = Nothing @@ -263,7 +263,7 @@ Public Class Timbres .Descripción = tPS, .ClaveUnidad = drr("SATClaveUM").ToString, .Unidad = drr("UM").ToString, - .Dimensiones = "", + .Dimensiones = drr("Dimensiones").ToString, .PesoenKg = drr("PesoKg").ToString.ToDecimal, .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index 2ff487e3a..f48bb590a 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -667,7 +667,13 @@ Partial Class Bancos_ConciliacionesBancariasaspx params.Add(New ReportParameter("LogoPath", "")) End If - ImprimirPDF("Empresas/Grales/Formatos/Conciliacion.rdlc", lrds, params, $"Conciliacion Bancaria {NombreMes} {txtFechaI.Text.ToDate.Year}", Formato) + Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/Conciliacion.rdlc" + + If Not IO.File.Exists($"{Server.MapPath("~")}/{Archivo}") Then + Archivo = "Empresas/Grales/Formatos/Conciliacion.rdlc" + End If + + ImprimirPDF(Archivo, lrds, params, $"Conciliacion Bancaria {NombreMes} {txtFechaI.Text.ToDate.Year}", Formato) End Sub #End Region diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 57ab71324..fd05105d7 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -302,8 +302,8 @@ Partial Class Bancos_PopIEVentas Set(value As String) ViewState("SerieFolio") = value End Set - End Property - + End Property + Private Property CveMonedaVenta As Integer Get Return ViewState("CveMonedaVenta").ToString.ToEntero @@ -728,6 +728,10 @@ Partial Class Bancos_PopIEVentas TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero + If UsuarioActual.CveEmpresa = 140 Then 'codigo temporal. RMF permite cargar el corte + CveCorte = dr("CveCorte").ToString.ToEntero + End If + LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" 'Configuración de Modalidad Update diff --git a/Bancos/RepCxCCliente.aspx b/Bancos/RepCxCCliente.aspx index 6148a08dc..2e3cf4dae 100644 --- a/Bancos/RepCxCCliente.aspx +++ b/Bancos/RepCxCCliente.aspx @@ -66,7 +66,8 @@
-
+ diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb index 1a02a421e..f2ff9d95b 100644 --- a/Bancos/RepCxCCliente.aspx.vb +++ b/Bancos/RepCxCCliente.aspx.vb @@ -19,15 +19,17 @@ Partial Class Bancos_RepCxCCliente DdlMoneda.DataSource = GlobalDTMonedas() DdlMoneda.DataBind() - Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) - If EsWS Then - DdlClientesWS.setEsWebService(True) - Else - DdlClientesWS.setEsWebService(False) - DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - DdlClientesWS.DataBind() - DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - End If + DdlClientesWS.setEsWebService(True) + + 'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + 'If EsWS Then + ' DdlClientesWS.setEsWebService(True) + 'Else + ' DdlClientesWS.setEsWebService(False) + ' DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + ' DdlClientesWS.DataBind() + ' DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + 'End If DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) DdlSubProyecto.DataBind() @@ -58,7 +60,8 @@ Partial Class Bancos_RepCxCCliente Dim Cuenta As String = If(TxtCuenta.Text = "", "-1", TxtCuenta.Text) - If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario, Cuenta:=Cuenta) Then + If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, + UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario, Cuenta:=Cuenta, EstatusFactura:=DdlEstatusFactura.SelectedValue.ToEntero) Then GvCxC.DataSource = Mov.DtResultados End If UsuarioActual.Sesion("CobroCliente-Sucursal") = DdlSubProyecto.SelectedValue diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index dea3a36fb..edeb0928b 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1790,7 +1790,6 @@ Partial Class General_SaldosIniciales Try For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows Dim almacenActual As String = almacenSinRepetir("Almacen").ToString.Trim - 'Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero If CveAlmacen > 0 Then @@ -1798,9 +1797,8 @@ Partial Class General_SaldosIniciales listadoMovimientos += $"movimiento con folio {ObjMovimientos.Folio}
" If movimientoCabecera > 0 Then - - contadorMovimientos += 1 - For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows + For Each nuevaEntrada As DataRow In dt.FiltraParametros($"TRIM(Almacen) = '{almacenActual}'").Rows + contadorMovimientos += 1 Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}") If RowPS IsNot Nothing Then Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero @@ -1823,6 +1821,11 @@ Partial Class General_SaldosIniciales Throw New Exception() End If Next + If contadorMovimientos = 0 Then + mensajeError = $"No se encontraros registros del almacen: ""{almacenActual}""" + Throw New Exception() + Exit For + End If Else mensajeError = $"No se registró el encabezado ""{almacenActual}""" Throw New Exception() diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index fcae2a7bd..19d6d12b9 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -783,7 +783,7 @@ Partial Class Inventarios_EntradasSalidas HplCartaPorteTimbre.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPOTIMBRE&CVEMOV={0}&CVETIMBRE={1}", CveMovimiento, drM("CveTimbre")))) Else HplDescargaPdf.Visible = True - HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", drM("TimbreSerieFolio"), "Tra"))) + HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}&CVETIMBRE={4}", CveMovimiento, "PDF", drM("TimbreSerieFolio"), "Tra", drM("CveTimbre")))) HplCartaPorte.Visible = True HplCartaPorte.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimiento))) @@ -3610,7 +3610,7 @@ Partial Class Inventarios_EntradasSalidas ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Dim CveVenta As Integer = ObjInventario.CveVenta - Dim MovAlmacen As Boolean = True + Dim MovAlmacen As Boolean = False Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & DdlConcepto.SelectedValue).ToEntero If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 6d146dde9..5e13576bb 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -321,12 +321,9 @@ Partial Class Inventarios_EntregaAlmacen DdlClientes.ddl.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) DdlClientes.ddl.DataBind() DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - End If - - If UsuarioActual.CveSubProyecto = 8804 Then - StrAlmacenes = "CveTipoAlmacen IN (1,2,12)" - End If - + End If + + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) DdlAlmacen.SelectedValue = "-1" @@ -744,12 +741,13 @@ Partial Class Inventarios_EntregaAlmacen If TipoDocto.Contiene("Ing") AndAlso TipoMovimiento = 2 Then Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"}) If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then - Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero() - DdlAlmacen.Items.Clear() - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}") - DdlAlmacen.DataBind() - - DdlAlmacen.SelectedValueExist(CveAlmacenDev) + Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero() + + 'DdlAlmacen.Items.Clear() + 'DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}") + 'DdlAlmacen.DataBind() + + DdlAlmacen.SelectedValueExist(CveAlmacenDev) ' se va a poder regresar en algun almacen diferente EsDevolucionDirecta = True End If End If diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index 3c8915d11..625fbaace 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -186,10 +186,20 @@ Partial Class Inventarios_ReporteEntradasSalidas End Sub Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveCategoria:=DdlCategoria.SelectedValue.ToEntero) - DdlClasificacion.DataBind() - DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) + + CargaClasificaciones() End Sub + + Private Sub CargaClasificaciones(CveCategoria As Integer) + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then + DdlClasificacion.DataSource = ObjClasificaciones.DtResultados + End If + ObjClasificaciones.Dispose() + DdlClasificacion.DataBind() + DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click CargaDatos() End Sub diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 71dbc9b57..279110a06 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -63,6 +63,9 @@
  • Cargar Conceptos
  • +
  • + Cargar Bitácora +
  • diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 5e0eb10ea..4e53310ab 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -159,6 +159,15 @@ Partial Class Inventarios_TraspasoAlmacen ViewState("FolioBusqueda") = 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 #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -173,6 +182,7 @@ Partial Class Inventarios_TraspasoAlmacen RVFechaRecepcion.MaximumValue = Now.ToShortDateString Folio = 0 CveMovimientoTimbrado = -1 + ArchivoBitacora = UsuarioActual.Empresa.Ruta & "Temp\Traspaso_" & UsuarioActual.CveUsuario & ".xml" If UsuarioActual.CveEmpresa = 119 Then divGastoIndirecto.Visible = False @@ -287,6 +297,7 @@ Partial Class Inventarios_TraspasoAlmacen dt.Columns.Add("Embalaje") dt.Columns.Add("PesoKg", Type.GetType("System.Decimal")) + dt.TableName = "TablaTraspaso" DtMovimientos = dt @@ -701,10 +712,10 @@ Partial Class Inventarios_TraspasoAlmacen DtMovimientos.Rows.Add(registro) RegistraScript("playsonidito('beep-07.wav')") - + IO.Path.GetDirectoryName(ArchivoBitacora).DirectoryExistsCreate 'verifica que exista la ruta + ActualizaBitacora() End If - CargaGvDatos() If Limpia Then @@ -715,6 +726,14 @@ Partial Class Inventarios_TraspasoAlmacen TxtnSerie.Focus() End If End Sub + Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False) + If Not Eliminar Then + DtMovimientos.WriteXml(ArchivoBitacora, XmlWriteMode.WriteSchema) + Else + File.Delete(ArchivoBitacora) + End If + + End Sub Private Sub LimpiaAgregar() 'DdlClasificacion.SelectedValue = "-1" @@ -857,7 +876,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim FechaCaducidad As Date Dim TextoExistencia As StringBuilder = New StringBuilder - Dim Existencia As Double + Dim Existencia As Decimal Dim CantidadenGrid As Decimal TextoExistencia.Append("Los siguiente productos se ajustaron por falta de existencia:
    ") If Not CargadoDeMov Then @@ -884,7 +903,7 @@ Partial Class Inventarios_TraspasoAlmacen CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad)) If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then 'si hay existencia en almacen costeado, lo tengo que sacar - Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal + Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal End If 'Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1) @@ -892,12 +911,10 @@ Partial Class Inventarios_TraspasoAlmacen 'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero)) 'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir 'las segunda consulta, que tenga existencia, ya con los parametros especificos - If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") Then + If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") OrElse (Serie <> "-1" AndAlso Serie <> "") Then If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("Existencia", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal End If - - 'ExistenciaEspecificada = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1) Existencia = ExistenciaEspecificada - CantidadenGrid End If @@ -1357,8 +1374,6 @@ Partial Class Inventarios_TraspasoAlmacen ChkTransitorio.Enabled = True TxtGastoIndirecto.Text = "" - - DivMov.Visible = False CargadoDeMov = False @@ -1366,6 +1381,7 @@ Partial Class Inventarios_TraspasoAlmacen UpMov.Update() DtMovimientos.Rows.Clear() + ActualizaBitacora() CargaGvDatos() End Sub #End Region @@ -1479,9 +1495,12 @@ Partial Class Inventarios_TraspasoAlmacen Private Sub EscondeColumnasGVM(DtTemp As DataTable) GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> "" + TdSerie.Visible = GvDatos.Columns(5).Visible : ThSerie.Visible = GvDatos.Columns(5).Visible GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> "" + TdLote.Visible = GvDatos.Columns(6).Visible : ThLote.Visible = GvDatos.Columns(6).Visible GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad") GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha + TdFechaCaducidad.Visible = GvDatos.Columns(7).Visible : ThFechaCaducidad.Visible = GvDatos.Columns(7).Visible GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 ''TxtnSerie.Visible = False @@ -1583,6 +1602,7 @@ Partial Class Inventarios_TraspasoAlmacen DbRow = DtMovimientos.Rows(e.RowIndex) DtMovimientos.Rows.Remove(DbRow) + ActualizaBitacora() CargaGvDatos() End Sub @@ -3059,6 +3079,17 @@ Partial Class Inventarios_TraspasoAlmacen End If + End Sub + + Protected Sub HplCargaBitacora_Click(sender As Object, e As EventArgs) + + If IO.File.Exists(ArchivoBitacora) Then + DtMovimientos.ReadXml(ArchivoBitacora) + CargaGvDatos() + Alert("Registro(s) Recuperados", TipoMensaje.ToastInformacion) + Else + Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion) + End If End Sub End Class diff --git a/Ventas/CatAutorizacionLimites.aspx b/Ventas/CatAutorizacionLimites.aspx index ea70c8c36..a83041256 100644 --- a/Ventas/CatAutorizacionLimites.aspx +++ b/Ventas/CatAutorizacionLimites.aspx @@ -64,20 +64,20 @@ - - - - - + + + + + - - + + - + diff --git a/Ventas/CatAutorizacionLimites.aspx.vb b/Ventas/CatAutorizacionLimites.aspx.vb index b191a76fb..d96767709 100644 --- a/Ventas/CatAutorizacionLimites.aspx.vb +++ b/Ventas/CatAutorizacionLimites.aspx.vb @@ -24,21 +24,25 @@ Partial Class Ventas_CatAutorizacionLimites #Region "CARGAS" Private Sub CargaCombos() - Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) - If EsWS Then - DdlCliente.setEsWebService(True) - DdlClienteFiltro.setEsWebService(True) - Else - DdlCliente.setEsWebService(False) - DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - DdlCliente.DataBind() - DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + + DdlCliente.setEsWebService(True) + DdlClienteFiltro.setEsWebService(True) + + 'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + 'If EsWS Then + ' DdlCliente.setEsWebService(True) + ' DdlClienteFiltro.setEsWebService(True) + 'Else + ' DdlCliente.setEsWebService(False) + ' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + ' DdlCliente.DataBind() + ' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlClienteFiltro.setEsWebService(False) - DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - DdlClienteFiltro.DataBind() - DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If + ' DdlClienteFiltro.setEsWebService(False) + ' DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + ' DdlClienteFiltro.DataBind() + ' DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataBind() diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 7c143cb75..b94dd2072 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1787,7 +1787,7 @@ Partial Class Clientes If ObjClientes.TipoCliente = 2 Then TabFiscalContable.Visible = False TabCxC.Visible = False - TabAnticipos.Visible = False + 'TabAnticipos.Visible = False TabRetenciones.Visible = False TabOS.Visible = False TabComplementos.Visible = False diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index eae1650c2..4c1ae7d4e 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2769,6 +2769,11 @@ + + + + +
    @@ -2791,6 +2796,8 @@
    + +
    @@ -2804,7 +2811,7 @@
    - +
    @@ -2832,7 +2839,10 @@
    - + +
    +
    + @@ -2969,6 +2979,8 @@ + +
    diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 0465c385d..2a26b05e5 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -6716,10 +6716,19 @@ Partial Class PV TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2) + DdlBCIAjuste.Items.Clear() If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then - DdlBCIAjuste.Items.Clear() DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}") DdlBCIAjuste.DataBind() + DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1")) + RFVAnio.Enabled = True + If CveTamanio = 16 Then 'motobaterias + DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0")) + RFVAnio.Enabled = False + End If + UPPDatosUsado.Update() ''refresca el RFV + Else + DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0")) End If DdlTipoUso.Items.Clear() diff --git a/Ventas/PopUpBuscarFolio.aspx b/Ventas/PopUpBuscarFolio.aspx index fa9005ee8..0345bb706 100644 --- a/Ventas/PopUpBuscarFolio.aspx +++ b/Ventas/PopUpBuscarFolio.aspx @@ -183,8 +183,8 @@ -
    - +
    + Tipo @@ -210,30 +210,36 @@ - - Pedido/OC + + Sucursal - + - + Total - + - Sucursal + Mon - + - + Estatus + + Pedido/OC + + + + XML diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index e0d9c2fb0..efd02c005 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -151,19 +151,10 @@ Partial Class PopUpBuscarFolio Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - 'If e.Row.RowIndex = 0 Then - ' e.Row.Cells(0).Width = Unit.Pixel(38) - ' e.Row.Cells(1).Width = Unit.Pixel(65) - ' e.Row.Cells(2).Width = Unit.Pixel(70) - ' e.Row.Cells(3).Width = Unit.Pixel(250) - ' 'e.Row.Cells(4).Width = Unit.Pixel(75) - ' e.Row.Cells(4).Width = Unit.Pixel(75) - ' e.Row.Cells(5).Width = Unit.Pixel(100) - ' e.Row.Cells(6).Width = Unit.Pixel(100) - 'End If + e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left 'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right Dim Liga As String = String.Format("", e.Row.DBCampo("CveVenta")) If UsuarioActual.CveEmpresa = 140 AndAlso e.Row.DBCampo("TipoDocto").Contiene("Rem") Then @@ -171,11 +162,12 @@ Partial Class PopUpBuscarFolio End If e.Row.FCLiteral("LtlTipo").Text = String.Format("", Liga, e.Row.DBCampo("TipoDocto")) - e.Row.FCLiteral("LtlFolio").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Folio")) + e.Row.FCLiteral("LtlFolio").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlFecha").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Fecha").ToDate.ToShortDateString) e.Row.FCLiteral("LtlNombre").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Nombre")) 'e.Row.FCLiteral("LtlSubTotal").Text = Liga & e.Row.DBCampo("SubTotal").FormatoNumero & " " e.Row.FCLiteral("LtlTotal").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Total").FormatoNumero) + e.Row.FCLiteral("LtlMon").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Abreviatura")) e.Row.FCLiteral("LtlSucursal").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("SubProyecto")) e.Row.FCLiteral("LtlEstatus").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("EstatusFactura")) e.Row.FCLiteral("LtlPedidoContrato").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("PedidoContrato")) diff --git a/Ventas/RepAuxiliarFacturas.aspx.vb b/Ventas/RepAuxiliarFacturas.aspx.vb index 801f64372..6f4d006ce 100644 --- a/Ventas/RepAuxiliarFacturas.aspx.vb +++ b/Ventas/RepAuxiliarFacturas.aspx.vb @@ -65,12 +65,10 @@ Partial Class Ventas_RepAuxiliarFacturas End Sub #Region "C A R G A - C O M B O S" - Private Sub CargaClientes() - DdlClientes.ddl.Items.Clear() - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - DdlClientes.DataBind() - DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub + 'Private Sub CargaClientes() + + ' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + 'End Sub Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs) DdlEstatus.Items.Clear() @@ -139,7 +137,7 @@ Partial Class Ventas_RepAuxiliarFacturas Private Sub CargaCombos() 'Cargo Clientes - CargaClientes() + 'CargaClientes() 'Cargo Proyectos DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) diff --git a/Ventas/RepRemisiones.aspx b/Ventas/RepRemisiones.aspx index ead8b63ad..926acd14c 100644 --- a/Ventas/RepRemisiones.aspx +++ b/Ventas/RepRemisiones.aspx @@ -130,12 +130,15 @@
    - -
    - - -
    + +
    + + <%-- + + --%> +
    +
    @@ -188,13 +191,13 @@ - -
    - - <%-- - - --%> -
    + +
    + + +
    + + @@ -232,7 +235,7 @@
    - + @@ -287,7 +290,7 @@ - + diff --git a/Ventas/RepVentasUtilidad.aspx.vb b/Ventas/RepVentasUtilidad.aspx.vb index 57b725bae..b80567830 100644 --- a/Ventas/RepVentasUtilidad.aspx.vb +++ b/Ventas/RepVentasUtilidad.aspx.vb @@ -66,7 +66,7 @@ Partial Class Ventas_RepVentasUtilidad 'Cargo categorias DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) DdlCategoria.DataBind() - + DdlCategoria.Items.Insert(0, New ListItem("Todas", "-1")) 'Cargo Clasificaciones DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) diff --git a/Ventas/RepVentasUtilidadDetalle.aspx.vb b/Ventas/RepVentasUtilidadDetalle.aspx.vb index d1db922ca..75133513f 100644 --- a/Ventas/RepVentasUtilidadDetalle.aspx.vb +++ b/Ventas/RepVentasUtilidadDetalle.aspx.vb @@ -178,7 +178,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, If(CveVenta = -1, Orden, CveVenta), DdlClientes.SelectedValue.ToEntero, Sucursales, - FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then + FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then DtVentas = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataBind() @@ -299,7 +299,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales, - FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, ddlmarcas.selectedvalue.toentero) Then + FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then Dim FechaInicio As String = txtFechaI.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 Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales, - FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then + FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then Dim FechaInicio As String = txtFechaI.Text Dim FechaFin As String = txtFechaF.Text diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx index 9c211461f..1dc7c4fc0 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx +++ b/Ventas/RepVentasUtilidadPadre.aspx @@ -178,6 +178,16 @@
    +
    + Garantía: +
    +
    + + + + + +
    diff --git a/Ventas/RepVentasUtilidadPadre.aspx.vb b/Ventas/RepVentasUtilidadPadre.aspx.vb index b9a6b80ca..c5f1d1cc7 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx.vb +++ b/Ventas/RepVentasUtilidadPadre.aspx.vb @@ -71,6 +71,7 @@ Partial Class Ventas_RepVentasUtilidadPadre 'Cargo categorias DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) DdlCategoria.DataBind() + DdlCategoria.Items.Insert(0, New ListItem("Todas", "-1")) 'Cargo Clasificaciones DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) @@ -90,6 +91,12 @@ Partial Class Ventas_RepVentasUtilidadPadre DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If + 'garantia + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + divgarantia1.visible = True + divgarantia2.visible = True + End If + DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarcas.DataBind() DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1")) @@ -125,7 +132,7 @@ Partial Class Ventas_RepVentasUtilidadPadre If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero, If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, - DdlMarcas.SelectedValue.ToEntero) Then + DdlMarcas.SelectedValue.ToEntero, DdlGarantia.SelectedValue.ToEntero) Then GvDatos.DataSource = ObjVentas.DtResultados DtDatos = ObjVentas.DtResultados End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3b480e592..b74786f7f 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2246,7 +2246,7 @@ Partial Class Ventas DivPenalizacion.Visible = True End If - If UsuarioActual.CveRol = 1 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then LnkSolicitarCredito.Visible = True End If @@ -6506,7 +6506,7 @@ Partial Class Ventas ObjVentas.Dispose() Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO 'RMF. codigo temporal para pruebas - If Alertas AndAlso UsuarioActual.CveEmpresa = 140 AndAlso UsuarioActual.CveUsuario.Contiene(100, 1937, 2275) AndAlso Now.Hour > 5 AndAlso Now.Hour < 9 Then + If Alertas AndAlso UsuarioActual.CveEmpresa = 140 Then Dim Vta As New ClsVentas Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

    {0}", Vta.SerieVenta) @@ -7534,17 +7534,17 @@ Partial Class Ventas End If 'SERIE ALMACEN - If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 Then - If CveVenta > 0 Then - e.Row.FCLiteral("LtlSerie").Visible = True - Else - e.Row.FCTextBox("TxtSerie").Visible = True + If CveVenta > 0 AndAlso e.Row.DBCampo("Serie") <> "" Then + e.Row.FCLiteral("LtlSerie").Visible = True + End If + + If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 And CveVenta <= 0 Then + + e.Row.FCTextBox("TxtSerie").Visible = True e.Row.FCTextBox("TxtSerie").Attributes.Remove("onkeypress") e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeypress", String.Format("SeriePS(event,{0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID)) e.Row.FCTextBox("TxtSerie").Attributes.Remove("onblur") e.Row.FCTextBox("TxtSerie").Attributes.Add("onblur", String.Format("SeriePSBlur({0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID)) - End If - 'e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeyup", String.Format("LimpiaAF(1, '{0}'); EnterAFEdit(event,this,{1},{2});", e.Row.FCHiddenField("HdnCveConcepto").Value, e.Row.FCHiddenField("HdnCveAF").ClientID, e.Row.FCHiddenField("HdnCodAF").ClientID)) @@ -15998,8 +15998,9 @@ Partial Class Ventas 'falta verificar traer el acuse y reenviarlo If UsuarioActual.Empresa.UsaAC Then - IDPoliza = GenerarPolizaAC(ObjAC, True) - If IDPoliza <= 0 Then + Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True) + IDPoliza = IDMPoliza.IdPoliza + If IDMPoliza.IdPoliza <= 0 Then Mensaje = "No se pudo generar la poliza" ErrorCancelar = True End If @@ -16088,8 +16089,9 @@ Partial Class Ventas ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then If UsuarioActual.Empresa.UsaAC Then - IDPoliza = GenerarPolizaAC(ObjAC, True) - If IDPoliza <= 0 Then + Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True) + IDPoliza = IDMPoliza.IdPoliza + If IDMPoliza.IdPoliza <= 0 Then Mensaje = "No se pudo generar la poliza" ErrorCancelar = True End If @@ -18311,125 +18313,124 @@ Partial Class Ventas End Function - Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer - Dim Retorno As Integer = 0 - Dim IDPoliza As Integer = 0 + 'Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer + ' Dim Retorno As Integer = 0 + ' Dim IDPoliza As Integer = 0 - Dim ErrorAC As Boolean = False - 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() - Dim Fecha As Date = TxtFecha.Text.ToDate - Dim Concepto As String = String.Format("GD {0}", NombreCliente) - Dim Paridad As Integer = 1 - Dim TipoMovto As Boolean = False + ' Dim ErrorAC As Boolean = False + ' 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() + ' Dim Fecha As Date = TxtFecha.Text.ToDate + ' Dim Concepto As String = String.Format("GD {0}", NombreCliente) + ' Dim Paridad As Integer = 1 + ' Dim TipoMovto As Boolean = False - If CancelacionIngreso Then - Concepto = String.Format("Cancelación GD {0}", NombreCliente) - Paridad = -1 - TipoMovto = True - End If + ' If CancelacionIngreso Then + ' Concepto = String.Format("Cancelación GD {0}", NombreCliente) + ' Paridad = -1 + ' TipoMovto = True + ' End If - Dim TipoPoliza = If(DdlTipoComprobante.SelectedValue.ToString() = "OP" Or DdlTipoComprobante.SelectedValue.ToString() = "Com", 3, 1) + ' Dim TipoPoliza = If(DdlTipoComprobante.SelectedValue.ToString() = "OP" Or DdlTipoComprobante.SelectedValue.ToString() = "Com", 3, 1) - IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, TxtTotal.Text.ToDouble * 2, TxtTotal.Text.ToDouble * 2, UsuarioActual.CveUsuario, Fecha) - Dim dr As DataRow ' = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue)) - 'Dim Importe As Double = TxtTotal.Text.ToDouble - Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero() - Dim CtaISSSTESON As Integer = 643 - Dim CtaISPT As Integer = 1745 - ' Dim NombreCliente As String = ViewState("NombreCliente").ToString() + ' IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, TxtTotal.Text.ToDouble * 2, TxtTotal.Text.ToDouble * 2, UsuarioActual.CveUsuario, Fecha) + ' Dim dr As DataRow ' = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue)) + ' 'Dim Importe As Double = TxtTotal.Text.ToDouble + ' Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero() + ' Dim CtaISSSTESON As Integer = 643 + ' Dim CtaISPT As Integer = 1745 + ' ' Dim NombreCliente As String = ViewState("NombreCliente").ToString() - If IDPoliza > 0 Then + ' If IDPoliza > 0 Then - 'Orden de PAGO - If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then + ' 'Orden de PAGO + ' If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then - If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then - 'ISSSTESON + ' If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then + ' 'ISSSTESON - If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then - If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then - ErrorAC = True - End If - Else - ErrorAC = True - End If + ' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then + ' If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then + ' ErrorAC = True + ' End If + ' Else + ' ErrorAC = True + ' End If - Else - 'ISPT + ' Else + ' 'ISPT - If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then - If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then - ErrorAC = True - End If - Else - ErrorAC = True - End If - End If + ' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then + ' If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then + ' ErrorAC = True + ' End If + ' Else + ' ErrorAC = True + ' End If + ' End If - ' NORMAL - Else - Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)() - Group gvr By Grp = New With { - Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero() - } Into Group - Select Grp.CvePresupuestoIngreso, - TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble) + ' ' NORMAL + ' Else + ' Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)() + ' Group gvr By Grp = New With { + ' Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero() + ' } Into Group + ' Select Grp.CvePresupuestoIngreso, + ' TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble) - 'Select Case TipoComprobante - ' Case "Ing", "Egs" - For Each grp In Detalles - dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso)) - Concepto = String.Format("{0} - {1}: {2}", NombreCliente, DdlTipoComprobante.SelectedItem.Text.ToString(), TxtFolio.Text) + ' 'Select Case TipoComprobante + ' ' Case "Ing", "Egs" + ' For Each grp In Detalles + ' dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso)) + ' Concepto = String.Format("{0} - {1}: {2}", NombreCliente, DdlTipoComprobante.SelectedItem.Text.ToString(), TxtFolio.Text) - If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString().ToEntero(), False, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then - If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString().ToEntero(), True, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then - 'CARGO la deuda del cliente - If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then - 'abono, - If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then - ErrorAC = True - End If - Else - ErrorAC = True - End If - Else - ErrorAC = True - End If - Else - ErrorAC = True - End If - Next + ' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString().ToEntero(), False, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then + ' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString().ToEntero(), True, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then + ' 'CARGO la deuda del cliente + ' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then + ' 'abono, + ' If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then + ' ErrorAC = True + ' End If + ' Else + ' ErrorAC = True + ' End If + ' Else + ' ErrorAC = True + ' End If + ' Else + ' ErrorAC = True + ' End If + ' Next - 'Case "OP", "Com" - ' Dim Importe As Decimal = 0 - ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then - ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then + ' 'Case "OP", "Com" + ' ' Dim Importe As Decimal = 0 + ' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then + ' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then - ' End If - ' End If - 'End Select - End If + ' ' End If + ' ' End If + ' 'End Select + ' End If - Else - ErrorAC = True + ' Else + ' ErrorAC = True - End If + ' End If - If Not ErrorAC Then - ObjAC.AjustaPoliza(IDPoliza) + ' If Not ErrorAC Then + ' ObjAC.AjustaPoliza(IDPoliza) + ' Retorno = IDPoliza + ' Else + ' Retorno = -1 + ' Alert("Error al agregar la Póliza de AC.", TipoMensaje.MsgError) + ' End If - Retorno = IDPoliza - Else + ' ' ObjAC.Dispose() - Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError) - End If + ' Return Retorno - ' ObjAC.Dispose() - - Return Retorno - - End Function + 'End Function Private Sub SetValues() ViewState("TipoCambio") = 1