diff --git a/Acumuladores/RepRecolecciones.aspx.vb b/Acumuladores/RepRecolecciones.aspx.vb index aa2843c47..116ce8b4f 100644 --- a/Acumuladores/RepRecolecciones.aspx.vb +++ b/Acumuladores/RepRecolecciones.aspx.vb @@ -41,11 +41,23 @@ Partial Class Acumuladores_RepRecolecciones Set(value As Boolean) ViewState("Actualizar") = value End Set - End Property - + End Property + Private Property DTPSDefinidos As DataTable + Get + If ViewState("DTPSDefinidos") Is Nothing Then + ViewState("DTPSDefinidos") = New DataTable() + End If + Return CType(ViewState("DTPSDefinidos"), DataTable) + End Get + Set(ByVal value As DataTable) + ViewState("DTPSDefinidos") = CType(value, DataTable) + End Set + End Property + + #End Region - - + + Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -128,14 +140,16 @@ Partial Class Acumuladores_RepRecolecciones Dim Str As New StringBuilder Str.Append("Productos Definidos
") If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then - For Each dr As DataRow In ObjGenerales.DtResultados.Rows - Str.AppendFormat(" {0} - {1}
", dr("Cantidad"), dr("CodigoPS")) - HdnPSRecoleccion.Value = dr("CvePS").ToString - HdnCantidadRecoleccion.Value = dr("Cantidad").ToString - Next - LblProductosCargados.Text = Str.ToString + DTPSDefinidos = ObjGenerales.DtResultados.Copy() End If - ObjGenerales.Dispose() + ObjGenerales.Dispose() + + For Each dr As DataRow In DTPSDefinidos.Rows + Str.AppendFormat(" {0} - {1}
", dr("Cantidad"), dr("CodigoPS")) + 'HdnPSRecoleccion.Value = dr("CvePS").ToString + 'HdnCantidadRecoleccion.Value = dr("Cantidad").ToString + Next + LblProductosCargados.Text = Str.ToString GvModalPSRecoleccion.DataSource = DTRecoleccion GvModalPSRecoleccion.DataBind() @@ -204,11 +218,12 @@ Partial Class Acumuladores_RepRecolecciones Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click - Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal + Dim Cantidad As Decimal = DTPSDefinidos.SUMD("Cantidad") Dim CantidadDefinido As Decimal = 0 For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows CantidadDefinido += gvr.DataKey("Cantidad").ToDecimal Next + If CantidadDefinido <> Cantidad Then Alert("La cantidad definida no es la correcta", TipoMensaje.MsgAdvertencia) Exit Sub @@ -219,15 +234,21 @@ Partial Class Acumuladores_RepRecolecciones Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL) Dim ErrorMovInv As Boolean = False Dim Fecha As DateTime = NowADS() - Dim Concepto As String = "Traspaso Recolección" + Dim Concepto As String = "Traspaso Recolección" + Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 45, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados") - Dim FolioSalida As Integer = ObjInventario.Folio - Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 42, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados") - Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=HdnPSRecoleccion.Value.ToEntero).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, HdnCantidadRecoleccion.Value.ToDecimal, CveUM, HdnPSRecoleccion.Value.ToEntero, 0) Then - ErrorMovInv = True - End If - 'HdnPSRecoleccion + Dim FolioSalida As Integer = ObjInventario.Folio + + For Each Row As DataRow In DTPSDefinidos.Rows + Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=Row("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Row("Cantidad").ToString().ToDecimal, CveUM, Row("CvePS").ToString().ToEntero(), 0) Then + ErrorMovInv = True + End If + Next + + Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 42, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados") + + 'HdnPSRecoleccion For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows Dim CveMovtoDetalle As Integer If ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.DataKey("Cantidad").ToDecimal, gvr.DataKey("CveUnidadMedida").ToEntero, gvr.DataKey("CvePS").ToEntero, 0) Then diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index b69978eb7..b415508c3 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -165,6 +165,7 @@ Public Class ClsClientes Public Property EnDemanda As Boolean = False Public Property EnQuebranto As Boolean = False Public Property GastosEnvio As Decimal = 0 + Public Property EsFilial As Boolean = False #End Region @@ -421,7 +422,7 @@ Public Class ClsClientes _EnQuebranto = CBool(Data(0)("EnQuebranto")) _CreditoRegistroFirmas = Data(0)("CreditoRegistroFirmas").ToString _GastosEnvio = Data(0)("GastosEnvio").ToString.ToDecimal - + _EsFilial = CBool(Data(0)("EsFilial")) End If Retorno = True Catch ex As Exception @@ -539,7 +540,7 @@ Public Class ClsClientes Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False, - Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0) As Boolean + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -675,6 +676,7 @@ Public Class ClsClientes .Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto .Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas .Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio + .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial End With Try SqlAdapter.Fill(Data) @@ -721,7 +723,7 @@ Public Class ClsClientes Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False, - Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0) As Boolean + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -867,6 +869,7 @@ Public Class ClsClientes .Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto .Add("@CreditoRegistroFirmas", SqlDbType.VarChar).Value = CreditoRegistroFirmas .Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio + .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 4e6b3ad42..5e234998a 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -7399,7 +7399,7 @@ Public Class ClsContPAQi Return Retorno End Function - Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, SegmentoNegocio As Integer, Optional CveEmpresa As Integer = -1) As Boolean + Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, SegmentoNegocio As Integer, FolioPoliza As Integer, Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False StrSQL.Clear() @@ -7411,6 +7411,7 @@ Public Class ClsContPAQi StrSQL.Append(" WHERE P.Ejercicio = @Ejercicio ") StrSQL.Append(" AND P.Periodo = @Periodo ") StrSQL.Append(" AND (@TipoPoliza = -1 OR P.TipoPol = @TipoPoliza) ") + StrSQL.Append(" AND (@FolioPoliza = -1 OR P.Folio = @FolioPoliza) ") StrSQL.Append(" AND (@SegmentoNegocio = -1 OR M.IdSegNeg = @SegmentoNegocio) ") StrSQL.Append(" GROUP BY P.Id, P.Fecha, T.Nombre, P.Concepto, P.Cargos, P.Abonos, P.Folio, PP.CvePrepoliza ") StrSQL.Append(" ORDER BY P.Folio ") @@ -7423,8 +7424,8 @@ Public Class ClsContPAQi .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza .Add("@SegmentoNegocio", SqlDbType.Int).Value = SegmentoNegocio + .Add("@FolioPoliza", SqlDbType.Int).Value = FolioPoliza .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 0ff191dbd..12007823c 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -6529,7 +6529,7 @@ Public Class ClsContabilidad #End Region - Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, CveSubProyecto As Integer, FolioPoliza As Integer, CveEmpresa As Integer) As Boolean Dim Respuesta As Boolean = False DataAdapter("PA_Conta_FiltraPolizasGet") @@ -6539,15 +6539,15 @@ Public Class ClsContabilidad .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FolioPoliza", SqlDbType.Int).Value = FolioPoliza .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With Try SqlAdapter.Fill(Data) Respuesta = True Catch ex As Exception - Me.OnError("Ocurrió un error al obtener las Prepolizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al obtener las Pólizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Respuesta diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 4fe89fa64..dced0eeca 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -1539,6 +1539,7 @@ Public Class ClsMovimientos Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveMoneda As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRecuperacion") + SqlAdapter.SelectCommand.CommandTimeout = 0 With SqlAdapter.SelectCommand.Parameters .Add("@CveResponsable", SqlDbType.Int).Value = CveResponsable .Add("@FechaI", SqlDbType.Date).Value = FechaI diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 2be37d84d..aca7aa3b2 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -708,7 +708,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) As Boolean + Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraAdd") @@ -754,6 +754,7 @@ Public Class ClsOC .Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito + .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito .Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output @@ -917,7 +918,8 @@ Public Class ClsOC pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "", Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, 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 UsoCFDI As Integer = -1, Optional Promocion As String = "-1", - Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1) As Boolean + Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1, + Optional CveSubProyectoEntrega As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraUpdate") @@ -953,6 +955,8 @@ Public Class ClsOC .Add("@PorcentajeIVA", SqlDbType.SmallMoney).Value = PorcentajeIVA .Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito + .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega + End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bf49e1ed5..1f67f7ea8 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -88,15 +88,13 @@ Public Class ClsPaginas Public Shared ReadOnly Property UsuarioActualRutaDB() As String Get - Try - If HttpContext.Current.Session("UsuarioSIG") Is Nothing Then - Return "" - Else - Return DirectCast(HttpContext.Current.Session("UsuarioSIG"), Usuario).RutaDB - End If - Catch ex As Exception + + If HttpContext.Current IsNot Nothing AndAlso HttpContext.Current.Session IsNot Nothing AndAlso HttpContext.Current.Session("UsuarioSIG") IsNot Nothing Then + Return DirectCast(HttpContext.Current.Session("UsuarioSIG"), Usuario).RutaDB + Else Return "" - End Try + End If + End Get End Property Public Property CveModulo As Integer @@ -5087,7 +5085,7 @@ Public Class ClsPaginas End If Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) 'TOMAR LA RUTA BASE PARA EL DIRECTORIO DE LA EMPRESA - If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") AndAlso Not RutaReporte.Contains("Contabilidad2/Reportes/") AndAlso Not RutaReporte.Contains("AC/Reportes/") Then + If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") AndAlso Not RutaReporte.Contains("AC/Reportes/") Then bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") End If RutaReporte.Replace("/", "\") @@ -7519,7 +7517,7 @@ Public Class ClsPaginas If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) End If - Dim urlHost As String = "http://localhost:2202/" + Dim urlHost As String = "hhttp://sig.adssistemas.mx:7998/" If EsProduccion Then urlHost = "http://sig.adssistemas.mx:6599/" End If @@ -7607,6 +7605,9 @@ Public Class ClsPaginas Dim bytes As Byte() = Nothing Dim CveEmpresaActual As Integer Dim params As New List(Of ReportParameter) + + + Try Dim DtDetalle As DataTable = Nothing Dim ObjOC As New ClsOC @@ -7632,8 +7633,81 @@ Public Class ClsPaginas DtDetalle = ObjOC.DtResultados End If - 'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES Dim DomicilioSucursal As String = "" + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) + + If Not Archivo.Exists Then + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + If Imagen.Exists Then ''POR EMPRESA + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + + End If + + If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then + + Dim SBDomicilioSucursal As New StringBuilder() + Dim CiudadSucursal As String = "" + Dim ObjClientes As New ClsClientes + + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) + + If ObjOC.GetSucursalOC(ObjOC.CveOrdenCompra) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then + + params.Add(New ReportParameter("Proyecto", ObjOC.SucSubProyecto.ToString)) + params.Add(New ReportParameter("Telefono", ObjOC.SucTelefono.ToString)) + + CiudadSucursal = String.Format("{0},{1}", ObjOC.SucMunicipio, ObjOC.SucEstado) + + SBDomicilioSucursal.AppendFormat("{0}", ObjOC.SucCalle) + If ObjOC.SucNoExt.Length > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", ObjOC.SucNoExt) + If ObjOC.SucNoInt.Length > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt) + If ObjOC.SucColonia.Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", ObjOC.SucColonia) + If ObjOC.SucCP.Length > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", ObjOC.SucCP) + If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal) + If ObjOC.SucPais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", ObjOC.SucPais) + + DomicilioSucursal = SBDomicilioSucursal.ToString + + + Dim DirecconSubProyectoEntrega As String = "" + Dim CveSubProyectoEntrega As Integer = dtOC(0)("CveSubProyectoEntrega").ToString.ToEntero + + If CveSubProyectoEntrega > 0 Then + + Dim DTSubProyectoEntrega As DataTable = GlobalDTSubProyectos(-1, CveSubProyectoEntrega) + + params.Add(New ReportParameter("SubProyectoEntrega", DTSubProyectoEntrega(0)("SubProyecto").ToString)) + + Dim SubProyectoEntregaDir As String = $"Calle {DTSubProyectoEntrega(0)("Calle").ToString}" + SubProyectoEntregaDir = $"{SubProyectoEntregaDir} No. {DTSubProyectoEntrega(0)("NoExt").ToString()}" + + If DTSubProyectoEntrega(0)("NoInt").ToString().Trim.Length > 0 Then + SubProyectoEntregaDir = $"{SubProyectoEntregaDir} No. int.{DTSubProyectoEntrega(0)("NoInt").ToString()}" + End If + + SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{vbCrLf}" + + SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{DTSubProyectoEntrega(0)("Colonia").ToString()} C.P. {DTSubProyectoEntrega(0)("CP").ToString()}{vbCrLf}" + SubProyectoEntregaDir = $"{SubProyectoEntregaDir}{DTSubProyectoEntrega(0)("Municipio").ToString()},{DTSubProyectoEntrega(0)("Estado").ToString()}{vbCrLf}Tel. { DTSubProyectoEntrega(0)("Telefono").ToString()}" + + params.Add(New ReportParameter("SubProyectoEntregaDir", SubProyectoEntregaDir)) + + End If + + End If + + + End If + + + + Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero Dim drSol As DataRow = GlobalDTUsuarios(CveUsuarioSol, EmpresaActual.CveEmpresa).FiltroPrimero("") 'DataRow (incluye el NOMBRE de quien SOLICITÓ la OC) @@ -7659,10 +7733,11 @@ Public Class ClsPaginas End If Dim nombreautorizo As String = dtOC(0)("UsuarioAutorizo").ToString - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) + If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126, 158) Then params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2))) End If + 'DATOS PARA DESCUENTO If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 119, 122, 126, 158) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO params.Add(New ReportParameter("SubTotal", ObjOC.SubTotal.ToString)) @@ -7710,7 +7785,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición"))) params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI)) - If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Then + If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then params.Add(New ReportParameter("FolioAdicional", dtOC(0)("FolioAdicional").ToString)) params.Add(New ReportParameter("Vendedor", dtOC(0)("Vendedor").ToString)) params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString)) @@ -7723,6 +7798,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("ProveedorContacto", ObjOC.ProveedorContacto)) params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado)) End If + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'Dim ObjCuentasBancos As New ClsGenerales() 'If ObjCuentasBancos.GetCuentasDepositos(CveProveedor:=ObjOC.CveProveedor) Then @@ -7737,6 +7813,7 @@ Public Class ClsPaginas 'End If 'ObjCuentasBancos.Dispose() End If + 'params.Add(New ReportParameter("FechaOC", ObjOC.Fecha.ToShortDateString)) Dim RutaFisicaSol As String = String.Format("Empresas\{0}\Firmas\{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol) Dim RutaVirtuaSol As String = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(RutaFisicaSol)) @@ -7750,7 +7827,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, ImageToBase64(Drawing.Image.FromFile(FirmaAut.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197 Then + If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then Dim ObjProveedor As New ClsCompProveedores If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ObjOC.CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, EmpresaActual.CveEmpresa) Then @@ -9907,19 +9984,19 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/RepEstadoResultadosAnual.aspx".ToUpper(), 127) PaginaDict.Add("/Contabilidad/FiltraPolizas.aspx".ToUpper(), 128) PaginaDict.Add("/Contabilidad/RepContabilidadDiaria.aspx".ToUpper(), 504) - PaginaDict.Add("/Contabilidad/CatCuentas.aspx".ToUpper(), 178) + PaginaDict.Add("/Contabilidad/CatCuentas.aspx".ToUpper(), 596) + PaginaDict.Add("/Contabilidad/CatCuentasCI.aspx".ToUpper(), 596) PaginaDict.Add("/Contabilidad/RepOrigenAplicacion.aspx".ToUpper(), 354) PaginaDict.Add("/Contabilidad/RepBalanceGeneralProForma.aspx".ToUpper(), 358) PaginaDict.Add("/Contabilidad/RepEstadoResultadosProForma.aspx".ToUpper(), 359) - PaginaDict.Add("/Contabilidad/RepBalanceGeneral.aspx".ToUpper(), 362) - PaginaDict.Add("/Contabilidad/RepEstadoResultados.aspx".ToUpper(), 363) + PaginaDict.Add("/Contabilidad/RepBalanceGeneral.aspx".ToUpper(), 586) + PaginaDict.Add("/Contabilidad/RepBalanceGeneralCI.aspx".ToUpper(), 586) + PaginaDict.Add("/Contabilidad/RepEstadoResultados.aspx".ToUpper(), 583) PaginaDict.Add("/Contabilidad/RepIVADiferencias.aspx".ToUpper(), 127) PaginaDict.Add("/Contabilidad/PolizasImpresion.aspx".ToUpper(), 380) - PaginaDict.Add("/Contabilidad/RegPrePoliza.aspx".ToUpper(), 398) - PaginaDict.Add("/Contabilidad/RegPrePoliza1.aspx".ToUpper(), 398) PaginaDict.Add("/Contabilidad/RegPrePolizaS.aspx".ToUpper(), 398) + PaginaDict.Add("/Contabilidad/RegPrePoliza.aspx".ToUpper(), 398) PaginaDict.Add("/Contabilidad/DescargaRespaldos.aspx".ToUpper(), 400) - PaginaDict.Add("/Contabilidad/RepBalanceGeneral2.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/CatEjercicios.aspx".ToUpper(), 570) PaginaDict.Add("/Contabilidad/AnalisisVertical.aspx".ToUpper(), 416) PaginaDict.Add("/Contabilidad/FisImpuestos.aspx".ToUpper(), 431) @@ -9936,39 +10013,36 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/RepEstadoResultadosPorSegmento.aspx".ToUpper(), 1317) PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMes.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/RepAnexoCatalogoSegmento.aspx".ToUpper(), -1) - PaginaDict.Add("/Contabilidad/RepAnexoCatalogo.aspx".ToUpper(), 341) - PaginaDict.Add("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx".ToUpper(), 340) - PaginaDict.Add("/Contabilidad/RepBalanzaComprobacion.aspx".ToUpper(), 344) - PaginaDict.Add("/Contabilidad/CatCuentasSIG.aspx".ToUpper(), 405) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogo.aspx".ToUpper(), 580) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogoCI.aspx".ToUpper(), 580) + PaginaDict.Add("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx".ToUpper(), 587) + PaginaDict.Add("/Contabilidad/RepMovimientosAuxiliaresCatalogoCI.aspx".ToUpper(), 587) + PaginaDict.Add("/Contabilidad/RepBalanzaComprobacion.aspx".ToUpper(), 582) + PaginaDict.Add("/Contabilidad/RepBalanzaComprobacionCI.aspx".ToUpper(), 582) PaginaDict.Add("/Contabilidad/RepIEPS.aspx".ToUpper(), 714) PaginaDict.Add("/Contabilidad/CatPeriodosBloqueo.aspx".ToUpper(), 677) PaginaDict.Add("/Contabilidad/CatClasificacionPorcentaje.aspx".ToUpper(), 752) PaginaDict.Add("/Contabilidad/RepFlujoEfectivo.aspx".ToUpper(), 783) -#End Region -#Region "Contabilidad2" - PaginaDict.Add("/Contabilidad2/RepAnexoCatalogo.aspx".ToUpper(), 580) - PaginaDict.Add("/Contabilidad2/RepBalanzaComprobacion.aspx".ToUpper(), 582) - PaginaDict.Add("/Contabilidad2/RepEstadoActividades.aspx".ToUpper(), 583) - PaginaDict.Add("/Contabilidad2/RepFlujoEfectivo.aspx".ToUpper(), 584) - PaginaDict.Add("/Contabilidad2/RepCambiosSituacionFinanciera.aspx".ToUpper(), 585) - PaginaDict.Add("/Contabilidad2/RepSituacionFinanciera.aspx".ToUpper(), 586) - PaginaDict.Add("/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx".ToUpper(), 587) - PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensual.aspx".ToUpper(), 589) - PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoAnual.aspx".ToUpper(), 593) - PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoCC.aspx".ToUpper(), 594) - PaginaDict.Add("/Contabilidad2/RepVariacionHaciendaPublica.aspx".ToUpper(), 595) - PaginaDict.Add("/Contabilidad2/CatCuentas.aspx".ToUpper(), 596) - PaginaDict.Add("/Contabilidad2/RepLibroDiario.aspx".ToUpper(), 544) - 'PaginaDict.Add("/Contabilidad2/RepSituacionFinancieraSAT.aspx".ToUpper(), 615) - 'PaginaDict.Add("/Contabilidad2/RepEstadoActividadesSAT.aspx".ToUpper(), 616) - 'PaginaDict.Add("/Contabilidad2/RepBalanzaComprobacionSAT.aspx".ToUpper(), 617) - 'PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoSAT.aspx".ToUpper(), 618) - PaginaDict.Add("/Contabilidad2/MovimientosConProveedores.aspx".ToUpper(), 619) - 'PaginaDict.Add("/Contabilidad2/RepBalanceGeneral.aspx".ToUpper(), 530) - PaginaDict.Add("/Contabilidad2/CatCuentasAsignaciones.aspx".ToUpper(), 724) - PaginaDict.Add("/Contabilidad2/CatContaEjercicios.aspx".ToUpper(), 725) - PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) - PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) + + 'PaginaDict.Add("/Contabilidad/RepAnexoCatalogo.aspx".ToUpper(), 580) + 'PaginaDict.Add("/Contabilidad/RepBalanzaComprobacion.aspx".ToUpper(), 582) + 'PaginaDict.Add("/Contabilidad/RepEstadoResultados.aspx".ToUpper(), 583) + 'PaginaDict.Add("/Contabilidad/RepFlujoEfectivo.aspx".ToUpper(), 584) + PaginaDict.Add("/Contabilidad/RepCambiosSituacionFinanciera.aspx".ToUpper(), 585) + 'PaginaDict.Add("/Contabilidad/RepSituacionFinanciera.aspx".ToUpper(), 586) + 'PaginaDict.Add("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx".ToUpper(), 587) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensual.aspx".ToUpper(), 589) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogoAnual.aspx".ToUpper(), 593) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogoCC.aspx".ToUpper(), 594) + PaginaDict.Add("/Contabilidad/RepVariacionHaciendaPublica.aspx".ToUpper(), 595) + 'PaginaDict.Add("/Contabilidad/CatCuentas.aspx".ToUpper(), 596) + PaginaDict.Add("/Contabilidad/RepLibroDiario.aspx".ToUpper(), 544) + PaginaDict.Add("/Contabilidad/MovimientosConProveedores.aspx".ToUpper(), 619) + 'PaginaDict.Add("/Contabilidad/RepBalanceGeneral.aspx".ToUpper(), 530) + PaginaDict.Add("/Contabilidad/CatCuentasAsignaciones.aspx".ToUpper(), 724) + PaginaDict.Add("/Contabilidad/CatContaEjercicios.aspx".ToUpper(), 725) + PaginaDict.Add("/Contabilidad/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) + PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) #End Region #Region "Contratos" '--------------------- C O N T R A T O S - P R E S U P U E S T O S --------------------- @@ -10656,7 +10730,7 @@ Public Class ClsPaginas 'PaginaDict.Add("/ZDG/MensajeAutomatico.aspx".ToUpper(), -1) PaginaDict.Add("/Planeacion/Presupuestos.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) - PaginaDict.Add("/Contabilidad2/RepBalanceGeneralHorizontal.aspx".ToUpper(), -1) + PaginaDict.Add("/Contabilidad/RepBalanceGeneralHorizontal.aspx".ToUpper(), -1) PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328) PaginaDict.Add("/testApi.aspx".ToUpper(), -1) diff --git a/App_Code/ClsPuntoVenta.vb b/App_Code/ClsPuntoVenta.vb index 7ae142533..729fc7426 100644 --- a/App_Code/ClsPuntoVenta.vb +++ b/App_Code/ClsPuntoVenta.vb @@ -228,8 +228,38 @@ Public Class ClsPuntoVenta Return Retorno End Function + Public Function GetVtaCortesActivos(CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_CortesActivosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + If Data.Rows.Count > 0 Then + With Me + .CveCorte = Data.Rows(0)("CveCorte").ToString.ToEntero + .FechaInicial = Data.Rows(0)("FechaInicial").ToString.ToDateTime + .FechaFinal = Data.Rows(0)("FechaFinal").ToString.ToDateTime + .FechaIng = Data.Rows(0)("FechaIng").ToString.ToDateTime + .ImporteInicial = Data.Rows(0)("ImporteInicial").ToString.ToDouble + .ImporteFinal = Data.Rows(0)("ImporteFinal").ToString.ToDouble + .Descripcion = Data.Rows(0)("Descripcion").ToString + .Estatus = Data.Rows(0)("Estatus").ToString + .Usuario = Data.Rows(0)("Usuario").ToString + .UsuarioNombre = Data.Rows(0)("UsuarioNombre").ToString + End With + End If + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Cortes del Punto de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function 'Public Function GetCortesPorCuenta(CveCuenta As Integer, CveEmpresa As Integer) As Boolean ' Dim Retorno As Boolean = False @@ -269,7 +299,7 @@ Public Class ClsPuntoVenta Return Retorno End Function - Public Function AddVtaCortes(FechaInicial As DateTime, ImporteInicial As Decimal, CveUsuario As Integer, Descripcion As String, CveEmpresa As Integer) As Boolean + Public Function AddVtaCortes(FechaInicial As DateTime, ImporteInicial As Decimal, CveUsuario As Integer, Descripcion As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_CortesAdd") @@ -278,6 +308,7 @@ Public Class ClsPuntoVenta .Add("@ImporteInicial", SqlDbType.Money).Value = ImporteInicial .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveCorte", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index a79bf4f32..130afb4dd 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1669,7 +1669,7 @@ Public Class ClsVentas 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) As Boolean + 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) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRep") @@ -1701,6 +1701,7 @@ Public Class ClsVentas .Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal + .Add("@EsFilial", SqlDbType.Int).Value = EsFilial End With Try @@ -1807,7 +1808,7 @@ Public Class ClsVentas CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -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) As Boolean + 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) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRepDetalle") @@ -1844,6 +1845,7 @@ Public Class ClsVentas .Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal + .Add("@EsFilial", SqlDbType.Int).Value = EsFilial End With Try @@ -3179,7 +3181,8 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean + Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, + CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, EsFilial As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepVentasUtilidadGet") @@ -3196,6 +3199,7 @@ Public Class ClsVentas .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia + .Add("@EsFilial", SqlDbType.Int).Value = EsFilial End With Try SqlAdapter.Fill(Data) @@ -3528,7 +3532,6 @@ Public Class ClsVentas Return Retorno End Function - 'Public Function AddVtaCortesDetalles(CveCorte As Integer, CveMetodoPago As Integer, Importe As Double) As Boolean ' Dim Retorno As Boolean = False ' DataAdapter("PA_Vta_CortesDetallesAdd") diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 7542fe598..e94b3853b 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -60,7 +60,9 @@ Partial Class Bancos_DepositosCaja divFolio.Visible = True End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" _ + OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" _ + OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then DivRowCuenta.Visible = True End If diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 3aa0660a9..5688cc07e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1448,11 +1448,33 @@ Partial Class Bancos_IE 'RecargaCuentas CargaCuenta(CveMoneda) RecargaCuentasDepositos() + ValidaFechaDocumentoDiasPosteriores() UpDatos.Update() BtnGuardar.Enabled = True End Sub + Private Sub ValidaFechaDocumentoDiasPosteriores() + + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString + Calendario.EndDate = NowADS().AddDays(3) + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 días de la fecha actual" + + If DdlTipoTransaccion.SelectedValue.Contiene("1", "16") Then 'cheques, 3meses + RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 meses de la fecha actual" + Calendario.EndDate = NowADS().AddMonths(3) + End If + If DdlTipoTransaccion.SelectedValue = "2" Then 'transfer, 3semanas + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 semanas de la fecha actual" + Calendario.EndDate = NowADS().AddDays(21) + End If + UpDatos.Update() + UpGuardar.Update() + + End Sub + Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'si solo es de egreso el movimiento debe de generar el siguiente folio. diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index 2bb7b8143..bff947397 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -268,6 +268,7 @@ - Otros Egresos + Deudores Diversos diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 52c647ae7..c357c01e4 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -348,7 +348,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (ImporteComision != 0 && MsgError == "") { ImporteComisionMN = (ImporteComision * TCPago).RoundSQL(); - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, ImporteComisionMN, 255, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(),CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + int tTipoConceptoOtro = 255; + if (DdlOtrosPagos.SelectedValue == "3") tTipoConceptoOtro = 43; //deudores diversos + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, ImporteComisionMN, tTipoConceptoOtro, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(),CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de pago acreedor"; break; @@ -394,9 +397,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (MsgError.Equals("")) { + ObjIE.Commit(); if (Msg.ToString().Equals("")) { - Msg.AppendFormat("El Documento se guardo correctamente. Folio {1}
", CveIE, ObjIE.Folio); + Msg.AppendFormat("El Documento se guardo correctamente.
Folio {1}
", CveIE, ObjIE.Folio); } //GUARDA COMPROBANTE @@ -432,11 +436,14 @@ public partial class Bancos_PagoAcreedor : ClsPaginas // } //} - if (IDPoliza > 0) - { - Msg.AppendFormat(@"

Ver Póliza", IDPoliza); - } - ObjIE.Commit(); + //if (IDPoliza > 0) + //{ + // Msg.AppendFormat(@"

Ver Póliza", IDPoliza); + //} + + Msg.AppendFormat(@"Ver Póliza
", CvePrePoliza); + Msg.AppendFormat($"Imprimir"); + } else { @@ -616,9 +623,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (MsgError.Equals("")) { + ObjIE.Commit(); if (Msg.ToString().Equals("")) { - Msg.Append("El Documento se guardo correctamente"); + Msg.Append("El Documento se guardo correctamente.
"); } System.IO.FileInfo archivo = null; @@ -648,11 +656,13 @@ public partial class Bancos_PagoAcreedor : ClsPaginas // } //} - if (IDPoliza > 0) - { - Msg.AppendFormat(@"

Ver Póliza", IDPoliza); - } - ObjIE.Commit(); + //if (IDPoliza > 0) + //{ + // Msg.AppendFormat(@"

Ver Póliza", IDPoliza); + //} + Msg.AppendFormat(@"Ver Póliza
", CvePrePoliza); + Msg.AppendFormat($"Imprimir"); + } else { diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 020ac979b..5ca8a834f 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -311,12 +311,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas if (MsgError.Equals("")) { + ObjIE.Commit(); if (Msg.ToString().Equals("")) { - Msg.Append("El Documento se guardo correctamente"); + Msg.Append("El Documento se guardo correctamente.
"); } System.IO.FileInfo archivo = null; - Msg.AppendFormat("

Folio: {1}
", CveIE, TxtFolioPrestamo.Text.Trim()); + Msg.AppendFormat("Folio: {1}
", CveIE, TxtFolioPrestamo.Text.Trim()); if (DdlTipoTransaccionPrestamo.SelectedValue.ToEntero().Contiene(2, 8, 9)) { @@ -335,7 +336,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas { archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuentaPrestamo.SelectedValue.ToEntero())); } - + //if (archivo.Length > 0) //{ // if (archivo.Exists) @@ -344,11 +345,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas // } //} - if (IDPoliza > 0) - { - Msg.AppendFormat(@"

Ver Póliza", IDPoliza); - } - ObjIE.Commit(); + //if (IDPoliza > 0) + //{ + // Msg.AppendFormat(@"

Ver Póliza", IDPoliza); + //} + Msg.AppendFormat(@"Ver Póliza
", CvePrePoliza); + Msg.AppendFormat($"Imprimir"); + } else { @@ -682,12 +685,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas if (MsgError.Equals("")) { + ObjIE.Commit(); if (Msg.ToString().Equals("")) { - Msg.Append("El Documento se guardo correctamente"); + Msg.Append("El Documento se guardo correctamente.
"); } System.IO.FileInfo archivo = null; - Msg.AppendFormat("

Folio: {1}
", CveIE, TxtFolio.Text.Trim()); + Msg.AppendFormat("Folio: {1}
", CveIE, TxtFolio.Text.Trim()); if (DdlTipoTransaccion.SelectedValue.ToEntero().Contiene(2, 8, 9)) { @@ -715,11 +719,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas // } //} - if (IDPoliza > 0) - { - Msg.AppendFormat(@"

Ver Póliza", IDPoliza); - } - ObjIE.Commit(); + //if (IDPoliza > 0) + //{ + // Msg.AppendFormat(@"

Ver Póliza", IDPoliza); + //} + Msg.AppendFormat(@"Ver Póliza
", CvePrePoliza); + Msg.AppendFormat($"Imprimir"); + } else { diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 4362fffd8..c4bc99aac 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -848,13 +848,12 @@ Partial Class Bancos_PopIECompras #Region "DDL'S CHANGED" Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged - Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero - Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing - + Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero + 'Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing + Select Case valor Case 1 LblPagueseA.Text = "Páguese a" - Case 2 LblPagueseA.Text = "Beneficiario" End Select @@ -1723,17 +1722,20 @@ Partial Class Bancos_PopIECompras Private Sub ValidaFechaDocumentoDiasPosteriores() + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString + Calendario.EndDate = NowADS().AddDays(3) + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 días de la fecha actual" - RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString - Calendario.EndDate = NowADS().AddDays(2) - RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 6 meses de la fecha actual" - - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then - RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(30).ToShortDateString - RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 6 meses de la fecha actual" - Calendario.EndDate = NowADS().AddDays(30) + If DdlTipoTransaccion.SelectedValue.Contiene("1", "16") Then 'cheques, 3meses + RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 meses de la fecha actual" + Calendario.EndDate = NowADS().AddMonths(3) + End If + If DdlTipoTransaccion.SelectedValue = "2" Then 'transfer, 3semanas + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 semanas de la fecha actual" + Calendario.EndDate = NowADS().AddDays(21) End If - UpDatos.Update() UpGuardar.Update() diff --git a/Bancos/PopIEVentas.aspx b/Bancos/PopIEVentas.aspx index 7326ad20b..349381e4e 100644 --- a/Bancos/PopIEVentas.aspx +++ b/Bancos/PopIEVentas.aspx @@ -7,10 +7,21 @@ .row { margin: 0 -10px; } - .calendar-extender-popup { + /*.calendar-extender-popup { position: absolute; - z-index: 10000; /* Asegura que se muestre sobre otros elementos */ + z-index: 10000;*/ /* Asegura que se muestre sobre otros elementos */ + /*}*/ + + #C_CETxtFechaEmision_popupDiv{ + z-index: 10000; /* Asegura que el calendario se muestre sobre otros elementos */ + margin-top:-160px!important; + position: absolute; /* Asegura que el calendario no desplace otros elementos */ } + #C_Calendario_popupDiv{ + z-index: 10000; /* Asegura que el calendario se muestre sobre otros elementos */ + margin-left:-50px!important; + position: absolute; /* Asegura que el calendario no desplace otros elementos */ + } @@ -150,7 +161,7 @@ -
+
@@ -559,7 +570,7 @@
- + diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index f8f7db127..e8da3815a 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -325,9 +325,7 @@ Partial Class Bancos_PopIEVentas ViewState("CveIE") = -1 End If - If UsuarioActual.CveEmpresa.Contiene(1, 4, 7, 11, 12, 72, 80, 119) Then - rowComisiones.Visible = True - End If + 'rowComisiones.Visible = True 'SI USUARIO USA AMORTIZACIÓN CONTABLE If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then @@ -547,10 +545,11 @@ Partial Class Bancos_PopIEVentas CargaCorteCaja() End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'toma como proridad el que viene de + If UsuarioActual.Empresa.Funcionalidad(531) = "1" OrElse (dr("CveCorte").ToString.ToEntero > 0) Then 'toma como proridad el que viene de CveCorte = dr("CveCorte").ToString.ToEntero End If + If RFCCliente.ToUpper <> "XAXX010101000" Then Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero @@ -753,7 +752,7 @@ Partial Class Bancos_PopIEVentas #Region "DDL'S CHANGED" Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero - Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing + 'Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing Select Case valor Case 1 @@ -1112,7 +1111,7 @@ Partial Class Bancos_PopIEVentas Dim FechaEmision As Date = MinFecha - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If ChkComplementoPago.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then FechaEmision = TxtFechaEmision.Text.ToDate If FechaEmision <= MinFecha Then @@ -1239,162 +1238,162 @@ Partial Class Bancos_PopIEVentas Pago.CveMonedaPago = CveMoneda Pago.Referencia = VentaActual.SerieFolio If DdlOtrosPagos.SelectedValue = "2" Then - ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL - TxtComision.Text.ToDecimal + ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL + TxtComision.Text.ToDecimal Else ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL End If 'Tipos de cambio If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos - Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal - ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES - Pago.TCPago = TxtTipoCambio.Text.ToDecimal - ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - Pago.TCPago = TxtTipoCambio.Text.ToDecimal - Pago.TCPago = TxtTipoCambio.Text.ToDecimal - End If - If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal - If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal + Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES + Pago.TCPago = TxtTipoCambio.Text.ToDecimal + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + Pago.TCPago = TxtTipoCambio.Text.ToDecimal + Pago.TCPago = TxtTipoCambio.Text.ToDecimal + End If + If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal + If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal - If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0 + If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0 - Select Case RBLContado.SelectedValue - Case "1" ' Banco + Select Case RBLContado.SelectedValue + Case "1" ' Banco CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCorte:=CveCorte, FechaEmision:=FechaEmision) If CveIE > 0 Then Pago.ImportePago = ImportePagado - Pago.ImportePagoVenta = ImportePagado + Pago.ImportePagoVenta = ImportePagado - Pago.OtroGastoIngreso Pago.CveIE = CveIE Pago.TipoPago = "B" + If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then + MsgError = "No se pudo insertar la póliza" + End If + + Else + MsgError = "Ocurrio un Error al registrarse el movimiento bancario." + Inserta = False + End If + Case "2" ' FyE + + Pago.ImportePago = ImportePagado + Pago.ImportePagoVenta = ImportePagado - Pago.OtroGastoIngreso + Pago.TipoPago = "FyE" + Pago.CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero + Pago.Referencia = DdlFuncionarioEmpleado.SelectedItem.ToString + If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" End If - Else - MsgError = "Ocurrio un Error al registrarse el movimiento bancario." - Inserta = False - End If - Case "2" ' FyE + Case "3" 'Ingresos x Comprobar - Pago.ImportePago = ImportePagado - Pago.ImportePagoVenta = ImportePagado - Pago.TipoPago = "FyE" - Pago.CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero - Pago.Referencia = DdlFuncionarioEmpleado.SelectedItem.ToString + CveCliente = DdlIngreso.SelectedValue.ToEntero + CveIE = -1 + ImportePagado = TxtImporte.Text.Trim.ToDecimal + Pago.ImportePago = ImportePagado + Pago.TipoPago = "I" - If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then - MsgError = "No se pudo insertar la póliza" - End If + For Each rw As GridViewRow In GvIngresos.Rows + If rw.FCCheckBox("Chk").Checked Then + CveIE = rw.DataKey("CveIE").ToEntero + Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero + Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal + Pago.FechaDocumentoRelacionado = rw.DataKey("FechaDocumento").ToDate + Pago.CveIE = CveIE + Pago.CveClientePago = rw.DataKey("CveCliente").ToEntero + If ChkPagarPesos.Checked Then Pago.TCPago = 1 / rw.DataKey("TipoCambio").ToDecimal + If ChkPagarDolares.Checked Then Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal - Case "3" 'Ingresos x Comprobar - - CveCliente = DdlIngreso.SelectedValue.ToEntero - CveIE = -1 - ImportePagado = TxtImporte.Text.Trim.ToDecimal - Pago.ImportePago = ImportePagado - Pago.TipoPago = "I" - - For Each rw As GridViewRow In GvIngresos.Rows - If rw.FCCheckBox("Chk").Checked Then - CveIE = rw.DataKey("CveIE").ToEntero - Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero - Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal - Pago.FechaDocumentoRelacionado = rw.DataKey("FechaDocumento").ToDate - Pago.CveIE = CveIE - Pago.CveClientePago = rw.DataKey("CveCliente").ToEntero - If ChkPagarPesos.Checked Then Pago.TCPago = 1 / rw.DataKey("TipoCambio").ToDecimal - If ChkPagarDolares.Checked Then Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal - - If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then - MsgError = "No se pudo insertar la póliza" - Else - Exit For - End If - End If - Next - - Case "4" 'Deudores Diversos - - ImportePagado = TxtImporte.Text.Trim.ToDecimal - 'CveProveedor2 = DdlDeudor.SelectedValue.ToEntero - CveIE = -1 - If DdlDeudor.SelectedValue.ToEntero <= 0 Then - Alert("Debe especificar el deudor.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - For Each rw As GridViewRow In GvDeudores.Rows - If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then - Pago.CveIE = rw.DataKey("CveIE").ToEntero - Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero - Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal - 'Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero - Pago.TipoPago = "DD" - If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then - MsgError = "No se pudo insertar la póliza" - Else - Exit For - End If - End If - Next - - Case "5" 'Compras - - ImportePagado = TxtImporte.Text.Trim.ToDecimal - CveIE = -1 - For Each rw As GridViewRow In GvCompras.Rows - If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then - Pago.CveMonedaPago = 1 - Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - Pago.TipoPago = "Compra" - If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then - MsgError = "No se pudo insertar la póliza" - End If - If MsgError = "" Then - Dim CompraActual As New Compra() With {.CveCompra = rw.DataKey("CveCompra").ToEntero, .ProveedorNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveProveedor = rw.DataKey("CveProveedor").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero, .CveTipoConceptoProveedor = rw.DataKey("CveTipoConcepto").ToEntero} - Dim PagoCompra As New CompraPago - - PagoCompra.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero - PagoCompra.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - PagoCompra.TCPago = rw.DataKey("TipoCambio").ToDecimal - PagoCompra.CveProveedor = rw.DataKey("CveProveedor").ToEntero - PagoCompra.CveVentaRelacionada = CveVenta - PagoCompra.TipoPago = "Venta" - If AplicaPrePolizaPagoCompra(CompraActual, PagoCompra, CvePrePoliza, ObjMov) Then + If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + Else + Exit For End If End If + Next + Case "4" 'Deudores Diversos + + ImportePagado = TxtImporte.Text.Trim.ToDecimal + 'CveProveedor2 = DdlDeudor.SelectedValue.ToEntero + CveIE = -1 + If DdlDeudor.SelectedValue.ToEntero <= 0 Then + Alert("Debe especificar el deudor.", TipoMensaje.MsgAdvertencia) + Exit Sub End If - Next - Case Else - 'NO SE HA DEFINIDO PARA FUNCIONARIO Y EMPLEADO - If RBLContado.SelectedValue <> "2" Then - MsgError = "No se ha especificada opcion." - End If - End Select - - If MsgError = "" Then - - If MsgError = "" AndAlso ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - MsgError = ObjMov.MensajePolizaDescuadre + For Each rw As GridViewRow In GvDeudores.Rows + If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then + Pago.CveIE = rw.DataKey("CveIE").ToEntero + Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero + Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal + 'Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero + Pago.TipoPago = "DD" + If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then + MsgError = "No se pudo insertar la póliza" + Else + Exit For + End If + End If + Next + + Case "5" 'Compras + + ImportePagado = TxtImporte.Text.Trim.ToDecimal + CveIE = -1 + For Each rw As GridViewRow In GvCompras.Rows + If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then + Pago.CveMonedaPago = 1 + Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + Pago.TipoPago = "Compra" + If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then + MsgError = "No se pudo insertar la póliza" + End If + If MsgError = "" Then + Dim CompraActual As New Compra() With {.CveCompra = rw.DataKey("CveCompra").ToEntero, .ProveedorNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveProveedor = rw.DataKey("CveProveedor").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero, .CveTipoConceptoProveedor = rw.DataKey("CveTipoConcepto").ToEntero} + Dim PagoCompra As New CompraPago + + PagoCompra.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero + PagoCompra.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + PagoCompra.TCPago = rw.DataKey("TipoCambio").ToDecimal + PagoCompra.CveProveedor = rw.DataKey("CveProveedor").ToEntero + PagoCompra.CveVentaRelacionada = CveVenta + PagoCompra.TipoPago = "Venta" + If AplicaPrePolizaPagoCompra(CompraActual, PagoCompra, CvePrePoliza, ObjMov) Then + MsgError = "No se pudo insertar la póliza" + End If + End If + + End If + Next + + Case Else + 'NO SE HA DEFINIDO PARA FUNCIONARIO Y EMPLEADO + If RBLContado.SelectedValue <> "2" Then + MsgError = "No se ha especificada opcion." + End If + End Select + + If MsgError = "" Then + + If MsgError = "" AndAlso ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + MsgError = ObjMov.MensajePolizaDescuadre + End If End If + Else + MsgError = "No se pudo insertar la poliza detalle" End If - Else - MsgError = "No se pudo insertar la poliza detalle" End If - End If - Else + Else MsgError = "venta no identificada" End If Else diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 3c3ba9bb5..dd8d8709c 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1627,20 +1627,21 @@ Partial Class Bancos_ProveedoresAbonar Private Sub ValidaFechaDocumentoDiasPosteriores() - RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString - RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(2).ToShortDateString + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString + RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(3).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 días de la fecha actual" - RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 6 meses de la fecha actual" + Calendario.EndDate = NowADS().AddDays(3) - Calendario.EndDate = NowADS().AddDays(2) - - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then - - RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(182).ToShortDateString - RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(182).ToShortDateString - RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 6 meses de la fecha actual" - - Calendario.EndDate = NowADS().AddDays(182) + If DdlTipoTransaccion.SelectedValue.Contiene("1", "16") Then 'cheques, 3meses + RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 meses de la fecha actual" + Calendario.EndDate = NowADS().AddMonths(3) + End If + If DdlTipoTransaccion.SelectedValue = "2" Then 'transfer, 3semanas + RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString + RVTxtFechaDocumento.ErrorMessage = "ERROR:
La fecha del documento no puede ser superior a 3 semanas de la fecha actual" + Calendario.EndDate = NowADS().AddDays(21) End If UpDatos.Update() diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index 091ecb714..67ddada77 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -227,7 +227,7 @@ Partial Class Bancos_RepCortes GvP.DataSource = DtCortesVentasResumen 'RESUMEN - IVA - If UsuarioActual.CveEmpresa.Contiene(190, 192) Then + If UsuarioActual.CveEmpresa.Contiene(190, 192) AndAlso DsDatos.Tables.Count > 2 Then DivIVA.Visible = True GvPorIVA.DataSource = DsDatos.Tables(2) Dim tsum As Decimal = DsDatos.Tables(2).SUMD("IVA16") + DsDatos.Tables(2).SUMD("IVA0") diff --git a/Bancos/RepIngresosPorComprobar.aspx b/Bancos/RepIngresosPorComprobar.aspx index f3f6b3b13..f0c84a439 100644 --- a/Bancos/RepIngresosPorComprobar.aspx +++ b/Bancos/RepIngresosPorComprobar.aspx @@ -271,7 +271,7 @@