diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index b9d3ff484..2780c2aab 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -25,5 +25,6 @@ Public Class CalendarEvent Public Property EmpresaCRM As String Public Property SubProyecto As String Public Property CveSubProyecto As Integer + Public Property Direccion As String End Class diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 52e092126..4c5f48563 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5890,7 +5890,7 @@ Public Class ClsContabilidad Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional RegeneraCuenta As Boolean = False) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesAdd") @@ -5911,6 +5911,7 @@ Public Class ClsContabilidad .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto + .Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta End With Try @@ -5923,30 +5924,12 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function RemoveCuentasAsignaciones(CveCuentaAsignacion As Integer) As Boolean - Dim Retorno = False - - DataAdapter("PA_Conta_CuentasAsignacionesDelete") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCuentaAsignacion", SqlDbType.Int).Value = CveCuentaAsignacion - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - Me.OnError("Ocurrió un error al eliminar el catálogo de cuentas asignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function UpdateCuentasAsignaciones(CveConceptoAsignacion As Integer, Optional CveConceptoContable As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, + Optional RegeneraCuenta As Boolean = False) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesUpdate") @@ -5967,6 +5950,7 @@ Public Class ClsContabilidad .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto + .Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta End With Try @@ -5978,6 +5962,24 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function RemoveCuentasAsignaciones(CveCuentaAsignacion As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Conta_CuentasAsignacionesDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCuentaAsignacion", SqlDbType.Int).Value = CveCuentaAsignacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar el catálogo de cuentas asignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #Region "Globales" Public Function GetCuentasGlobales(CveEmpresa As Integer, Optional CveConcepto As Integer = -1) As Boolean diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 05ec2309d..8d262bcc5 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -1541,9 +1541,10 @@ Public Class ClsOIEventos Public Function GetEventos(CveEvento As Integer, CveTipoEvento As Integer, CveAgendaTipo As Integer, Asunto As String, Descripcion As String, Prioridad As Integer, CveUsuarioDe As Integer, CveUsuarioPara As Integer, CveEventoEstatus As Integer, CveRevision As Integer, CveEventoPadre As Integer, Acuerdos As String, CveActivoFijo As Integer, CveIE As Integer, CveProspecto As Integer, CveCliente As Integer, - CveOS As Integer, CveOC As Integer, CvePersonal As Integer, CveProveedor As Integer, CveCompra As Integer, CveVenta As Integer, CveUsuario As Integer, CveUsuarioIng As Integer, CveUsuarioConsulta As Integer, CveEmpresa As Integer, Optional FechaInicio As Nullable(Of DateTime) = Nothing, - Optional FechaFin As Nullable(Of DateTime) = Nothing, Optional FechaRealTermino As Nullable(Of DateTime) = Nothing, Optional CveContrato As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, - Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1) As Boolean + CveOS As Integer, CveOC As Integer, CvePersonal As Integer, CveProveedor As Integer, CveCompra As Integer, CveVenta As Integer, CveUsuario As Integer, CveUsuarioIng As Integer, CveUsuarioConsulta As Integer, + CveEmpresa As Integer, Optional FechaInicio As Nullable(Of DateTime) = Nothing, Optional FechaFin As Nullable(Of DateTime) = Nothing, Optional FechaRealTermino As Nullable(Of DateTime) = Nothing, + Optional CveContrato As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, + Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OI_EventosGet") @@ -1593,6 +1594,8 @@ Public Class ClsOIEventos .Add("@CveTipoProcesoCRM", SqlDbType.Int).Value = CveTipoProcesoCRM .Add("@CveEtapaProcesoCRM", SqlDbType.Int).Value = CveEtapaProcesoCRM + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + End With Try diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 42e8c4cd2..102870404 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -568,7 +568,8 @@ Public Class ClsOS Return Retorno End Function Public Function AddOrdenesServicios(CveCliente As Integer, CveSubProyecto As Integer, PersonaSolicito As String, FechaRecepcion As Date, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, - CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1) As Boolean + CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, + Optional Direccion As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosAdd") @@ -588,6 +589,8 @@ Public Class ClsOS .Add("@CveOSPadre", SqlDbType.Int).Value = CveOSPadre .Add("@CveOSTipo", SqlDbType.Int).Value = CveOSTipo .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal + .Add("@Direccion", SqlDbType.VarChar).Value = Direccion + .Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -629,7 +632,8 @@ Public Class ClsOS Return Retorno End Function - Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1) As Boolean + Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer, + CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosUpdate") @@ -644,6 +648,7 @@ Public Class ClsOS .Add("@CveOSTipo", SqlDbType.Int).Value = CveOSTipo .Add("@CveOS", SqlDbType.Int).Value = CveOS .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal + .Add("@Direccion", SqlDbType.VarChar).Value = Direccion End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c7f0c0d2d..7a15cb5e1 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5663,6 +5663,9 @@ Public Class ClsPaginas PaginaDict.Add("/Acumuladores/RepPolizasVirtuales.aspx".ToUpper(), 1322) + PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), -1) + PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=LI".ToUpper(), -1) + PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), -1) 'Antes de aquí. @@ -9256,7 +9259,7 @@ Public Class ClsPaginas Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim PathXML As String = $"{Ruta}XML\Pag\{Serie}-{Folio}.xml" Dim PathPDF As String = $"{Ruta}PDF\Pag\{Serie}-{Folio}.pdf" - Dim ImagenCBB As String = $"file://{Ruta}CBB\{Serie}-{Folio}.jpg" + Dim ImagenCBB As String = $"{Ruta}CBB\{Serie}-{Folio}.jpg" If File.Exists(PathXML) Then Dim XmlDoc As New System.Xml.XmlDocument @@ -9441,6 +9444,12 @@ Public Class ClsPaginas Dim CadenaOriginal As String = $"||1.0| {FolioFiscal} | {FechaCertificacion.ToDate.ToShortDateString} T {FechaCertificacion.ToDateTime.ToShortTimeString} | {SelloCFDi} | {NoSerieCertificado} ||" + If Not File.Exists(ImagenCBB) AndAlso FolioFiscal <> "" Then + Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCOrdenante, 1, FolioFiscal, ImagenCBB) + End If + + ' PARAMETROS DEL REPORTE params.Add(New ReportParameter("SerieFolio", SerieFolio)) params.Add(New ReportParameter("RFCOrdenante", RFCOrdenante)) @@ -9461,7 +9470,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("SelloSAT", SelloSAT)) params.Add(New ReportParameter("CadenaOriginal", CadenaOriginal)) params.Add(New ReportParameter("CertificadoSAT", CertificadoSAT)) - params.Add(New ReportParameter("QR", ImagenCBB)) + params.Add(New ReportParameter("QR", $"file://{ImagenCBB}")) Dim lrds As New List(Of ReportDataSource) Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = If(DTConceptosPago IsNot Nothing, DTConceptosPago, New DataTable)} @@ -9606,7 +9615,6 @@ Public Class ClsPaginas End If End If - If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares tImportePago = ((Pago.ImportePago * TCValuacion / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares @@ -9619,37 +9627,44 @@ Public Class ClsPaginas If CompraActual.CveMoneda > 1 Then ImporteME = Pago.ImportePago 'movimiento de pago proveedor - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, Pago.CveConceptoPago, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, Pago.CveConceptoPago, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True 'movimiento de pago proveedor Complementaria If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacion - ImporteME).RoundSQL, CveConceptoContableComplementaria, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacion - ImporteME).RoundSQL, CveConceptoContableComplementaria, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If - 'si tiene iva y su proporcion - If Not ErrorMovtos AndAlso CompraActual.IVA <> 0 Then + If Pago.AplicaAcreditable Then + + 'si tiene iva y su proporcion + If Not ErrorMovtos AndAlso CompraActual.IVA <> 0 Then ImporteMovimiento = (PorcentajePago * CompraActual.IVA).RoundSQL ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaIVA - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True - 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe - If FuncionalidadFluctuacionImpuestos Then ImporteMovimiento = (ImporteMovimiento.RoundSQL * Pago.TCPago).RoundSQL + If CompraActual.IVADeducible > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + ImporteMovimiento = (PorcentajePago * CompraActual.IVADeducible).RoundSQL + ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL + 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe + If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento.RoundSQL * Pago.TCPago).RoundSQL + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + End If If CompraActual.IVANoDeducible > 0 Then - ImporteMovimiento = (CompraActual.IVANoDeducible * PorcentajePago).RoundSQL + ImporteMovimiento = (PorcentajePago * CompraActual.IVANoDeducible).RoundSQL ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 280, CompraActual.SerieFolio, Concepto, Ret.IdCtaContIVANoAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 280, CompraActual.SerieFolio, Concepto, Ret.IdCtaContIVANoAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, PorcentajeImpuesto:=CompraActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If @@ -9662,12 +9677,12 @@ Public Class ClsPaginas If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetIVA - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If @@ -9682,36 +9697,38 @@ Public Class ClsPaginas End If Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetISR - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, Ret.CveConceptoAcreditable, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If - 'si tiene IEPS y su proporcion - If Not ErrorMovtos AndAlso CompraActual.IEPS > 0 Then - ImporteMovimiento = (PorcentajePago * CompraActual.IEPS).RoundSQL - ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL - If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + 'si tiene IEPS y su proporcion + If Not ErrorMovtos AndAlso CompraActual.IEPS > 0 Then + ImporteMovimiento = (PorcentajePago * CompraActual.IEPS).RoundSQL + ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL + If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - Dim Ret As New ConceptosRetenciones - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If ObjConta.GetRetCuenta(26, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + Dim Ret As New ConceptosRetenciones + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If ObjConta.GetRetCuenta(26, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero - If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 25, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + + 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe + If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 26, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 25, CompraActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True - - 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe - If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 26, CompraActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True - End If 'si tiene otros gastos/ingresos @@ -9725,7 +9742,7 @@ Public Class ClsPaginas ImporteMovimiento = Math.Abs(ImporteMovimiento) IdCta = If(UsuarioActual.Empresa.TipoContabilidad = 2, UsuarioActual.Empresa.IdCuentaOtrosIngresos, 0) End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tOtTipoMovto, ImporteMovimiento, ImporteMovimiento, tOtCveCon, CompraActual.SerieFolio, Concepto, IdCta, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveSubProyecto:=CompraActual.CveSubProyecto, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tOtTipoMovto, ImporteMovimiento, ImporteMovimiento, tOtCveCon, CompraActual.SerieFolio, Concepto, IdCta, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If @@ -9769,6 +9786,7 @@ Public Class ClsPaginas Public Class CompraPago + Public Property TipoPago As String = "B" ' B - Bancos, A - Anticipos, E - ExC, NC - Nota de crédito Public Fecha As Date Public Property CveIE As Integer = -1 Public Property CvePersonal As Integer = -1 @@ -9779,6 +9797,7 @@ Public Class ClsPaginas Public Property OtroGastoIngreso As Decimal = 0 Public Property CveConceptoPago As Integer = -1 'no definido de inicio Public Property CveCreditoDetalle As Integer = -1 + Public Property AplicaAcreditable As Boolean = True End Class @@ -9819,15 +9838,17 @@ Public Class ClsPaginas If UsuarioActual.Empresa.TipoContabilidad = 2 Then - Dim IdCtaIVAXAcreditar, IdCtaIVAAcreditable As Integer + Dim IdCtaIVAXAcreditar, IdCtaIVAAcreditable, IdCtaIVANOAcreditable As Integer Dim dt As DataTable = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA) If dt.Rows.Count > 0 Then IdCtaIVAXAcreditar = dt.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero IdCtaIVAAcreditable = dt.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + IdCtaIVANOAcreditable = dt.Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero End If Ret.IdCtaContableAcreditable = IdCtaIVAAcreditable Ret.IdCtaContablexAcreditar = IdCtaIVAXAcreditar + Ret.IdCtaContIVANoAcreditable = IdCtaIVANOAcreditable End If Return Ret @@ -10083,7 +10104,7 @@ Public Class ClsPaginas 'concepto pago Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia) - If Pago.TipoPago = "A" AndAlso Not ErrorMovtos Then 'A N T I C I P O + If Pago.TipoPago = "A" AndAlso Not ErrorMovtos Then ' A N T I C I P O Dim Ret As New ConceptosRetenciones If Pago.CveMonedaPago > 1 Then 'Agregamos la Extranjera @@ -10099,14 +10120,14 @@ Public Class ClsPaginas End If - If Pago.TipoPago = "NC" AndAlso Not ErrorMovtos Then ' N O T A D E C R E D I T O + If Pago.TipoPago = "NC" AndAlso Not ErrorMovtos Then ' N O T A D E C R E D I T O Dim Ret As New ConceptosRetenciones If Pago.CveMonedaPago > 1 Then 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 91, Pago.Referencia, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 294, Pago.Referencia, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 203, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True Else 'Agregamos Nacional If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 91, Pago.Referencia, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True @@ -10115,7 +10136,7 @@ Public Class ClsPaginas End If - If Pago.TipoPago = "I" AndAlso Not ErrorMovtos Then 'I N G R E S O S X C O M P R O B A R + If Pago.TipoPago = "I" AndAlso Not ErrorMovtos Then ' I N G R E S O S X C O M P R O B A R Dim Ret As New ConceptosRetenciones If UsuarioActual.Empresa.TipoContabilidad = 2 Then If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 3f820e8d0..e5ad7c6c9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5575,6 +5575,124 @@ Public Class ClsVentas End Function + Public Function GetLineasAdicionales(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, CveMoneda As Integer, + FechaI As Date, FechaF As Date, CveEstatus As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_LineasAdicionalesGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error obtener las lineas de adicionales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + + End Function + + Public Function AddLineasAdicionales(LineaAdicional As String, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, Importe As Decimal, + CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveClasificacionPS As Integer, CveEstatus As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_LineasAdicionalesAdd") + With SqlAdapter.SelectCommand.Parameters + + + .Add("@LineaAdicional", SqlDbType.VarChar).Value = LineaAdicional + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea + .Add("@Importe", SqlDbType.Money).Value = Importe + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveClasificacionPS", SqlDbType.Int).Value = CveClasificacionPS + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error agregar la linea adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + + End Function + + + Public Function UpdateLineasAdicionales(CveLineaAdicional As Integer, LineaAdicional As String, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, Importe As Decimal, + CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveClasificacionPS As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional Comprobante As String = "-1") As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_LineasAdicionalesUpdate") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional + .Add("@LineaAdicional", SqlDbType.VarChar).Value = LineaAdicional + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea + .Add("@Importe", SqlDbType.Money).Value = Importe + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveClasificacionPS", SqlDbType.Int).Value = CveClasificacionPS + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Comprobante", SqlDbType.VarChar).Value = Comprobante + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error agregar la linea adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + + End Function + + Public Function RemoveLineasAdicionales(CveLineaAdicional As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_LineasAdicionalesRemove") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error eliminar la linea adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + + End Function + + #Region "IDisposable Support" diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 55071651d..8f2cafafa 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -81,7 +81,7 @@ Public Class LogicNominas Return Retorno End Function Dim hasfiniquito As Boolean - Private Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean) As CFDITimbre + Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean) As CFDITimbre Dim continuar As Boolean = True hasfiniquito = False Dim CvePersonal As Integer = -1 @@ -431,9 +431,9 @@ Public Class LogicNominas cfdi.Comprobante.Serie = Serie cfdi.Comprobante.Folio = Folio cfdi.Comprobante.Fecha = Now - cfdi.Comprobante.Subtotal = cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal() + cfdi.Comprobante.SubTotal = cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal() cfdi.Comprobante.Descuentos = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal() - cfdi.Comprobante.Total = cfdi.Comprobante.Subtotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones + cfdi.Comprobante.Total = cfdi.Comprobante.SubTotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones cfdi.Comprobante.MotivoDescuento = "" '"Deducciones nómina" cfdi.Comprobante.Moneda = "MXN" cfdi.Comprobante.TipoComprobante = "N" diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 9dc3d44bd..abe6d4e94 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -4469,7 +4469,7 @@ Public Class Timbrado Nom.TotalOtrosPagos = ObjCFDITimbre.Nomina.TotalOtrosPagos.ToDecimal Nom.Emisor = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaEmisor - Nom.Emisor.Curp = ObjCFDITimbre.Emisor.CURP + Nom.Emisor.Curp = If(String.IsNullOrEmpty(ObjCFDITimbre.Emisor.CURP), Nothing, ObjCFDITimbre.Emisor.CURP) Nom.Emisor.RegistroPatronal = ObjCFDITimbre.Emisor.RegistroPatronal Nom.Emisor.RfcPatronOrigen = ObjCFDITimbre.Emisor.RFC @@ -4596,9 +4596,9 @@ Public Class Timbrado Nom.Receptor.Banco = ObjCFDITimbre.Nomina.Receptor.CodigoBanco Nom.Receptor.CuentaBancaria = ObjCFDITimbre.Nomina.Receptor.NumeroCuenta Nom.Receptor.SalarioBaseCotAporSpecified = True - Nom.Receptor.SalarioBaseCotApor = ObjCFDITimbre.Nomina.Receptor.SBC.ToDecimal + Nom.Receptor.SalarioBaseCotApor = Decimal.Round(ObjCFDITimbre.Nomina.Receptor.SBC.ToDecimal(), 2) Nom.Receptor.SalarioDiarioIntegradoSpecified = True - Nom.Receptor.SalarioDiarioIntegrado = ObjCFDITimbre.Nomina.Receptor.SDI.ToDecimal + Nom.Receptor.SalarioDiarioIntegrado = Decimal.Round(ObjCFDITimbre.Nomina.Receptor.SDI.ToDecimal(), 2) Nom.Receptor.ClaveEntFed = ObjCFDITimbre.Nomina.Receptor.CodigoEntidadFederativa Dim nsNom As New System.Xml.Serialization.XmlSerializerNamespaces() @@ -5251,7 +5251,7 @@ Public Class Timbrado If otpag.TipoOtroPago = "004" AndAlso otpag.Importe > 0 Then If otpag.ejercicio > 0 Then - cfdi.CompensacionSaldosAFavor(otpag.SaldoAFavor, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor + cfdi.Nomina12CompensacionSaldosAFavor(otpag.SaldoAFavor, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor End If End If diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index b25e72291..2f5a0ee5d 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -31,10 +31,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState CveUsuario = context.Request("U").ToEntero CveEmpresa = context.Request("E").ToEntero + + Dim CveSubProyecto As Integer = If(context.Request("CveSubProyecto") IsNot Nothing, context.Request("CveSubProyecto").ToEntero, -1) + Dim CveUsuarioPara As Integer = If(context.Request("CveUsuarioPara") IsNot Nothing, context.Request("CveUsuarioPara").ToEntero, -1) + + FI = context.Request("start").ToDate FF = context.Request("end").ToDate - If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2) Then + If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2, CveUsuarioPara:=CveUsuarioPara, CveSubProyecto:=CveSubProyecto) Then 'Convierte el objeto de Eventos en JSON 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) @@ -85,11 +90,11 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState End Property - Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1) As Boolean + Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean Dim ObjEventos As New ClsOIEventos Dim ErrorEventos = False Dim CveEmpresaCRM As Integer = 0 - If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then + If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuarioPara, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF, CveSubProyecto:=CveSubProyecto) Then If ObjEventos.DtResultados.Rows.Count > 0 Then events = New List(Of CalendarEvent) @@ -119,6 +124,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.EmpresaCRM = dr("EmpresaCRM").ToString cevent.SubProyecto = dr("SubProyecto").ToString cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero + cevent.Direccion = dr("Direccion").ToString '11/05/2018 - Evento Gasto Recurrente cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 9afe72256..b78140971 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -959,7 +959,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim UsaGlobal As Boolean = True 'verifica existencias - If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163, 166) Then + If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso usuario.Empresa.Funcionalidad(141) = "1" Then UsaGlobal = False 'If CveEmpresa.Contiene(140, 141) And Pagina.Contiene("ventas/ventas") Then diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 70b809ca8..e073494dc 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -295,7 +295,7 @@
- + diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 069a5dd6c..7cbb67f23 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -42,8 +42,12 @@ Partial Class Bancos_DepositosCaja DdlCuentaDeposito.DataBind() DdlCajaChica.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) - DdlCajaChica.DataBind() - + DdlCajaChica.DataBind() + 'código temporal, para claudia y toñita + If UsuarioActual.CveUsuario.Contiene(1937, 2452) Then + DdlCajaChica.Items.Add(New ListItem("Todas", "-1")) + End If + DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) DdlSubProyectos.DataBind() DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) @@ -102,19 +106,14 @@ Partial Class Bancos_DepositosCaja GvFacturas.DataSource = ObjBancos.DtResultados - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then lblValorTotal.Text = ObjBancos.DtResultados.SUM("Importe").ToString("###,###,###.00") RegistraScript($" ValorTotalSeleccionado = {ObjBancos.DtResultados.SUM("Importe")};") End If - - - ObjBancos.Dispose() - GvFacturas.DataBind() ChkFaltante.Checked = False ChkDescuento.Checked = False @@ -133,9 +132,6 @@ Partial Class Bancos_DepositosCaja UpParametros.Update() UpComisiones.Update() - - - End Sub Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click @@ -305,13 +301,14 @@ Partial Class Bancos_DepositosCaja Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero + Dim CveCuentaBancaria As Integer = Gvr.DataKey("CveCuenta").ToEntero - FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2) + FolioIE = ObjBancos.GetNextFolio(CveCuentaBancaria, 2) If Not FolioIE > 0 Then OcurrioError = True Exit For End If - CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveIEDestino = ObjBancos.AddBancos_IE(CveCuentaBancaria, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio) Then diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index e6d65eee3..710d7e509 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -174,12 +174,6 @@ Partial Class Bancos_ProveedoresAbonar ViewState("PermiteModificarImporte") = value End Set End Property - Private ReadOnly Property IdCtaContMonedaExtranjera As Integer - Get - Return ViewState("IdCtaContMonedaExtranjera").ToString.ToEntero - End Get - End Property - Private ReadOnly Property IdCtaContComplementaria As Integer Get Return ViewState("IdCtaContComplementaria").ToString.ToEntero @@ -265,7 +259,6 @@ Partial Class Bancos_ProveedoresAbonar If Not Page.IsPostBack Then If Not UsuarioActual.Empresa.UsaAC Then - ViewState("IdCtaContMonedaExtranjera") = 0 ViewState("IdCtaContComplementaria") = 0 ViewState("IdCtaContRetIVA") = 0 ViewState("IdCtaContRetISR") = 0 @@ -851,7 +844,7 @@ Partial Class Bancos_ProveedoresAbonar CompraActual.EsImportacion = gvr.DataKey("EsImportacion") = "1" CompraActual.UsuarioActual = UsuarioActual CompraActual.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero - CompraActual.IdCtaContableProv = If(CompraActual.CveMoneda >= 2, IdCtaContMonedaExtranjera, CtaProveedor) + CompraActual.IdCtaContableProv = If(CompraActual.CveMoneda >= 2, IdCtaProveedorExtranjera, CtaProveedor) CompraActual.IdCtaContableProvComplementaria = IdCtaContComplementaria 'Importe de pago diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index ee10c6e4d..3656903b0 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index a55268f82..535bfd2ea 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -881,10 +881,7 @@ -       - - - +       @@ -909,19 +906,13 @@ Anticipo/NC -   - - - +   Mon -   - - - +   @@ -2842,18 +2833,24 @@
-
+
-
+
+
+ +
+ +
+

