diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 1b16277ef..b06d1b586 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -1162,7 +1162,7 @@ Public Class ClsCompras Return Retorno End Function - Public Function GetFacturasComparacionXML(Version As String, Xml As String, CveEmpresa As Integer) As Boolean + Public Function GetFacturasComparacionXML(Version As String, Xml As String, CveEmpresa As Integer, Optional RestriccionesVinculacion As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComparacionXML") @@ -1170,6 +1170,7 @@ Public Class ClsCompras .Add("@Version", SqlDbType.VarChar, 4).Value = Version .Add("@Xml", SqlDbType.Xml).Value = Xml .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@RestriccionesVinculacion", SqlDbType.VarChar, 100).Value = RestriccionesVinculacion .Add("@Error", SqlDbType.VarChar, 300).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 85a36307a..cf04e3794 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2008,7 +2008,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_RepNotasSinAlmacen") @@ -2021,6 +2021,7 @@ Public Class ClsInventarios .Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try @@ -2257,6 +2258,25 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetExistenciasPSVenta(CveVenta As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ExistenciasVentaGET") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .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 obtener las existencias de los almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional MostrarTodosAlmacenes As Boolean = False, Optional CveAlmacen As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index c48d73aee..68de58744 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -521,6 +521,27 @@ Public Class ClsMovimientos OnError("Ocurrió un error al consultar los Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + + Public Function GetAnticiposNCIxCAutorizaciones(CveCliente As Integer, CveEmpresa As Integer, FechaI As DateTime, FechaF As DateTime) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ClienteAnticiposNCIxCAutorizaciones") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar los autorizaciones de anticipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 29c6072ed..622e12946 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -715,7 +715,7 @@ Public Class ClsOC Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1", - Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional EsTemporal As Boolean = False) As Boolean + Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraAdd") @@ -763,8 +763,6 @@ Public Class ClsOC .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago - .Add("@EsTemporal", SqlDbType.Bit).Value = EsTemporal - .Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output @@ -1675,7 +1673,7 @@ Public Class ClsOC CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, - Optional MetodoPago As Integer = -1, Optional Serie As String = "-1", Optional TieneAnticipo As Integer = -1, Optional EsTemporal As Integer = -1) As Boolean + Optional MetodoPago As Integer = -1, Optional Serie As String = "-1", Optional TieneAnticipo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraRep") @@ -1708,9 +1706,6 @@ Public Class ClsOC .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago .Add("@Serie", SqlDbType.VarChar).Value = Serie .Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo - .Add("@EsTemporal", SqlDbType.Int).Value = EsTemporal - - End With Try @@ -1849,7 +1844,7 @@ Public Class ClsOC Public Function GetOrdenesPendientes(pTipo As String, pTipoBusqueda As Integer, pCveEmpresa As Integer, pCveProyecto As Integer, pCveSubProyecto As Integer, pCveEstatusCompra As Integer, pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, - Optional TieneAnticipo As Integer = -1, Optional EsTemporal As Integer = -1) As Boolean + Optional TieneAnticipo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraPendientes") @@ -1867,7 +1862,6 @@ Public Class ClsOC .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta .Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo - .Add("@EsTemporal", SqlDbType.Int).Value = EsTemporal End With Try @@ -2247,7 +2241,7 @@ Public Class ClsOC #End Region #Region " OC X VINCULAR COMPRA " - Public Function GetPendietePorSurtirOC(FechaI As String, FechaF As String, CveProveedor As Integer, Folio As Integer, CveSubProyecto As Integer, CveCliente As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1) As Boolean + Public Function GetPendietePorSurtirOC(FechaI As String, FechaF As String, CveProveedor As Integer, Folio As Integer, CveSubProyecto As Integer, CveCliente As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1, Optional Gpo As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_ComprasPendientesPorSurtirGet") @@ -2261,6 +2255,7 @@ Public Class ClsOC .Add("@FechaF", SqlDbType.VarChar).Value = FechaF .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@Gpo", SqlDbType.Int).Value = Gpo End With Try @@ -2631,12 +2626,13 @@ Public Class ClsOC End Function - Public Function PendientesCompra(CvePS As Integer, CveEmpresa As Integer) As Boolean + Public Function PendientesCompra(CvePS As Integer, CveSubProyectos As String, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_PendientesCompra") With SqlAdapter.SelectCommand.Parameters .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveSubProyectos", SqlDbType.VarChar, 100).Value = CveSubProyectos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bc48001fa..9f0cf23aa 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1260,21 +1260,21 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Public Shared Property GlobalDTMetodosPago() As DataTable - Get - Dim AppNombre As String = "GlobalDTMetodosPago" - If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then - Dim ObjMetodoPago As New ClsVentas - If ObjMetodoPago.GetMetodosPago() Then HttpContext.Current.Application(AppNombre) = ObjMetodoPago.DtResultados - ObjMetodoPago.Dispose() - End If - GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) - End Get - Set(value As DataTable) - Dim AppNombre As String = "GlobalDTMetodosPago" - HttpContext.Current.Application(AppNombre) = value - End Set - End Property + 'Public Shared Property GlobalDTMetodosPago() As DataTable + ' Get + ' Dim AppNombre As String = "GlobalDTMetodosPago" + ' If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + ' Dim ObjMetodoPago As New ClsVentas + ' If ObjMetodoPago.GetMetodosPago() Then HttpContext.Current.Application(AppNombre) = ObjMetodoPago.DtResultados + ' ObjMetodoPago.Dispose() + ' End If + ' GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + ' End Get + ' Set(value As DataTable) + ' Dim AppNombre As String = "GlobalDTMetodosPago" + ' HttpContext.Current.Application(AppNombre) = value + ' End Set + 'End Property Property GlobalDTModulos(Optional CveModulo As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTModulos" @@ -7122,16 +7122,13 @@ Public Class ClsPaginas params.Add(New ReportParameter("MetodoPago", Vta.ClaveMetodoPagoSAT.ToString)) End If If Vta.Version.Contiene("3.3", "4.0") Then - params.Add(New ReportParameter("FormaPago", Vta.FormaPago33.ToString)) - params.Add(New ReportParameter("MetodoPago", Vta.MetodoPago33.ToString)) + params.Add(New ReportParameter("FormaPago", Vta.FormaPago)) + params.Add(New ReportParameter("MetodoPago", Vta.MetodoPago)) params.Add(New ReportParameter("UsoCFDI", Vta.UsoCFDI)) If Vta.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then params.Add(New ReportParameter("TipoRelacionTexto", If(Vta.Timbre.CFDIRelacionados.TipoRelacionTexto Is Nothing, "", Vta.Timbre.CFDIRelacionados.TipoRelacionTexto))) params.Add(New ReportParameter("FolioFiscalRelacionado", If(Vta.Timbre.CFDIRelacionados.UUID.Count = 0, "", Vta.Timbre.CFDIRelacionados.UUID.Item(0)))) End If - Else - params.Add(New ReportParameter("FormaPago", Vta.FormaPagoText)) - params.Add(New ReportParameter("MetodoPago", Vta.MetodoPago.ToString)) End If 'DIRECCION ENVIO If Vta.EnviarA IsNot Nothing AndAlso Vta.EnviarA.CveDireccionEnvio > 0 Then @@ -9819,6 +9816,7 @@ Public Class ClsPaginas Public Property RetISR As Decimal Public Property PorcentajeIVA As Decimal Public Property CveSubProyecto As Integer + Public Property CveUsoCFDI As Integer Public Property UsuarioActual As Usuario End Class diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 0f4eea25a..60ced51bc 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -602,7 +602,7 @@ Public Class ClsVentas Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1, Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha, - Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveCondicionEntrega As Integer = -1, Optional FolioRemision As String = "-1") As Boolean + Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveCondicionEntrega As Integer = -1, Optional FolioRemision As String = "-1", Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") @@ -643,6 +643,7 @@ Public Class ClsVentas .Add("@Episodio", SqlDbType.VarChar).Value = Episodio .Add("@CveCondicionEntrega", SqlDbType.Int).Value = CveCondicionEntrega .Add("@FolioRemision", SqlDbType.VarChar).Value = FolioRemision + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With Try @@ -657,7 +658,7 @@ Public Class ClsVentas Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String, Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, - Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1") As Boolean + Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasObservacionesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -678,6 +679,8 @@ Public Class ClsVentas .Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir .Add("@Paciente", SqlDbType.VarChar).Value = Paciente .Add("@Episodio", SqlDbType.VarChar).Value = Episodio + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico + End With Try @@ -835,12 +838,13 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean + Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date, CveUsuarioModifico As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasFechaVencimientoUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With Try SqlAdapter.Fill(Data) @@ -2504,7 +2508,7 @@ Public Class ClsVentas 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) As Integer + Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional ReqAutorizacion As Boolean = False) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Vta_PromocionesAdd") @@ -2522,6 +2526,7 @@ Public Class ClsVentas .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor + .Add("@ReqAutorizacion", SqlDbType.Bit).Value = ReqAutorizacion .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -2668,7 +2673,8 @@ Public Class ClsVentas Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1, - Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False, Optional Opcion As Integer = 1) As Boolean + Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False, Optional Opcion As Integer = 1 + ) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleAdd") @@ -2695,6 +2701,7 @@ Public Class ClsVentas .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño .Add("@IncluyeImpuestos", SqlDbType.Bit).Value = IncluyeImpuestos .Add("@Opcion", SqlDbType.Int).Value = Opcion + End With Try @@ -5240,7 +5247,6 @@ Public Class ClsVentas .Add("@Importe", SqlDbType.Money).Value = Importe .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With Try @@ -5992,7 +5998,7 @@ Public Class ClsVentas #End Region - Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "", Optional PorcentajeDescuento As Decimal = 0, Optional CveVenta As Integer = -1) As Boolean + Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "", Optional PorcentajeDescuento As Decimal = 0, Optional CveVenta As Integer = -1, Optional CveIE As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_AutorizacionLimitesAdd") With SqlAdapter.SelectCommand.Parameters @@ -6008,6 +6014,7 @@ Public Class ClsVentas .Add("@PorcentajeDescuento", SqlDbType.Decimal).Value = PorcentajeDescuento .Add("@Motivo", SqlDbType.VarChar).Value = Motivo .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveIE", SqlDbType.Int).Value = CveIE End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 80ac46373..196c9b331 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -481,7 +481,7 @@ Namespace Modelos If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then setValues(ObjVentas.DtResultados.Rows(0)) - SetMetodoPago() + 'SetMetodoPago() SetMoneda() If Me.CveSubProyecto > 0 Then @@ -1294,10 +1294,7 @@ Namespace Modelos ObjFactura.Version = "4.0" ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa - 'ObjFactura.CveMoneda = CveMoneda - 'ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") - 'ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}") - 'ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal()) + ObjFactura.TipoDocto = TipoDocto ObjFactura.Folio = -1 ObjFactura.Serie = "-1" @@ -1315,31 +1312,31 @@ Namespace Modelos ObjFactura.CveCliente = CveCliente ObjFactura.SetCliente() - Dim ObjCliente As New ClsClientes - If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - - ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - - ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI - ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - End If - End If - - 'If ObjCliente.GetSucursales(ObjFactura.CveCliente) Then + 'Dim ObjCliente As New ClsClientes + 'If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then ' If ObjCliente.DtResultados.Rows.Count > 0 Then - ' ObjFactura.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero()) - ' Else - ' ObjFactura.CveClienteSucursal = -1 + ' ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33 + ' ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ' ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + + ' ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33 + ' ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + ' ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + + ' ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI + ' ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) + ' ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) ' End If 'End If - ObjCliente.Dispose() + + ''If ObjCliente.GetSucursales(ObjFactura.CveCliente) Then + '' If ObjCliente.DtResultados.Rows.Count > 0 Then + '' ObjFactura.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero()) + '' Else + '' ObjFactura.CveClienteSucursal = -1 + '' End If + ''End If + 'ObjCliente.Dispose() ObjFactura.CveSubProyecto = CveSubProyecto.ToEntero @@ -1348,6 +1345,8 @@ Namespace Modelos ObjFactura.CveSubProyectoCobranza = CveSubProyecto.ToEntero ObjFactura.CveSubProyectoEjecucion = CveSubProyecto.ToEntero + + ObjFactura.CveMoneda = CveMoneda 'DETALLES ObjFactura.DtDetalle = CreaDTFactura() @@ -1359,7 +1358,6 @@ Namespace Modelos ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR) - 'SUBPROYECTO Catch ex As Exception ObjFactura = Nothing End Try @@ -1719,8 +1717,8 @@ Namespace Modelos Timbre.Comprobante.Folio = Me.Folio.ToString() Timbre.Comprobante.Serie = Me.Serie Timbre.Comprobante.Fecha = Me.FechaCP - Timbre.Comprobante.FormadePago = Me.FormaPagoSAT33 - Timbre.Comprobante.CondicionesdePago = Me.FormaPago33 + Timbre.Comprobante.FormadePago = Me.ClaveFormaPagoSAT + Timbre.Comprobante.CondicionesdePago = Me.FormaPago Timbre.Comprobante.MetodoPago = Me.ClaveMetodoPagoSAT Timbre.Comprobante.SubTotal = Me.SubTotal Timbre.Comprobante.Descuentos = Me.Descuento @@ -1750,7 +1748,7 @@ Namespace Modelos Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Me.ClaveUsoCFDI + Timbre.Receptor.UsoCFDI = Me.ClaveUsoCFDISAT Dim totSubTotal As Decimal = Me.SubTotal Dim totIVA As Decimal = Me.IVA @@ -2201,7 +2199,7 @@ Namespace Modelos If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, - factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, + factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, factura.Observaciones, factura.FechaEjecucion, factura.CveVendedor, factura.Alfa1, factura.Alfa2, factura.Alfa3, factura.Num1, factura.Num2, factura.Num3, factura.Fech1, factura.Fech2, factura.Fech3, factura.CveCorte, factura.NumeroPersonas, factura.CvePrePoliza, factura.CveUsuario, factura.CveEmpresa, @@ -2210,8 +2208,8 @@ Namespace Modelos Entrega:=factura.Entrega, Vigencia:=If(factura.TipoDocto = "Cot", FechaVencimiento, MinFecha), CveAlmacenTraspasoDestino:=CveAlmacenTraspasoDestino, CveAlmacenTraspasoOrigen:=CveAlmacenTraspasoOrigen, CveDireccionEnvio:=factura.CveDireccionEnvio, CveOC:=factura.CveOC, IEPS:=factura.IEPSTC, Serie:=factura.Serie, CveCondicionEntrega:=factura.CveCondicionEntrega, - 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, + PedidoContrato:=factura.PedidoContrato, ObservacionesAlmacen:=factura.ObservacionesAlmacen, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago, + CveMetodoPago33:=factura.CveMetodoPago, 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, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta, CveVentaTerminal:=factura.CveVentaTerminal, CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta, FechaParaSurtir:=factura.FechaParaSurtir, Paciente:=factura.Paciente, Episodio:=factura.Episodio, EsFacturaGlobal:=factura.EsFacturaGlobal, CveSATPeriodicidad:=factura.CveSATPeriodicidad, CveSATMes:=factura.CveSATMes, SATAnio:=factura.SATAnio) Then @@ -3073,7 +3071,7 @@ Namespace Modelos Try Dim AplicaCancelacionConPagos As Boolean = (CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE OrElse CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC) - If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso AplicaCancelacionConPagos AndAlso ValorMultiplicador = -1 Then + If ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso AplicaCancelacionConPagos AndAlso ValorMultiplicador = -1 Then Dim DtPagosVenta As DataTable = Nothing If ObjClientes IsNot Nothing Then @@ -3943,12 +3941,13 @@ Namespace Modelos CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then ErrorPrepoliza = True End If + End If End If 'SI ES PAGO CON DEVOLUCION - If ObjFactura.CveTipoAmortizacionAnticipo = 4 Then + If Not ErrorPrepoliza AndAlso ObjFactura.CveTipoAmortizacionAnticipo = 4 Then If row2("CveConceptoContable").ToString().ToEntero = 277 Then importeMovimiento = row2("Importe").ToString().ToDecimal() @@ -3972,10 +3971,15 @@ Namespace Modelos End If End If + If ErrorPrepoliza Then + Exit For + End If + Next End If - If sumaAmorticaciones <> 0 Then + + If Not ErrorPrepoliza AndAlso sumaAmorticaciones <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, sumaAmorticaciones * tipoCambio, 251, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then @@ -7888,22 +7892,7 @@ Namespace Modelos Public Property TipoCambioDolares As Decimal Public Property ConvertirPesos As Boolean = False Public Property ConvertirDolares As Boolean - Public Property FormaPago As Integer = 0 - - Public ReadOnly Property FormaPagoText As String - Get - Dim retorno As String = "" - Select Case FormaPago - Case 0 - retorno = "PAGO EN UNA SOLA EXHIBICIÓN" - Case 1 - retorno = "PAGO EN PARCIALIDADES" - End Select - Return retorno - End Get - End Property Public Property CondicionesPago As Integer = 0 ' 0 - Contado, 1 - Credito (CHECAR) - Public ReadOnly Property CondicionesPagoText As String Get Dim retorno As String = "" @@ -8091,6 +8080,16 @@ Namespace Modelos Public Sub SetCliente() If CveCliente > 0 Then Cliente = New Modelos.ClienteModel(CveCliente, CveEmpresa) + + Me.CveFormaPago = Cliente.CveFormaPago + Me.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", Me.CveFormaPago)) + + Me.CveMetodoPago = Cliente.CveMetodoPago + Me.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", Me.CveMetodoPago)) + + Me.CveUsoCFDI = Cliente.CveUsoCFDI + Me.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", Me.CveUsoCFDI)) + If Me.CveClienteSucursal > 0 Then Dim ObjCliente As New ClsClientes() If ObjCliente.GetSucursales(CveCliente, Me.CveClienteSucursal) AndAlso ObjCliente.DtResultados.Rows.Count > 0 Then @@ -8127,15 +8126,6 @@ Namespace Modelos End If End If End Sub - Public Sub SetMetodoPago() - If CveMetodoPago > 0 Then - Dim dr As DataRow = ClsPaginas.GlobalDTMetodosPago.FiltroPrimero(String.Format(" CveMetodoPago = {0}", CveMetodoPago)) - If Not IsNothing(dr) Then - MetodoPago = dr("MetodoPago").ToString() - ClaveMetodoPagoSAT = dr("ClaveSAT").ToString() - End If - End If - End Sub Public Sub SetSubProyecto(obj As ClsPaginas) If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then @@ -8150,25 +8140,21 @@ Namespace Modelos End If End If End Sub - Public Property CveClienteSucursal As Integer = 0 Public Property ClienteSucursal As Modelos.SucursalModel Public Property EnviarA As Modelos.EnviarAModel Public Property NumeroContrato As String = "" Public Property PedidoContrato As String = "" Public Property OrdenCompra As String = "" - Public Property CveMetodoPago As Integer = 0 + Public Property CveMetodoPago As Integer = 1 Public Property MetodoPago As String = "" Public Property ClaveMetodoPagoSAT As String = "" - Public Property CveMetodoPago33 As Integer = 1 - Public Property MetodoPago33 As String = "" - Public Property CveFormaPago33 As Integer - Public Property MetodoPagoSAT33 As String = "" - Public Property FormaPago33 As String = "" - Public Property FormaPagoSAT33 As String = "" + Public Property CveFormaPago As Integer + Public Property FormaPago As String = "" + Public Property ClaveFormaPagoSAT As String = "" Public Property UsoCFDI As String = "" Public Property CveUsoCFDI As Integer - Public Property ClaveUsoCFDI As String = "" + Public Property ClaveUsoCFDISAT As String = "" Public Property CveTipoRelacion As Integer = -1 Public Property CveEstatusFactura As Integer Public Property CveVendedor As Integer = 0 @@ -8478,6 +8464,9 @@ Namespace Modelos AplicaFEMSA = False AplicaDetallista = False AplicaComercioExterior = False + CveUsoCFDI = -1 + CveFormaPago = -1 + CveMetodoPago = -1 End Sub Public Sub New() MyBase.New() @@ -8512,6 +8501,9 @@ Namespace Modelos Public Property CveRegimenFiscal As Integer Public Property CodigoRegimenFiscal As String Public Property RegimenFiscal As String + Public Property CveUsoCFDI As Integer + Public Property CveFormaPago As Integer + Public Property CveMetodoPago As Integer Public Property Telefono As String Public Property Contacto As String Public Property Mail As String @@ -8540,7 +8532,6 @@ Namespace Modelos Public Property FormaFacturacion As String Public Property LimiteCredito As Decimal Public Property NumCtaPago As String - Public Property CveMetodoPago As Integer Public Property AplicaFEMSA As Boolean Public Property FEMSA_NumSociedad As String Public Property FEMSA_NumProveedor As String diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index d634088ea..d977e35e8 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -80,7 +80,7 @@ Public Class Timbres Dim Timbre As New CFDITimbre Timbre.Comprobante.TipoComprobante = "T" Timbre.Comprobante.Fecha = Obj.Fecha - Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 + Timbre.Comprobante.FormadePago = Obj.ClaveFormaPagoSAT Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index e8fd53eae..9343ffa93 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -3726,6 +3726,14 @@ Namespace Extensiones End Try End Sub + + Public Function DataColumnToString(ByRef dtt As DataTable, NombreColumna As String) As String + + Return String.Join(", ", dtt.AsEnumerable(). + Where(Function(row) Not row.IsNull(NombreColumna)). + Select(Function(row) row(NombreColumna).ToString())) + End Function + Public Function GetSelectedValues(ByRef Ddl As ListBox, Optional beforeValue As String = "", Optional AfterValue As String = "") As String Dim retorno As New StringBuilder diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 50a0603aa..ca85d2adb 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -807,7 +807,6 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe ObjFactura.CondicionEntrega = "" ObjFactura.NumeroCuenta = "" ObjFactura.CondicionesPago = 0 - ObjFactura.FormaPago = 0 ObjFactura.PedidoContrato = "" ObjFactura.NumeroContrato = "" ObjFactura.DescripcionContrato = "" @@ -833,17 +832,17 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe If ObjFactura.TipoDocto = "Cot" Then If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjClientes.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago33 = ObjClientes.CveFormaPago33 - ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) - ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjClientes.CveFormaPago33 + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33)) - ObjFactura.CveMetodoPago33 = ObjClientes.CveMetodoPago33 - ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjClientes.CveMetodoPago33 + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33)) ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33)) ObjFactura.CveUsoCFDI = ObjClientes.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI)) - ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI)) + ObjFactura.ClaveUsoCFDISAT = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI)) End If End If @@ -860,9 +859,9 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe If Not String.IsNullOrEmpty(JsonRequest("invoice_way_to_pay").ToString()) Then Dim RowFormaPago As DataRow = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimero(String.Format("ClaveFormaPagoSAT = '{0}'", JsonRequest("invoice_way_to_pay").ToString())) If RowFormaPago IsNot Nothing Then - ObjFactura.CveFormaPago33 = RowFormaPago("CveFormaPago").ToString().ToEntero() - ObjFactura.FormaPago33 = RowFormaPago("FormaPago").ToString() - ObjFactura.FormaPagoSAT33 = RowFormaPago("ClaveFormaPagoSAT").ToString() + ObjFactura.CveFormaPago = RowFormaPago("CveFormaPago").ToString().ToEntero() + ObjFactura.FormaPago = RowFormaPago("FormaPago").ToString() + ObjFactura.ClaveFormaPagoSAT = RowFormaPago("ClaveFormaPagoSAT").ToString() Else Resp.TieneError = False Resp.Mensajes.Add("No se encontro la forma de pago") @@ -886,7 +885,7 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe If RowUsoCFDi IsNot Nothing Then ObjFactura.CveUsoCFDI = RowUsoCFDi("CveUsoCFDI").ToString().ToEntero() ObjFactura.UsoCFDI = RowUsoCFDi("Descripcion").ToString() - ObjFactura.ClaveUsoCFDI = RowUsoCFDi("UsoCFDI").ToString() + ObjFactura.ClaveUsoCFDISAT = RowUsoCFDi("UsoCFDI").ToString() Else Resp.TieneError = False Resp.Mensajes.Add("No se encontro el uso cfdi") @@ -908,8 +907,8 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe If Not String.IsNullOrEmpty(JsonRequest("invoice_payment_method").ToString()) Then Dim RowMetodoPago As DataRow = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", JsonRequest("invoice_payment_method").ToString())) If RowMetodoPago IsNot Nothing Then - ObjFactura.CveMetodoPago33 = RowMetodoPago("CveMetodoPago").ToString().ToEntero() - ObjFactura.MetodoPago33 = RowMetodoPago("MetodoPago").ToString() + ObjFactura.CveMetodoPago = RowMetodoPago("CveMetodoPago").ToString().ToEntero() + ObjFactura.MetodoPago = RowMetodoPago("MetodoPago").ToString() ObjFactura.ClaveMetodoPagoSAT = RowMetodoPago("ClaveMetodoPagoSAT").ToString() Else Resp.TieneError = False @@ -981,7 +980,7 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe End If Dim Cliente = ObjFactura.Cliente - If Not ObjClientes.UpdateClienteNoFrencuente(CveCliente, Cliente.Nombre, Cliente.Direccion, Cliente.NoExt, Cliente.NoInt, Cliente.Colonia, Cliente.Localidad, Cliente.Ciudad, CveEstado, Cliente.RFC, Cliente.CP, Cliente.Telefono, Cliente.Mail, CveSubProyecto, UsuarioActual.CveUsuario, CveEmpresa, "-1", ObjFactura.CveMetodoPago33, ObjFactura.CveFormaPago33) Then + If Not ObjClientes.UpdateClienteNoFrencuente(CveCliente, Cliente.Nombre, Cliente.Direccion, Cliente.NoExt, Cliente.NoInt, Cliente.Colonia, Cliente.Localidad, Cliente.Ciudad, CveEstado, Cliente.RFC, Cliente.CP, Cliente.Telefono, Cliente.Mail, CveSubProyecto, UsuarioActual.CveUsuario, CveEmpresa, "-1", ObjFactura.CveMetodoPago, ObjFactura.CveFormaPago) Then Resp.TieneError = False Resp.Mensajes.Add("No se puedo actualizar un cliente") Return Nothing @@ -1091,8 +1090,8 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Fecha = Obj.FechaCP - Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 - Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 + Timbre.Comprobante.FormadePago = Obj.FormaPago + Timbre.Comprobante.CondicionesdePago = Obj.FormaPago Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.Subtotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento @@ -1107,7 +1106,7 @@ Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Timbre.Receptor.Nombre = Obj.Cliente.Nombre Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI + Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDISAT If Obj.CveTipoRelacion > 0 Then diff --git a/Ashx/E194.ashx b/Ashx/E194.ashx index 34a2d2c9d..d5604d293 100644 --- a/Ashx/E194.ashx +++ b/Ashx/E194.ashx @@ -301,7 +301,6 @@ Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe ObjFactura.CondicionEntrega = "" ObjFactura.NumeroCuenta = "" ObjFactura.CondicionesPago = 0 - ObjFactura.FormaPago = 0 ObjFactura.PedidoContrato = "" ObjFactura.NumeroContrato = "" ObjFactura.DescripcionContrato = "" @@ -327,17 +326,17 @@ Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Dim ObjCliente As New ClsClientes If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjCliente.CveFormaPago33 + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago33 + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) + ObjFactura.ClaveUsoCFDISAT = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) 'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago @@ -424,8 +423,8 @@ Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Fecha = Obj.FechaCP - Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 - Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 + Timbre.Comprobante.FormadePago = Obj.ClaveFormaPagoSAT + Timbre.Comprobante.CondicionesdePago = Obj.FormaPago Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento @@ -440,7 +439,7 @@ Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe Timbre.Receptor.Nombre = Obj.Cliente.Nombre Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI + Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDISAT If Obj.CveTipoRelacion > 0 Then diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 3d92e1a8a..baabe5df8 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -281,16 +281,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.Folio = Folio.ToEntero() ObjFactura.TipoMensajeRespuesta = TipoMensajeRespuesta.TextoLimpio ObjFactura.Version = "4.0" - ObjFactura.FolioFiscal = "" ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa - ObjFactura.TipoCambio = 1 - ObjFactura.ConvertirPesos = False + ObjFactura.CveMoneda = CveMoneda ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda)) ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda)) ObjFactura.TipoDocto = "Ing" - ObjFactura.RefDocto = "" 'ObjFactura.CveMesa = -1 ObjFactura.Fecha = ClsPaginas.NowADS() ObjFactura.CvePrePoliza = -1 @@ -299,19 +296,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.FechaEjecucion = ClsPaginas.NowADS() ObjFactura.UsuarioCreo = UsuarioActual.Usuario ObjFactura.CveCondicionEntrega = -1 - ObjFactura.CondicionEntrega = "" - ObjFactura.NumeroCuenta = "" + ObjFactura.CondicionesPago = 0 - ObjFactura.FormaPago = 0 - ObjFactura.PedidoContrato = "" - ObjFactura.NumeroContrato = "" - ObjFactura.DescripcionContrato = "" - ObjFactura.CveCorte = -1 ObjFactura.TipoDocumento = "Ingresos" - ObjFactura.Alfa1 = "" - ObjFactura.Alfa2 = "" - ObjFactura.Alfa3 = "" - ObjFactura.CveContrato = -1 ObjFactura.ConvertirPesos = False ObjFactura.CveSubProyecto = CveSubProyecto ObjFactura.CveSubProyectoCobranza = CveSubProyecto @@ -327,17 +314,17 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Dim ObjCliente As New ClsClientes If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.CveFormaPago = ObjCliente.CveFormaPago33 + ObjFactura.FormaPago = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) + ObjFactura.ClaveFormaPagoSAT = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) + ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago33 + ObjFactura.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) + ObjFactura.ClaveUsoCFDISAT = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) 'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago @@ -424,8 +411,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Fecha = Obj.FechaCP - Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 - Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 + Timbre.Comprobante.FormadePago = Obj.ClaveFormaPagoSAT + Timbre.Comprobante.CondicionesdePago = Obj.FormaPago Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.Subtotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento @@ -440,7 +427,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Timbre.Receptor.Nombre = Obj.Cliente.Nombre Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI + Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDISAT If Obj.CveTipoRelacion > 0 Then diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx index 540f6df90..aa934ff85 100644 --- a/Ashx/SIGFacturacionCiclica.ashx +++ b/Ashx/SIGFacturacionCiclica.ashx @@ -311,7 +311,6 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt 'ObjFactura.CveSucursal = GlobalDTSucursales.FiltroPrimeroValor("CveSucursal", $"CveEmpresa = {UsuarioActual.CveEmpresa}").ToEntero 'ObjFactura.Cliente.NumCtaPago = TxtNumCtaPago.Text.Trim ObjFactura.CondicionesPago = 0 - ObjFactura.FormaPago = 0 'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text) ObjFactura.PedidoContrato = "" ObjFactura.NumeroContrato = DR("NumeroContrato").ToString @@ -406,41 +405,6 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt ObjFactura.CveCliente = DR("CveCliente").ToString.ToEntero ObjFactura.SetCliente() - Dim ObjCliente As New ClsClientes - If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33 - ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33)) - - ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33 - ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)) - - ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI - ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - - 'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago - - 'If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows.Count > 0 Then - ' ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString - 'Else - ' ObjFactura.CveMetodoPago = 1 - ' ObjFactura.MetodoPago = "Efectivo" - 'End If - End If - End If - - If ObjCliente.GetSucursales(ObjFactura.CveCliente) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFactura.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero()) - Else - ObjFactura.CveClienteSucursal = -1 - End If - End If - ObjCliente.Dispose() - 'SUBPROYECTO 'ObjFactura.SetSubProyectoMatriz(Me) 'ObjFactura.SetSubProyecto(Me) @@ -451,7 +415,6 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt OnError("Ocurrió un error al generar la factura", ex) End Try - Return ObjFactura End Function @@ -462,8 +425,8 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Fecha = Obj.FechaCP - Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 - Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 + Timbre.Comprobante.FormadePago = Obj.ClaveFormaPagoSAT + Timbre.Comprobante.CondicionesdePago = Obj.FormaPago Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT Timbre.Comprobante.Subtotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento @@ -478,8 +441,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Timbre.Receptor.Nombre = Obj.Cliente.Nombre Timbre.Receptor.ResidenciaFiscal = "" Timbre.Receptor.NumeroRegistroTributario = "" - Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI - + Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDISAT If Obj.CveTipoRelacion > 0 Then Select Case Obj.CveTipoRelacion diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index e060b3de8..ac7b0420a 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -512,40 +512,46 @@ Partial Class Bancos_DepositosCaja If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then - Dim ObjMovtos As New ClsMovimientos() - Dim FechaI, FechaF As Date - FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) - FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) + If DdlTipoDeposito.SelectedValue <> "8" Then + Dim ObjMovtos As New ClsMovimientos() + Dim FechaI, FechaF As Date + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) - Dim CveSubProyecto As Integer = -1 + Dim CveSubProyecto As Integer = -1 - If DdlSubProyectos.SelectedValue.ToEntero > 0 Then - CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero - End If - - Dim CveSubProyectoCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero() - - If CveSubProyectoCuenta > 0 Then - CveSubProyecto = CveSubProyectoCuenta - End If - - If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then - Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") - 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") - 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta - - If dtt.Rows.Count = 0 Then - Respuesta = True - Else - Respuesta = False - Alert("No se puede realizar el depósito, ya que hay cobros pendientes por aplicar.", TipoMensaje.MsgAdvertencia) + If DdlSubProyectos.SelectedValue.ToEntero > 0 Then + CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero End If + Dim CveSubProyectoCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero() + + If CveSubProyectoCuenta > 0 Then + CveSubProyecto = CveSubProyectoCuenta + End If + + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then + Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") + 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") + 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta + + If dtt.Rows.Count = 0 Then + Respuesta = True + Else + Respuesta = False + Alert("No se puede realizar el depósito, ya que hay cobros pendientes por aplicar.", TipoMensaje.MsgAdvertencia) + End If + + Else + Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia) + Respuesta = False + End If + ObjMovtos.Dispose() Else - Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia) - Respuesta = False + 'SI ES TRANSFERENCIA PERMITIR CERRAR + Respuesta = True End If - ObjMovtos.Dispose() + Else Respuesta = True End If diff --git a/Bancos/Devoluciones.aspx b/Bancos/Devoluciones.aspx index d63c1c52f..512e5d298 100644 --- a/Bancos/Devoluciones.aspx +++ b/Bancos/Devoluciones.aspx @@ -160,7 +160,7 @@
- +
diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index bc166e690..67049b026 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -24,6 +24,7 @@ public partial class Bancos_Devoluciones : ClsPaginas TxtComisiones.Attributes.Add("disabled", "disabled"); TxtTotal.Attributes.Add("disabled", "disabled"); TipoDevolucion.SelectedValue = "1"; + CargarCentrosDeCosto(null, null, null, LblSubProyecto); } } diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index a2ff0baa0..2076a6b21 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -208,31 +208,29 @@ Partial Class Bancos_FluctuacionCambiaria Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") - Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion > 0").Abs - Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion < 0").Abs - - Dim Final As Double = GanaciaAux - PerdidaAux + Dim GananciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion < 0").Abs + HdnClienteCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString HplClientesLiga.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ObjBancos.DtResultados.MAX("CvePrePoliza").ToString) HplClientesLiga.Visible = HdnClienteCvePrePoliza.Value.ToEntero > 0 BtnClientesRemove.Visible = HdnClienteCvePrePoliza.Value.ToEntero > 0 - BtnGeneraVentas.Visible = Not HdnClienteCvePrePoliza.Value.ToEntero > 0 - - IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") - - LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero - LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero - LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero - LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia") - - LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero - + BtnGeneraVentas.Visible = Not HdnClienteCvePrePoliza.Value.ToEntero > 0 + + 'LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero + 'LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero + 'LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero + UpIndicadoresVentas.Visible = True Dim tdt As DataTable = VerificacionFluctuacion(3, FechaUltimoDiaMes) + Dim Final As Decimal = tdt.SUMD("Diferencia") + IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + LblVentasPerdidaGanancia.Text = If(Final > 0, "Pérdida", "Ganancia") + + LblTotalVentas.Text = (PerdidaAux - GananciaAux).FormatoNumero 'tdt.SUMD("Diferencia").FormatoNumero LtIndicador_PerdidasVentas.Text = tdt.SUMD("Diferencia").FormatoNumero LtIndicador_GanaciaVentas.Text = "" LtIndicador_FinalVentas.Text = "" @@ -669,7 +667,8 @@ Partial Class Bancos_FluctuacionCambiaria ' AjusteTotal = AjusteTotal + dr("Importe").ToString.ToDecimal 'End If tTipoMovto = dr("TipoMovto").ToString.ToBool - If TipoFluctuacion.Contiene(3) AndAlso tTipoMovto AndAlso AjusteTotal > 0 Then AjusteTotal = -AjusteTotal 'si es cleintes, abonado y el ajustes es positivo tiene que restar + If TipoFluctuacion.Contiene(3) AndAlso tTipoMovto Then AjusteTotal = -AjusteTotal 'si es cleintes, abonado y el ajustes es positivo tiene que restar + AjusteTotal = AjusteTotal + dr("Importe").ToString.ToDecimal If AjusteTotal < 0 Then diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index 56deee488..eeca92ae5 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -101,8 +101,7 @@
- - +
@@ -249,8 +248,8 @@
-
-
SubProyecto +
+
diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index de1d871ad..2605d9662 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -50,6 +50,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString(); txtFechaF.Text = NowADS().ToShortDateString(); TxtImporte.Attributes.Add("disabled", "disabled"); + CargarCentrosDeCosto(null, null, null, LblSubProyecto); + LblSubProyecto2.Text = LblSubProyecto.Text; } } diff --git a/Bancos/PagoDeudor.aspx b/Bancos/PagoDeudor.aspx index 6e9e0970b..09e008c7e 100644 --- a/Bancos/PagoDeudor.aspx +++ b/Bancos/PagoDeudor.aspx @@ -121,8 +121,8 @@
-
- +
+
@@ -304,8 +304,8 @@
-
- +
+
diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 46a3b1198..e2af4114e 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -54,6 +54,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas TxtTCDolaresPrestamo.Text = get_GlobalTipoCambio(TxtFechaPrestamo.Text.ToDateTime()).FormatoNumero(4); TxtTCDolaresPago.Text = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDateTime()).FormatoNumero(4); TxtImporte.Attributes.Add("disabled", "disabled"); + CargarCentrosDeCosto(null, null, null, LblSubProyecto); + LblSubProyecto2.Text = LblSubProyecto.Text; } } diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index ebd03c200..873bea6e1 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -341,8 +341,9 @@ - - + + + @@ -453,7 +454,7 @@ % Desc. - + @@ -789,6 +790,10 @@ } + function DescuenoMasivo(txt) { + $(".selDescuento").val(txt.value); + $(".selDescuento").trigger("keyup"); + } diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index d27e7066e..af50a3933 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -324,6 +324,7 @@ Partial Class Bancos_ProveedoresAbonar If UsuarioActual.TienePermisoProceso(361) Then 'GvCxP.Columns(11).Visible = True chkaplicaDescuento.Visible = True + 'chkaplicaDescuentoMasivo.Visible = True End If @@ -1672,12 +1673,11 @@ Partial Class Bancos_ProveedoresAbonar Protected Sub chkaplicaDescuento_CheckedChanged(sender As Object, e As EventArgs) GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked + TxtDescuenoMasivo.Visible = chkaplicaDescuento.Checked UPCompras.Update() - End Sub - Private Sub tmpValida() Dim ValidaSAT As Boolean = True diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 4f4952174..a267bb624 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -672,7 +672,7 @@ # Cant Unidad - Clasificación + Clasificación     @@ -682,7 +682,7 @@
Producto o Servicio - Observación + Observación   @@ -710,10 +710,8 @@ - - - - + + @@ -772,7 +770,7 @@
<%-- 3 --%> - +
@@ -785,7 +783,7 @@ <%-- 4 --%> - + <%-- 5 --%> @@ -796,7 +794,7 @@ <%-- 6 --%> - + <%-- 7 --%> <%-- 8 --%> @@ -827,13 +825,13 @@ <%-- 12 --%> - + <%-- 13 --%> - + @@ -1125,11 +1123,11 @@ - + <%-- Deglose 6% - <%----%> - + <%-- + --%> <%-- @@ -1342,7 +1340,14 @@ <%--3--%> - + <%----%> + + Producto + + + + + <%--4--%> <%--5--%> @@ -1439,6 +1444,7 @@ Producto + @@ -3729,7 +3735,7 @@