diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6f3d45107..c456d2ffa 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4,6 +4,7 @@ Option Strict On Imports System.Data Imports System.Data.SqlClient Imports Extensiones +Imports Profact.TimbraCFDI40 Public Class ClsVentas Implements IDisposable @@ -1826,6 +1827,7 @@ Public Class ClsVentas Try SqlAdapter.Fill(Data) Retorno = True + Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los datos del reporte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -1856,38 +1858,53 @@ Public Class ClsVentas 'Reporte de Ventas por Período + 'Public Function GetRepVentasPeriodos(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, + ' CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", + ' Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, + ' Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean + + Public Function GetRepVentasPeriodos(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, - CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", - Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, - Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean + CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", + Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, + Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False, + Optional EsDistribuidor As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ServicioDomicilio As Integer = -1, Optional EsFacturaGlobal As Integer = -1, Optional EsFilial As Integer = -1, + Optional VerEn As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasGetRepPeriodo") With SqlAdapter.SelectCommand.Parameters - '.Add("@CveVenta", SqlDbType.Int).Value = CveVenta + 'PARAMETROS BASE .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaIEjec", SqlDbType.Date).Value = FechaIEjec .Add("@FechaFEjec", SqlDbType.Date).Value = FechaFEjec .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyectoEjecucion", SqlDbType.Int).Value = CveSubProyectoEjecucion - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEstatus", SqlDbType.VarChar).Value = CveEstatus .Add("@IVA", SqlDbType.VarChar).Value = IVA .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@GPO", SqlDbType.Int).Value = Gpo .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@VerEn", SqlDbType.Int).Value = VerEn .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion + .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable + .Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion + .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio + .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal + .Add("@EsFilial", SqlDbType.Int).Value = EsFilial + 'PARAMETROS EXTRA + .Add("@VerEn", SqlDbType.Int).Value = VerEn End With Try @@ -2485,33 +2502,29 @@ Public Class ClsVentas Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional ReqAutorizacion As Boolean = False) As Integer @@ -2613,30 +2626,27 @@ Public Class ClsVentas Return Retorno End Function - - - Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionEstatusUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionEstatusUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + - Return Retorno - End Function - - Public Function RemovePromociones(CvePromocion As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3294,36 +3304,33 @@ Public Class ClsVentas Return Retorno End Function - + Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False, Optional PrimerProducto As Boolean = False) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_RepRemisionesGet") + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepRemisionesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.VarChar).Value = FechaI + .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaV", SqlDbType.VarChar).Value = FechaV + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario + .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF - .Add("@FechaV", SqlDbType.VarChar).Value = FechaV - .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario - .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetRepRemisionesSinFacturarDetalle(FechaI As String, FechaF As String, FechaV As String, CveCliente As Integer, CveContrato As Integer, CveVenta As Integer, CveEmpresa As Integer, CveSubProyecto As String, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRemisionesDetalleGet") @@ -7614,29 +7621,26 @@ Public Class ClsVentas Return Retorno End Function - - Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentasSabanaDatos") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio - .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function + Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasSabanaDatos") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio + .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function #Region "IDisposable Support" diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index ea5c15c34..26e98bffa 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1689,9 +1689,16 @@ Namespace Modelos Timbre.Comprobante.Folio = Me.Folio.ToString() Timbre.Comprobante.Serie = Me.Serie Timbre.Comprobante.Fecha = Me.FechaCP - Timbre.Comprobante.FormadePago = Me.ClaveFormaPagoSAT - Timbre.Comprobante.CondicionesdePago = Me.FormaPago - Timbre.Comprobante.MetodoPago = Me.ClaveMetodoPagoSAT + + 'Timbre.Comprobante.FormadePago = Me.ClaveFormaPagoSAT + 'Timbre.Comprobante.CondicionesdePago = Me.FormaPago + 'Timbre.Comprobante.MetodoPago = Me.ClaveMetodoPagoSAT + + Timbre.Comprobante.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {Me.CveMetodoPago}") + Timbre.Comprobante.FormadePago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {Me.CveFormaPago}") + Timbre.Receptor.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {Me.CveUsoCFDI}") + Timbre.Comprobante.CondicionesdePago = ClsPaginas.GlobalDTVtaFormaPago().FiltroPrimeroValor("FormaPago", $"CveFormaPago = {Me.CveFormaPago}") + Timbre.Comprobante.SubTotal = Me.SubTotal Timbre.Comprobante.Descuentos = Me.Descuento Timbre.Comprobante.Moneda = Me.MonedaSAT @@ -1720,7 +1727,7 @@ Namespace Modelos Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Me.ClaveUsoCFDISAT + 'Timbre.Receptor.UsoCFDI = Me.ClaveUsoCFDISAT Dim totSubTotal As Decimal = Me.SubTotal Dim totIVA As Decimal = Me.IVA diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8ad5465df..518a66355 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1284,6 +1284,32 @@ Partial Class Compras_Compras End Property + Private Property ObsOC As String + Get + If ViewState("ObsOC") Is Nothing Then + ViewState("ObsOC") = "" + End If + + Return ViewState("ObsOC").ToString + End Get + Set(value As String) + ViewState("ObsOC") = value + End Set + End Property + + Private Property AplicarObsOC As Boolean + Get + If ViewState("AplicarObsOC") Is Nothing Then + ViewState("AplicarObsOC") = False + End If + + Return Boolean.Parse(ViewState("AplicarObsOC").ToString) + End Get + Set(value As Boolean) + ViewState("AplicarObsOC") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -5789,6 +5815,10 @@ Partial Class Compras_Compras Dim ObsGDiaz As String = If(EsGrupoDiaz, TxtObsFact.Text, "") + If AplicarObsOC Then + ObsGDiaz = ObsOC + End If + For Each tCveAlmacen As Integer In ListAlmacenes If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then Continue For @@ -15049,7 +15079,18 @@ Partial Class Compras_Compras + Dim ObsOCAsignado As Boolean = False + For Each CveOCItem As String In ArrayCveOC.Distinct + + + If Not ObsOCAsignado Then + If ObjOC.GetOC(CveOCItem.ToEntero, UsuarioActual.CveEmpresa) Then + ObsOC = ObjOC.Descripcion + End If + ObsOCAsignado = True + End If + If ObjOC.GetOrdenesDetalle(CveOCItem.ToEntero, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then If IsNothing(DTOCTemp) Then DTOCTemp = ObjOC.DtResultados.Copy @@ -15932,6 +15973,8 @@ Partial Class Compras_Compras End If + AplicarObsOC = True + CalculaTotales() End Sub diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 066cf8806..a8be99ea4 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -6080,6 +6080,7 @@ Partial Class Compras_eFacturas End Sub Private Sub VinculacionAutomaticaRNC() + Dim ErrorProceso As Boolean = False Dim ErrorProcesoStr As String = "" Dim Contador As Integer = 0 @@ -6088,7 +6089,6 @@ Partial Class Compras_eFacturas 'DataKeyNames="CveFactura,CveCompra,CveProveedor,SerieFolio,NombreProveedor,UUID,RFCDe,RFCPara,TipoFactura,FueValidado,TipoComprobante,Version,RFCde,XML,PDF,BloquePorComplemento,Total,CveTipoProveedor,FechaFactura" - For Each GvRow As GridViewRow In GvD.Rows If GvRow.DataKey("TipoComprobante") = "E" Then @@ -6113,31 +6113,97 @@ Partial Class Compras_eFacturas CompraActual.Descripcion = TxtDescripcionCompra.Text.Trim CompraActual.NombreProveedor = GvRow.DataKey("NombreProveedor") - Dim listaRNC As New List(Of Integer) + Dim DT_RNC As New DataTable + DT_RNC.Columns.Add("CveCompra", GetType(Integer)) + DT_RNC.Columns.Add("CveSubProyecto", GetType(Integer)) + DT_RNC.Columns.Add("Saldo", GetType(Decimal)) + + For Each DR As String In CompraActual.DocumentosRelacionadosUUIDSList If Objcompras.GetVinculacionRNC(UUID:=DR, CveEmpresa:=UsuarioActual.CveEmpresa) Then - + For Each drRNC As DataRow In Objcompras.DtResultados.Rows + Dim DR_RNC As DataRow = DT_RNC.NewRow + DR_RNC("CveCompra") = drRNC("CveCompra").ToString.ToEntero + DR_RNC("CveSubProyecto") = drRNC("CveSubProyecto").ToString.ToEntero + DR_RNC("Saldo") = drRNC("Saldo").ToString.ToDecimal + DT_RNC.Rows.Add(DR_RNC) + Next End If Next + Dim Saldo As Decimal = DT_RNC.SUM("Saldo") + Dim CveSubProyectoPrincipal As Integer = DT_RNC.FiltroPrimeroValor("CveSubProyecto").ToEntero + + If Saldo >= CompraActual.Total Then + + Dim CvePSRNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero + Dim PSRow As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSRNC).FiltroPrimero("") + + + + If CompraActual.ConfiguraRegistroCompra(CvePSRNC, CveSubProyectoPrincipal, -1, -1, + -1, -1, NumeroReembolso:="", + DTProrrateo:=New DataTable, DTPagosDeudores:=New DataTable, TipoComprobante:="E") Then + + If CompraActual.AddCompra(Objcompras.IniciaTransacSQL()) Then + Contador = Contador + 1 + Else + ErrorProceso = True + ErrorProcesoStr = CompraActual.MensajeError + Exit For + End If + Else + ErrorProceso = True + ErrorProcesoStr = CompraActual.MensajeError + Exit For + End If + + + + If Not ErrorProceso Then + Dim ObjConta As New ClsContabilidad(Objcompras.IniciaTransacSQL()) + Dim TotalSaldo As Decimal = CompraActual.Total + Dim Referencia As String = GvRow.DataKey("SerieFolio") + Dim Concepto As String = GvRow.DataKey("SerieFolio") + Dim TipoCambio As Decimal = GlobalTipoCambio(GvRow.DataKey("FechaFactura").ToDate).ToDecimal + + For Each drRNC As GridViewRow In DT_RNC.Rows + + + Dim ImporteRNCSaldar As Decimal = drRNC.DataKey("Saldo").ToDecimal + Dim CveCompraRNC As Integer = drRNC.DataKey("CveCompra").ToEntero + If ImporteRNCSaldar > TotalSaldo Then ImporteRNCSaldar = TotalSaldo + + If Not ErrorProceso Then + + If Not ObjConta.AddPrePolizasDetalle(CompraActual.CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 373, Referencia, Concepto, CveCompra:=CveCompraRNC, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio, + CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then + ErrorProceso = True + Exit For + End If + + If Not ErrorProceso Then + Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor) + + If Not ObjConta.AddPrePolizasDetalle(CompraActual.CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, ConPrePNC.CveConcepto, Referencia, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio, + CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then + ErrorProceso = True + Exit For + End If + End If + + If Not ErrorProceso Then + TotalSaldo = TotalSaldo - ImporteRNCSaldar + End If + + End If + + Next + End If + + End If - 'If CompraActual.ConfiguraRegistroCompra(DdlPS.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, CveCajachica, CvePersonal, - ' DdlRetIVAConcepto.SelectedValue.ToEntero, DdlRetISRConcepto.SelectedValue.ToEntero, NumeroReembolso:=TxtNumeroReembolso.Text, - ' DTProrrateo:=DTProrrateo, DTPagosDeudores:=New DataTable) Then - ' 'FIX ME OIC Recuerda cambiar el tipo de documento al registrar, actualmente tiene FAC y NC uno u otro, ajustar para que registre *** Egs *** cuado TipoComprobante = 'E' - ' If CompraActual.AddCompra(Objcompras.IniciaTransacSQL()) Then - ' Contador = Contador + 1 - ' Else - ' ErrorProceso = True - ' ErrorProcesoStr = CompraActual.MensajeError - ' Exit For - ' End If - 'Else - ' ErrorProceso = True - ' ErrorProcesoStr = CompraActual.MensajeError - ' Exit For - 'End If 'If RBLContado.SelectedValue.ToEntero = 4 Then 'Deudores ' Dim CompraActualPagar = New Compra @@ -6850,7 +6916,8 @@ Public Class ClsCompraManager #End Region End Sub - Public Function ConfiguraRegistroCompra(CvePS As Integer, CveSubProyecto As Integer, CveCajaChica As Integer, CvePersonal As Integer, CveRetIVAConcepto As Integer, CveRetISRConcepto As Integer, NumeroReembolso As String, DTProrrateo As DataTable, DTPagosDeudores As DataTable) As Boolean + Public Function ConfiguraRegistroCompra(CvePS As Integer, CveSubProyecto As Integer, CveCajaChica As Integer, CvePersonal As Integer, CveRetIVAConcepto As Integer, CveRetISRConcepto As Integer, NumeroReembolso As String, DTProrrateo As DataTable, + DTPagosDeudores As DataTable, Optional TipoComprobante As String = "") As Boolean Dim respuesta As Boolean = True Me.CveSubProyecto = CveSubProyecto @@ -6863,6 +6930,10 @@ Public Class ClsCompraManager Me.NumeroReembolso = NumeroReembolso Me.DTPagosDeudores = DTPagosDeudores + If TipoComprobante.Length > 0 Then + Me.TipoComprobante = TipoComprobante + End If + Dim dRowSubProyecto As DataRow = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto).FiltroPrimero("") If dRowSubProyecto IsNot Nothing Then @@ -6877,7 +6948,7 @@ Public Class ClsCompraManager Dim DTIndex As DataTable = TmpDT.FiltraParametros("", DistinctColumns:={"Consec"}) For Each dRowIndex As DataRow In DTIndex.Rows - If Not UpdatePSReembolso(dRowIndex("Consec").ToString.ToEntero, CvePS) Then + If Not UpdatePSDetalles(dRowIndex("Consec").ToString.ToEntero, CvePS) Then respuesta = False End If Next @@ -7830,7 +7901,7 @@ Public Class ClsCompraManager End Sub - Private Function UpdatePSReembolso(Index As Integer, CvePS As Integer) As Boolean + Private Function UpdatePSDetalles(Index As Integer, CvePS As Integer) As Boolean Dim Respuesta As Boolean = True diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc index 987d6d497..d0e580d43 100644 --- a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -5884,6 +5884,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot + LightGrey 2pt 2pt 2pt @@ -6015,6 +6016,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot + LightGrey 2pt 2pt 2pt @@ -6134,6 +6136,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot + LightGrey 2pt 2pt 2pt diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 014cea3f9..526136ddb 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -285,7 +285,8 @@
- + <%----%> +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index d9d4fac80..791c11dbb 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1130,10 +1130,18 @@ Partial Class Inventarios_EntradasSalidas 'TxtPedidoContrato.Text = Mov.PedidoContrato If Mov.CveProveedor > 0 Then - DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, Mov.CveProveedor) - DdlProveedor.DataBind() - DdlProveedor.SelectedValueExist(Mov.CveProveedor) - DdlProveedor.Enabled = False + 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, Mov.CveProveedor) + 'DdlProveedor.DataBind() + 'DdlProveedor.SelectedValueExist(Mov.CveProveedor) + 'DdlProveedor.Enabled = False + + 'CargaProveedores + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.txtValue.Value = Mov.CveProveedor.ToString + DdlProveedores.txtText.Value = Mov.DtResultados.Rows(0)("RazonSocial").ToString + DdlProveedores.SelectedValue = "-1" + TrProveedor.Visible = True End If @@ -1766,6 +1774,10 @@ Partial Class Inventarios_EntradasSalidas End Sub Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + If DdlConcepto.SelectedValue.ToEntero = 28 AndAlso DdlProveedores.SelectedValue.ToEntero <= 0 Then + Alert("Debe seleccionar un proveedor", TipoMensaje.MsgAdvertencia) + Exit Sub + End If If Not IsDate(TxtFecha.Text.Replace(",", "")) Then Alert("Debe seleccioanr una fecha valida", TipoMensaje.MsgAdvertencia) @@ -1978,7 +1990,7 @@ Partial Class Inventarios_EntradasSalidas tFolio = If(TxtFolio.Text.ToEntero <> FolioAsignado, TxtFolio.Text.ToEntero, -1) End If Dim tCveProveedor As Integer = -1 - If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero + If DdlProveedores.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedores.SelectedValue.ToEntero Dim obs As String = TxtObservaciones.Text.Trim() If obs = "" Then obs = DdlConcepto.SelectedItem.Text @@ -2604,8 +2616,13 @@ Partial Class Inventarios_EntradasSalidas Case "28" TrProveedor.Visible = True - DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedor.DataBind() + 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + 'DdlProveedor.DataBind() + 'CargaProveedores + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Seleccione Uno" + DdlProveedores.SelectedValue = "-1" If UsuarioActual.CveEmpresa = 119 Then txtPrecio.Enabled = False Case Else @@ -5288,7 +5305,7 @@ Partial Class Inventarios_EntradasSalidas If TxtFecha.Visible Then TxtFecha.Enabled = True If TxtResponsable.Visible Then TxtResponsable.Enabled = True If TxtObservaciones.Visible Then TxtObservaciones.Enabled = True - If DdlProveedor.Visible Then DdlProveedor.Enabled = True + If DdlProveedores.Visible Then DdlProveedores.Enabled = True If TxtRemision.Visible Then TxtRemision.Enabled = True If DdlMoneda.Visible Then DdlMoneda.Enabled = True If TxtGuia.Visible Then TxtGuia.Enabled = True diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 9ed15756f..5847b3b9f 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -1105,6 +1105,8 @@ Partial Class OC_OC End If End If + DdlUsoCFDI.SelectedValueExist(1) + End If 'FIX - no funcionan los eventos despues de hacer postback diff --git a/Ventas/RepRemisiones.aspx b/Ventas/RepRemisiones.aspx index 12bd915ec..51deb1ca1 100644 --- a/Ventas/RepRemisiones.aspx +++ b/Ventas/RepRemisiones.aspx @@ -208,6 +208,7 @@
+
" style="display: inline-block; margin-right: -20px; width: 150px;" /> @@ -221,8 +222,18 @@ CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None"> - - + + <%----%> + + + + Fecha + + + + + + diff --git a/Ventas/RepRemisiones.aspx.vb b/Ventas/RepRemisiones.aspx.vb index 19a3d659f..366aaedd6 100644 --- a/Ventas/RepRemisiones.aspx.vb +++ b/Ventas/RepRemisiones.aspx.vb @@ -130,7 +130,12 @@ Partial Class RepRemisiones e.Row.Cells(2).ForeColor = Drawing.Color.Red End If - e.Row.Cells(1).Text = $"{e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm:ss")}" + 'e.Row.Cells(1).Text = $"{e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm:ss")}" + Dim LnkFecha = e.Row.FCLinkButton("LnkFecha") + LnkFecha.Text = If(UsuarioActual.Empresa.Funcionalidad(578) = "1", e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm"), e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm:ss")) + LnkFecha.Attributes("onclick") = $"window.open('./Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}', '_blank'); return false;" + + End If @@ -155,8 +160,8 @@ Partial Class RepRemisiones GvDatos.Columns(7).Visible = True 'columna de fecha GvDatos.Columns(1).HeaderText = "Fecha Cirugía" - CType(GvDatos.Columns(1), HyperLinkField).DataTextFormatString = "{0:dd/MM/yyyy HH:mm}" - CType(GvDatos.Columns(1), HyperLinkField).ItemStyle.Width = Unit.Pixel(120) + 'CType(GvDatos.Columns(1), HyperLinkField).DataTextFormatString = "{0:dd/MM/yyyy HH:mm}" + 'CType(GvDatos.Columns(1), HyperLinkField).ItemStyle.Width = Unit.Pixel(120) GvDatos.Columns(16).Visible = True End If diff --git a/Ventas/RepVentasPeriodo.aspx b/Ventas/RepVentasPeriodo.aspx index 15e46ca00..47b26fde0 100644 --- a/Ventas/RepVentasPeriodo.aspx +++ b/Ventas/RepVentasPeriodo.aspx @@ -15,6 +15,39 @@ color: #FFF; font-weight: bold; } + + .select2 .select2-selection__rendered { + line-height: 1; + color: #111; + } + + .select2 .select2-selection--multiple { + box-sizing: border-box; + cursor: pointer; + display: block; + min-height: 20px; + user-select: none; + -webkit-user-select: none; + } + + .select2-container--default .select2-selection--multiple .select2-selection__choice { + margin-top: 10px; + } + + .select2-selection__rendered { + margin-top: 0px; + height: 25px; + } + + .select2-selection { + margin-top: 0px; + height: 31px; + } + + .select2-container--default.select2-container--focus .select2-selection--multiple { + border: none; + outline: 0; + } @@ -67,18 +100,17 @@ -
+
-
+
- - + @@ -86,16 +118,54 @@ - + + <%-- + + + + + + + + + --%>
- - -
- - - +
+ Fecha Inicio: + +
+
+
+ + + + +
+ + + + + + +
+
+ Fecha Fin: + +
+
+
+ + + + +
+ + + + + +
-
@@ -120,67 +190,52 @@
- - - -
-
-
+