@@ -2912,6 +2909,13 @@ + + + <%----%> + + + + @@ -5891,23 +5895,47 @@ } $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); - $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); - $("#LblSaldoFactura").text(FormatoNumero(Total - FnSumaValoresAnt(), 2)); + $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); + $("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2)); + $("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2)); } - function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal) { + function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, txtComision) { + var Total = ToDouble($get('TxtTotal').value); + let txtComisionImporte = 0; + + if (txtComision != null) { + if (!isNaN(txtComision.value)) { + txtComisionImporte = ToDouble(txtComision.value); + } + } + + var txtvalue = ToDouble(txt.value); - if (CveMonedaAnticipo = 1 && CveMonedaOriginal == 2) { + + + if (txtComisionImporte != 0 && txtComisionImporte > txtvalue) { + + if (txtComision != null) { + txtComision.value = txtvalue; + alert('La comisión no debe de exder la amortización.') + } + return; + } + + + if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) { txtvalue = ToDouble(txtvalue / TCAnticipo); - } else if (CveMonedaAnticipo = 2 && CveMonedaOriginal == 1) { + } else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) { txtvalue = ToDouble(txtvalue * TCAnticipo); } var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); + if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue; //minimo entre saldocompra y el saldoanticipo if (SaldoCompra < saldo) saldo = SaldoCompra; @@ -5919,12 +5947,13 @@ } if (ToDouble(txtvalue) > saldo) { - txt.value = saldo; + txt.value = saldo; alert("El Importe no debe de exceder a el saldo"); } $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); + $("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2)); $("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2)); } @@ -5941,8 +5970,21 @@ // totalPoints += ToDouble($(this).val()); //}); + let respuesta = Math.round(totalPoints * 100) / 100; + return respuesta + } - return Math.round(totalPoints * 100) / 100; + function FnSumaValoresAntComisiones() { + var totalPoints = 0; + var t = ''; + + + $('input[name*=TxtComision]').each(function () { + totalPoints += ToDouble($(this).val()); + }); + + let respuesta = Math.round(totalPoints * 100) / 100; + return respuesta } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 48968f247..a933fb13a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7,6 +7,7 @@ Imports System.IO Imports System.Threading.Tasks Imports System.Xml Imports Extensiones +Imports Microsoft.ReportingServices.DataProcessing Imports Newtonsoft.Json Partial Class Compras_Compras @@ -566,6 +567,7 @@ Partial Class Compras_Compras Public Property TipoMovto As String Public Property CveIE As Integer Public Property Importe As Decimal + Public Property ImporteComision As Decimal Public Property TCCompra As Decimal Public Property CvePersonal As Integer @@ -1134,9 +1136,16 @@ Partial Class Compras_Compras End Set End Property + Public Property FechaCompraOriginal As Date + Get + Return ViewState("FechaCompraOriginal").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaCompraOriginal") = value + End Set - + End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -1580,6 +1589,13 @@ Partial Class Compras_Compras divDevAuto.Visible = True End If + + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then + GVAnticipos.Columns(6).Visible = True + DVAntComiciones.Visible = True + End If + + End If 'SE OCUPAN AFUERA DEL POSTBACK ?? @@ -1767,7 +1783,7 @@ Partial Class Compras_Compras CargaComprobanteXML(XMLDoc) If NuevaValidacionXML = 1 Or (Version = "3.3" Or Version = "4.0") Then - Dim Xml As New StringBuilder + Dim Xml As String Dim nodo As XmlNode = XMLDoc.DocumentElement Dim Version = ValorXML(nodo, "version") @@ -1795,33 +1811,32 @@ Partial Class Compras_Compras namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces) + Xml = Replace(nodeconceptos.OuterXml, "", drr("PS")) - Next If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - End If End If @@ -2529,6 +2544,8 @@ Partial Class Compras_Compras TxtFolio.Text = dr("Folio").ToString TxtFolioSecundario.Text = dr("FolioSecundario").ToString TxtFecha.Text = dr("Fecha").ToString.ToDate.ToShortDateString + FechaCompraOriginal = dr("Fecha").ToString.ToDate + TxtDescripcion.Text = dr("Descripcion").ToString CvePrePoliza = dr("CvePrePoliza").ToString.ToEntero EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero @@ -4465,25 +4482,27 @@ Partial Class Compras_Compras 'REGISTRO LOS PRODUCTOS If Row("CvePS").ToString.ToEntero = 0 Then - tCve = PSS.AddPS(Row("CveClasificacionActualizar").ToString.ToEntero, -1, Row("CveUM").ToString.ToEntero, "", "", "", Row("PS").ToString, Row("PU").ToString.ToDouble, If(TxtIVA.Text.ToDouble > 0, -1, 0), 0, False, 0, True, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, 0) - If tCve > 0 Then - RegeneraPS = True - Row("CvePS") = tCve - Row("CveClasificacion") = Row("CveClasificacionActualizar").ToString.ToEntero - 'Row("CveEq") = 1 - TmpDT.AcceptChanges() + 'tCve = PSS.AddPS(Row("CveClasificacionActualizar").ToString.ToEntero, -1, Row("CveUM").ToString.ToEntero, "", "", "", Row("PS").ToString, Row("PU").ToString.ToDouble, If(TxtIVA.Text.ToDouble > 0, -1, 0), 0, False, 0, True, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, 0) + 'If tCve > 0 Then + ' RegeneraPS = True + ' Row("CvePS") = tCve + ' Row("CveClasificacion") = Row("CveClasificacionActualizar").ToString.ToEntero + ' 'Row("CveEq") = 1 + ' TmpDT.AcceptChanges() - 'busco el mismo PS dentro de la tabla por si está más de una vez y lo actualizo - Dim rowsToUpdate = TmpDT.AsEnumerable().Where(Function(r) r.Field(Of String)("PS") = Row("PS").ToString AndAlso r!CvePS.ToString.ToEntero = 0) - For Each roww As DataRow In rowsToUpdate - roww.SetField("CvePS", tCve) - roww.SetField("CveClasificacion", Row("CveClasificacionActualizar").ToString.ToEntero) - 'roww.SetField("CveEq", 1) - Next - TmpDT.AcceptChanges() - Else - Correcto = False - End If + ' 'busco el mismo PS dentro de la tabla por si está más de una vez y lo actualizo + ' Dim rowsToUpdate = TmpDT.AsEnumerable().Where(Function(r) r.Field(Of String)("PS") = Row("PS").ToString AndAlso r!CvePS.ToString.ToEntero = 0) + ' For Each roww As DataRow In rowsToUpdate + ' roww.SetField("CvePS", tCve) + ' roww.SetField("CveClasificacion", Row("CveClasificacionActualizar").ToString.ToEntero) + ' 'roww.SetField("CveEq", 1) + ' Next + ' TmpDT.AcceptChanges() + 'Else + ' Correcto = False + 'End If + Alert("Existen productos sin registrar/Asignar.", TipoMensaje.MsgAdvertencia) + Correcto = False Else 'UPDATE CLASIFICACION DE PRODUCTO YA REGISTRADO If Row("CveClasificacionActualizar").ToString.ToEntero > 0 AndAlso Row("CveClasificacion").ToString.ToEntero <= 0 Then @@ -4819,6 +4838,7 @@ Partial Class Compras_Compras CompraActual.TC = TipoCambio CompraActual.Total = TxtTotal.Text.ToDecimal CompraActual.IVA = TxtIVA.Text.ToDecimal + CompraActual.IVADeducible = TxtIVA.Text.ToDecimal CompraActual.IEPS = TxtIEPS.Text.ToDecimal CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal CompraActual.RetISR = TxtRetISR.Text.ToDecimal @@ -6120,7 +6140,7 @@ Partial Class Compras_Compras ConceptoContable = 333 End If - importeMovimiento = CompraActual.retiva + importeMovimiento = CompraActual.RetIVA importeMN = (importeMovimiento * tipoCambioActual * Multiplicador).RoundSQL If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" @@ -7130,6 +7150,9 @@ Partial Class Compras_Compras importeMovimiento = Ant.Importe importeMN = importeMovimiento * tipoCambioActual * Multiplicador + Dim ImporComisionAnticipo As Decimal = Ant.ImporteComision + Dim importeMNComision As Decimal = ImporComisionAnticipo * tipoCambioActual * Multiplicador + If importeMovimiento <> 0 Then 'Conta ContPAQ If IdCtaContable = 0 Then @@ -7242,6 +7265,7 @@ Partial Class Compras_Compras Pago.ImportePago = importeMovimientoNC Pago.CveIE = Ant.CveIE Pago.CveMonedaPago = 1 + Pago.OtroGastoIngreso = ImporComisionAnticipo ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) @@ -7274,10 +7298,24 @@ Partial Class Compras_Compras End If 'Agregamos el 21/37/60 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAnt, Referencia, ConceptoContableAnticipo, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteMX:=ImporteAntMN, ImporteME:=If(tipoCambioActual = 1, 0, ImporteAnt), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True + + + 'Dim ImporComisionAnticipo As Decimal = Ant.ImporteComision + 'Dim importeMNComision As Decimal = ImporComisionAnticipo * tipoCambioActual * Multiplicador + If ImporComisionAnticipo = 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAnt, Referencia, ConceptoContableAnticipo, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteMX:=ImporteAntMN, ImporteME:=If(tipoCambioActual = 1, 0, ImporteAnt), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + Else + Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt + ImporComisionAnticipo), Referencia, ConceptoContableAnticipo, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteMX:=ImporteAntMNComision, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt + ImporComisionAnticipo)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If End If + + If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then Dim Pago As New CompraPago @@ -7285,6 +7323,7 @@ Partial Class Compras_Compras Pago.CveIE = Ant.CveIE Pago.TCPago = Ant.TCCompra Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1) + Pago.OtroGastoIngreso = ImporComisionAnticipo ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) @@ -7605,6 +7644,7 @@ Partial Class Compras_Compras Pago.CveMonedaPago = 1 Pago.CveCompraAmortizacion = CveCompraNC Pago.CveConceptoPago = CveConceptoPago + Pago.AplicaAcreditable = If(Ant.TipoMovto.Contiene("NC", "DEV"), False, True) 'SI ES NC, no se acredita ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) @@ -8348,807 +8388,101 @@ Partial Class Compras_Compras End If Dim CveCompraNC, IdCtaContable As Integer - - Dim PorcentajePago, ImporteMovimiento, sumaAmortizacion, sumaAmortizacionCompleto As Decimal + Dim PorcentajePago As Decimal Dim ConceptoPoliza As String = $"Amortización {NombreProveedor} - {TxtSerie.Text}-{TxtFolio.Text}" - Dim CompraUnificada As Boolean = False - Dim IVACompleto As Boolean = False - Dim IdCtaIVAXAcreditar As Integer = 0 - Dim IdCtaIVAAcreditable As Integer = 0 - 'PorcentajeIVA - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("IVAPorcentaje").ToDouble).Rows.Count > 0 Then - IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("IVAPorcentaje").ToDouble).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("IVAPorcentaje").ToDouble).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - End If Try Dim CveIE As Integer = -1 - - If EmpresaPrueba Then - Dim CvePlantillaPoliza = 52 - Dim tipoCambio As Decimal - Dim tipoCambioNC As Decimal - Dim alertaContabilizacion As New StringBuilder - Dim idCuentaContabilizacion As Long = 1 - Dim CvePrepolizaPadre As Integer = CvePrePoliza - Dim CuentasContablesInvalidas As New StringBuilder - Dim CuentasContablesInvalidasSIG As New StringBuilder - - If DdlMoneda.SelectedValue.ToString.ToEntero = 2 Then - tipoCambio = GlobalTipoCambio(Fecha).ToString.ToDecimal - Else - tipoCambio = 1 - End If - - '[IPP] PARCHE PARA AMORTIZACIÓN NC - Dim TipoCambioCompra = Me.TipoCambio - - Dim CvePrePolizaNueva As Integer = ObjConta.AddPrePolizas("Compras/Anticipos", 52, Importe, Importe, DdlMoneda.SelectedValue.ToEntero, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - For Each gvr As GridViewRow In GVAnticipos.Rows - If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then - - CveCompraNC = gvr.DataKey("CveCompra").ToEntero - tipoCambioNC = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, gvr.DataKey("TCCompra").ToDecimal) - sumaAmortizacion = 0 - - If CvePrePolizaNueva > 0 Then - If ObjConta.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - - For Each Row As DataRow In ObjConta.DtResultados.Rows - - Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero - Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False) - ImporteMovimiento = 0 - IdCtaContable = 0 - - - - Dim Concepto As String = String.Format("{0} F:{1}-{2}", HplProveedor.Text, TxtSerie.Text, TxtFolio.Text) - Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) - Dim PorcentajeImpuesto As Decimal = 0 - Dim ConceptoPartida As String = String.Format("{0} F:{1}-{2}", HplProveedor.Text, TxtSerie.Text, TxtFolio.Text) - - - Select Case ConceptoContable - Case 265 'Amortización Anticipos Compras - If gvr.DataKey("TipoDocto").Contiene("Ant") Then - CveIE = -1 - ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal - importeMN = ImporteMovimiento * tipoCambioNC - sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento - - If ChkPagarConPesos.Checked Then - ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal - ElseIf ChkPagarConDolares.Checked Then - ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal - End If - - If DdlMoneda.SelectedValue.ToEntero <> 1 Then - IdCtaContable = CtaProveedorAnticiposExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - - IdCtaContable = CtaProveedorAnticiposComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, ConceptoPartida, 266, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - Exit Select - End If - - Else - ErrorMovtosCxP = 1 - Exit Select - End If - Else - IdCtaContable = CtaProveedorAnticipos - If ImporteMovimiento <> 0 Then - PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - End If - End If - End If - - ImporteMovimiento = 0 - Case 60 'Nota de Credito - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - CveIE = -1 - ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal - importeMN = ImporteMovimiento * tipoCambioNC - sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento - - If ChkPagarConPesos.Checked Then - ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal - ElseIf ChkPagarConDolares.Checked Then - ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal - End If - - If DdlMoneda.SelectedValue.ToEntero <> 1 Then - IdCtaContable = CtaProveedorExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - IdCtaContable = CtaProveedorComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, ConceptoPartida, 235, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - Exit Select - End If - Else - ErrorMovtosCxP = 1 - Exit Select - End If - Else - IdCtaContable = CtaProveedor - If ImporteMovimiento <> 0 Then - PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompra, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - End If - End If - End If - - ImporteMovimiento = 0 - Case 21 'Anticipo - If gvr.DataKey("TipoDocto") = "Egsc" Then - CveCompraNC = -1 - CveIE = gvr.DataKey("CveIE").ToEntero - ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal - sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento - IdCtaContable = CtaProveedorAnticipos - - PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - - If ChkPagarConPesos.Checked Then - ImporteMovimiento = ImporteMovimiento * GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal - ElseIf ChkPagarConDolares.Checked Then - ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal - End If - - If ImporteMovimiento <> 0 Then - - Dim TipoCambioAnt = gvr.DataKey("TCCompra").ToDecimal - - Dim usacomplementariaAnticipo As Boolean = False - usacomplementariaAnticipo = If(TipoCambioAnt > 1, True, False) - - - Dim ImporteAnt As Decimal = ImporteMovimiento - Dim ImporteAntMN As Decimal = ImporteAnt * TipoCambioAnt - If usacomplementariaAnticipo Then - IdCtaContable = CtaProveedorAnticiposComplementaria - ImporteAntMN = TipoCambioAnt * ImporteAnt - ImporteAnt - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, ConceptoPartida, 266, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, ImporteMX:=ImporteAntMN, ImporteME:=ImporteAnt, TipoCambio:=TipoCambioAnt, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - ImporteAntMN = ImporteAnt - End If - - If TipoCambioAnt > 1 Then - IdCtaContable = CtaProveedorAnticiposExtranjera - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteAnt, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteAntMN, CvePrePolizaOriginal:=CvePrePolizaNueva, ImporteME:=If(tipoCambio = 1, 0, ImporteAnt), CveCompraAmortizacion:=CveCompraNC, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - - If ChkPagarConPesos.Checked Or ChkPagarConDolares.Checked Then - ImporteAnt = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal - TipoCambioAnt = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, gvr.DataKey("TCCompra").ToDecimal) - End If - - Dim TipoCambioDiferencia = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal - - If TipoCambioDiferencia <> TipoCambioAnt Then - Dim importeFluctuacion = (ImporteAnt * TipoCambioDiferencia) - (ImporteAnt * TipoCambioAnt) - - If importeFluctuacion > 0 Then - ConceptoContable = 64 - TipoMovimiento = True - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - ElseIf importeFluctuacion < 0 Then - ConceptoContable = 65 - TipoMovimiento = False - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - End If - - importeFluctuacion = importeFluctuacion.Abs.RoundSQL() - If importeFluctuacion <> 0 Then - Dim CveSubProyecto6465 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeFluctuacion, "", ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyecto6465, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeFluctuacion, CvePrePolizaOriginal:=CvePrePolizaNueva, ImporteME:=0) Then - ErrorMovtosCxP = 1 - End If - End If - End If - - End If - End If - - ImporteMovimiento = 0 - - Case 37 'Deudores Diversos - If gvr.DataKey("TipoDocto") = "DD" Then - CveCompraNC = -1 - CveIE = gvr.DataKey("CveIE").ToEntero - ImporteMovimiento = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal - sumaAmortizacion += ImporteMovimiento - sumaAmortizacionCompleto += ImporteMovimiento - IdCtaContable = CtaProveedorDeudores - - If ImporteMovimiento <> 0 Then - PorcentajePago = ImporteMovimiento / TxtTotal.Text.ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCompraAmortizacion:=CveCompraNC, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - End If - End If - - ImporteMovimiento = 0 - - Case 17 'Pago Proveedores - - If CveTipoConcepto = 2 Then ConceptoContable = 308 'cuando es acreedor - If CveMoneda > 1 Then - Select Case ConceptoContable - Case 17 - ConceptoContable = 312 - Case 308 - ConceptoContable = 309 - Case Else - End Select - End If - - Dim TipoCambio17 = tipoCambio - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant", "Egsc") Then - TipoCambio17 = TipoCambioCompra - End If - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - ConceptoContable = 272 - End If - - ImporteMovimiento = sumaAmortizacion - importeMN = ImporteMovimiento * TipoCambio17 - - If DdlMoneda.SelectedValue.ToEntero <> 1 Then - IdCtaContable = CtaProveedorExtranjera - If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17, CveSubProyecto:=CveSubProyectoAnticipo) Then - - Dim CveConceptoContableComplementaria As Integer = 206 - If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor - - IdCtaContable = CtaProveedorComplementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, Concepto, CveConceptoContableComplementaria, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - Exit Select - End If - Else - ErrorMovtosCxP = 1 - Exit Select - End If - Else - IdCtaContable = CtaProveedor - If ImporteMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(TipoCambio17 = 1, 0, ImporteMovimiento), CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - Exit For - End If - End If - End If - - ImporteMovimiento = 0 - Case 14 'Iva X Acreditar - - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then - If sumaAmortizacion = CompraSaldo Then - ImporteMovimiento = TxtIVA.Text.ToDecimal - If ImporteMovimiento > 0 Then - IVACompleto = True - End If - Else - ImporteMovimiento = 0 - End If - Else - ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) - End If - importeMN = ImporteMovimiento * tipoCambioNC - PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal - IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) - - If chkImportacion.Checked Then - ConceptoContable = 287 - End If - - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero - End If - End If - End If - - - Case 19 'Iva Acreditado - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then - If sumaAmortizacion = CompraSaldo Then - ImporteMovimiento = TxtIVA.Text.ToDecimal - IVACompleto = True - Else - ImporteMovimiento = 0 - End If - Else - ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) - End If - importeMN = ImporteMovimiento * tipoCambioNC - PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal - IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) - - If chkImportacion.Checked Then - ConceptoContable = 288 - End If - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero - End If - End If - End If - Case 15 'RetIVA x Acreditar Honorarios/Serv. Prof. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - If DdlRetIVAConcepto.Items.Count > 0 Then - TipoMovimiento = If(TipoMovimiento, False, True) - Dim Funcionalidad As Integer = 0 - If CveRetIVAConceptoOriginal = 1 Then - Funcionalidad = 307 - ConceptoContable = 15 - ElseIf CveRetIVAConceptoOriginal = 2 Then - Funcionalidad = 309 - ConceptoContable = 183 - ElseIf CveRetIVAConceptoOriginal = 3 Then - Funcionalidad = 311 - ConceptoContable = 185 - ElseIf CveRetIVAConceptoOriginal = 4 Then - Funcionalidad = 313 - ConceptoContable = 248 - ElseIf CveRetIVAConceptoOriginal = 5 Then - Funcionalidad = 578 - ConceptoContable = 285 - ElseIf CveRetIVAConceptoOriginal = 6 Then - ConceptoContable = 333 - End If - - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - - If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - - End If - End If - Case 22 'RetIVA Acreditable Honorarios/Serv. Prof. - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero > 0 Then - - - TipoMovimiento = If(TipoMovimiento, False, True) - - Dim Funcionalidad As Integer = 0 - Dim ConceptoContableContra As Integer = 0 - - If CveRetIVAConceptoOriginal = 1 Then - Funcionalidad = 308 - ConceptoContable = 22 - ConceptoContableContra = 15 - ElseIf CveRetIVAConceptoOriginal = 2 Then - Funcionalidad = 310 - ConceptoContable = 184 - ConceptoContableContra = 183 - - ElseIf CveRetIVAConceptoOriginal = 3 Then - Funcionalidad = 312 - ConceptoContable = 186 - ConceptoContableContra = 185 - - ElseIf CveRetIVAConceptoOriginal = 4 Then - Funcionalidad = 314 - ConceptoContable = 249 - ConceptoContableContra = 248 - - ElseIf CveRetIVAConceptoOriginal = 5 Then - Funcionalidad = 578 - ConceptoContable = 286 - ConceptoContableContra = 285 - ElseIf CveRetIVAConceptoOriginal = 6 Then - ConceptoContable = 334 - ConceptoContableContra = 333 - End If - - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambioNC - - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If CtaProveedorRetIVA > 0 Then - IdCtaContable = CtaProveedorRetIVA - ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - - - - 'If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" - ''Agregamos el Opuesto del 22 -> 15 - 'If ImporteMovimiento <> 0 Then - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContableContra, Concepto + If(tipoCambio > 1, $" TC {tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}", ""), Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=-1, CveCreditoDetalle:=-1, ImporteMX:=ImporteMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), Contabilizable:=True, TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoAnticipo) Then - ' ErrorMovtosCxP = 1 - ' Exit For - ' End If - 'End If - - End If - End If - - - - Case 16 'RetISR x Acreditar - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then - - TipoMovimiento = If(TipoMovimiento, False, True) - - Dim funcionalidad As Integer = 0 - If DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then - funcionalidad = 315 - ConceptoContable = 16 - ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then - funcionalidad = 317 - ConceptoContable = 243 - ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then - funcionalidad = 348 - ConceptoContable = 327 - End If - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio - If tipoCambio > 1 Then Concepto += $" TC{tipoCambio} ${ImporteMovimiento.FormatoNumero(2)}" - - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - - ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - End If - - - End If - End If - - Case 23 'RetISR Acreditable - If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then - 'If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then - - TipoMovimiento = If(TipoMovimiento, False, True) - - Dim funcionalidad As Integer = 0 - Dim ConceptoContableContra As Integer = 0 - - If CveRetISRConceptoOriginal = 1 Then - funcionalidad = 316 - ConceptoContable = 23 - ConceptoContableContra = 16 - ElseIf CveRetISRConceptoOriginal = 2 Then - funcionalidad = 318 - ConceptoContable = 244 - ConceptoContableContra = 243 - ElseIf CveRetISRConceptoOriginal = 3 Then - funcionalidad = 348 - ConceptoContable = 328 - ConceptoContableContra = 327 - End If - - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - importeMN = Math.Round(ImporteMovimiento, 2) * tipoCambio * Multiplicador - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - End If - End If - End If - - Case 64 'GANANCIA - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then 'SOLO SE IMPLEMENTÓ PARA NC - If DdlMoneda.SelectedValue.ToEntero <> 1 Or gvr.DataKey("CveMoneda").ToEntero <> 1 Then - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - Dim TipoCambioDiferenciaCambiaria = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, tipoCambioNC) - Dim TipoCambioDiferenciaCompra = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal - If TipoCambioDiferenciaCompra > TipoCambioDiferenciaCambiaria Then - ImporteMovimiento = (sumaAmortizacion * TipoCambioDiferenciaCompra) - (sumaAmortizacion * TipoCambioDiferenciaCambiaria) - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMN = ImporteMovimiento - End If - - If ImporteMovimiento <> 0 Then - - Dim CveSubProyecto64 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyecto64, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0) Then - ErrorMovtosCxP = 1 - Exit For - End If - End If - - End If - End If - ImporteMovimiento = 0 - Case 65 'PERDIDA - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then 'SOLO SE IMPLEMENTÓ PARA NC - If DdlMoneda.SelectedValue.ToEntero <> 1 Or gvr.DataKey("CveMoneda").ToEntero <> 1 Then - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - Dim TipoCambioDiferenciaCambiaria = If(ChkPagarConPesos.Checked, GlobalTipoCambio(gvr.DataKey("Fecha").ToDate).ToDecimal, tipoCambioNC) - Dim TipoCambioDiferenciaCompra = If(ChkPagarConDolares.Checked, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambioCompra).ToDecimal - If TipoCambioDiferenciaCambiaria > TipoCambioDiferenciaCompra Then - ImporteMovimiento = (sumaAmortizacion * TipoCambioDiferenciaCambiaria) - (sumaAmortizacion * TipoCambioDiferenciaCompra) - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMN = ImporteMovimiento - End If - - If ImporteMovimiento <> 0 Then - Dim CveSubProyecto65 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyecto65, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0) Then - ErrorMovtosCxP = 1 - Exit For - End If - End If - - End If - End If - ImporteMovimiento = 0 - End Select - - If ImporteMovimiento <> 0 Then - 'Conta ContPAQ - If IdCtaContable = 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - idCuentaContabilizacion = 0 - End If - - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambioNC, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - Exit For - End If - - End If - Next - - End If - - End If - - End If - Next - - 'Si el importe total de la amortizacion es igual al saldo de la compra se registra IVA - If IVACompleto = False AndAlso UsuarioActual.Empresa.Funcionalidad(521) = "1" Then - If sumaAmortizacionCompleto = CompraSaldo Then - Dim PorcentajeImpuesto As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal - - - If TxtIVA.Text.ToDecimal > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, True, TxtIVA.Text.ToDecimal, "", 14, "", Fecha, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, False, TxtIVA.Text.ToDecimal, "", 19, "", Fecha, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=TxtIVA.Text.ToDecimal * tipoCambio, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, TxtIVA.Text.ToDecimal), PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then - ErrorMovtosCxP = 1 - End If - End If - End If - End If - - 'Unificacion de PrePolizas - If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then - If Not ObjConta.PrePolizaUnificacion(CvePrepolizaPadre, CvePrePolizaNueva) Then - ErrorMovtosCxP = 1 - Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) - End If - - If ObjConta.SeUnifico Then - CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva - End If - - End If - - 'Simplificacion de PrePolizas - If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then - If Not ObjConta.PrePolizaSimplificacion(CvePrePolizaNueva, UsuarioActual.CveEmpresa) Then - ErrorMovtosCxP = 1 - Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) - End If - End If - - 'Validacion de prepolizas - If ObjConta.ValidacionPrePolizaCuadre(CvePrePolizaNueva, 4) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - GuardaLogAD($"Compras/Compras-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - 'ErrorMovtosCxP = 1 - End If - End If - - 'Conta ContPAQ - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso ErrorMovtosCxP = 0 Then - If idCuentaContabilizacion > 0 Then - If ObjConta.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - alertaContabilizacion.AppendFormat("{1}<\a>
", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) - Else - ErrorMovtosCxP = 1 - End If - If ErrorMovtosCxP = 0 Then - Alert("Se enviaron correctamente las siguientes pólizas:

