diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index b991a40a3..388078978 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -161,6 +161,8 @@ Public Class ClsClientes Public Property CveAlmacenAlterno As Integer = -1 Public Property CveAlmacenConsignacion As Integer = -1 Public Property UsaProductoAlterno As Boolean = False + Public Property EnDemanda As Boolean = False + Public Property EnQuebranto As Boolean = False #End Region @@ -413,6 +415,8 @@ Public Class ClsClientes _CveAlmacenConsignacion = Data(0)("CveAlmacenConsignacion").ToString.ToEntero _UsaProductoAlterno = CBool(Data(0)("UsaProductoAlterno")) + _EnDemanda = CBool(Data(0)("UsaProductoAlterno")) + _EnQuebranto = CBool(Data(0)("EnQuebranto")) End If Retorno = True @@ -530,7 +534,8 @@ Public Class ClsClientes Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False, Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, - Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean + Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False, + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -662,6 +667,8 @@ Public Class ClsClientes .Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion .Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno + .Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda + .Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto End With Try SqlAdapter.Fill(Data) @@ -707,7 +714,8 @@ Public Class ClsClientes Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False, Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, - Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean + Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False, + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -849,7 +857,8 @@ Public Class ClsClientes .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion .Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno .Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno - + .Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda + .Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index fd013534f..496459e94 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1355,7 +1355,7 @@ Public Class ClsInventarios End If Catch Ex1 As SqlException If Ex1.Message.Contains("50019") Then - Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError(String.Format(" El producto '{0}' no tiene existencia.", Ex1.Message.GetTagValue("codigops")), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Else @@ -3324,11 +3324,12 @@ Public Class ClsInventarios #End Region #Region " INVENTARIOS - VENTAS " - Public Function EntregaAlmacenGet(CveVenta As Integer, Optional CveAlmacen As Integer = -1) As Boolean + Public Function EntregaAlmacenGet(CveVenta As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_EntregaAlmacenGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 277b6fbf5..b94f14de9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6984,6 +6984,15 @@ Public Class ClsPaginas If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then params.Add(New ReportParameter("UsaProductoAlterno", If(Vta.Cliente.UsaProductoAlterno, "1", "0"))) + + params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) + params.Add(New ReportParameter("Medico", Vta.Medico)) + params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) + params.Add(New ReportParameter("FechaCirugia", Vta.FechaParaSurtir.ToString("yyyy-MM-dd HH:mm"))) + params.Add(New ReportParameter("Paciente", Vta.Paciente)) + params.Add(New ReportParameter("Episodio", Vta.Episodio)) + params.Add(New ReportParameter("Alfa1", Vta.Alfa1)) + End If 'PARAMETROS SEGUN TIPO DOCUMENTO @@ -7022,16 +7031,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) - params.Add(New ReportParameter("Medico", Vta.Medico)) - params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) - params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm"))) - params.Add(New ReportParameter("Paciente", Vta.Paciente)) - params.Add(New ReportParameter("Episodio", Vta.Episodio)) - params.Add(New ReportParameter("Alfa1", Vta.Alfa1)) - End If 'VSH If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then 'DATOS CLIENTES @@ -7081,15 +7081,6 @@ Public Class ClsPaginas params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) - params.Add(New ReportParameter("Medico", Vta.Medico)) - params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) - params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm"))) - params.Add(New ReportParameter("Paciente", Vta.Paciente)) - params.Add(New ReportParameter("Episodio", Vta.Episodio)) - params.Add(New ReportParameter("Alfa1", Vta.Alfa1)) - End If RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) @@ -7115,11 +7106,11 @@ Public Class ClsPaginas params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString)) End If 'COMPU DN DIFUSA - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177, 186) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 137, 132, 144, 177, 186) Then Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor)) params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, ""))) params.Add(New ReportParameter("Entrega", Vta.Entrega)) - params.Add(New ReportParameter("Vigencia", Vta.Vigencia.ToString("dd/MMMM/yyyy"))) + params.Add(New ReportParameter("Vigencia", Vta.Vigencia.ToString("yyyy-MM-dd"))) params.Add(New ReportParameter("Sucursal", Vta.SubProyecto.SubProyecto)) params.Add(New ReportParameter("SucursalCliente", If(Vta.ClienteSucursal.Sucursal Is Nothing, "", Vta.ClienteSucursal.Sucursal.ToString))) params.Add(New ReportParameter("CveMoneda", Vta.CveMoneda.ToString)) @@ -7133,11 +7124,8 @@ Public Class ClsPaginas RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) Case "Egs" - If UsuarioActual.CveEmpresa.Contiene(72, 80) Then - NombreArchivo = "NotaCredito" - Else - NombreArchivo = "Factura" - End If + + NombreArchivo = "Factura" NombreArchivoDescarga = "Nota de Crédito" TipoDocumento = "EGRESO" TipoDocumentoRef = String.Format(": Ref.:{0}", Vta.RefDocto) @@ -7163,22 +7151,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("Tipo", TipoDocumento)) params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) - 'INE COMPLEMENTOS - If UsuarioActual.CveEmpresa.Contiene(72) Then - Dim INETipoProceso As String = "" - Dim INETipoComite As String = "" - Dim INEIdContabilidad As Integer = 0 - If Vta.ComplementoINE IsNot Nothing Then - INETipoProceso = Vta.ComplementoINE.INETipoProceso - INETipoComite = Vta.ComplementoINE.INETipoComite - INEIdContabilidad = Vta.ComplementoINE.INEIdContabilidad - End If - params.Add(New ReportParameter("INETipoProceso", INETipoProceso)) - params.Add(New ReportParameter("INETipoComite", INETipoComite)) - params.Add(New ReportParameter("INEIdContabilidad", INEIdContabilidad.ToString)) - params.Add(New ReportParameter("Referencia", Vta.Cliente.ReferenciaFiscal)) - params.Add(New ReportParameter("ClienteContacto", Vta.AtencionA)) - End If + RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) Case "Ped" @@ -7192,14 +7165,6 @@ Public Class ClsPaginas params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) params.Add(New ReportParameter("CveAlmacenTraspasoOrigen", Vta.CveAlmacenTraspasoOrigen.ToString)) - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) - params.Add(New ReportParameter("Medico", Vta.Medico)) - params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) - params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm"))) - params.Add(New ReportParameter("Paciente", Vta.Paciente)) - params.Add(New ReportParameter("Episodio", Vta.Episodio)) - End If RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) @@ -7616,116 +7581,6 @@ Public Class ClsPaginas Return o.Value End If End Function - Public Sub GenerarFacturaVenta(CveVenta As Integer) - Dim ObjVentas As New ClsVentas - Dim Vta As Modelos.Factura = Nothing - Dim TmpDTImpuestos As DataTable = New DataTable - TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) - TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) - TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - Dim dtVentas As DataTable = ObjVentas.DtResultados - ' se rellenan los campos de la factura - Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura) - Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString - 'se rellena la sucursal - Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) - Vta.Cliente = New Modelos.ClienteModel - Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString - Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString - Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString - Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString - Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString - Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString - Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString - Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString - Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString - Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString - Vta.AtencionA = dtVentas(0)("AtencionA").ToString - Vta.TelefonoGenerico = dtVentas(0)("TelefonoGenerico").ToString - Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString - Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString - Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString - Vta.Cliente.Mail = dtVentas(0)("Mail").ToString - Vta.RefDocto = dtVentas(0)("Ref").ToString - Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero - Vta.Version = dtVentas(0)("Version").ToString - Vta.ClienteSucursal = New Modelos.SucursalModel - Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString - Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString - Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString - Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString - Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString - Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString - Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString - Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString - Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString - Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString - Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString - Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString - Vta.EnviarA = New Modelos.EnviarAModel - Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero - Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString - Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString - Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString - Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString - Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString - Dim DR As DataRow = TmpDTImpuestos.NewRow() - If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR) - 'solo para eclipse, que muesre un subtotal debajo de IVA - If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - End If - If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra - Vta.DtDetalle = ObjVentas.DtResultados - End If - If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then - If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - Dim dtImpuesto As DataTable = ObjVentas.DtResultados - If dtImpuesto.Rows.Count > 0 Then - For Each Row As DataRow In dtImpuesto.Rows - Dim Orden As Integer = 80 - If Row("Importe").ToString.ToDouble <> 0 Then - DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString - DR("Importe") = Row("Importe").ToString.ToDouble - DR("Orden") = Orden - TmpDTImpuestos.Rows.Add(DR) - DR = TmpDTImpuestos.NewRow() - Orden = Orden + 1 - End If - Next - End If - Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC") - Else - Vta.DtDeduccion = ObjVentas.DtResultados - End If - End If - If ObjVentas.GetVentasFirmas(CveVenta) Then - Vta.DtFirmas = ObjVentas.DtResultados - End If - End If - ObjVentas.Dispose() - - If Not IsNothing(Vta) Then - PdfFactura(Vta) - Vta = Nothing - End If - End Sub #End Region Public Function RutaFormatoReporte(NombreReporte As String) As String @@ -7745,7 +7600,6 @@ Public Class ClsPaginas Public Function NewGeneraBytesOC(tCveOrdenCompra As Integer, Optional MR As ReportViewer = Nothing, Optional ConBitacora As Boolean = False) As Byte() Dim bytes As Byte() = Nothing Dim CveEmpresaActual As Integer - Dim TmpDTEnvioDireccion As DataTable Dim params As New List(Of ReportParameter) Try Dim DtDetalle As DataTable = Nothing @@ -7774,68 +7628,6 @@ Public Class ClsPaginas 'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES Dim DomicilioSucursal As String = "" - If UsuarioActual.CveEmpresa.Contiene(72, 80) Then - Dim SBDomicilioSucursal As New StringBuilder() - Dim CiudadSucursal As String = "" - Dim ObjClientes As New ClsClientes - If ObjOC.GetSucursalOC(ObjOC.CveOrdenCompra) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then - CiudadSucursal = String.Format("{0},{1}", ObjOC.SucMunicipio, ObjOC.SucEstado) - SBDomicilioSucursal.AppendFormat("{0}", ObjOC.SucCalle) - If ObjOC.SucNoExt.Length > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", ObjOC.SucNoExt) - If ObjOC.SucNoInt.Length > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt) - If ObjOC.SucColonia.Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", ObjOC.SucColonia) - If ObjOC.SucCP.Length > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", ObjOC.SucCP) - If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal) - If ObjOC.SucPais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", ObjOC.SucPais) - DomicilioSucursal = SBDomicilioSucursal.ToString - params.Add(New ReportParameter("Proyecto", ObjOC.SucSubProyecto.ToString)) - params.Add(New ReportParameter("Telefono", ObjOC.SucTelefono.ToString)) - 'Obtenemos la direccion envio PARA COMPU PROVEEDORES - If ObjOC.CveDireccionEnvio > 0 Then - Dim StrEnvioDi As New StringBuilder - If ObjClientes.DireccionEnvioGet(ObjOC.CveDireccionEnvio, ObjOC.CveCliente, -1) Then - TmpDTEnvioDireccion = ObjClientes.DtResultados - Else - TmpDTEnvioDireccion = Nothing - End If - ObjClientes.Dispose() - - If TmpDTEnvioDireccion IsNot Nothing AndAlso TmpDTEnvioDireccion.FiltraParametros(String.Format("CveDireccionEnvio = {0}", ObjOC.CveDireccionEnvio)).Rows.Count > 0 Then - StrEnvioDi.AppendFormat("{0}", TmpDTEnvioDireccion(0)("EnvioDireccion")) - If TmpDTEnvioDireccion(0)("EnvioNoExt") IsNot Nothing AndAlso TmpDTEnvioDireccion(0)("EnvioNoExt").ToString.Length > 0 Then StrEnvioDi.AppendFormat(", No.Ext: {0}", TmpDTEnvioDireccion(0)("EnvioNoExt")) - If TmpDTEnvioDireccion(0)("EnvioNoInt") IsNot Nothing AndAlso TmpDTEnvioDireccion(0)("EnvioNoInt").ToString.Length > 0 Then StrEnvioDi.AppendFormat(", No.Int: {0}", TmpDTEnvioDireccion(0)("EnvioNoInt")) - params.Add(New ReportParameter("EnvioDireccion", StrEnvioDi.ToString)) - params.Add(New ReportParameter("EnvioNoExt", TmpDTEnvioDireccion(0)("EnvioNoExt").ToString)) - params.Add(New ReportParameter("EnvioNoInt", TmpDTEnvioDireccion(0)("EnvioNoInt").ToString)) - params.Add(New ReportParameter("EnvioColonia", TmpDTEnvioDireccion(0)("EnvioColonia").ToString)) - params.Add(New ReportParameter("EnvioCiudad", TmpDTEnvioDireccion(0)("EnvioCiudad").ToString)) - params.Add(New ReportParameter("EnvioEstado", TmpDTEnvioDireccion(0)("EnvioEstado").ToString)) - params.Add(New ReportParameter("EnvioContacto", TmpDTEnvioDireccion(0)("EnvioContacto").ToString)) - params.Add(New ReportParameter("EnvioDepartamento", TmpDTEnvioDireccion(0)("EnvioDepartamento").ToString)) - params.Add(New ReportParameter("EnvioCP", TmpDTEnvioDireccion(0)("EnvioCP").ToString)) - params.Add(New ReportParameter("EnvioTel", TmpDTEnvioDireccion(0)("EnvioTel").ToString)) - End If - Else - If ObjOC.LugarEntrega.ToString IsNot Nothing AndAlso ObjOC.LugarEntrega.ToString = "" Then - Dim StrEnvioDi As New StringBuilder - StrEnvioDi.AppendFormat("{0}", ObjOC.SucCalle) - If ObjOC.SucNoExt.Length > 0 Then StrEnvioDi.AppendFormat(", No.Ext: {0}", ObjOC.SucNoExt) - If ObjOC.SucNoInt.Length > 0 Then StrEnvioDi.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt) - params.Add(New ReportParameter("EnvioDireccion", StrEnvioDi.ToString)) - params.Add(New ReportParameter("EnvioColonia", If(ObjOC.SucColonia.Length > 0, ObjOC.SucColonia, ""))) - params.Add(New ReportParameter("EnvioCiudad", If(ObjOC.SucMunicipio.Length > 0, ObjOC.SucMunicipio, ""))) - params.Add(New ReportParameter("EnvioEstado", If(ObjOC.SucEstado.Length > 0, ObjOC.SucEstado, ""))) - params.Add(New ReportParameter("EnvioCP", If(ObjOC.SucCP.Length > 0, ObjOC.SucCP, ""))) - Else - params.Add(New ReportParameter("EnvioDireccion", ObjOC.LugarEntrega)) - params.Add(New ReportParameter("LugarEntrega", ObjOC.LugarEntrega)) - End If - params.Add(New ReportParameter("EnvioTel", ObjOC.SucTelefono.ToString)) - - End If - End If - End If - Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero Dim drSol As DataRow = GlobalDTUsuarios(CveUsuarioSol, EmpresaActual.CveEmpresa).FiltroPrimero("") 'DataRow (incluye el NOMBRE de quien SOLICITÓ la OC) @@ -7846,10 +7638,10 @@ Public Class ClsPaginas If drSol IsNot Nothing AndAlso drSol("CvePersonal").ToString.ToEntero > 0 Then CvePersonalSol = drSol("CvePersonal").ToString.ToEntero If drAut IsNot Nothing AndAlso drAut("CvePersonal").ToString.ToEntero > 0 Then CvePersonalAut = drAut("CvePersonal").ToString.ToEntero Dim ObjRH As New ClsRH() - If ObjRH.GetPersonal(CvePersonalSol, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then + If CvePersonalSol > 0 AndAlso ObjRH.GetPersonal(CvePersonalSol, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then PuestoSol = ObjRH.DtResultados(0)("Puesto").ToString End If - If ObjRH.GetPersonal(CvePersonalAut, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then + If CvePersonalAut > 0 AndAlso ObjRH.GetPersonal(CvePersonalAut, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then PuestoAut = ObjRH.DtResultados(0)("Puesto").ToString End If ObjRH.Dispose() @@ -7861,9 +7653,6 @@ Public Class ClsPaginas End If Dim nombreautorizo As String = dtOC(0)("UsuarioAutorizo").ToString - 'If EmpresaActual = 48 Then - ' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE" - 'End If Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126, 158) Then params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2))) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 776036e64..34e00d8a3 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6446,7 +6446,7 @@ Namespace Modelos 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) If Not ErrorCancelar Then If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then - DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10,4)") + DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10)") CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToEntero() 'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN If Me.ServicioDomicilio Then @@ -6456,6 +6456,7 @@ Namespace Modelos CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero() If CveAlmacenExA <= 0 Then CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero() + DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (4)") End If CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero() diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b734f4fd1..b60325ce8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1790,7 +1790,7 @@ Partial Class Compras_Compras Private Function CargaFactura(CveFactura As Integer) As String Dim ObjeFacturas As New ClsCompras Dim RFC As String = "" - If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-4), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then + If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-6), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador ViewState("CveTipoProveedor") = dr("CveTipoProveedor").ToString.ToEntero @@ -3566,89 +3566,87 @@ Partial Class Compras_Compras 'End If If RetIVAOriginal > 0 Then - Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal + Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal - If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then - DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profesionales - End If - If RetIVAFlete Then '4 Fletes - If RFCProveedor.Length = 13 Then - DdlRetIVAConcepto.SelectedValueExist("2") - Else - DdlRetIVAConcepto.SelectedValueExist("3") - End If - End If + If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then + DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profesionales End If - - If RetISROriginal > 0 Then - Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal - - If (CalRetISRPor).RoundSQL(1) = 0.1 Then '10 Servicios profesionales - DdlRetISRConcepto.SelectedValueExist("1") - End If - 'permitido en un margen de 1% a 2% - If RetISRResico OrElse (CalRetISRPor >= 0.01 AndAlso CalRetISRPor <= 0.02) Then '1.25 Recico regimen simplificado confianza - DdlRetISRConcepto.SelectedValueExist("3") - RetISRResico = True + If RetIVAFlete Then '4 Fletes + If RFCProveedor.Length = 13 Then + DdlRetIVAConcepto.SelectedValueExist("2") + Else + DdlRetIVAConcepto.SelectedValueExist("3") End If End If End If - CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion) - CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion) + If RetISROriginal > 0 Then + Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal - LbAgregar.Enabled = True - UpPSS.Update() - UpPS.Update() - UpParametros.Update() - UPCondicionesPago.Update() - 'si tiene el habiltiado el módulo de Contratos - 'checo si tiene estimaciones - - 'CargaDatosEstimaciones(ObjProveedor.CveProveedor) - ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue) - CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update() - - 'If UsuarioActual.Empresa.UsaAC Then - ' If (TxtRetIVA.Text.ToDouble > 0) Or (TxtRetISR.Text.ToDouble > 0) Then ' - ' ImgBtnBuscarOC.Visible = False - ' TxtOC.Enabled = False - ' BtnGuardar.Visible = False - ' Alert("El proveedor no tiene registrada cuentas contables de retenciones. Debe asignar las cuentas en el registro del proveedor.", TipoMensaje.MsgAdvertencia) - ' DivRestriccionAdvertencia.Visible = True - ' LtRestriccionAdvertencia.Text = "El proveedor no tiene registrada cuentas contables de retenciones." - ' End If - 'End If - - If CveProveedor > 0 Then - - Dim ObjSAT As New ClsSAT - Dim RFCRequest As String = ObjProveedor.RFC - If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFCRequest) Then - If ObjSAT.DtResultados.Rows.Count > 0 Then - Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString - BtnGuardar.Enabled = False - UpParametros.Update() - - Alert($"El RFC del proveedor se encuentra en estado {Estatus} en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia) - System.Threading.Thread.Sleep(5) - End If + If (CalRetISRPor).RoundSQL(1) = 0.1 Then '10 Servicios profesionales + DdlRetISRConcepto.SelectedValueExist("1") + End If + 'permitido en un margen de 1% a 2% + If RetISRResico OrElse (CalRetISRPor >= 0.01 AndAlso CalRetISRPor <= 0.02) Then '1.25 Recico regimen simplificado confianza + DdlRetISRConcepto.SelectedValueExist("3") + RetISRResico = True End If - ObjSAT.Dispose() - End If - - If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then - PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago - End If - - Else - Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) End If + + CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion) + CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion) + + LbAgregar.Enabled = True + UpPSS.Update() + UpPS.Update() + UpParametros.Update() + UPCondicionesPago.Update() + 'si tiene el habiltiado el módulo de Contratos + 'checo si tiene estimaciones + + 'CargaDatosEstimaciones(ObjProveedor.CveProveedor) + ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue) + CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update() + + 'If UsuarioActual.Empresa.UsaAC Then + ' If (TxtRetIVA.Text.ToDouble > 0) Or (TxtRetISR.Text.ToDouble > 0) Then ' + ' ImgBtnBuscarOC.Visible = False + ' TxtOC.Enabled = False + ' BtnGuardar.Visible = False + ' Alert("El proveedor no tiene registrada cuentas contables de retenciones. Debe asignar las cuentas en el registro del proveedor.", TipoMensaje.MsgAdvertencia) + ' DivRestriccionAdvertencia.Visible = True + ' LtRestriccionAdvertencia.Text = "El proveedor no tiene registrada cuentas contables de retenciones." + ' End If + 'End If + + If CveProveedor > 0 Then + + Dim ObjSAT As New ClsSAT + Dim RFCRequest As String = ObjProveedor.RFC + If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFCRequest) Then + If ObjSAT.DtResultados.Rows.Count > 0 Then + Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString + BtnGuardar.Enabled = False + UpParametros.Update() + + Alert($"El RFC del proveedor se encuentra en estado {Estatus} en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia) + System.Threading.Thread.Sleep(5) + End If + End If + ObjSAT.Dispose() + + End If + + If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then + PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago + End If + Else - Alert("Ocurrió un error al consultar el proveedor.", TipoMensaje.MsgError) + Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) End If + If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then If ObjProveedor.DtResultados.Rows.Count > 0 Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 764f725d1..edfe9bbf0 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -399,7 +399,7 @@ Partial Class PopUpVerFactura Dim archivoBinario As Byte() = StreamPDF(rutardlc, lrds, params, "Inventario", formato) Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = archivoBinario, .NombreArchivo = String.Format("Inventario {0}.pdf", fechas)}) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.archivoBinario = archivoBinario, .NombreArchivo = String.Format("Inventario {0}.pdf", fechas)}) Dim Mail As New ClsSisMail() @@ -5818,7 +5818,7 @@ Partial Class PopUpVerFactura End With dtMovs.Dispose() - If (UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Or UsuarioActual.Empresa.Funcionalidad(382).ToEntero = 1) And CvePrePoliza > 0 Then + If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) And CvePrePoliza > 0 Then Dim ObjContabilidad As New ClsContabilidad diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index eff14876b..a0173309e 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -623,9 +623,7 @@
- - - +
@@ -648,6 +646,9 @@
+
+ +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 1be8472d2..f3cc6a70e 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1034,7 +1034,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10", "204") Then ' 30-bancos, 10-anticipos proveedores, 204- blancos complementaria + If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10", "204", "348", "350") Then ' 30-bancos, 10-anticipos proveedores, 204- blancos complementaria,348-350 - doc x pagar If gvr.DataKey("CveConceptoContable").ToEntero = 41 Then CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero Else diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index e064ddac8..28fd47c91 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -658,7 +658,7 @@ Partial Class Inventarios_EntregaAlmacen Dim ObjInventario As New ClsInventarios - If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then + If ObjInventario.EntregaAlmacenGet(CveVenta, UsuarioActual.CveEmpresa, CveAlmacen) Then If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) @@ -2181,7 +2181,7 @@ Partial Class Inventarios_EntregaAlmacen 'VALIDA SI HUBO CAMBIOS EN LA EXISTENCIA Dim DtDatosVenta As New DataTable - If ObjInventario.EntregaAlmacenGet(CveVentaSurtir) Then + If ObjInventario.EntregaAlmacenGet(CveVentaSurtir, UsuarioActual.CveEmpresa) Then DtDatosVenta = ObjInventario.DtResultados End If Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal) diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb index 55a9eb262..1ee22d54b 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx.vb +++ b/Inventarios/RepNotasSinAlmacen.aspx.vb @@ -1,7 +1,6 @@ Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms -Imports Stimulsoft.Report.QuickButtons.StiWpfQuickButtonAttribute Partial Class RepNotasSinAlmacen Inherits ClsPaginas @@ -122,8 +121,8 @@ Partial Class RepNotasSinAlmacen CargaDatos() End Sub - Private Sub CargaDatos() - Dim Reporte As New ClsInventarios + Private Sub CargaDatos() + Dim CveClienteProveedor As Integer = -1 Dim TipoDocumento As String = DdlTipoDocto1.SelectedValue @@ -139,14 +138,18 @@ Partial Class RepNotasSinAlmacen Else CveClienteProveedor = DdlCliente.SelectedValue.ToEntero End If - - If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then + Dim Reporte As New ClsInventarios + If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then + Dim dtt As DataTable = Reporte.DtResultados + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria + dtt = dtt.fit + End If GvVentas.DataSource = Reporte.DtResultados DtNotasSinAlmacenVentas = Reporte.DtResultados Else GvVentas.DataSource = Nothing - End If - + End If + Reporte.Dispose() GvVentas.DataBind() Else @@ -155,15 +158,15 @@ Partial Class RepNotasSinAlmacen CveClienteProveedor = -1 Else CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero - End If - + End If + Dim Reporte As New ClsInventarios If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then GvCompras.DataSource = Reporte.DtResultados DtNotasSinAlmacenCompras = Reporte.DtResultados Else GvCompras.DataSource = Nothing - End If - + End If + Reporte.Dispose() GvCompras.DataBind() 'If (GvCompras.Rows.Count > 0) Then @@ -174,8 +177,8 @@ Partial Class RepNotasSinAlmacen End If UpDatosGvVentas.Update() - UpDatosGvCompras.Update() - Reporte.Dispose() + UpDatosGvCompras.Update() + End Sub diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 2400b9d2d..47e6963ce 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -4252,7 +4252,8 @@ Partial Class Clientes ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) End If - Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True)) + Dim tusuario As Usuario = UsuarioActual + Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(tusuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True)) Hilo.Start() Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion) Catch ex As Exception @@ -4332,7 +4333,7 @@ Partial Class Clientes End If End If End Sub - Private Sub MandaCorreoEstadoCuenta(CveUsuario As Integer, CveEmpresa As Integer, CveCliente As Integer, File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False) + Private Sub MandaCorreoEstadoCuenta(UsuarioActual As Usuario, CveEmpresa As Integer, CveCliente As Integer, File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False) Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) 'a.GuardaLog() @@ -4344,8 +4345,8 @@ Partial Class Clientes Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) If Envio AndAlso GuardarBitacora Then - Using ObjBitacora As New ClsOIEventos - ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", CveUsuario, CveEmpresa, CveCliente:=CveCliente) + Using ObjBitacora As New ClsOIEventos(UsuarioActual:=UsuarioActual) + ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, CveEmpresa, CveCliente:=CveCliente) End Using End If diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 33007aedc..013fb3576 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -2057,8 +2057,8 @@ Partial Class Ventas_ClientesAbonar Dim dtt As DataTable = Nothing Dim Deudores As New ClsMovimientos If Deudores.GetDocumentosxPagarDetalle(CveCliente, tCveMoneda, 2, UsuarioActual.CveEmpresa) Then - DdlPrestamo.DataSource = Deudores.DtResultados '.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0") - dtt = Deudores.DtResultados + dtt = Deudores.DtResultados.FiltraParametros("CveProveedor > 0 AND Saldo > 0 AND CveIE > 0", "FechaDocumento") + DdlPrestamo.DataSource = dtt End If Deudores.Dispose() diff --git a/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs b/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs index 94d71c882..af42ae3fd 100644 --- a/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs +++ b/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs @@ -358,7 +358,8 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas CveIE = Gv.DataKey("CveIE").ToEntero(); Saldo = Gv.DataKey("Saldo").ToDecimal(); SaldoAdmin = Saldo; - } + } + Saldo = -Saldo; // invertimos el saldo para que se haga negativo para que sea ABono ImporteTotalGasto += Saldo; if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, SaldoAdmin, Saldo, ConPreP.CveConcepto, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE: CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero())) diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index 2adae64a3..5939e44d1 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -125,6 +125,13 @@ Partial Class Ventas_RepVentas LnkDescargaCartaPorte.Visible = True End If + If Opcion = "Cot" Then + DdlTipoComprobante.SelectedValuesIfExistM(Opcion) + DdlGrupo.SelectedValueExist("7") + DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty) + DdlEstatus.ClearSelection() + End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then LblServicioDomicilioFiltro.Visible = True DVServicioDomicilio.Visible = True