diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 3ec0a2a06..81001388a 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -390,7 +390,8 @@ - + + diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 4e3b0b213..5098d660e 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4350,11 +4350,13 @@ Public Class ClsBancos Return Retorno End Function - Public Function GetAcreedoresReporte(CveEmpresa As Integer) As Boolean + Public Function GetAcreedoresReporte(CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_AcreedorReporte") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index d269279b6..acabd6abe 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -1089,6 +1089,43 @@ Public Class ClsCRM End Function #End Region +#Region "Asignar Vendedor a Prospectos" + Public Function GetProspectosPorAsignarVendedor(CveEmpresa As Integer, Optional Empresa As String = "-1", Optional CveSubProyecto As Integer = -1, Optional CveGiro As Integer = -1) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_CRM_GetProspectosPorAsignarVendedor", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Empresa", SqlDbType.NVarChar).Value = Empresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveGiro", SqlDbType.Int).Value = CveGiro + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Prospectos sin Vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function AsignarVendedor(CveProspectos As String, CveVendedor As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_CRM_AsignarVendedores", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@ProspectosCve", SqlDbType.NVarChar).Value = CveProspectos + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Prospectos sin Vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) diff --git a/App_Code/ClsEncuestas.vb b/App_Code/ClsEncuestas.vb index edec3dd57..bafb08bd6 100644 --- a/App_Code/ClsEncuestas.vb +++ b/App_Code/ClsEncuestas.vb @@ -33,6 +33,7 @@ Public Class ClsEncuestas SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString Try SqlConexion.Open() + ConexionAdd() Catch ex As Exception OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) End Try @@ -42,7 +43,6 @@ Public Class ClsEncuestas End If SqlAdapter = New SqlDataAdapter("", SqlConexion) - ConexionAdd() End Sub Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) With SqlAdapter.SelectCommand diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index e40a7740e..79507b7fc 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -540,6 +540,33 @@ Public Class ClsNominas Return Retorno End Function + + Public Function PA_Nom_NominasAutorizarUP(cvePersonal As Int32, cvePeriodo As Int32, salarioDiario As Decimal, sBC As Decimal, sDI As Decimal, horasDobles As Int16, horasTriples As Int16, total As Double, subTotal As Double, diasPagados As Double, diasFaltados As Int32, diasVacaciones As Int32, diasIncapacidad As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_NominasAutorizarUP", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = cvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = cvePeriodo + .Add("@SalarioDiario", SqlDbType.SmallMoney).Value = salarioDiario + .Add("@SBC", SqlDbType.SmallMoney).Value = sBC + .Add("@SDI", SqlDbType.SmallMoney).Value = sDI + .Add("@HorasDobles", SqlDbType.SmallInt).Value = horasDobles + .Add("@HorasTriples", SqlDbType.SmallInt).Value = horasTriples + .Add("@Total", SqlDbType.Float).Value = total + .Add("@SubTotal", SqlDbType.Float).Value = subTotal + .Add("@DiasPagados", SqlDbType.Float).Value = diasPagados + .Add("@DiasFaltados", SqlDbType.Int).Value = diasFaltados + .Add("@DiasVacaciones", SqlDbType.Int).Value = diasVacaciones + .Add("@DiasIncapacidad", SqlDbType.Int).Value = diasIncapacidad + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al autorizar la nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function Public Function AddNom_Nominas(FolioNom As Integer, CveNominaTipo As Integer, CvePersonal As Integer, CvePeriodo As Integer, SubTotal As Double, Descuento As Double, RetISR As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, Fecha As Date, MotivoDescuento As String, Observaciones As String, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index df2523887..ec50c30d6 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4453,6 +4453,7 @@ Public Class ClsPaginas PaginaDict.Add("/CRM/RepAcercamientosRechazos.aspx".ToUpper(), 1314) PaginaDict.Add("/CRM/RepAcercamientosProcesosDetalle.aspx".ToUpper(), 1313) PaginaDict.Add("/CRM/CatMetas.aspx".ToUpper(), 684) + PaginaDict.Add("/CRM/AsignarVendedorEnProspectos.aspx".ToUpper(), 695) #End Region #Region "CxC" @@ -5123,7 +5124,7 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) - + PaginaDict.Add("/testApi.aspx".ToUpper(), -1) 'PaginaDict.Add("/Compras/Efacturas.aspx".ToUpper(), 2007) 'PaginaDict.Add("/Compras/Compras.aspx".ToUpper(), 2008) @@ -5287,11 +5288,11 @@ Public Class ClsPaginas If sw IsNot Nothing AndAlso Not (Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing) Then sw.Stop() - If Not Page.IsPostBack Then - Using ObjUsuario As New ClsSisUsuarios - ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) - End Using - End If + 'If Not Page.IsPostBack Then + ' Using ObjUsuario As New ClsSisUsuarios + ' ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) + ' End Using + 'End If End If If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then @@ -6833,13 +6834,6 @@ Public Class ClsPaginas params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) - 'ALAN YEPIZ - If UsuarioActual.CveEmpresa.Contiene(123) Then - params.Add(New ReportParameter("DiaExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Day))) - params.Add(New ReportParameter("MesExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Month))) - params.Add(New ReportParameter("AñoExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Year))) - End If - RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) Case "Cot" @@ -7474,11 +7468,11 @@ Public Class ClsPaginas ' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE" 'End If Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) - If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126) Then + 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) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO + 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)) params.Add(New ReportParameter("SubTotal2", DtDetalle.SUM("Total").ToString)) Else diff --git a/App_Code/Models/Request/RequestLogin.vb b/App_Code/Models/Request/RequestLogin.vb new file mode 100644 index 000000000..b1833aaa2 --- /dev/null +++ b/App_Code/Models/Request/RequestLogin.vb @@ -0,0 +1,9 @@ +Imports Microsoft.VisualBasic + +Namespace Models.Request + Public Class RequestLogin + Public Property UserName As String + Public Property Password As String + End Class + +End Namespace diff --git a/App_Code/Models/Response/ResponseGenericModel.vb b/App_Code/Models/Response/ResponseGenericModel.vb new file mode 100644 index 000000000..e0c18e717 --- /dev/null +++ b/App_Code/Models/Response/ResponseGenericModel.vb @@ -0,0 +1,10 @@ +Imports Microsoft.VisualBasic + +Namespace Models.Response + Public Class ResponseGenericModel(Of T) + Public Property IsSuccess As Boolean + Public Property Msg As String + Public Property Result As T + End Class + +End Namespace diff --git a/App_Code/Models/Response/ResponseLogin.vb b/App_Code/Models/Response/ResponseLogin.vb new file mode 100644 index 000000000..32213c941 --- /dev/null +++ b/App_Code/Models/Response/ResponseLogin.vb @@ -0,0 +1,93 @@ +Imports Microsoft.VisualBasic +Imports Newtonsoft.Json + + +Namespace Models.Response + Public Class ResponseLogin + Public Property CveUsuario As Long + Public Property Usuario As String + Public Property Nombre As String + Public Property Correo As String + Public Property CveEmpresa As Long + Public Property Empresa As String + Public Property CvePlataforma As Long + Public Property Estatus As Boolean + Public Property CveRol As Integer + Public Property Rol As String + Public Property CveToken As Long + Public Property AccessToken As String + Public Property RefreshToken As String + Public Property UsuarioModulos As List(Of UsuarioModulo) + Public Property UsuarioEmpresas As List(Of UsuarioEmpresa) + Public Property EmpresaFuncionalidades As List(Of EmpresaFuncionalidad) + End Class + + Public Class UsuarioModulo + Public Property CveModulo As Long + Public Property Modulo As String + Public Property CveUsuario As Long + Public Property Agrupacion As String + Public Property Descripcion As String + Public Property Liga As String + Public Property CveModuloAcceso As Long + Public Property CveProcesoAcceso As Long + Public Property Permitir As Long + Public Property Estilo As String + Public Property Padre As String + Public Property CvePadre As Long + Public Property Usuario As String + Public Property CveRol As Long + Public Property Rol As String + Public Property CvePlataforma As Long + Public Property Parametros As String + End Class + + Public Class UsuarioEmpresa + Public Property Tipo_CentroCosto As Long + Public Property CveEmpresa As Long + Public Property Empresa As String + Public Property CveUsuario As Long + Public Property Usuario As String + Public Property Contraseña As String + Public Property CveCliente As Long + Public Property Cliente As String + Public Property CveProveedor As Long + Public Property Proveedor As String + Public Property FechaUltimoAcceso As DateTime + Public Property Nombre As String + Public Property CveRol As Long + Public Property Rol As String + Public Property Telefono As String + Public Property Correo As String + Public Property Estatus As Boolean + Public Property FechaIng As DateTime + Public Property EsSupervisorRH As Boolean + Public Property CveSupervisa As Long + Public Property CveAutoriza As Long + Public Property CvePersonal As Long + Public Property CveVendedor As Long + Public Property CvePlataforma As Long + Public Property ComprasProgramadas As Long + Public Property ProveedoresResponsables As Long + Public Property CveSubProyecto As Long + Public Property CveUsuarioIng As Long + Public Property CveEncuestaCRM As Long + + + Public Property EmpresaFuncionalidades As List(Of EmpresaFuncionalidad) + + Public Function Funcionalidad(ByVal CveFuncionalidad As Long) As String + Return If(EmpresaFuncionalidades IsNot Nothing AndAlso EmpresaFuncionalidades.FirstOrDefault(Function(x) x.CveFuncionalidad = CveFuncionalidad) IsNot Nothing, EmpresaFuncionalidades.FirstOrDefault(Function(x) x.CveFuncionalidad = CveFuncionalidad).Valor, "") + End Function + End Class + + Public Class EmpresaFuncionalidad + Public Property CveEmpresa As Long + Public Property CveFuncionalidad As Long + Public Property Valor As String + Public Property Descripción As String + Public Property Funcionalidad As String + End Class + +End Namespace + diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 42549491e..bed33b7e6 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2981,8 +2981,10 @@ Public Class Timbrado comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then - comprobante.Conceptos(i).Descuento = concep.Descuento - comprobante.Conceptos(i).DescuentoSpecified = True + If concep.Descuento > 0 Then + comprobante.Conceptos(i).Descuento = concep.Descuento + comprobante.Conceptos(i).DescuentoSpecified = True + End If End If If concep.Noidentificacion <> "" Then comprobante.Conceptos(i).NoIdentificacion = concep.Noidentificacion @@ -2996,33 +2998,39 @@ Public Class Timbrado k = 0 'SI NO ES FACTURA EN 0 AGREGA LOS IMPUESTOS If Not ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("P", "N") AndAlso (Ventas.Total <> 0 OrElse (ObjCFDITimbre.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.TotalImpuestosTrasladados > 0)) Then - comprobante.Conceptos(i).Impuestos = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestos() - comprobante.Conceptos(i).Impuestos.Traslados = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion = "T").Count - 1) {} - If concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count > 0 Then - comprobante.Conceptos(i).Impuestos.Retenciones = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count - 1) {} + + If concep.Impuestos.Count > 0 Then + + comprobante.Conceptos(i).Impuestos = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestos() + comprobante.Conceptos(i).Impuestos.Traslados = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion = "T").Count - 1) {} + If concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count > 0 Then + comprobante.Conceptos(i).Impuestos.Retenciones = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count - 1) {} + End If + + For Each imp As CFDIConceptosImpuestos In concep.Impuestos + If imp.TrasladooRetencion = "T" Then + comprobante.Conceptos(i).Impuestos.Traslados(j) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado() + comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base + comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto + comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor + comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe + comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True + comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6) + comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True + j += 1 + Else + comprobante.Conceptos(i).Impuestos.Retenciones(k) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion() + comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base + comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto + comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor + comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe + comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal + k += 1 + End If + Next End If - For Each imp As CFDIConceptosImpuestos In concep.Impuestos - If imp.TrasladooRetencion = "T" Then - comprobante.Conceptos(i).Impuestos.Traslados(j) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado() - comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base - comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto - comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor - comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe - comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True - comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6) - comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True - j += 1 - Else - comprobante.Conceptos(i).Impuestos.Retenciones(k) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion() - comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base - comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto - comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor - comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe - comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal - k += 1 - End If - Next + End If i += 1 Next diff --git a/App_Code/TimbradoB.vb b/App_Code/TimbradoB.vb new file mode 100644 index 000000000..6e044c5ed --- /dev/null +++ b/App_Code/TimbradoB.vb @@ -0,0 +1,36 @@ +Imports Microsoft.VisualBasic + +Public Class TimbradoB + + + + 'Public Function TimbrarFactura(UsuarioActual As Usuario, Ventas As Modelos.Factura, Optional CvePACEspecial As Integer = -1) As Boolean + + ' Dim Retorno As Boolean = False + ' Dim tCvePAC As Integer = UsuarioActual.Empresa.CvePAC + ' If CvePACEspecial <> -1 Then tCvePAC = CvePACEspecial + ' Dim objs As ADSTimbrado.TimbradoEmpresa + ' Dim result = ADSTimbrado.Timbrado.TimbrarFactura(Ventas, objs, ADSTimbrado.PacTimbrado.PADEv) + ' Retorno = result.isOK + ' If result.isOK Then + ' Else + + ' End If + + + ' Return Retorno + 'End Function +End Class + +'Public Class TimbradoEmpresa +' Inherits ADSTimbradoLibrary.TimbradoEmpresa + +' Public Overrides Function UpdateEstatusFactura(FolioFiscal As String, ObjCFDITimbre As ADSTimbradoLibrary.CFDITimbre, facturaCFDI As ADSTimbradoLibrary.Factura, CvePAC As Integer) As String +' Throw New NotImplementedException() +' End Function + +' Public Overrides Function Timbre() As String +' Throw New NotImplementedException() +' End Function +'End Class + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 0f859956c..80424468e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -3450,9 +3450,16 @@ Partial Class Bancos_IE Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) Dim CveCuentaIVAxAcreditarDevDinC = 0 Dim CveCuentaIVAAcreditableDevDinC = 0 - Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + Dim IdCtaIVAXAcreditarDevDinC As Integer + Dim IdCtaIVAAcreditableDevDinC As Integer + + If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then + IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + Else + MsgError = "Sin Registros de porcentaje impuesto" + End If Dim IVADevMN As Decimal = 0 Dim IEPSDevMN As Decimal = 0 @@ -4508,7 +4515,8 @@ Partial Class Bancos_IE End If If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + + If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then ErrorCancelar = True MensajeError = "Error al contabilizar poliza" End If diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index e51215961..934cc2d4e 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -385,6 +385,93 @@ + + +
+
+
+ + +
+
+
+ +
Fecha Inicio:
+
+
+ <%--width: 120px !important;--%> + + + + + + + + + + <%----%> + + + <%----%> + + +
+
+
Fecha Fin:
+
+ +
+ <%--width: 120px !important;--%> + + + + + + + + <%----%> + + + <%----%> + + +
+
+ +
+
+ +
+ +
+ + + + +
diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index cdcd5066d..bf115dfad 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -931,14 +931,29 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region"REPORTE" protected void CargaReporte() { + + DateTime FInicio = MinFecha; + DateTime FFin = MaxFecha; + + if(TxtFechaInicio.Text.Length == 10) + { + FInicio = TxtFechaInicio.Text.ToDate(); + } + + if(TxtFechaFin.Text.Length == 10) + { + FFin = TxtFechaFin.Text.ToDate(); + } + ClsBancos bancos = new ClsBancos(); - if (bancos.GetAcreedoresReporte(UsuarioActual.CveEmpresa)) + if (bancos.GetAcreedoresReporte(UsuarioActual.CveEmpresa, FInicio, FFin)) { GvReporte.DataSource = bancos.DtResultados; GvReporte.DataBind(); } bancos.Dispose(); UpReporte.Update(); + } protected void GvReporte_RowDataBound(object sender, GridViewRowEventArgs e) { @@ -970,4 +985,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas UpDatos.Update(); UpMovAcreedor.Update(); } + + protected void BtnConsultarReporte_Click(object sender, EventArgs e) + { + CargaReporte(); + } } diff --git a/CRM/AsignarVendedorEnProspectos.aspx b/CRM/AsignarVendedorEnProspectos.aspx new file mode 100644 index 000000000..bf082f0cd --- /dev/null +++ b/CRM/AsignarVendedorEnProspectos.aspx @@ -0,0 +1,102 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="AsignarVendedorEnProspectos.aspx.cs" Inherits="CRM_AsignarVendedorEnProspectos" %> + + + + + + + Asignar Vendedor a Prospectos + + + + + + + + + + +
+
+
+ +
+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+
+
+
+
+
+
+ + +
+
+
+
+
+ + Asignar vendedor +
+
+
+
+
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+ + +
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+ + + + + + + + + + + + +
+
+
+ + diff --git a/CRM/AsignarVendedorEnProspectos.aspx.cs b/CRM/AsignarVendedorEnProspectos.aspx.cs new file mode 100644 index 000000000..025b2970a --- /dev/null +++ b/CRM/AsignarVendedorEnProspectos.aspx.cs @@ -0,0 +1,94 @@ +using System; +using System.Text; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using Microsoft.Reporting.WebForms; +using Extensiones; + +public partial class CRM_AsignarVendedorEnProspectos : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.CargaFiltros(); + this.CargaDatos(); + } + } + + private void CargaDatos() + { + string Empresa = (TxtNombre.Text == "" ? "-1" : TxtNombre.Text); + ClsCRM ObjCRM = new ClsCRM(); + if (ObjCRM.GetProspectosPorAsignarVendedor(UsuarioActual.CveEmpresa, Empresa, DdlSubProyecto.SelectedValue.ToEntero(),DdlGiroClasificacion.SelectedValue.ToEntero())) + { + GvProspectos.DataSource = ObjCRM.DtResultados; + } + ObjCRM.Dispose(); + GvProspectos.DataBind(); + } + + private void CargaFiltros() + { + DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa); + DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlSubProyecto.DataBind(); + + DdlGiroClasificacion.DataSource = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlGiroClasificacion.DataBind(); + + DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa); + DdlVendedor.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlVendedor.DataBind(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaDatos(); + } + + protected void BtnAsignar_Click(object sender, EventArgs e) + { + StringBuilder CveProspectos = new StringBuilder(); + GridViewRowCollection RowsProspectos = GvProspectos.Rows; + + foreach (GridViewRow Prospecto in RowsProspectos) + { + bool Asignado = Prospecto.FCCheckBox("ChkAsignar").Checked; + + if (Asignado) + { + int CveProspecto = Prospecto.DataKey("CveEmpresaCRM").ToEntero(); + CveProspectos.AppendFormat("{0},",CveProspecto); + } + } + + string CveProspectosFinal = CveProspectos.ToString(); + int CveVendedor = DdlVendedor.SelectedValue.ToEntero(); + + if (CveProspectosFinal.Length > 0 && CveVendedor != -1) + { + CveProspectos.Remove((CveProspectos.Length -1),1); + ClsCRM ObjCRM = new ClsCRM(); + + if (ObjCRM.AsignarVendedor(CveProspectosFinal,CveVendedor)) + { + + string Vendedor = DdlVendedor.SelectedItem.Text; + string MensajeExito = String.Format("El vendedor '{0}' fue asignado a los prospectos de manera exitosa", Vendedor); + Alert(MensajeExito); + this.CargaDatos(); + UpDatos.Update(); + + } + + ObjCRM.Dispose(); + + } + } +} \ No newline at end of file diff --git a/CRM/CatEmpresasCRM.aspx b/CRM/CatEmpresasCRM.aspx index c4391eec7..1e7e82f94 100644 --- a/CRM/CatEmpresasCRM.aspx +++ b/CRM/CatEmpresasCRM.aspx @@ -11,13 +11,16 @@
  • - Agregar Prospecto + Agregar +
  • +
  • + Cargar Prospectos
  • - +
    @@ -47,9 +50,9 @@ - + -
    +
    " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    @@ -59,7 +62,7 @@ - + @@ -72,21 +75,21 @@ - + - - + + - - + + - + @@ -95,14 +98,49 @@ - - + + + - +
    diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index 1eef821ff..07844b84b 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -6,6 +6,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; using System.Data; +using Microsoft.Reporting.WebForms; public partial class CRM_RepAcercamientos : ClsPaginas { @@ -22,6 +23,18 @@ public partial class CRM_RepAcercamientos : ClsPaginas ViewState["CveVendedor"] = value; } } + private DataTable DtDatos + { + get + { + return (ViewState["DtDatos"] == null ? null : (DataTable)ViewState["DtDatos"]); + } + + set + { + ViewState["DtDatos"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -49,6 +62,7 @@ public partial class CRM_RepAcercamientos : ClsPaginas if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { GVDatos.DataSource = ObjCRM.DtResultados; + DtDatos = ObjCRM.DtResultados; GVDatos.DataBind(); } @@ -78,13 +92,43 @@ public partial class CRM_RepAcercamientos : ClsPaginas //CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString(); - //TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString(); + TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString(); DdlPS.setEsWebService(true); - + DdlPS.SelectedValue = "-1"; + DdlPS.SelectedText = "Seleccione"; DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); DdlGiroClasificacion.DataSource = dtGiroClasificaciones; DdlGiroClasificacion.DataBind(); DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); } #endregion + + protected void LnkPDF_Click(object sender, EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkExcel_Click(object sender, EventArgs e) + { + Imprimir("Excel"); + } + + private void Imprimir(string formato) + { + string VendedorFiltro = String.Format("Vendedor: {0}    ", (DdlVendedor.SelectedValue != "-1" ? DdlVendedor.SelectedItem.Text : "Todos")); + string ProductoServicioFiltro = String.Format("Producto Servicio: {0}    ", (DdlPS.SelectedValue != "-1" ? DdlPS.SelectedText : "Todos")); + string GiroFiltro = String.Format("Giro: {0}    ", (DdlGiroClasificacion.SelectedValue != "-1" ? DdlGiroClasificacion.SelectedItem.Text : "Todos")); + string FechaInicioFiltro = String.Format("Fecha Inicio: {0}    ", TxtFechaInicio.Text); + string FechaFinFiltro = String.Format("Fecha Fin: {0}    ", TxtFechaFin.Text); + + string Filtros = String.Format("{0}{1}{2}{3}{4}", VendedorFiltro, FechaInicioFiltro, FechaFinFiltro, ProductoServicioFiltro, GiroFiltro); + + List @params = new List(); + @params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + @params.Add(new ReportParameter("LogoPath", new Uri(Server.MapPath(string.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)); + @params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)); + @params.Add(new ReportParameter("AgrupadoPor", Filtros)); + + ImprimirPDF("Empresas/Grales/Formatos/RepAcercamientos.rdlc", DtDatos, @params, "Reporte de Acercamientos", formato); + } } \ No newline at end of file diff --git a/CRM/RepAcercamientosProcesos.aspx.cs b/CRM/RepAcercamientosProcesos.aspx.cs index 59588035e..241ff91d7 100644 --- a/CRM/RepAcercamientosProcesos.aspx.cs +++ b/CRM/RepAcercamientosProcesos.aspx.cs @@ -393,7 +393,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas doc.Add(header); Paragraph Filtros = this.filtrosDelReporte(); doc.Add(Filtros); - PdfPTable table = this.convertirReporteATabla(); + PdfPTable table = this.convertirReporteATabla(doc); doc.Add(table); doc.Close(); @@ -533,12 +533,15 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas return Filtros; } - private PdfPTable convertirReporteATabla() + private PdfPTable convertirReporteATabla(Document doc) { int numeroDeColumnas = GVRepAcercamientosEtapas.Columns.Count; PdfPTable table = new PdfPTable(numeroDeColumnas); table.WidthPercentage = 100f; + float[] anchoColumnas = this.ColumnasWidth(); + table.SetWidths(anchoColumnas); + BaseColor headerBackGroundColor = new BaseColor(240,240,240); Font fuente = FontFactory.GetFont("Arial", 9f); @@ -568,6 +571,29 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas return table; } + private float[] ColumnasWidth() + { + int CantidadColumnas = GVRepAcercamientosEtapas.Columns.Count; + float[] ColumnsWidth = new float[CantidadColumnas]; + + int cursor = 0; + DataControlFieldCollection ColumnsCollection = GVRepAcercamientosEtapas.Columns; + foreach (DataControlField columns in ColumnsCollection) + { + if (columns.HeaderText == "Total") + { + ColumnsWidth[cursor] = 20f; + }else + { + ColumnsWidth[cursor] = 80f; + } + + cursor++; + } + + return ColumnsWidth; + } + protected void LnkExcel_Click(object sender, EventArgs e) { GVRepAcercamientosEtapas.ExportToExcelGembox("Reporte de Rechazos de Acercamiento", UsuarioActual, "", "", "Reporte de Rechazos de Acercamiento", "", -1); diff --git a/CRM/RepAcercamientosRechazos.aspx.cs b/CRM/RepAcercamientosRechazos.aspx.cs index 2ab4f2746..ea1d906c8 100644 --- a/CRM/RepAcercamientosRechazos.aspx.cs +++ b/CRM/RepAcercamientosRechazos.aspx.cs @@ -520,6 +520,9 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas PdfPTable table = new PdfPTable(numeroDeColumnas); table.WidthPercentage = 100f; + //float[] anchoColumnas = this.ColumnasWidth(); + //table.SetWidths(anchoColumnas); + BaseColor headerBackGroundColor = new BaseColor(240, 240, 240); Font fuente = FontFactory.GetFont("Arial", 9f); @@ -550,6 +553,30 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas return table; } + private float[] ColumnasWidth() + { + int CantidadColumnas = GVRepAcercamientosEtapas.Columns.Count; + float[] ColumnsWidth = new float[CantidadColumnas]; + + int cursor = 0; + DataControlFieldCollection ColumnsCollection = GVRepAcercamientosEtapas.Columns; + foreach (DataControlField columns in ColumnsCollection) + { + //if (columns.HeaderText == "Total") + //{ + // ColumnsWidth[cursor] = 20f; + //} + //else + //{ + // ColumnsWidth[cursor] = 80f; + //} + + cursor++; + } + + return ColumnsWidth; + } + protected void LnkExcel_Click(object sender, EventArgs e) { GVRepAcercamientosEtapas.ExportToExcelGembox("Reporte de Rechazos de Acercamiento", UsuarioActual, "", "", "Reporte de Rechazos de Acercamiento", "", -1); diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 994c06c8a..12b6e23e7 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4053,7 +4053,7 @@ Partial Class Compras_Compras 'Verifica funcionalidad 702 "Require orden de compra para factura de compra" - If UsuarioActual.Empresa.Funcionalidad(702) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(128) <> "" Then If Not EstaAsociadoACajaChica And Not EstaAsociadoAPersonal Then If Not CompraEstaVinculadaOC Then Alert("Debe de vincular una orden de compra para registrar la factura") diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 81d5f93f5..1cd5bf0c5 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -910,7 +910,7 @@ Partial Class PopUpVerFactura If Archivo.Exists Then HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf") + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name).ToLower = "xml", "application/xml", "application/pdf") HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) HttpContext.Current.Response.TransmitFile(Path) diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 197c8bf07..6756eca1a 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -542,7 +542,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then CargaProveedores() DdlProveedores.Visible = True DdlCompras.Visible = True @@ -557,7 +557,7 @@ Partial Class ContabilidadC_RegPrePoliza Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -594,11 +594,21 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - CargaCompras(DdlProveedores.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero, DdlCompras) + Else + CargaCompras(DdlProveedores.SelectedValue.ToEntero) + End If + End Sub Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - CargaVentas(DdlClientes.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(12, 91) Then + CargaVentas(DdlClientes.SelectedValue.ToEntero) + Else + CargaVentas(DdlClientes.SelectedValue.ToEntero) + End If + End Sub Private Sub CargaSubProyectos() @@ -646,6 +656,24 @@ Partial Class ContabilidadC_RegPrePoliza End If End Sub + Private Sub CargaNotasCreditoCompras(CveProveedor As Integer, ddl As DropDownList) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + Dim ObjCompras As New ClsCompras + + ddl.ClearSelection() + If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, "NC", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", CveProveedor:=CveProveedor, TopSelect:=1000) Then + ddl.DataSource = ObjCompras.DtResultados '.FiltraParametros("Saldo <> 0") + ddl.DataBind() + ddl.Items.Insert(0, New ListItem(" - ", "-1")) + Else + ddl.DataSource = Nothing + ddl.DataBind() + ddl.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + Private Sub CargaClientes() DdlClientes.setEsWebService(True) DdlClientes.Attributes.Add("data-metodo", "getcliente") @@ -676,6 +704,22 @@ Partial Class ContabilidadC_RegPrePoliza ObjVentas.Dispose() End Sub + Private Sub CargaNotasCreditoVentas(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentas.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentas.DataSource = Nothing + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + Private Sub CargaPersonal() DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataBind() @@ -904,15 +948,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim IdCtaContable As Integer = 0 Dim PorcentajeImpuesto As Decimal = 0 - 'Registra movimieno bancario - If CveConcepto = 30 Then - CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" - CveIEInsertado = CveIE - If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - FolioIE = ObjIE.Folio - End If - End If + Dim CveProveedor As Integer = -1 @@ -945,7 +981,18 @@ Partial Class ContabilidadC_RegPrePoliza CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero Else If CveConcepto = 30 Then + 'Registra movimieno bancario + If CveConcepto = 30 Then + CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" + CveIEInsertado = CveIE + If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then + FolioIE = ObjIE.Folio + End If + End If + CveIE = CveIEInsertado + Else CveIE = -1 End If @@ -993,7 +1040,7 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE PRINCIPAL MensajeAlert.AppendFormat("

    Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) - MensajeAlert.AppendFormat("

    Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) + MensajeAlert.AppendFormat("

    Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) Else Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") @@ -1671,7 +1718,12 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlProveedores_SelectedIndexChanged1(sender As Object, e As EventArgs) Dim ddl As DropDownList = CType(sender, DropDownList) Dim ddl2 As DropDownList = DirectCast(ddl.BindingContainer, GridViewRow).FCDropDownList("DdlCompras") - CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero, ddl2) + Else + CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + End If + End Sub Private Sub CargaCompras2(CveProveedor As Integer, ddl As DropDownList) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2210878a2..a358c4250 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -514,7 +514,7 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -542,7 +542,11 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Sub CargaCuentasContables() - DdlCtaContable.DataSource = Session("DtCuentas") + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCtaContable.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() DdlCtaContable.DataBind() DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub @@ -1058,8 +1062,13 @@ Partial Class ContabilidadC_RegPrePolizaS DdlTipoGastoE.DataBind() DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub - Private Sub CargaCtaContableE() - DdlCtaContableE.DataSource = Session("DtCuentas") + Private Sub CargaCtaContableE() + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCtaContableE.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() + DdlCtaContableE.DataBind() DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub @@ -1086,7 +1095,7 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlClasificacionesE.Visible = False End If - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientesE() DdlClientesE.Visible = True DdlVentasE.Visible = True diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 0ac1a8eb6..58f533539 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -147,10 +147,10 @@ public partial class Contabilidad_RepIVA : ClsPaginas } if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0) { - Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0)); + Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0)); Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal() + Math.Round(e.Row.DBCampo("IVANoDeducible").ToDecimal()), 2); - if (dif > 1) + if (Math.Abs(dif) > 1) { e.Row.ForeColor = System.Drawing.Color.Red; e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; diff --git a/Empresas/Grales/Formatos/RHGafete.rdlc b/Empresas/Grales/Formatos/RHGafete.rdlc index 4e950f982..7eda769b1 100644 --- a/Empresas/Grales/Formatos/RHGafete.rdlc +++ b/Empresas/Grales/Formatos/RHGafete.rdlc @@ -4,20 +4,6 @@ - - Embedded - Logo - FitProportional - 0.41929cm - 1.2827cm - 3.23567cm - 4.49779cm - - - - true true @@ -41,7 +27,6 @@ 0.381cm 0.6cm 1.74625cm - 1 @@ -60,7 +45,7 @@ 4.21416cm 2.78048cm 2.21979cm - 2 + 1 @@ -107,7 +92,7 @@ 0.28575cm 0cm 3.2225cm - 4 + 3 @@ -156,7 +141,7 @@ 0.28575cm 0cm 3.10079cm - 6 + 5 @@ -205,7 +190,7 @@ 3.61103cm 0cm 2.82292cm - 8 + 7 @@ -270,7 +255,7 @@ 6.97976cm 0.41303cm 1.04599cm - 10 + 9 @@ -303,7 +288,7 @@ 6.97976cm 0.41628cm 1.08479cm - 11 + 10 @@ -336,7 +321,7 @@ 6.97976cm 0.43596cm 3.37312cm - 12 + 11 @@ -369,7 +354,7 @@ 6.97976cm 0.39892cm 1.55985cm - 13 + 12 @@ -402,7 +387,7 @@ 6.97976cm 0.3901cm 2.36625cm - 14 + 13 @@ -435,7 +420,7 @@ 6.97976cm 0.40421cm 1.58424cm - 15 + 14 @@ -468,7 +453,7 @@ 6.95537cm 0.43118cm 3.37312cm - 16 + 15 @@ -501,7 +486,7 @@ 6.95537cm 0.37069cm 1.07037cm - 17 + 16 @@ -534,7 +519,7 @@ 6.97976cm 0.4601cm 2.10312cm - 18 + 17 @@ -567,7 +552,7 @@ 6.97976cm 0.42008cm 1.04599cm - 19 + 18 @@ -600,7 +585,7 @@ 6.95537cm 0.44125cm 1.96378cm - 20 + 19 @@ -616,7 +601,7 @@ 8.06455cm 0cm 5.59245cm - 21 + 20 @@ -837,7 +822,7 @@ 6.97976cm 0.89104cm 6.67724cm - 33 + 32 @@ -870,7 +855,7 @@ 8.04338cm 0.34247cm 5.61362cm - 34 + 33 @@ -902,7 +887,7 @@ 8.06455cm 0.33894cm 5.59245cm - 35 + 34 @@ -934,7 +919,7 @@ 10.38816cm 0.34776cm 3.26884cm - 36 + 35 @@ -966,7 +951,7 @@ 8.63838cm 0.2384cm 5.01862cm - 37 + 36 @@ -998,7 +983,7 @@ 9.34601cm 0.30719cm 4.31099cm - 38 + 37 @@ -1030,7 +1015,7 @@ 8.46874cm 0.27544cm 5.16176cm - 39 + 38 @@ -1062,7 +1047,7 @@ 10.39905cm 0.32535cm 3.25795cm - 40 + 39 @@ -1094,7 +1079,7 @@ 8.06455cm 0.32131cm 5.59245cm - 41 + 40 @@ -1126,7 +1111,7 @@ 9.15344cm 0.30543cm 4.50356cm - 42 + 41 @@ -1166,7 +1151,7 @@ 0.381cm 1.4631cm 6.05295cm - 43 + 42 @@ -1200,7 +1185,7 @@ 3.61103cm 0.41382cm 2.82292cm - 44 + 43 @@ -1232,7 +1217,7 @@ 8.0963cm 0.38481cm 5.5607cm - 45 + 44 @@ -1264,7 +1249,7 @@ 9.01439cm 0.33189cm 4.6426cm - 46 + 45 @@ -1280,7 +1265,7 @@ 2.02882cm 0cm 4.40513cm - 47 + 46 @@ -3025,7 +3025,7 @@ - $ + =IIf(not IsNothing(Fields!ConceptoD.Value) ORELSE Fields!ImporteD.Value >0,"$"," ") @@ -4194,7 +4194,7 @@ - Percepciones y deducciones que en el aparecen a la fecha COMPUPROVEEDORES SA DE CV no me adeuda + Percepciones y deducciones que en el aparecen a la fecha [@Empresa] no me adeuda