" & alertaContabilizacion.ToString, ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) - End If - Else - Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas:
{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia) - End If - End If - - - Else 'Empresa Prueba - - For Each gvr As GridViewRow In GVAnticipos.Rows - If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then - - CveCompraNC = gvr.DataKey("CveCompra").ToEntero - If CvePrePoliza > 0 Then - - Dim CveConceptoCompra As Integer = 60 - - Dim CveConceptoPago As Integer = 17 - If CveTipoConcepto = 2 Then CveConceptoPago = 308 'cuando es acreedor - If CveMoneda <> 1 Then - Select Case CveConceptoPago - Case 17 - CveConceptoPago = 312 - Case 308 - CveConceptoPago = 309 - Case Else - End Select - End If - - Dim TipoMovimientoCompra As Boolean = True - Select Case gvr.DataKey("TipoDocto") - Case "NC", "DEV" - CveConceptoCompra = 60 - CveIE = -1 - CveConceptoPago = 272 - Case "Egsc" - CveConceptoCompra = 21 - 'vinculo la compra actual, y no la compra como si fuera nota de credito - CveCompraNC = -1 - CveIE = gvr.DataKey("CveIE").ToEntero - Case "DD" - CveConceptoCompra = 37 - 'vinculo la compra actual, y no la compra como si fuera nota de credito - CveCompraNC = -1 - CveIE = gvr.DataKey("CveIE").ToEntero - End Select - - PorcentajePago = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal / TxtTotal.Text.ToDecimal - - 'Se agrega la nota de credito - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoCompra, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, CveSubProyecto:=CveSubProyectoAnticipo) Then + For Each gvr As GridViewRow In GVAnticipos.Rows + If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then + + CveCompraNC = gvr.DataKey("CveCompra").ToEntero + If CvePrePoliza > 0 Then + + Dim CveConceptoCompra As Integer = 60 + Dim TipoMovimientoCompra As Boolean = True + Select Case gvr.DataKey("TipoDocto") + Case "NC", "DEV" + CveConceptoCompra = 60 + CveIE = -1 + Case "Egsc" + CveConceptoCompra = 21 + 'vinculo la compra actual, y no la compra como si fuera nota de credito + CveCompraNC = -1 + CveIE = gvr.DataKey("CveIE").ToEntero + Case "DD" + CveConceptoCompra = 37 + 'vinculo la compra actual, y no la compra como si fuera nota de credito + CveCompraNC = -1 + CveIE = gvr.DataKey("CveIE").ToEntero + End Select + + PorcentajePago = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal / TxtTotal.Text.ToDecimal + + + Dim ImporteAnt As Decimal = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal + Dim ImporComisionAnticipo As Decimal = gvr.FCTextBox("TxtComision").Text.ToDecimal + Dim CvemonedaAnticipo As Integer = gvr.DataKey("CveMoneda").ToEntero + Dim TipoCambioAnt As Decimal = gvr.DataKey("TCCompra").ToDecimal + + If ImporComisionAnticipo = 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, ImporteAnt, " ", CveConceptoCompra, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=ImporteAnt, ImporteME:=If(TipoCambioAnt = 1, 0, ImporteAnt), CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 Exit For End If - - 'movimiento de pago proveedor - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, CveCompraAmortizacion:=CveCompraNC, ImporteMX:=gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, CveSubProyecto:=CveSubProyectoAnticipo) Then + Else + Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, (ImporteAnt + ImporComisionAnticipo), "", CveConceptoCompra, "", TxtFechaPago.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteAntMNComision, ImporteME:=If(TipoCambioAnt = 1, 0, (ImporteAnt + ImporComisionAnticipo)), CveSubProyecto:=CveSubProyectoAnticipo) Then + ErrorMovtosCxP = 1 ErrorMovtosCxP = 1 - Exit For End If - - 'si tiene iva y su proporcion - ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) - If ImporteMovimiento > 0 Then - Dim PorcentajeImpuesto As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 14, " ", TxtFechaPago.Text.ToDate, IdCtaIVAXAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 19, " ", TxtFechaPago.Text.ToDate, IdCtaIVAAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, PorcentajeImpuesto:=PorcentajeImpuesto, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - End If - - 'si tiene Ret iva y su proporcion - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - If ImporteMovimiento > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 15, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 22, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - End If - - 'si tiene Ret ISR y su proporcion - ImporteMovimiento = Math.Round(PorcentajePago * TxtRetISR.Text.ToDecimal, 2) - If ImporteMovimiento > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, " ", 16, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, " ", 23, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CveSubProyecto:=CveSubProyectoAnticipo) Then ErrorMovtosCxP = 1 : Exit For - - End If - - - 'actualizo una tabla de vinculaciones - - 'actualizo la cantidad en amortizaciones - - If gvr.DataKey("TipoDocto").Contiene("NC", "DEV") Then - If Not ObjCompra.AmortizarCompra(CveCompra, CveCompraNC, gvr.FCTextBox("TxtAnticipo").Text.ToDouble, UsuarioActual.CveUsuario) Then - ErrorMovtosCxP = 2 - Exit For - - End If - - End If - - End If + Dim Pago As New CompraPago + Pago.ImportePago = ImporteAnt + Pago.CveIE = CveIE + Pago.CveMonedaPago = CvemonedaAnticipo + Pago.CveCompraAmortizacion = CveCompraNC + Pago.CveCreditoDetalle = -1 + Pago.OtroGastoIngreso = ImporComisionAnticipo + + Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + Dim CompraActual As New Compra + CompraActual.CveCompra = CveCompra + CompraActual.CveTipoConceptoProveedor = CveTipoConcepto + CompraActual.CveProveedor = CveProveedor + CompraActual.CveMoneda = DdlMoneda.SelectedValue.ToEntero + CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim + CompraActual.ProveedorNombre = HplProveedor.Text + CompraActual.TC = TipoCambio + CompraActual.Total = TxtTotal.Text.ToDecimal + CompraActual.IVA = TxtIVA.Text.ToDecimal + CompraActual.IVADeducible = TxtIVA.Text.ToDecimal + CompraActual.IEPS = TxtIEPS.Text.ToDecimal + CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal + CompraActual.RetISR = TxtRetISR.Text.ToDecimal + CompraActual.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero + CompraActual.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero + CompraActual.PorcentajeIVA = PorcentajeIVA + CompraActual.UsuarioActual = UsuarioActual + CompraActual.CveSubProyecto = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero + CompraActual.IdCtaContableProv = CtaProveedor + CompraActual.IdCtaContableProvComplementaria = CtaProveedorComplementaria + CompraActual.EsImportacion = chkImportacion.Checked + + AplicaPrePolizaPagoCompra(CompraActual, pago, CvePrePoliza, ObjConta) + End If - Next - - End If 'Empresa Prueba - + End If + Next Select Case ErrorMovtosCxP Case 0 Alert("El movimiento se aplicó correctamente.", TipoMensaje.MsgInformacion) ObjCompra.Commit() - Dim dtnc As DataTable = Nothing If ObjCompra.GetComprasNotasCredito(CveCompra, -1) Then dtnc = ObjCompra.DtResultados @@ -9184,7 +8518,7 @@ Partial Class Compras_Compras For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then - ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")}) + ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")}) End If Next @@ -9234,8 +8568,20 @@ Partial Class Compras_Compras Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click + If CveFactura > 0 Then + If Not AjustaCombustibles() Then + Exit Sub + End If + End If + + + 'VALIDA IMPORTES If CveFactura > 0 Then 'SI NO VIENE DE FACTURA/XML NO VALIDA TOTALES + + + + If Not ValidaTotalesGuardar() Then Exit Sub End If @@ -9982,15 +9328,15 @@ Partial Class Compras_Compras End If 'Removemos los conceptos de la prepoliza - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) 'GASTO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) 'ALMACEN - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) 'AF - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) 'PS YA RECIBIDO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 230, CveCompra, 1) 'PS YA RECIBIDO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 231, CveCompra, 1) 'PS YA RECIBIDO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 176, CveCompra, 1) 'PS NO RECIBIDO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) 'PS NO RECIBIDO - ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) 'PS NO RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) Then ErrorPrepoliza = True 'GASTO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) Then ErrorPrepoliza = True 'ALMACEN + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) Then ErrorPrepoliza = True 'AF + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 230, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 231, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 176, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO + If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO 'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR Dim ConceptoContabilizacionAlmacen = 0 @@ -10431,10 +9777,12 @@ Partial Class Compras_Compras #Region "GV'S" Protected Sub GVAnticipos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAnticipos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("SerieFolio") = "" Then e.Row.Cells(0).Text = "" e.Row.Cells(5).Text = "" + e.Row.Cells(6).Text = "" e.Row.Cells(0).Width = Unit.Pixel(150) e.Row.CssClass = "Totales TextCenter" Select Case e.Row.DBCampo("TipoDocto") @@ -10451,6 +9799,7 @@ Partial Class Compras_Compras ElseIf e.Row.DBCampo("CveProveedor") = "" Then e.Row.Cells(0).Text = "" e.Row.Cells(5).Text = "" + e.Row.Cells(6).Text = "" e.Row.BackColor = Drawing.Color.LightGray Else If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(3).ForeColor = Drawing.Color.Red @@ -10458,7 +9807,44 @@ Partial Class Compras_Compras Dim ImporteAmortizacion As Decimal = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal) e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO - e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + + + If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then + e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});", + e.Row.FCCheckBox("Chk").ClientID, + e.Row.DBCampo("Saldo"), + If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, + If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), + DdlMoneda.SelectedValue.ToEntero, + e.Row.FCTextBox("TxtComision").ClientID)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + + e.Row.FCTextBox("TxtComision").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},{6},{1},{2},{3},{4},{5},this);", + e.Row.FCCheckBox("Chk").ClientID, + e.Row.DBCampo("Saldo"), + If(CveCompra > 0, Saldo, ImporteAmortizacion), + e.Row.DBCampo("CveMoneda").ToEntero, + If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), + DdlMoneda.SelectedValue.ToEntero, + e.Row.FCTextBox("TxtAnticipo").ClientID)) + Else + e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5});", + e.Row.FCCheckBox("Chk").ClientID, + e.Row.DBCampo("Saldo"), + If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, + If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), + DdlMoneda.SelectedValue.ToEntero, + e.Row.FCTextBox("TxtComision").ClientID)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO + + e.Row.FCTextBox("TxtComision").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},{6},{1},{2},{3},{4},{5},this);", + e.Row.FCCheckBox("Chk").ClientID, + e.Row.DBCampo("Saldo"), + If(CveCompra > 0, Saldo, ImporteAmortizacion), + e.Row.DBCampo("CveMoneda").ToEntero, + If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), + DdlMoneda.SelectedValue.ToEntero, + e.Row.FCTextBox("TxtAnticipo").ClientID)) + End If + If ChkNCInv.Checked Then e.Row.FCCheckBox("Chk").CssClass = "ChkAntNC" @@ -16790,7 +16176,14 @@ Partial Class Compras_Compras RetIVA = TmpDT.SUM("RetIVA") RetISR = TmpDT.SUM("RetISR") IEPSPS = TmpDT.SUM("IEPSPS") - IVA = If(TmpDT.SUM("IVA") > 0, SubTotalIVA + SubTotalIEPSIVA, 0) + + If CveCompra > 0 AndAlso CveFactura > 0 Then + IVA = TxtIVA.Text.ToDecimal + Else + IVA = If(TmpDT.SUM("IVA") > 0, SubTotalIVA + SubTotalIEPSIVA, 0) + End If + + 'If CalculaIVA Then IVA = TxtIVA.Text.ToDouble Descuentos = TmpDT.SUM("Descuento") @@ -20558,39 +19951,74 @@ Partial Class Compras_Compras Protected Sub LnkActualziarFechadecompra_Click(sender As Object, e As EventArgs) - Dim ObjCompra As New ClsCompras + Dim ProcesoError As Boolean = True + + If FechaCompraOriginal <> TxtFecha.Text.ToDate Then + + + Dim ObjCompra As New ClsCompras + ObjCompra.IniciaTransacSQL() + + Dim ObjEventos As New ClsOIEventos(ObjCompra.IniciaTransacSQL()) + + If ObjEventos.AddEventoBitacora($"Cambio de Fecha de compra de { FechaCompraOriginal.ToString("dd/MM/yyyy")} a {TxtFecha.Text}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then + ProcesoError = False + Else + ProcesoError = True + End If + + If ProcesoError = False And ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then + ProcesoError = False + Else + ProcesoError = True + End If + + + If Not ProcesoError Then + ObjCompra.Commit() + FechaCompraOriginal = TxtFecha.Text.ToDate + Alert("Fecha Actualizada Correctamente.") + Else + ObjCompra.RollBack() + End If + + ObjCompra.Dispose() + + If Not ProcesoError Then + CargaEventoBitacora() + UPEventoBitacora.Update() + End If + - If ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then - Alert("Fecha Actualizada Correctamente") End If - ObjCompra.Dispose() + End Sub Private Function ValidaSeleccionAnticipo() As Boolean - Dim Respuesta As Boolean + Dim Respuesta As Boolean = True - If UsuarioActual.CveEmpresa.Contiene(13, 83) Then - If GVAnticipos.Rows.Count > 0 Then + 'If UsuarioActual.CveEmpresa.Contiene(13, 83) Then + ' If GVAnticipos.Rows.Count > 0 Then - For Each GVRow As GridViewRow In GVAnticipos.Rows - If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then - Respuesta = True - Exit For - Else - Respuesta = False - End If - Next + ' For Each GVRow As GridViewRow In GVAnticipos.Rows + ' If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then + ' Respuesta = True + ' Exit For + ' Else + ' Respuesta = False + ' End If + ' Next - Else - Respuesta = True - End If + ' Else + ' Respuesta = True + ' End If - Else - Respuesta = True - End If + 'Else + ' Respuesta = True + 'End If Return Respuesta diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index b4e9fa82b..dad1c926d 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -234,297 +234,6 @@ Partial Class PopUpVerFactura End Sub - Public Function GeneraPDFNomina(CvePersonal As Integer, CvePeriodo As Integer, CveEmpresa As Integer, RutaEmpresa As String, Optional indemnizacion As Boolean = False) As Byte() - - - Dim ObjNomina As New ClsNominas - Dim ObjPersonal As New ClsRH - Dim TieneError = False - Dim Retorno As Byte() = Nothing - - If Not ObjNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodo, -1, CveEmpresa) Then - Alert("Ocurrio un erro al obtener datos de la nomina", TipoMensaje.MsgError) - ObjPersonal.Dispose() - ObjNomina.Dispose() - Return Nothing - End If - - Dim CveNomina = ObjNomina.CveNomina - Dim DTPercepciones As Data.DataTable - Dim DTDeducciones As Data.DataTable - Dim DTDeducciones2 As New Data.DataTable - - Dim Ruta As String = UsuarioActual.Empresa.Ruta - Dim PathXML As String = $"{Ruta}XML\Nomina\{ObjNomina.Serie }{If(indemnizacion, "F", "")}-{ObjNomina.Folio}.xml" - Dim FechaEmision, FechaCertificacion As DateTime - Dim FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT As String - FolioFiscal = "" - NoSerieCertificado = "" - SelloCFDi = "" - SelloSAT = "" - NoSerieCertificadoContribuyente = "" - - Dim RutaCBB As String = String.Format("{0}CBB\Nomina\{1}.jpg", RutaEmpresa, ObjNomina.SerieFolio) - Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) - Dim ImgCBB As String - - Dim RutaFormato As String = String.Format("{0}Formatos\Nomina.rdlc", RutaEmpresa) - Dim RutaFormatoDefault As String = String.Format("Empresas\Grales\Formatos\Nomina.rdlc") - - 'SI ESTA TIMBRADA - CON XML - - If System.IO.File.Exists(PathXML) Then - - Dim XmlDoc As New System.Xml.XmlDocument - 'XmlDoc.Load(Ruta & "XML\\Nomina\NOM A-3845.xml") - XmlDoc.Load(PathXML) - - If ValorNodoXML(XmlDoc.DocumentElement, "version").Contiene("3.3", "4.0") Then - FechaEmision = XmlDoc.DocumentElement.Attributes("Fecha").InnerText.ToDate - NoSerieCertificadoContribuyente = XmlDoc.DocumentElement.Attributes("NoCertificado").InnerText - - For i As Integer = 0 To XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes.Count - 1 - If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:TimbreFiscalDigital" Then - FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText - NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("NoCertificadoSAT").InnerText - FechaCertificacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("FechaTimbrado").InnerText.ToDate - SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloCFD").InnerText - SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloSAT").InnerText - End If - Next - Else - FechaEmision = XmlDoc.DocumentElement.Attributes("fecha").InnerText.ToDate - NoSerieCertificadoContribuyente = XmlDoc.DocumentElement.Attributes("noCertificado").InnerText - - For i As Integer = 0 To XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes.Count - 1 - If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "tfd:timbreFiscalDigital" Then - FolioFiscal = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("UUID").InnerText - NoSerieCertificado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("noCertificadoSAT").InnerText - FechaCertificacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("fechaTimbrado").InnerText.ToDate - SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloCFD").InnerText - SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("selloSAT").InnerText - End If - Next - End If - - - 'SIN TIMBRAR - SIN XML - Else - FolioFiscal = "Sin Timbrar" - NoSerieCertificado = "Sin Timbrar" - SelloCFDi = "Sin Timbrar" - SelloSAT = "Sin Timbrar" - End If - - 'Si no tiene CBB, SE GENERA - If Not ImagenCBB.Exists Then - Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - If ObjPersonal.GetPersonal(CvePersonal, CveEmpresa) Then - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString.ToDecimal, FolioFiscal, RutaCBB) - End If - End If - - ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/Nomina/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjNomina.SerieFolio) - - Dim cQr As Byte() = Nothing - Try - Dim CadenaOriginalCFD As String = "||1.0|" + FolioFiscal + "|" + FechaCertificacion.ToString("yyyy-MM-dd") + "T" + FechaCertificacion.ToString("HH:mm:ss") + "|" + SelloCFDi + "|" + NoSerieCertificado + "||" - - Dim RptParametro As New List(Of ReportParameter) - - - 'Datos Empresa - RptParametro.Add(New ReportParameter("RegistroPatronal", ObjNomina.RegistroPatronal)) - Dim ajusteindemnizacion As Double = 0 - 'PERCECIONES - DEDUCCIONES - If ObjNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then - Dim filtrop As String = " AND CveSistema NOT IN(10,11,32)" - Dim friltrod As String = " AND CveSistema <>47" - If indemnizacion Then - filtrop = "AND CveSistema IN(10,11,32)" - friltrod = " AND CveSistema =47" - End If - DTPercepciones = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND Importe <>0 AND EsPadre = 1 AND SoloVisible =0) {filtrop}") - DTDeducciones = ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) {friltrod}") - DTDeducciones2 = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) OR CveSistema IN (20,21) OR CveConcepto =4714){friltrod}") - - ajusteindemnizacion = ObjNomina.DtResultados.FiltraParametros($"((Tipo = 'P' OR (Tipo = 'D' AND Importe <0)) AND Importe <>0 AND EsPadre = 1 AND SoloVisible =0) AND CveSistema IN(10,11,32)").SUM("Importe") - - ObjNomina.DtResultados.FiltraParametros($"(Tipo = 'D' AND Importe >0 AND EsPadre = 1 AND SoloVisible =0) AND CveSistema =47").SUM("Importe") - For Each row As DataRow In DTPercepciones.Rows - If row("Tipo").ToString() = "D" Then - row("Codigo") = row("Codigo").ToString().Replace("D", "OP") - row("Importe") = row("Importe").ToString().ToDecimal() * -1 - End If - Next - - Else - DTPercepciones = Nothing - DTDeducciones = Nothing - End If - 'DATOS DEL EMPLEADO - If ObjPersonal.GetPersonal(CvePersonal, CveEmpresa) Then - - RptParametro.Add(New ReportParameter("NoEmpleado", ObjPersonal.Codigo)) - RptParametro.Add(New ReportParameter("RFC", ObjPersonal.RFC)) - RptParametro.Add(New ReportParameter("CURP", ObjPersonal.CURP)) - - RptParametro.Add(New ReportParameter("NombreCompleto", String.Format("{0} {1} {2}", ObjPersonal.Nombres, ObjPersonal.APaterno, ObjPersonal.AMaterno).Trim())) - RptParametro.Add(New ReportParameter("Regimen", ObjPersonal.RegimenContratacion)) - RptParametro.Add(New ReportParameter("RiesgoPuesto", ObjPersonal.RiesgoPuesto)) - - RptParametro.Add(New ReportParameter("NSS", ObjPersonal.NumeroSS)) - RptParametro.Add(New ReportParameter("Departamento", ObjPersonal.Departamento)) - RptParametro.Add(New ReportParameter("Puesto", ObjPersonal.Puesto.ToString())) - RptParametro.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToString("dd/MM/yyyy"))) - - RptParametro.Add(New ReportParameter("Contrato", ObjPersonal.TipoContrato.ToString)) - - RptParametro.Add(New ReportParameter("Jornada", ObjPersonal.Jornada)) - RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo)) - RptParametro.Add(New ReportParameter("SalarioBase", ObjPersonal.SalarioDiario.ToString)) - RptParametro.Add(New ReportParameter("SalarioDiarioInt", ObjPersonal.SDI.ToString)) - - RptParametro.Add(New ReportParameter("Banco", ObjPersonal.Banco)) - RptParametro.Add(New ReportParameter("CLABE", ObjPersonal.CLABE)) - - - 'DATOS NOMINA - If ObjNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, 1, CveEmpresa) Then - RptParametro.Add(New ReportParameter("ReciboNomina", ObjNomina.Folio.ToString)) - RptParametro.Add(New ReportParameter("Serie", ObjNomina.Serie)) - RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString)) - RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo)) - - RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString)) - RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)" - RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)")) - - RptParametro.Add(New ReportParameter("Cantidad", "1")) - RptParametro.Add(New ReportParameter("Unidad", "ACT")) - RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA")) - RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString())) - - Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal) - RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras)) - RptParametro.Add(New ReportParameter("Clave", "84111505")) - Else - TieneError = True - End If - Else - TieneError = True - End If - - If Not TieneError Then - If ObjNomina.GetPeriodos(-1, CveEmpresa, -1, -1, CvePeriodo) Then - RptParametro.Add(New ReportParameter("FechaInicio", ObjNomina.FechaInicio.ToString("dd/MM/yyyy"))) - RptParametro.Add(New ReportParameter("FechaFin", ObjNomina.FechaFin.ToString("dd/MM/yyyy"))) - Else - TieneError = True - End If - End If - - - RptParametro.Add(New ReportParameter("PU", DTPercepciones.SUM("Importe").ToString())) - RptParametro.Add(New ReportParameter("Importe", DTPercepciones.SUM("Importe").ToString())) - RptParametro.Add(New ReportParameter("ImporteDeducciones", DTDeducciones.SUM("Importe").ToString())) - - RptParametro.Add(New ReportParameter("SubTotal", DTPercepciones.SUM("Importe").ToString())) - RptParametro.Add(New ReportParameter("Descuentos", DTDeducciones.SUM("Importe", "SATCveConcepto <> '002'").ToString())) - RptParametro.Add(New ReportParameter("ISR", DTDeducciones.SUM("Importe", "SATCveConcepto = '002'").ToString())) - 'Timbrado - RptParametro.Add(New ReportParameter("FolioFiscal", FolioFiscal)) - RptParametro.Add(New ReportParameter("CertificadoSAT", NoSerieCertificado)) - RptParametro.Add(New ReportParameter("FechaCertificacion", FechaCertificacion.ToString)) - RptParametro.Add(New ReportParameter("SelloDigitalEmisor", SelloCFDi)) - RptParametro.Add(New ReportParameter("SelloDigitalSAT", SelloSAT)) - RptParametro.Add(New ReportParameter("CadenaOriginal", CadenaOriginalCFD)) - RptParametro.Add(New ReportParameter("QR", ImgCBB.ToString)) - - - Dim LSRds As New List(Of ReportDataSource) - - - Dim rds2 = New ReportDataSource() - - Dim dtqr As New DataTable - - Dim column As DataColumn = New DataColumn("ImagenByte") - column.DataType = System.Type.[GetType]("System.Byte[]") - column.AllowDBNull = True - column.Caption = "ImagenByte" - dtqr.Columns.Add(column) - Dim rowqr As DataRow = dtqr.NewRow() - rowqr("ImagenByte") = cQr - - dtqr.Rows.Add(rowqr) - rds2.Name = "dsImagenes" - rds2.Value = dtqr - LSRds.Add(rds2) - Dim numnewfiles As Integer = 0 - If DTPercepciones.Rows.Count > DTDeducciones2.Rows.Count Then - - numnewfiles = DTPercepciones.Rows.Count - DTDeducciones2.Rows.Count - For index = 1 To numnewfiles - - DTDeducciones2.Rows.Add(DTDeducciones2.NewRow) - Next - Else - - If DTDeducciones2.Rows.Count > DTPercepciones.Rows.Count Then - numnewfiles = DTDeducciones2.Rows.Count - DTPercepciones.Rows.Count - For index = 1 To numnewfiles - - DTPercepciones.Rows.Add(DTPercepciones.NewRow) - Next - - End If - End If - - Dim RptDS As New ReportDataSource - RptDS.Name = "DsOC" - RptDS.Value = DTPercepciones - LSRds.Add(RptDS) - - Dim RDS As New ReportDataSource - RDS.Name = "DataSet1" - RDS.Value = DTDeducciones2 - LSRds.Add(RDS) - Dim Archivo As New System.IO.FileInfo(RutaFormato) - - If Not TieneError Then - If Archivo.Exists Then - Retorno = StreamPDF(RutaFormato, LSRds, RptParametro, ObjNomina.SerieFolio, "PDF", MR:=Nothing) - Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\\{1}.pdf", RutaEmpresa, ObjNomina.SerieFolio)) - If Not ArchivoPDF.Exists Then - Try - DirectoryExistsCreate(String.Format("{0}PDF", RutaEmpresa)) - DirectoryExistsCreate(String.Format("{0}PDF\{1}", RutaEmpresa, "Nomina")) - File.WriteAllBytes(String.Format("{0}PDF\Nomina\{1}.pdf", RutaEmpresa, ObjNomina.SerieFolio), Retorno) - Catch ex As Exception - Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) - GuardaLog(String.Format("Ocurrió un error al generar el PDF {0}", ex)) - End Try - End If - Else - 'ImprimirPDF(String.Format("{0}\Formatos\Nomina.rdlc", RutaEmpresa), LSRds, RptParametro, ObjNomina.SerieFolio) - End If - Else - Alert("Ocurrio un error al obtener los datos de la Nomina") - End If - Catch ex As Exception - - GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) - End Try - - - ObjNomina.Dispose() - ObjPersonal.Dispose() - - Return Retorno - End Function - - Private Sub DescargaArchivoDirecto(RutaArchivo As String) If RutaArchivo <> "" Then @@ -5668,7 +5377,8 @@ Partial Class PopUpVerFactura Dim params As New List(Of ReportParameter) Dim CveFolio = "" CreaDT() - Dim ReporteEmpresa As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) + + Dim RutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) If ObjOS.GetOrdenesServicios(CveOS, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then If ObjOS.DtResultados.Rows.Count > 0 Then @@ -5688,7 +5398,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("ClienteEstado", dr("Estado").ToString)) CveFolio = dr("Folio").ToString - If ReporteEmpresa.Exists Then + If RutaReporte.Exists Then params.Add(New ReportParameter("NoDeCliente", dr("CveCliente").ToString)) params.Add(New ReportParameter("RFC", dr("RFC").ToString)) params.Add(New ReportParameter("Vendedor", " ")) @@ -5706,7 +5416,10 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - If Not ReporteEmpresa.Exists Then + If Not RutaReporte.Exists Then + + RutaReporte = New System.IO.FileInfo(String.Format("{0}Empresas\Grales\Formatos\OrdenServicio.rdlc", ModExtensiones.DirectorioBaseEmpresas)) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) @@ -5734,7 +5447,7 @@ Partial Class PopUpVerFactura lrds.Add(rds2) ObjOS.Dispose() - ImprimirPDF(String.Format("Empresas/{0}/Formatos/OrdenServicio.rdlc", UsuarioActual.CveEmpresa), lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) + ImprimirPDF(RutaReporte.FullName, lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) End Sub Private Sub CreaDT() TmpDTOS = New DataTable diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 103f9c9a0..914246a36 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -696,6 +696,7 @@ Partial Class Compras_ReembolsosComprobaciones CompraActual.Total = gvr.DataKey("Total").ToDecimal CompraActual.IVA = gvr.DataKey("IVA").ToDecimal CompraActual.IVADeducible = gvr.DataKey("IVADeducible").ToDecimal + CompraActual.IVANoDeducible = gvr.DataKey("IVANoDeducible").ToDecimal CompraActual.IEPS = gvr.DataKey("IEPS").ToDecimal CompraActual.RetIVA = gvr.DataKey("RetIVA").ToDecimal CompraActual.RetISR = gvr.DataKey("RetISR").ToDecimal @@ -735,6 +736,7 @@ Partial Class Compras_ReembolsosComprobaciones Pago.CveIE = CveIEPago Pago.CveMonedaPago = CveMonedaPago Pago.TCPago = TipoCambioPago + Pago.CvePersonal =CvePersonal 'Otros Ingresos If MsgError = "" AndAlso (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then @@ -807,7 +809,7 @@ Partial Class Compras_ReembolsosComprobaciones Pago.ImportePago = ImporteMovto Pago.CveIE = CveIEExcedente Pago.CveMonedaPago = CveMoneda - + Pago.CvePersonal = CvePersonal If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, ImporteMovto, Referencia, 30, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaBancaria) Then MsgError = "no se pudo insertar el detalle de la poliza" @@ -844,6 +846,7 @@ Partial Class Compras_ReembolsosComprobaciones End If End If End If + If MsgError <> "" Then Exit For End If End If Next diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2b6a245a2..1e0a49b93 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1660,7 +1660,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If End If - If AplicaBancos Then + If AplicaBancos AndAlso Not AplicaComplementaria Then If DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero <= 0 Then Alert("seleccione las opciones de bancos ") Retorno = False diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index 5018a16cf..7c71c6558 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -192,6 +192,10 @@
+
+ + +
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index c37d1511e..3e26bae19 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -136,7 +136,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable")) DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta")) DdlConceptoNomina.SelectedValueExist(GvRow.DataKey("CveConceptoNomina").ToEntero) - DdlProveedor.ddl.SelectedValueExist(GvRow.DataKey("CveProveedor")) + If GvRow.DataKey("CveProveedor").ToEntero > 0 Then + DdlProveedor.ddl.Items.Clear() + DdlProveedor.ddl.ClearSelection() + Dim NomProv As String = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, CveProveedor:=GvRow.DataKey("CveProveedor").ToEntero).FiltroPrimeroValor("NombreComercial") + DdlProveedor.ddl.Items.Add(New ListItem(NomProv, GvRow.DataKey("CveProveedor"))) + DdlProveedor.SelectedValue = GvRow.DataKey("CveProveedor") + End If DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion")) DdlAlmacen.SelectedValueExist(GvRow.DataKey("CveAlmacen")) TxtIdCuentaContable.Text = GvRow.DataKey("IdCuenta") @@ -150,8 +156,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero DdlClientes.ddl.SelectedValueExist(CveCliente) - DdlPersonal.ddl.SelectedValueExist(CvePersonal) + If CvePersonal > 0 Then + Dim drp As String = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal).FiltroPrimeroValor("NombreCompleto") + + DdlPersonal.ddl.Items.Add(New ListItem(drp, CvePersonal)) + + End If + DdlPersonal.ddl.SelectedValueExist(CvePersonal) LbAgregar.Text = "Actualizar" UpModalModulos.Update() RegistraScript("$('#ModalCat').modal();") @@ -193,9 +205,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If CveConceptoContable = 51 Then divTipoGasto.Visible = True + DdlTipoGasto.Items.Clear() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() - ' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo")) + DdlTipoGasto.Items.Add(New ListItem("-", "-1")) + End If + If Dr("CveTipoSaldo").ToString = "1" Then + divRegeneraCuenta.Visible = True End If End If @@ -262,30 +278,37 @@ Partial Class Contabilidad2_CatCuentasAsignaciones Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click Dim ObjConta As New ClsContabilidad + ObjConta.IniciaTransacSQL() Dim ErrorString As String = "" If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), - CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero) Then + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, + CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then ErrorString = "Error al agregar" End If ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), - CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero) Then + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, + CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then ErrorString = "Error al actualizar" End If - End If - ObjConta.Dispose() + End If + If Not ChkSeguirRegistrando.Checked Then RegistraScript("$('#ModalCat').modal('hide');") If ErrorString.Length > 0 Then + ObjConta.RollBack() Alert(ErrorString) Else + ObjConta.Commit() Alert("Agregado correctamente") - End If + End If + ObjConta.Dispose() + CargaDatosSistema() UpDatos.Update() End Sub diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index c4049ee0c..15e7d3ea7 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -1050,7 +1050,7 @@ Partial Class Contratos_Default TxtFechaInicial.Text = ObjContratos.FechaInicial.ToShortDateString TxtUbicacion.Text = ObjContratos.Ubicacion TxtResponsable.Text = ObjContratos.Responsable - TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero + TxtPorAnticipo.Text = ObjContratos.PorAnticipo.FormatoNumero TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero 'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString diff --git a/Empresas/2/Formatos/ReciboDePago.rdlc b/Empresas/2/Formatos/ReciboDePago.rdlc new file mode 100644 index 000000000..4d16840be --- /dev/null +++ b/Empresas/2/Formatos/ReciboDePago.rdlc @@ -0,0 +1,9739 @@ + + + + + + + + + 2.55292cm + + + 3.0262cm + + + 9.76834cm + + + 2.55292cm + + + 2.63526cm + + + + + 0.49cm + + + + + true + true + + + + + Cantidad + + + + + + + Textbox24 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UM + + + + + + + Textbox27 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox26 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + P. Unitario + + + + + + + Textbox36 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox38 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + + + true + true + + + + + =Parameters!Cantidad.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!UnidadMedida.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Descripcion.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!PU.Value + + + + + + + Textbox37 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Parameters!Importe.Value + + + + + + + Textbox39 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + + + + + + DataSet2 + 3.3876cm + 1.01062cm + 20.53564cm + + + + + + + + + 2.17514cm + + + 2.11178cm + + + 2.23655cm + + + 2.17856cm + + + 1.8cm + + + 1.8cm + + + 1.8cm + + + 1.99576cm + + + 2.17826cm + + + 2.29961cm + + + + + 0.49cm + + + + + true + true + + + + + UUID + + + + + + + Textbox6 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + Serie + + + + + + + Textbox3 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio + + + + + + + Textbox9 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Moneda + + + + + + + Textbox31 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Num. Parc. + + + + + + + Textbox8 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldo Anterior + + + + + + + Textbox19 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Monto Pagado + + + + + + + Textbox25 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.38146cm + + + + + true + true + + + + + =Fields!IdDocumento.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + =Fields!Serie.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Folio.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!MonedaDR.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NumParcialidad.Value + + + + + + + NumParcialidad + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImpSaldoAnt.Value + + + + + + + ImpSaldoAnt + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + Impuesto + + + + + + + Textbox108 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + Tipo + + + + + + + Textbox109 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + Base + + + + + + + Textbox110 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + Tipo Factor + + + + + + + Textbox111 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + Tasa/Cuota + + + + + + + Textbox112 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox113 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + Top + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox53 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox54 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + ISR + + + + + + + Textbox61 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Traslado + + + + + + + Textbox204 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra001TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra001TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra001ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox63 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox64 + + = IIF( + Fields!Tra001BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + IVA + + + + + + + Textbox61 + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Traslado + + + + + + + Textbox204 + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra002TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra002TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra002ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox83 + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox84 + + = IIF( + Fields!Tra002BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + IEPS + + + + + + + Textbox61 + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Traslado + + + + + + + Textbox204 + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra003TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra003TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Tra003ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox73 + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox74 + + = IIF( + Fields!Tra003BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + ISR + + + + + + + Textbox61 + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Retención + + + + + + + Textbox207 + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret001TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret001TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret001ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox93 + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox94 + + = IIF( + Fields!Ret001BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + IVA + + + + + + + Textbox61 + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Retención + + + + + + + Textbox207 + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret002TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret002TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret002ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox103 + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox104 + + = IIF( + Fields!Ret002BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.07938cm + + + + + true + true + + + + + IEPS + + + + + + + Textbox59 + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + Retención + + + + + + + Textbox207 + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!ImpPagado.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret003TipoFactorDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret003TasaOCuotaDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + + + + true + true + + + + + =Fields!Ret003ImporteDR.Value + + + + + + + ImpPagado + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + es-MX + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox113 + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox114 + + = IIF( + Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + + + + + + + + + + + DataSet2 + 5.27225cm + 1.42708cm + 20.57566cm + 1 + + + + + + + + + 4.5cm + + + 1.74905cm + + + 1.5cm + + + 2.96606cm + + + 6.82934cm + + + 2.98695cm + + + + + 0.49cm + + + + + true + true + + + + + Fecha y hora de pago + + + + + + + Textbox45 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Moneda + + + + + + + Textbox21 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TC + + + + + + + Textbox5 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cta Ordenante + + + + + + + Textbox12 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Forma de Pago + + + + + + + Textbox48 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total de Pago + + + + + + + Textbox50 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + + + true + true + + + + + =Fields!FechaPago.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!MonedaP.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!TipoCambioP.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Fields!CtaOrdenante.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FormaDePagoP.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Monto.Value + + + + + + + Monto + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total de Pago con letra: + + + + =Parameters!CantidadLetra.Value + + + + + + + Textbox16 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DataSet1 + 7.03975cm + 1.61062cm + 20.5314cm + 2 + + + + + + true + true + + + + + CFDI RELACIONADOS + + + + + + + Textbox5 + 4.78697cm + 0.04426cm + 0.45cm + 20.5314cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 3.98273in + 1.3in + 1.5in + 4 + + + + + + true + true + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. Certificado: + + + + + + + White + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + UUID: + + + + + + + White + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Sello.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!NoCertificado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UUIDPago.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Régímen: Régimen General de Ley Personas Morales. + + + + + + + + + Éste documento es una representación impresa de un CFDi + + + + + + + Textbox171 + 15.63197cm + 4.00059cm + 0.89979cm + 16.50467cm + 13 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Datos del Cliente: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cliente: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cliente.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + , + + + + =Parameters!ClienteColonia.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Ciudad: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteCiudad.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteCP.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CP: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + RFC Ordenante: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RFCOrdenante.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello: + + + + + + + White + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello digital del SAT: + + + + + + + White + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Régimen Fiscal: + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RegimenFiscalCodigo.Value + + + + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + 16.53176cm + + + + + 20.57566cm + + + 2.99735cm + true + true + + + true + + + + + RECIBO DE PAGO + + + + + + + Textbox3 + 0.01725cm + 5.84339in + 0.5cm + 2.24597in + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!SerieFolio.Value + + + + + + + Textbox3 + 0.21512in + 5.84339in + 0.60856cm + 2.24597in + 1 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Fecha Timbre + + + + + + + + + + + + + + + + Textbox3 + 0.45471in + 5.84339in + 0.5cm + 2.24597in + 2 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + #bdd7ee + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!FechaTimbre.Value + + + + + + + Textbox3 + 0.65156in + 5.84339in + 0.25114in + 2.24597in + 3 + + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + + #bdd7ee + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + AD Sistemas, Análisis y Diseño de Sistemas + + + + + + + + + Jesús Julián Moreno Quintana, R.F.C MOQJ851214HK4 + + + + + + + + + |www.adsistemas.mx | julian@adsistemas.mx| + + + + + + + Textbox4 + 0.03532cm + 1.91311in + 0.66099in + 3.62386in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Hermosillo, Sonora, México. + + + + + + + + + Tel.: (662) 216-2270 + + + + + + + Textbox10 + 0.52493in + 2.69127in + 0.65513in + 2.06754in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.84667cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.17639cm + 17.56289cm + 0.41981cm + 2.94979cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 1.27cm + + true @@ -1515,9 +1516,9 @@ Textbox1 0.22833cm - 2.8349cm + 4.1049cm 0.6cm - 8.44903cm + 10.98903cm @@ -1565,9 +1566,9 @@ Textbox2 0.86361cm - 2.8349cm + 5.85115cm 0.52945cm - 8.44903cm + 7.58473cm 1 - - No. - - =Parameters!FolioOS.Value + + + + + + + + + + + + + +
  • + Excel +
  • +
    + + + +
    + +
    + + + + + + +
    +
    + +
    +
    + +
    Proveedor:
    +
    + +
    + +
    Cliente:
    +
    + +
    + +
    Fecha Inicio:
    +
    +
    + + + + +
    + + + + + + +
    +
    Fecha Fin:
    +
    +
    + + + + +
    + + + + + + +
    + +
    +
    +
    + +
    +
    + + + + + +
    +
    + +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + <%-- MODAL COMPROBANTE --%> + + <%-- FIN MODAL COMPROBANTE --%> + + + + + + + + + + + + + diff --git a/Ventas/RepLineasAdicionales.aspx.cs b/Ventas/RepLineasAdicionales.aspx.cs new file mode 100644 index 000000000..51f634d90 --- /dev/null +++ b/Ventas/RepLineasAdicionales.aspx.cs @@ -0,0 +1,254 @@ +using System; using System.Web.UI.WebControls; using Extensiones; using System.Data; using static Extensiones.ModExtensiones; +using System.Collections.Generic; +using System.IO; +using ListItem = System.Web.UI.WebControls.ListItem; + +public partial class Ventas_RepLineasAdicionales : ClsPaginas +{ + #region PROPIEDADES + + private int CveLineaAdicional + { + get { return (ViewState["CveLineaAdicional"] == null) ? 0 : int.Parse(ViewState["CveLineaAdicional"].ToString()); } + set { ViewState["CveLineaAdicional"] =(int) value; } + } + + private string Comprobante + { + get { + + if(ViewState["Comprobante"] == null) + { + ViewState["Comprobante"] = ""; + } + + return ViewState["Comprobante"].ToString(); + } + set { ViewState["Comprobante"] = value; } + } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + InicializaValores(); + } + } + + private void InicializaValores() + { + + if (Request["OP"] != null && Request["OP"].ToString() == "PO") + { + DVProveedor1.Visible = true; + DVProveedor2.Visible = true; + GvLineasAdicionales.Columns[9].Visible = true; + } + + //Carga Clientes + DdlClientes.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1); + DdlClientes.DataBind(); + + + + if(UsuarioActual.Empresa.Funcionalidad(105) == "1") { + DdlProveedor.setEsWebService(true); + DdlProveedor.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedor.SelectedText = "Todos"; + DdlProveedor.SelectedValue = "-1"; + + + + }else { + DdlProveedor.setEsWebService(false); + DdlProveedor.ddl.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); + DdlProveedor.ddl.DataBind(); + DdlProveedor.ddl.Items.Insert(0, new ListItem("-", "-1")); + } + + DdlClientes.setEsWebService(true); + DdlClientes.Attributes.Add("data-metodo", "getcliente"); + DdlClientes.SelectedText = "Todos"; + DdlClientes.SelectedValue = "-1"; + + txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString(); + txtFechaF.Text = DateTime.Now.ToShortDateString(); + + } + + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaDatos(); + } + + private void CargaDatos() + { + LnkDescargaExcel.Visible = false; + + ClsVentas objVentas = new ClsVentas(); + + int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1; + + if(objVentas.GetLineasAdicionales(-1,DdlClientes.SelectedValue.ToEntero(),CveProveedor,-1,-1,txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), -1, UsuarioActual.CveEmpresa)){ + GvLineasAdicionales.DataSource = objVentas.DtResultados; + + if( objVentas.DtResultados.Rows.Count > 0) + { + LnkDescargaExcel.Visible = true; + UpAcciones.Update(); + } + } + else + { + GvLineasAdicionales.DataSource = null; + } + + objVentas.Dispose(); + + GvLineasAdicionales.DataBind(); + UpLineasAdicionales.Update(); + } + + + protected void LnkCargarComprobante_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow) ((LinkButton) sender).NamingContainer; + + CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero(); + Comprobante = GvRow.DataKey("Comprobante").ToString(); + + RegistraScript("$('#ModalComprobante').modal('show');",""); + } + + protected void BtnAddComprobante_Click(object sender, EventArgs e) + { + bool errorCargaComprobante = false; + string FileExtension = "-1"; + List filesgral = Anexo.getfiles().Archivos; + string filemove = ""; + FileInfo fiNuevo; + + DirectoryInfo df = new DirectoryInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\"); + + + //Crea directorio si no existe + if (!df.Exists) + { + try + { + Directory.CreateDirectory(df.FullName); + } + catch + { + errorCargaComprobante = true; + } + } + + //borrar archivo anterior + if((!errorCargaComprobante) && Comprobante.Length > 0) + { + FileInfo fiAnterior = new FileInfo($@"{df.FullName}{Comprobante}"); + if (fiAnterior.Exists) + { + try + { + File.Delete(fiAnterior.FullName); + } + catch + { + errorCargaComprobante = true; + } + } + } + + if(!errorCargaComprobante){ + + string RutaArchivoTemp = ""; + foreach (Archivo fileItem in filesgral) + { + FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); + filemove = fileItem.filename; + RutaArchivoTemp = $@"{AppDomain.CurrentDomain.BaseDirectory}\Temp\{fileItem.filename}"; + + break; + } + + if((!errorCargaComprobante) && RutaArchivoTemp.Length > 0) + { + fiNuevo = new FileInfo(RutaArchivoTemp); + + if (fiNuevo.Exists) + { + try + { + + if (File.Exists($@"{df.FullName}\{CveLineaAdicional}{fiNuevo.Extension}")) + { + File.Delete($@"{df.FullName}\{CveLineaAdicional}{fiNuevo.Extension}"); + } + + File.Move(fiNuevo.FullName, $@"{df.FullName}\{CveLineaAdicional}{fiNuevo.Extension}"); + errorCargaComprobante = false; + } + catch + { + errorCargaComprobante = true; + } + + if (!errorCargaComprobante) + { + ClsVentas objVentas = new ClsVentas(); + if (!objVentas.UpdateLineasAdicionales(CveLineaAdicional, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, -1, UsuarioActual.CveEmpresa, Comprobante: $@"{CveLineaAdicional}{fiNuevo.Extension}")) + { + errorCargaComprobante = true; + } + objVentas.Dispose(); + } + } + } + + } + + + if (!errorCargaComprobante) + { + CargaDatos(); + Anexo.Text = "[]"; + RegistraScript("$('#ModalComprobante').modal('hide');", ""); + Alert("Comprbante actualizado correctamente."); + } + + UpAddComprobancte.Update(); + } + + protected void LnkCambiarEstatus_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; + int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero(); + bool errorCambioEstatus = false; + + ClsVentas objVentas = new ClsVentas(); + + if (!objVentas.UpdateLineasAdicionales(CveLineaAdicionalActualzarEstatus, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, 3, UsuarioActual.CveEmpresa)) + { + errorCambioEstatus = true; + } + + if (!errorCambioEstatus) + { + CargaDatos(); + } + + objVentas.Dispose(); + } + + + protected void LnkDescargaExcel_Click(object sender, EventArgs e) + { + GvLineasAdicionales.ExportToExcel2("RepLineas"); + } + + +} \ No newline at end of file diff --git a/Ventas/RepRecuperacionPeriodo.aspx b/Ventas/RepRecuperacionPeriodo.aspx index cb4068856..0579aedcd 100644 --- a/Ventas/RepRecuperacionPeriodo.aspx +++ b/Ventas/RepRecuperacionPeriodo.aspx @@ -16,22 +16,24 @@ + +
  • + PDF +
  • +
  • + Excel +
  • Ver Dlls en pesos
  • - Ver Grafica + Ver Grafica
  • -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • +
    @@ -212,7 +214,7 @@ - +
    diff --git a/Web - 20220908.config b/Web - 20220908.config new file mode 100644 index 000000000..c93b2c158 --- /dev/null +++ b/Web - 20220908.config @@ -0,0 +1,594 @@ + + + + + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Webprod.config b/Webprod.config new file mode 100644 index 000000000..5f73315eb --- /dev/null +++ b/Webprod.config @@ -0,0 +1,482 @@ + + + + + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vwd.webinfo b/vwd.webinfo index 404a6a72c..81c9ef656 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -544,6 +544,16 @@ + + + + + + + + + +