diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index cd29409c4..2f7ac71dc 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -875,6 +875,23 @@ Public Class ClsAcumuladores End Try Return Retorno End Function + + Public Function UpdatePolizaVirtual(CvePolizaVirtual As Integer, CveMarca As Integer, FechaUsado As DateTime) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Vta_PolizaVirtualUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate") diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 277667dc0..83377e9b8 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -196,7 +196,7 @@ Public Class ClsCompras Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, - Optional CveContrato As Integer = -1) As Boolean + Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -248,6 +248,8 @@ Public Class ClsCompras .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveTipoConcepto .Add("@CveFactura", SqlDbType.Int).Value = CveFactura .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@EsImportacion", SqlDbType.Bit).Value = EsImportacion + End With Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index fa2e30bf1..308ebb7ed 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -514,6 +514,23 @@ Public Class ClsNominas Return Retorno End Function + Public Function DeleteNom_NominasDetalles(CveConcepto As Integer, CvePersonal As Integer, CvePeriodo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Nom_NominasDetallesDelete") + SqlAdapter.SelectCommand.Parameters.Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + SqlAdapter.SelectCommand.Parameters.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + SqlAdapter.SelectCommand.Parameters.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function Public Function RemoveNom_NominasDetalles(CveNominaDetalle As Integer) As Boolean Dim Retorno As Boolean = False @@ -2108,13 +2125,14 @@ Public Class ClsNominas Return retorno End Function - Public Function GetCalculoSBC(CveEmpresa As Integer, FechaCalculo As String) As Boolean + Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() DataAdapter("PA_GetCalculoSBC", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = Tipo .Add("@Fecha", SqlDbType.Date).Value = FechaCalculo End With @@ -2514,6 +2532,97 @@ Public Class ClsNominas End Function #End Region + +#Region "CRUD_RH_TablasValores" + Public Function RH_TablasValoresGet(cveEmpresa As Int32, tipo As Int32) As Boolean + Dim retorno As Boolean = False + Try + DataAdapter("PA_RH_TablasValoresGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresAdd(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_TablasValoresAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + .Add("@valor", SqlDbType.Money).Value = valor + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresUp(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_TablasValoresUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + .Add("@valor", SqlDbType.Money).Value = valor + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresRemove(cveEmpresa As Int32, fecha As DateTime, tipo As Int32) As Boolean + Dim retorno As Boolean = False + Try + DataAdapter("PA_RH_TablasValoresRemove", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b3d91f4c4..c8e653938 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6473,7 +6473,7 @@ Public Class ClsPaginas If Vta.SubProyecto.CP.ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", Vta.SubProyecto.CP) If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal) If Vta.SubProyecto.Pais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", Vta.SubProyecto.Pais) - If Not String.IsNullOrEmpty(Vta.SubProyecto.Telefono) AndAlso UsuarioActual.CveEmpresa = 141 Then SBDomicilioSucursal.AppendFormat(", Tel: {0}", Vta.SubProyecto.Telefono) + If Not String.IsNullOrEmpty(Vta.SubProyecto.Telefono) AndAlso UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162) Then SBDomicilioSucursal.AppendFormat(", Tel: {0}", Vta.SubProyecto.Telefono) DomicilioSucursal = SBDomicilioSucursal.ToString @@ -6718,7 +6718,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("ClienteTelefono", Vta.ClienteSucursal.TelefonoSucursal)) ElseIf Vta.CveCliente.ToEntero > 0 Then params.Add(New ReportParameter("ClienteContactoMail", Vta.Cliente.MailCotizacion)) - params.Add(New ReportParameter("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", Vta.TelefonoGenerico, Vta.Cliente.Telefono))) + params.Add(New ReportParameter("ClienteTelefono", If(Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.Telefono.Length > 6, Vta.TelefonoGenerico, Vta.Cliente.Telefono))) End If If UsuarioActual.CveEmpresa.Contiene(17) Then diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 6a35f980b..678bccbbc 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1742,7 +1742,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, Celular As String, RFC As String, CURP As String, NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, - Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1) As Boolean + Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -1823,7 +1823,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@TelefonoMarcadoRapido", SqlDbType.VarChar).Value = TelefonoMarcadoRapido .Add("@ContactoAlterno", SqlDbType.VarChar).Value = ContactoAlterno .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario - + .Add("@Sindicalizado", SqlDbType.Bit).Value = Sindicalizado + .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -1855,7 +1856,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, CvePersonal As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1, - Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1) As Boolean + Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1940,7 +1941,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@FechaActivo", SqlDbType.Date).Value = FechaActivo .Add("@FechaReingreso", SqlDbType.Date).Value = FechaReingreso .Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario - + .Add("@Sindicalizado", SqlDbType.Int).Value = Sindicalizado + End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 79a6ab882..a4549c442 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1268,17 +1268,19 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Double, PU As Double, IEPS As Double, PorcentajeIEPS As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean + Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleRemisionUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Cantidad", SqlDbType.Float).Value = Cantidad - .Add("@PU", SqlDbType.Float).Value = PU - .Add("@IEPS", SqlDbType.Float).Value = IEPS - .Add("@PorcentajeIEPS", SqlDbType.Float).Value = PorcentajeIEPS + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@PU", SqlDbType.Decimal).Value = PU + .Add("@IEPS", SqlDbType.Decimal).Value = IEPS + .Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index e19a7325e..ae2fbadef 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -88,6 +88,7 @@ Public Class LogicNominas Dim NombreCompleto As String = "" Dim CURP As String = "" + Dim Sindicalizado As Boolean = False Dim NumeroSS As String = "" Dim FechaInicioContrato As String = "" Dim CodigoTipoContrato As String = "" @@ -101,6 +102,7 @@ Public Class LogicNominas Dim ClaveBanco As String = "" Dim BancoNumCuenta As String = "" Dim SDI As Double = 0 + Dim SalarioDiarioSS As Double = 0 Dim ClaveEstado As String = "" Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades) @@ -120,6 +122,7 @@ Public Class LogicNominas RFC = objPersonal.RFC NombreCompleto = objPersonal.NombreCompleto + Sindicalizado = objPersonal.DtResultados.Rows(0)("Sindicalizado").ToString().ToUpper().Contiene("TRUE", "1") CURP = objPersonal.CURP NumeroSS = objPersonal.NumeroSS FechaInicioContrato = objPersonal.FechaInicioContrato.ToString() @@ -134,6 +137,7 @@ Public Class LogicNominas ClaveBanco = objPersonal.ClaveBanco BancoNumCuenta = objPersonal.BancoNumCuenta SDI = objPersonal.SDI + SalarioDiarioSS = objPersonal.SalarioDiarioSS ClaveEstado = objPersonal.ClaveEstado AntiguedadSemanas = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero() @@ -368,8 +372,8 @@ Public Class LogicNominas cfdi.Nomina.Receptor.CodigoBanco = ClaveBanco cfdi.Nomina.Receptor.NumeroCuenta = BancoNumCuenta cfdi.Nomina.Receptor.SDI = SDI - cfdi.Nomina.Receptor.SBC = SDI - cfdi.Nomina.Receptor.Sindicalizado = "" + cfdi.Nomina.Receptor.SBC = SalarioDiarioSS + cfdi.Nomina.Receptor.Sindicalizado = If(Sindicalizado, "Si", "No") cfdi.Nomina.Receptor.CodigoEntidadFederativa = ClaveEstado cfdi.Conceptos.Add(New CFDIConceptos With {.Cantidad = 1, .ClaveUnidad = "ACT", .ClaveProdServ = "84111505", .Descripcion = "Pago de nómina", .ValorUnitario = cfdi.Comprobante.Subtotal, .Importe = cfdi.Comprobante.Subtotal, .Descuento = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()}) diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index fca4a8b19..4d52b8b02 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -392,22 +392,37 @@ Public Class E141 : Implements IHttpHandler Select Case Metodo Case "CrearActualizarProductos" respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If + Case "CrearActualizarProductosJson" + retorno = CrearActualizarProductosJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarPrecios" respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If Case "ActualizarExistencias" respuesta = ActualizarExistencias() + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If Case "ActualizarVendedores" respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If End Select - If respuesta Then - retorno = "True" - Else - retorno = "False" - End If End If - - End If context.Response.Write(retorno) @@ -1962,6 +1977,25 @@ Public Class E141 : Implements IHttpHandler Return Retorno End Function + Private Function CrearActualizarProductosJson(Todos As Boolean) As String + Dim payload = New JObject() + + Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0 + + Dim DtPS As DataTable = Nothing + Using ObjPS As New ClsProductosServicios + 'OBTERNER PRECIOS DE PUBLICO GENERAL + If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then + DtPS = ObjPS.DtResultados.Copy() + End If + End Using + + If DtPS IsNot Nothing Then + payload.Add(New JProperty("products", GenerarPayloadProductos(DtPS))) + End If + + Return payload.ToString() + End Function Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray Dim ArrayPS As New JArray For Each RowPS As DataRow In DtPS.Rows diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 1d7742e10..9274e79ab 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -163,7 +163,7 @@ Partial Class Bancos_DepositosCaja CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero CveClasificacion = DdlClasificacion.SelectedValue.ToEntero - If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Comision, DdlClasificacion.SelectedItem.Text, 51, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then + If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, DdlClasificacion.SelectedItem.Text, 51, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then OcurrioError = True End If End If diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 925566892..0aa0039e8 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -47,8 +47,7 @@ Partial Class Bancos_PopIECompras Set(value As Integer) ViewState("CveCompra") = value End Set - End Property - + End Property Private Property CveTipoConcepto As Integer Get Return ViewState("CveTipoConcepto").ToString.ToEntero @@ -474,6 +473,21 @@ Partial Class Bancos_PopIECompras End Set End Property + Private Property EsImportacion As Boolean + Get + + If ViewState("EsImportacion") Is Nothing Then + Return False + Else + Return CBool(ViewState("EsImportacion")) + End If + + End Get + Set(value As Boolean) + ViewState("EsImportacion") = value + End Set + End Property + @@ -735,6 +749,7 @@ Partial Class Bancos_PopIECompras TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero SaldoVenta = dr("Saldo").ToString.ToDouble + EsImportacion = CBool(dr("EsImportacion")) End If End If End If @@ -1589,7 +1604,19 @@ Partial Class Bancos_PopIECompras Dim CveSubProyectoInsertar As Integer = -1 - Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero + Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + If ConceptoContable.Contiene(14, 19) AndAlso CveCompra > 0 Then + If EsImportacion Then + If ConceptoContable = 14 Then + ConceptoContable = 287 + Else + ConceptoContable = 288 + End If + + End If + End If + End If TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) Dim ImporteMovimiento As Decimal = 0 Dim ImporteMX As Decimal = 0 @@ -2635,6 +2662,230 @@ Partial Class Bancos_PopIECompras End If End If + Case 287 'Iva por Acreditar + If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then + 'funcionalidad que toma el 100% del pago para acreditamiento de iva + Dim TotalImporte As Decimal + + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + TotalImporte = ImportePagado.ToString.ToDecimal + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + TotalImporte = ImportePagado.ToString.ToDecimal + End If + + If TotalImporte = CompraSaldo Then + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = MovimientoPagar.IVA + ImporteMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = MovimientoPagar.IVA + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = MovimientoPagar.IVA + ImporteMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = MovimientoPagar.IVA + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ImporteMX = Math.Round(ImporteMX, 2) + TimpocambioGeneral = tipoCambioCompra + + If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" + Else + ImporteMovimiento = 0 + ImporteMX = 0 + End If + Else + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago + ImporteMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) + ImporteMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) + ImporteMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) + ImporteMX = ImporteMovimiento * tipoCambioCompra + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ImporteMX = Math.Round(ImporteMX, 2) + TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + + If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" + End If + + PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA + Dim IdCtaIVAXAcreditar As Integer = 0 + Dim IdCtaIVAAcreditable As Integer = 0 + + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + End If + + IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) + + If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + End If + + Case 288 'Iva Acreditable + + If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then + 'funcionalidad que toma el 100% del pago para acreditamiento de iva + Dim TotalImporte As Decimal + + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + TotalImporte = ImportePagado.ToString.ToDecimal + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + TotalImporte = ImportePagado.ToString.ToDecimal + End If + + If TotalImporte = CompraSaldo Then + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = MovimientoPagar.IVADeducible + ImporteMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible) + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible) + ImporteMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible) + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ImporteMX = Math.Round(ImporteMX, 2) + TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + + If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + Else + ImporteMovimiento = 0 + ImporteMX = 0 + End If + + Else + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago).RoundSQL + ImporteMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago) + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago) + ImporteMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago) + ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ImporteMX = Math.Round(ImporteMX, 2) + TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + + If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + End If + + If MovimientoPagar.IVANoDeducible.ToString.ToDecimal > 0 Then + If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then + 'funcionalidad que toma el 100% del pago para acreditamiento de iva + Dim TotalImporte As Decimal + + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + TotalImporte = ImportePagado.ToString.ToDecimal + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + TotalImporte = ImportePagado.ToString.ToDecimal + End If + + If TotalImporte = CompraSaldo Then + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible + ImporteMXNoDeducible = ImporteMovimientoNoDeducible + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + End If + ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) + ImporteMXNoDeducible = Math.Round(ImporteMX, 2) + TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + + If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}" + Else + ImporteMovimientoNoDeducible = 0 + ImporteMXNoDeducible = 0 + End If + + Else + If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then + ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible * PorcentajePago + ImporteMXNoDeducible = ImporteMovimientoNoDeducible + ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then + ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago) + ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + End If + ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) + ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2) + TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) + + If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}" + End If + End If + + PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA + Dim IdCtaIVAXAcreditar As Integer = 0 + Dim IdCtaIVAAcreditable As Integer = 0 + Dim IdCtaContableNoIVA As Integer = 0 + + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + IdCtaContableNoIVA = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero + End If + + IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) + + If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + End If + + If MovimientoPagar.IVANoDeducible > 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContableNoIVA, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then + MsgError = "No se pudo insertar la póliza" + End If + End If 'Case 280 'Iva Acreditable No Deducible ' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then ' 'funcionalidad que toma el 100% del pago para acreditamiento de iva diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 9b6ae3795..84d152fbc 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -718,79 +718,76 @@ Partial Class Bancos_PopIEVentas Validada = True End If - - If Validada Then - - CveCliente = dr("CveCliente").ToString.ToEntero - CveClienteOriginal = dr("CveCliente").ToString.ToEntero - HdnCveCliente.Value = CveCliente.ToString - CargaCliente(CveCliente, "-1") - CveMoneda = dr("CveMoneda").ToString.ToEntero - CveMonedaVenta = dr("CveMoneda").ToString.ToEntero - CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero - NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) - SerieFolio = dr("SerieFolio").ToString - TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal - CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero - - LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" + CveCliente = dr("CveCliente").ToString.ToEntero + CveClienteOriginal = dr("CveCliente").ToString.ToEntero + HdnCveCliente.Value = CveCliente.ToString + CargaCliente(CveCliente, "-1") + CveMoneda = dr("CveMoneda").ToString.ToEntero + CveMonedaVenta = dr("CveMoneda").ToString.ToEntero + CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero + NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) + SerieFolio = dr("SerieFolio").ToString + TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal + CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero + + LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" + + 'Configuración de Modalidad Update + + 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") + + If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then + If dr("TipoDocto").ToString = "Rem" Then + Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) + BtnGuardar.Visible = False + End If + End If - 'Configuración de Modalidad Update + MovimientoPagar = New IEMovimiento + MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal + MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal + MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal + MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal + MovimientoPagar.Total = dr("Total").ToString.ToDecimal + MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal + MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal + MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") + LtlTitulo.Text = "Cuentas por Cobrar" + LtlTipo2.Text = "Folio de la Venta" + LtlTipo3.Text = "Fecha de la Venta" + LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") + LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() + LtlFolio.Text = dr("SerieFolio").ToString + + TxtFolio.Enabled = True + TxtFechaDocumento.Enabled = True + Calendario.Enabled = True + TxtPagueseA.Enabled = False + TxtImporte.Enabled = True + + DdlCuenta.Enabled = True + + DdlTipoTransaccion.Enabled = True + TxtObservaciones.Enabled = True + + RVImporte.Enabled = True + RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero + TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero + + FechaVenta = dr("Fecha").ToString.ToDate + SaldoVenta = dr("Saldo").ToString.ToDouble - If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then - If dr("TipoDocto").ToString = "Rem" Then - Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) - BtnGuardar.Visible = False - End If - End If + 'Cortes de Caja + If UsuarioActual.TienePermisoProceso(160) Then + CargaCorteCaja() + End If - - - MovimientoPagar = New IEMovimiento - MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal - MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal - MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal - MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal - MovimientoPagar.Total = dr("Total").ToString.ToDecimal - MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal - MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal - MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - - LtlTitulo.Text = "Cuentas por Cobrar" - LtlTipo2.Text = "Folio de la Venta" - LtlTipo3.Text = "Fecha de la Venta" - LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") - LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() - LtlFolio.Text = dr("SerieFolio").ToString - - TxtFolio.Enabled = True - TxtFechaDocumento.Enabled = True - Calendario.Enabled = True - TxtPagueseA.Enabled = False - TxtImporte.Enabled = True - - DdlCuenta.Enabled = True - - DdlTipoTransaccion.Enabled = True - TxtObservaciones.Enabled = True - - RVImporte.Enabled = True - RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero - TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero - - FechaVenta = dr("Fecha").ToString.ToDate - SaldoVenta = dr("Saldo").ToString.ToDouble - - - 'Cortes de Caja - If UsuarioActual.TienePermisoProceso(160) Then - CargaCorteCaja() - End If + If Not Validada Then + BtnGuardar.Visible = False End If @@ -1388,8 +1385,6 @@ Partial Class Bancos_PopIEVentas #Region "G U A R D A R" Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - - Dim FechaFactura As Date = FechaVenta Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate diff --git a/Bancos/PopUpBuscarIE.aspx b/Bancos/PopUpBuscarIE.aspx index 228691300..def89512c 100644 --- a/Bancos/PopUpBuscarIE.aspx +++ b/Bancos/PopUpBuscarIE.aspx @@ -51,7 +51,7 @@ - + diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c11b25731..c74e59d8b 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1006,6 +1006,7 @@ Partial Class Bancos_ProveedoresAbonar 'inserto las compras que voy a pagar For Each gvr As GridViewRow In GvCxP.Rows If gvr.FCCheckBox("Chk").Checked Then + Dim EsImportacion As Boolean = False 'Tipos de cambio If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos @@ -1032,7 +1033,6 @@ Partial Class Bancos_ProveedoresAbonar If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then For Each Row As DataRow In ObjMov.DtResultados.Rows - ConceptoContable = Row("CveConcepto").ToString.ToEntero TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) ImporteMovimiento = 0 @@ -1042,6 +1042,27 @@ Partial Class Bancos_ProveedoresAbonar Referencia = gvr.DataKey("SerieFolio").ToString Dim PorcentajeImpuesto As Decimal = 0 + If ConceptoContable.Contiene(14, 19) AndAlso gvr.DataKey("CveCompra").ToEntero > 0 Then + Dim objcompras As New ClsCompras + objcompras.GetCompras(gvr.DataKey("CveCompra").ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) + If objcompras.DtResultados IsNot Nothing AndAlso objcompras.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow = objcompras.DtResultados.Rows(0) + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + If dr("EsImportacion").ToString = "True" Then + EsImportacion = True + If ConceptoContable = 14 Then + ConceptoContable = 287 + Else + ConceptoContable = 288 + End If + Else + EsImportacion = False + End If + End If + End If + + End If + Select Case ConceptoContable Case 17 'Pago Proveedores @@ -1736,6 +1757,72 @@ Partial Class Bancos_ProveedoresAbonar CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditarSIG").ToString.ToEntero End If End If + Case 287 'Iva X Acreditar Importacion + Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then + 'funcionalidad que toma el 100% del pago para acreditamiento de iva + + If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then + If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + ImporteMovimiento = gvr.DataKey("IVA").ToDecimal + importeMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + ImporteMovimiento = gvr.DataKey("IVA").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + ImporteMovimiento = gvr.DataKey("IVA").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + ImporteMovimiento = gvr.DataKey("IVA").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) + importeMX = Math.Round(importeMX, 2) + + If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" + Else + ImporteMovimiento = 0 + importeMX = 0 + End If + Else + ImporteMovimiento = gvr.DataKey("IVAPorPagar").ToDecimal * PorcentajePago + + + If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + importeMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) + importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + + If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" + End If + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + + PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal + Dim IdCtaIVAXAcreditar As Integer = 0 + Dim IdCtaIVAAcreditable As Integer = 0 + + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + End If + IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) + If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + End If Case 19 'Iva Acreditado Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then @@ -1817,6 +1904,88 @@ Partial Class Bancos_ProveedoresAbonar CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero End If End If + + Case 288 'Iva Acreditado + Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then + 'funcionalidad que toma el 100% del pago para acreditamiento de iva + If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then + If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal + importeMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal + importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) + importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + + If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + Else + ImporteMovimiento = 0 + importeMX = 0 + End If + Else + ImporteMovimiento = gvr.DataKey("IVAPorPagar").ToDecimal * PorcentajePago + + If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + importeMX = ImporteMovimiento + ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then + importeMX = ImporteMovimiento * tipoCambioCompra + ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + End If + ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) + importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + + If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + End If + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + + + + PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal + Dim IdCtaIVAXAcreditar As Integer = 0 + Dim IdCtaIVAAcreditable As Integer = 0 + Dim IdCtaContableNoIVA As Integer = 0 + + If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + IdCtaContableNoIVA = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero + End If + IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) + + 'se registra el iva no acreditable + If gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal > 0 Then + + Dim ImporteNOIVA As Decimal = gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal * PorcentajePago + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, FechaMovimiento, IdCtaContableNoIVA, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=ImporteNOIVA, ImporteME:=If(TipoCambioPago = 1, 0, ImporteMovimiento), CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + End If Case 25 'IEPS X Acreditar Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago @@ -2219,6 +2388,7 @@ Partial Class Bancos_ProveedoresAbonar End If 'Agrego el IVA + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, TxtObservaciones.Text, 14, TxtObservaciones.Text, Now, IdCtaIVAXAcreditar, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=gvr.DataKey("IVA").ToDecimal * PorcentajePago) Then MsgError = "Detalle" @@ -3392,6 +3562,7 @@ Partial Class Bancos_ProveedoresAbonar Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-4).ToShortDateString + RVTxtFechaDocumentoMenor.MaximumValue = DateTime.Now.ToShortDateString Calendario.EndDate = DateTime.Now End Sub diff --git a/Bancos/RepCobradoPagadoDetalle.aspx.vb b/Bancos/RepCobradoPagadoDetalle.aspx.vb index 46ed75b7c..9fd9a2b39 100644 --- a/Bancos/RepCobradoPagadoDetalle.aspx.vb +++ b/Bancos/RepCobradoPagadoDetalle.aspx.vb @@ -48,8 +48,9 @@ Partial Class Bancos_RepCobradoPagadoDetalle ' GvDatos.Columns(5).HeaderText = "Cobrado" ' End If 'End If - - CargaDatos() + If Modalidad <> 0 Then + CargaDatos() + End If End Sub #End Region diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 30c7a064f..8a7c0fff3 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -1068,10 +1068,10 @@ public partial class CRM_Acercamiento : ClsPaginas ClsOIEventos ObjEventos = new ClsOIEventos(); DateTime FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime(); int CveContactoAgendar = DdlContactoAgenda.SelectedValue.ToEntero(); - + int CveEmpresaCRM = DdlEmpresaCRM.SelectedValue.ToEntero(); int CveEtapa = HdfEtapaSeleccionada.Value.ToEntero() == -1 ? CveEtapaActual : HdfEtapaSeleccionada.Value.ToEntero(); - if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoAgendar, CveEtapaProcesoCRM: CveEtapa)) + if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoAgendar, CveEtapaProcesoCRM: CveEtapa, CveEmpresaCRM:CveEmpresaCRM)) { limpiarModalAgendar(); RegistraScript("$('#ModalAgenda').modal('hide')"); diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index f0c780a36..f1d7fa63e 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -514,6 +514,12 @@ +
+ Importación +
+ +
+
@@ -4427,7 +4433,7 @@
-
+
8% @@ -4439,6 +4445,15 @@
+
+
+ + + <%-- + --%> + +
+
@@ -6613,9 +6628,19 @@ $('#LblTotalContrato').text(SubTotal); } + function ChkImportacion(chk) { + if (chk.checked == true) { + $('#divIVA').css("display", "none"); + $('#divImporteImportacion').css("display", "block"); + debugger; + } else { + $('#divIVA').css("display", "none"); + $("#divImporteImportacion").css("display", "block"); + debugger; - + } + } function ValidateCantCon(variable) { diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index bf272f6be..bd1247c18 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1623,6 +1623,13 @@ Partial Class Compras_Compras 'End If 'RegistraScript("ScrollVentanaAddProducto();") + + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + divImportacion.Visible = True + chkImportacion.Attributes.Add("onclick", "ChkImportacion(this);") + + End If + End Sub #Region "C A R G A S" @@ -3009,6 +3016,14 @@ Partial Class Compras_Compras End If End If + 'Tiene Importacion + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + If dr("EsImportacion").ToString = "True" Then + chkImportacion.Checked = True + Else + chkImportacion.Checked = False + End If + End If CargaComplementosPago() Else @@ -4507,6 +4522,7 @@ Partial Class Compras_Compras Dim EntregaDirecta = False Dim ConceptoPoliza As String = String.Format("{0} - {1}{2} - {3}", NombreProveedor, TxtSerie.Text, TxtFolio.Text, TxtDescripcion.Text.Trim) + Dim EsImportacion As Boolean = chkImportacion.Checked 'funcion para empresas llanteras 'TIPO CAMBIO MANUAL CON COMPRA NUEVA Dim TipoCambioGuardar As Decimal = 1 @@ -4616,7 +4632,7 @@ Partial Class Compras_Compras Else CveConceptoContableAlmacen = 205 End If - If OCVinculada And Not (CveImportacion > 0 Or CveFlete > 0) Then + If OCVinculada AndAlso DdlOCVinculaInv.visible AndAlso Not (CveImportacion > 0 Or CveFlete > 0) Then CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero End If If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'se comento, RMF. 2020.08.19, no le hallo sentido @@ -4671,12 +4687,13 @@ Partial Class Compras_Compras 'Compra + If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble, TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen, - CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto) Then + CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion) Then ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString @@ -5844,8 +5861,11 @@ Partial Class Compras_Compras For Each Row As DataRow In DTPlatilla.Rows Dim CveSubProyectoInsertar As Integer = -1 - Dim ConceptoContable As Integer = Row("CveConcepto").ToString.ToEntero + If chkImportacion.Checked And ConceptoContable = 14 Then + ConceptoContable = 287 + + End If Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False) Dim importeMovimiento As Decimal = 0 Dim IdCtaContable As Integer = 0 @@ -6077,6 +6097,21 @@ Partial Class Compras_Compras CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditarSIG").ToString.ToEntero End If End If + + Case 287 'IVA X Acreditar + importeMovimiento = importeIVAxAcreditar + importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador + If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" + PorcentajeImpuesto = PorcentajeIVA + IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) + If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero + CveCuenta = ObjConta.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero + End If + End If + + Case 25 'IEPS X Acreditar If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then importeMovimiento = ImporteIEPSxAcreditar @@ -6517,7 +6552,7 @@ Partial Class Compras_Compras End If Case 6 'Compra - Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141, 152, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" + Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141, 152, 153, 154, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" @@ -9167,6 +9202,32 @@ Partial Class Compras_Compras End If End If End If + Case 287 'Iva X Acreditar importacion + 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 * tipoCambio + PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal + IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) + 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 + CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditarSIG").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 @@ -17757,6 +17818,15 @@ Partial Class Compras_Compras UpPSS.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "divAddProducto")) + If chkImportacion.Checked Then + divImporteImportacion.Visible = True + divIVA.Visible = False + + Else + divIVA.Visible = True + divImporteImportacion.Visible = False + + End If End Sub Private Sub LimpiaAgregar() @@ -18198,9 +18268,14 @@ Partial Class Compras_Compras If PSRow IsNot Nothing Then SATClavePS = PSRow("SATClavePS").ToString.ToEntero End If - + Dim IVA As Double + If chkImportacion.Checked Then + IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble)) + Else + IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) + End If AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, - DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), + DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA, TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS) diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx index 0ef7196ce..48cbb6308 100644 --- a/Contabilidad/RegPrePoliza.aspx +++ b/Contabilidad/RegPrePoliza.aspx @@ -70,13 +70,25 @@
  • - Cargar Excel + Cargar Excel
  • Crear Complemento de Pago
  • +
  • + Imprmir PDF's +
  • +
  • + Cargar Comprobante +
  • +
    + + + +
    + @@ -783,7 +795,50 @@
    + diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index c5225c895..a92d266e1 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -5,6 +5,9 @@ Imports Extensiones Imports System.Linq Imports System.Web.Services Imports GemBox.Spreadsheet +Imports System.IO +Imports iTextSharp.text.pdf +Imports Microsoft.Reporting.WebForms Partial Class ContabilidadC_RegPrePoliza Inherits ClsPaginas @@ -167,12 +170,32 @@ Partial Class ContabilidadC_RegPrePoliza ViewState("IdPoliza") = value End Set End Property + + Public Property Tick As String + Get + Return CType(ViewState("Tick"), String) + End Get + Set(value As String) + ViewState("Tick") = value + End Set + End Property + + Public Property CveIE As Integer + Get + Return CType(ViewState("CveIE"), Integer) + End Get + Set(value As Integer) + ViewState("CveIE") = value + End Set + End Property + + #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then - + Tick = DateTime.Now.Ticks.ToString If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) @@ -265,8 +288,8 @@ Partial Class ContabilidadC_RegPrePoliza ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero ViewState("CveTurno") = Request("CveTurno").ToEntero - DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) - DdlPlantilla.SelectedValue = "61" + 'DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) + 'DdlPlantilla.SelectedValue = "61" DdlPlantilla.Enabled = False DivAgregarConceptos.Visible = False @@ -485,19 +508,19 @@ Partial Class ContabilidadC_RegPrePoliza 'Asignamos los Subproyectos e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlSubProyecto").DataBind() - e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) 'Asignamos los Tipos de Gasto e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlTipoGasto").DataBind() - e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) 'ASignamos las CuentasContables e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") e.Row.FCDropDownList("DdlCtaContable").DataBind() - e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) + 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero @@ -511,6 +534,12 @@ Partial Class ContabilidadC_RegPrePoliza If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + If CveConceptoContable.Contiene(30) AndAlso UsuarioActual.CveRol = 1 Then + LnkImprimirPDF.Visible = True + LnkComprobante.Visible = True + CveIE = e.Row.DBCampo("CveIE").ToString.ToEntero + + End If 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable @@ -1724,6 +1753,235 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) GeneraTimbre(CvePrePoliza) End Sub + + Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) + Dim pdf() As Byte + Dim filtro() As String = {"CveCompra", "CveIE", "CveConceptoContable"} + Dim filtroComplemento() As String = {"CveIE"} + Dim Pathpdf As New List(Of String) + Dim nombre As String = "recibo" + Dim pdfs = New List(Of Byte()) + Dim Path As String + Dim Factura() As Byte + Dim dt As DataTable = DtMovimientos.FiltraParametros("", "", filtro) + Dim ObjCompra As New ClsCompras + Dim ObjIE As New ClsBancos() + Dim i As Integer = 0 + Dim pathPoliza As String + Try + + + Path = ImprimirPolizaPDF(IdPoliza) + pathPoliza = Path + If File.Exists(Path) Then + Pathpdf.Add(Path) + End If + + For Each Row As DataRow In dt.Rows + If Row("CveConceptoContable").ToString.ToEntero = 30 Then + If Row("CveIE").ToString.ToEntero > 0 Then + If ObjIE.GetBancosIE(Row("CveIE").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Path = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString) + If File.Exists(Path) Then + Dim formato As String = System.IO.Path.GetExtension(Path) + If formato.ToLower.Contiene(".jpg", ".png", ".jpeg") Then + Dim ComprobantePDF As String = String.Format("{0}\{1}\comprobante.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick) + Using crea_archivo = New iTextSharp.text.Document + PdfWriter.GetInstance(crea_archivo, New FileStream(ComprobantePDF, FileMode.Create)) + crea_archivo.Open() + Dim image As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(Path) + crea_archivo.Add(image) + End Using + Pathpdf.Add(ComprobantePDF) + + Else + Pathpdf.Add(Path) + End If + + End If + End If + End If + End If + End If + If Row("CveConceptoContable").ToString.ToEntero.Contiene(17, 309, 312) Then + If ObjCompra.GetCompras(Row("CveCompra").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) + Dim RFC As String = dr("RFC").ToString + Dim CveFactura As String = dr("CveFactura").ToString + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + If File.Exists(Path) Then + + Pathpdf.Add(Path) + End If + End If + End If + End If + Next + + dt = DtMovimientos.FiltraParametros("", "", filtroComplemento) + For Each Row As DataRow In dt.Rows + If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, Row("CveIE").ToString.ToEntero) Then + If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow = ObjCompra.DtResultados.Rows(0) + Dim RFC As String = dr("RFCde").ToString + Dim CveFactura As String = dr("CveFactura").ToString + If CveFactura <> "" Then + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + If File.Exists(Path) Then + Pathpdf.Add(Path) + End If + End If + End If + End If + Next + + MergePdfFiles(Pathpdf.ToArray) + If File.Exists(pathPoliza) Then + Directory.Delete(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick), True) + End If + + Catch ex As Exception + Alert("Error") + End Try + End Sub + Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String + Dim ObjConta As New ClsContabilidad + 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) + Dim params As New List(Of ReportParameter) + Dim Bytes As Byte() = Nothing + + + 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + Try + + + Dim dtVC As DataTable + Dim dr As DataRow + dtVC = ObjConta.DtResultados + dr = dtVC.Rows(0) + Dim ruta As String = "" + + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", dr("CveTipoPoliza").ToString)) + params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) + params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) + params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) + 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) + 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) + params.Add(New ReportParameter("Moneda", "")) + params.Add(New ReportParameter("CodigoPostal", "")) + + If UsuarioActual.CveEmpresa = 119 Then + params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) + End If + + If Archivo.Exists Then + ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" + Else + ruta = "Empresas/Grales/Formatos/Polizas.rdlc" + End If + + Bytes = StreamPDF(ruta, dtVC, params, "ppoliza") + + If Not File.Exists(String.Format("{0}{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString)) Then + DirectoryExistsCreate(String.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, Tick)) + File.WriteAllBytes(String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString), Bytes) + End If + + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) + Catch ex As Exception + Alert("ggg") + End Try + End If + + + ObjConta.Dispose() + + End Function + Private Sub MergePdfFiles(ByVal pdfFiles() As String) + Dim result As Boolean = False + Dim pdfCount As Integer = 0 + Dim f As Integer = 0 + Dim fileName As String + Dim reader As iTextSharp.text.pdf.PdfReader = Nothing + Dim pageCount As Integer = 0 + Dim pdfDoc As iTextSharp.text.Document = Nothing + Dim writer As PdfWriter = Nothing + Dim cb As PdfContentByte = Nothing + + Dim page As PdfImportedPage = Nothing + Dim rotation As Integer = 0 + + + Try + pdfCount = pdfFiles.Length + If pdfCount > 0 Then + fileName = pdfFiles(f) + reader = New iTextSharp.text.pdf.PdfReader(fileName) + pageCount = reader.NumberOfPages + pdfDoc = New iTextSharp.text.Document(reader.GetPageSizeWithRotation(1), 18, 18, 18, 18) + writer = PdfWriter.GetInstance(pdfDoc, New FileStream(String.Format("{0}\{1}\Salida.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick), FileMode.Create)) + + With pdfDoc + .Open() + End With + cb = writer.DirectContent + While f < pdfCount + Dim i As Integer = 0 + While i < pageCount + i += 1 + pdfDoc.SetPageSize(reader.GetPageSizeWithRotation(i)) + pdfDoc.NewPage() + page = writer.GetImportedPage(reader, i) + rotation = reader.GetPageRotation(i) + If rotation = 90 Then + cb.AddTemplate(page, 0, -1.0F, 1.0F, 0, 0, reader.GetPageSizeWithRotation(i).Height) + ElseIf rotation = 270 Then + cb.AddTemplate(page, 0, 1.0F, -1.0F, 0, reader.GetPageSizeWithRotation(i).Width + 60, -30) + Else + cb.AddTemplate(page, 1.0F, 0, 0, 1.0F, 0, 0) + End If + End While + f += 1 + If f < pdfCount Then + fileName = pdfFiles(f) + reader = New iTextSharp.text.pdf.PdfReader(fileName) + pageCount = reader.NumberOfPages + End If + End While + + + pdfDoc.Close() + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}\{1}\Salida.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick)) + + If Archivo.Exists Then + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(String.Format("{0}\{1}\Salida.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick)) + Response.Flush() ' send it to the client to download + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + + End If + result = True + End If + Catch ex As Exception + End Try + + + + End Sub + #End Region @@ -1945,7 +2203,7 @@ Partial Class ContabilidadC_RegPrePoliza Next If Not TieneError Then ObjConta.Commit() - Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, ObjConta.ContaFolio)) + Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, ObjConta.ContaFolio)) Alert($"Se agregó la póliza {ObjConta.ContaFolio}") @@ -2014,5 +2272,41 @@ Partial Class ContabilidadC_RegPrePoliza Return dataTable End Function + + Protected Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click + Dim ObjIE As New ClsBancos + Dim Comprobante As String = "" + + Dim Filesgral As List(Of Archivo) = TxtCargarArchivo.getfiles().Archivos + If Filesgral.Count > 0 Then + Dim fileItem As Archivo = Filesgral(0) + Dim Path As String = HttpContext.Current.Request.ApplicationPath + Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + + Path = Extensiones.DirectorioBaseEmpresas + Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa) + + + + If Not Directory.Exists(Path) Then + Directory.CreateDirectory(Path) + End If + Path += $"/{CveIE}.{Comprobante}" + If File.Exists(Path) Then + File.Delete(Path) + End If + My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path) + End If + TxtCargarArchivo.Text = "" + RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1") + + If ObjIE.UpdateComprobanteIE(Comprobante.Replace("."c, ""), CveIE) Then + Alert("El Comprobante se guardo exitosamente.", TipoMensaje.MsgInformacion) + End If + + ObjIE.Dispose() + + End Sub + End Class diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 286ca172c..421303bcd 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -67,9 +67,17 @@
    -
  • - Crear Complemento de Pago -
  • + + +
  • + Cargar Excel +
  • +
  • + Crear Complemento de Pago +
  • +
    +
    +
  • @@ -779,6 +787,54 @@
  • + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 617ce1010..f62902ab6 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -4,11 +4,12 @@ Imports System.Data Imports Extensiones Imports System.Linq Imports System.Web.Services +Imports GemBox.Spreadsheet Partial Class ContabilidadC_RegPrePolizaS - Inherits ClsPaginas - - + Inherits ClsPaginas + + #Region "Propiedades" Public Property ArregloMovs As ArrayList Get @@ -157,9 +158,9 @@ Partial Class ContabilidadC_RegPrePolizaS Set(value As Integer) ViewState("IndiceGrid") = value End Set - End Property + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -483,16 +484,29 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub - Private Sub CargaPlantillas(TipoPlantilla As Integer) - - 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - 'GvPlantillas.DataBind() - - DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - DdlPlantilla.DataBind() - DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) - End Sub - + Private Sub CargaPlantillas(TipoPlantilla As Integer) + + 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + 'GvPlantillas.DataBind() + + If UsuarioActual.CveEmpresa.Contiene(120) Then + DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + + Else + DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + + End If + + + DdlPlantilla.DataBind() + DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + + DdlPlantilla2.DataBind() + DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + End Sub + Private Sub CargaConceptos() DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1) DdlConceptosContables.DataBind() @@ -543,8 +557,9 @@ Partial Class ContabilidadC_RegPrePolizaS Private Sub CargaCuentasContables() Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then DdlCtaContable.DataSource = ObjConta.DtResultados + DtCuentasContables = ObjConta.DtResultados End If ObjConta.Dispose() DdlCtaContable.DataBind() @@ -1338,7 +1353,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("IdCuenta") = DdlCtaContable.SelectedValue If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() NombreCuenta = drr("Nombre").ToString() @@ -1406,7 +1421,7 @@ Partial Class ContabilidadC_RegPrePolizaS dr("IdCuenta") = DdlCtaContable.SelectedValue If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) If drr IsNot Nothing Then CodigoCuenta = drr("CuentaFormato").ToString() NombreCuenta = drr("Nombre").ToString() @@ -1457,8 +1472,8 @@ Partial Class ContabilidadC_RegPrePolizaS TxtAbono.Text = "" TxtReferencia.Text = "" TxtDescripcion.Text = "" - End Sub - + End Sub + #Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" Public Sub Bancos_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) @@ -1510,9 +1525,9 @@ Partial Class ContabilidadC_RegPrePolizaS End If ObjContabilidad.Dispose() - End Sub + End Sub #End Region - + Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs) If UpPrePoliza.Visible Then For Each Gvr As GridViewRow In GvPrePoliza.Rows @@ -1669,11 +1684,11 @@ Partial Class ContabilidadC_RegPrePolizaS ObjConta.Dispose() - End Sub - - + End Sub + + #Region "COMPLEMENTO DE PAGO" - + Private Sub GeneraTimbre(CvePrePoliza As Integer) Dim Str As New StringBuilder Dim Banco As New ClsBancos @@ -1730,10 +1745,211 @@ Partial Class ContabilidadC_RegPrePolizaS Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) GeneraTimbre(CvePrePoliza) - End Sub + End Sub #End Region - - - + + + +#Region "E X C E L" + + + Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel")) + + End Sub + + Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click + Dim NombreArchivo As String + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + Dim workbook As New ExcelFile() + Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) + + Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero + Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") + + Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows + Select New With + { + .ConceptoAdministrativo = row.Item("ConceptoContable"), + .Cuenta = row.Item("Codigo"), + .NombreCuenta = row.Item("NombreCuenta"), + .Cargo = "", + .Abono = "", + .Referencia = "", + .Concepto = "", + .SubProyecto = row.Item("SubProyecto"), + .CveConceptoContable = row.Item("CveConcepto"), + .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), + .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), + .CveCuenta = row.Item("CveCuenta") + }).QueryToDataTable(True) + + worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + + Dim columnCount = worksheet.CalculateMaxUsedColumns() + For i = 0 To columnCount + worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) + Next + worksheet.Columns("I").Hidden = True + worksheet.Columns("J").Hidden = True + worksheet.Columns("K").Hidden = True + worksheet.Columns("L").Hidden = True + + + NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString + workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) + + + End Sub + + Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click + If TxtExcel.getfiles().Archivos.Count > 0 Then + Dim file As Archivo = TxtExcel.getfiles().Archivos(0) + + Dim Directorio As String = Server.MapPath("~") & file.patch + + Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + CargarArchivo(Directorio, file.filename, Tipo) + Else + Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) + End If + End Sub + Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) + Dim dt As New DataTable + ' Conexion As Odbc.OdbcConnection = Nothing + Dim ErrorArchivo = False + Dim ErrorExcel = False + + dt = ReadExcelFile(Ruta + FileName, True) + + + If Not ErrorArchivo Then + + If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then + Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(1).ColumnName = "Cuenta" Then + Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(2).ColumnName = "NombreCuenta" Then + Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(3).ColumnName = "Cargo" Then + Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(4).ColumnName = "Abono" Then + Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(5).ColumnName = "Referencia" Then + Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(6).ColumnName = "Concepto" Then + Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(7).ColumnName = "SubProyecto" Then + Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + End If + + If Not ErrorArchivo Then + + + Dim ObjConta As New ClsContabilidad() + ObjConta.IniciaTransacSQL() + Try + Dim TieneError As Boolean = False + Dim ContadorUpdate As Integer = 0 + Dim ContadorError As Integer = 0 + Dim NombreCuenta As String = "" + Dim CvePrePoliza As Integer = 0 + Dim Cuenta As String = "" + Dim Reporte As New StringBuilder + Dim TotalCargos As Integer = 0 + Dim TotalAbonos As Integer = 0 + + + CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + + + For Each Row As DataRow In dt.Rows + NombreCuenta = Row("NombreCuenta").ToString + Cuenta = Row("Cuenta").ToString + + Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) + Dim Concepto As String = Row("Concepto").ToString + Dim Referencia As String = Row("Referencia").ToString + Dim IdCuenta As Integer = -1 + Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero + Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) + Dim YaExiste As Boolean = False + Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero + Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + + + If Importe <> 0 Then + + If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero + 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") + Else + Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
    ") + TieneError = True + YaExiste = True + End If + Else + TieneError = True + Exit For + End If + + + If YaExiste = False Then + If IdCuenta > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + TieneError = True + Exit For + End If + Else + IdCuenta = -2 + End If + End If + + End If + + Next + If Not TieneError Then + ObjConta.Commit() + Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, "Ver")) + + Alert($"Se agregó la póliza {ObjConta.ContaFolio}") + + Else + Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError) + ObjConta.RollBack() + End If + + + Catch ex As Exception + ObjConta.RollBack() + End Try + + ObjConta.Dispose() + End If + End Sub +#End Region + End Class diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 992646e1b..346bf361c 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -894,6 +894,10 @@ Partial Class Contratos_Default GRidsPresupuestos.Visible = True msjpresupuestos.Visible = False + If ObjContratos.CveContratoTipo = 30 Then + Server.Transfer(String.Format("/Contratos/ContratoObra.aspx?CveContrato={0}", CveContrato)) + End If + If ArchivoUpdate = ObjContratos.Archivo.ToString Then LinkArchivo.Visible = True LinkArchivo.HRef = String.Format("{0}{1}", Ruta, ObjContratos.Archivo.ToString) diff --git a/Contratos/ContratoAvance.aspx b/Contratos/ContratoAvance.aspx index 2a42ad29a..69501d2c1 100644 --- a/Contratos/ContratoAvance.aspx +++ b/Contratos/ContratoAvance.aspx @@ -192,7 +192,7 @@ - + diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index bfdd2c2cc..47510cdea 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -103,7 +103,7 @@
  • - Agregar Maquionaria Flotilla Herramienta + Agregar Maquinaria-Flotilla-Herramienta
  • diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 79a23d44f..fa20efdbd 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1340,12 +1340,26 @@ Bold + + + + + + ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + HTML + + + + + + + + ="<b>Próxima Rotación y Balanceo: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) & " <b>Próxima Alineacion: </b>" & FormatDateTime(CDate(Parameters!Fecha.Value).AddMonths(6), DateFormat.ShortDate) + HTML + + + + + + + + + =Parameters!Serie.Value + + + + + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + Textbox81 + 0.36804in + 5.50529in + 0.18682in + 2.05349in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cliente: + + + + =Parameters!ClienteCodigo.Value + + + + - + + + + =Parameters!ClienteNombre.Value + + + + + + + + + Domicilio: + + + + =Parameters!ClienteDireccion.Value + + + + , + + + + =Parameters!ClienteCiudad.Value + + + + , + + + + =Parameters!ClienteEstado.Value + + + + + + + Textbox36 + 1.83775cm + 4.3204cm + 0.96667cm + 14.87889cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + 3.08165cm + 0.635cm + 0cm + 18.56429cm + 2 + + + + + + true + true + + + + + + + + + POR ESTE PAGARE ME(NO) OBLIGO(AMOS) INCONDICIONALMENTE A PAGAR A LA ORDEN DE + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + AL VENCIMIENTO ABAJO INDICADO. EN LA CIUDAD DE HERMOSILLO, SONORA O EN CUALQUIER OTRO LUGAR QUE SE ME REQUIERA DE PAGO, RENUNCIANDO EXPRESAMENTE AL FUERO DE MI DOMICILIO. LA CANTIDAD DE + + + + $ + + + + =Parameters!Total.Value + + + + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + + + + LA SUMA ANTERIOR SI NO FUERA CUBIERTA A SU VENCIMIENTO, CAUSARA INTERES MORATORIO A RAZON DEL + + + + 3.00% MENSUAL + + + + Y EN CASO DEL COBRO JUDICIAL SE CARGARAN LOS GASTOS QUE ESTOS GENEREN. + + + + + + + true + true + + + + + a + + + + =cdate(Parameters!Fecha.Value) + + + + + + + + + Vencimiento el + + + + =Parameters!Vencimiento.Value + + + + + + + Textbox38 + 8.17569cm + 3.93558cm + 1.07625cm + 5.19875cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 10.25697cm + 3.93558cm + 0cm + 5.19875cm + 5 + + + + + + true + true + + + + + S U S C R I P T O R + + + + + + + Textbox39 + 10.43336cm + 3.93558cm + 0.6cm + 5.19875cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + 10.25697cm + 11.9387cm + 0cm + 5.19875cm + 7 + + + + + + true + true + + + + + NOMBRE Y FIRMA DEL AVAL + + + + + + + Textbox39 + 10.43336cm + 11.9387cm + 0.6cm + 5.19875cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logo + FitProportional + 0cm + 2.54331cm + 4.05375cm + 9 + + + + + + + Start + + true + 7.78895in + 0.18226in + 4.422in + 7.87128in + + =iif(Parameters!AplicaPagare.Value="0",True,False) + + + + + + + true + true + + + + + Facturado a: + + + + + + + + + Cliente: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Calle: + + + + + + + + =Parameters!ClienteCalle.Value & IIF(Parameters!ClienteNoExt.Value <> "", " No.Ext: " & Parameters!ClienteNoExt.Value & iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,""),iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,"")) + + + + + + + + + Colonia: + + + + + + + + =Parameters!ClienteColonia.Value + + + + + + + + + Ciudad: + + + + =Parameters!ClienteCiudad.Value + + + + + + + + Estado: + + + + + + + + =Parameters!ClienteEstado.Value + + + + + + + + + Municipio y/o Delegación: + + + + =Parameters!ClienteMunicipio.Value + + + + + + + + + + + + + Pais: + + + + =Parameters!ClientePais.Value + + + + + + + + CP: + + + + + + + + =Parameters!ClienteCP.Value + + + + + + + + + Pedido/Contrato: + + + + =Parameters!PedidoContrato.Value + + + + + + + + + Orden Compra: + + + + =Parameters!OrdenCompra.Value + + + + + + + Textbox2 + 0.05159in + 4.31439cm + 1.62208in + 3.20861in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + "Este documento es una representación impresa de un CFDI" + + + + + + + + + Folio fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + =Parameters!FechaCertificacion.Value + + + + Número de serie del Certificado de Sello Digital: + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 0.0444in + 6.56374in + 1.13974in + 1.53682in + 1 + + + + + + true + 3.57076in + 0.02339in + 1.21305in + 8.22763in + 2 + + + + + + true + true + + + + + Domicilio fiscal: + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + TIPO DE DOCUMENTO: + + + + =Parameters!Tipo.Value + + + + + + + + + + + + + Serie: + + + + =Parameters!Serie.Value + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Fecha: + + + + + + + + = Parameters!Fecha.Value + + + + + + + + + Moneda: + + + + + + + + =Parameters!MonedaAbreviatura.Value + + + + + + + + + + + + + =iif(Parameters!TipoCambio.Value <= 1, "", "Tipo Cambio: " & Parameters!TipoCambio.Value) + + + + + + + + + Forma de pago: + + + + =Parameters!FormaPago.Value + + + + + + + + + Método de pago: + + + + =Parameters!MetodoPago.Value + + + + + + + + + Uso CFDI: + + + + =Parameters!UsoCFDI.Value + + + + + + + + + Régimen fiscal: + + + + Regimen General de Ley Personas Morales + + + + + + + + + + + Textbox4 + 0.05022in + 4.90719in + 1.62345in + 3.35633in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Expedido en + + + + : + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + + + AJA850608L7A + + + + + + + + + + + + + + + + + + Vendedor: + + + + =Parameters!VendedorNombre.Value + + + + + + + Textbox40 + 4.25cm + 13.26812cm + 1.42163cm + 7.72123cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.54927in + + + 0.58129in + + + 0.8527in + + + 3.02234in + + + 0.57354in + + + 0.59047in + + + 0.61967in + + + 0.64182in + + + 0.79194in + + + + + 0.19645in + + + + + true + true + + + + + CANT + + + + + + + Textbox22 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE SAT + + + + + + + Textbox29 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PU + + + + + + + Textbox3 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESC. + + + + + + + Textbox8 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IVA + + + + + + + Textbox2 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + + Textbox4 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TOTAL + + + + + + + Textbox1 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =iif(cdbl(Fields!ImporteIVA.Value) > 0, Fields!ImporteIVA.Value & "(" & cdbl(Fields!PorcentajeIVA.Value) * 100 & "%)","") + + + + + + + ImporteIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =iif(cdbl(Fields!PorcentajeIEPS.Value) > 0, Fields!ImporteIEPS.Value & "(" & Round(cdbl(Fields!PorcentajeIEPS.Value) * 100,0) & "%)","") + + + + + + + ImporteIEPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value * Fields!PU.Value + + + + + + + TiempoEntrega + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 2.25503in + 0.04048in + 0.34081in + 8.22304in + 6 + + + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + Textbox5 + 7.54968cm + 15.05252cm + 0.14316cm + 5.93682cm + 8 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =UCase(Parameters!ImporteLetra.Value) + + + + + + + ImporteLetra + 3.07034in + 2.02374in + 0.18861in + 6.23978in + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.99824cm + + + + + 0.48004cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.93858cm + + + true + true + + + + + =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 6.99203cm + 15.05252cm + 0.48004cm + 5.93682cm + 13 + + + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.14926cm + 0.07193cm + 0.54004cm + 20.7077cm + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.83025cm + 4.78817cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 3.28643cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + true + + + + + VERSION 3.3 + + + + + + + Textbox5 + 2.32303cm + 17.39754cm + 0.6cm + 3.32021cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 14.85441cm + 0.10282cm + 2.97096cm + 20.89818cm + 14 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + true + true + + + + + "REVISAR SU FACTURA Y SUS PRODUCTOS AL MOMENTO DE RECIBIRLAS, YA QUE NO SE REALIZARAN CAMBIOS EN FACTURA NI SE ACEPTARAN DEVOLUCIONES DE MERCANCIA DESPUES DE + + + + + + + + + 72 HORAS + + + + POSTERIORES A LA FECHA DE ELABORACIÓN" + + + + + + + Textbox1 + 8.5629cm + 0.10282cm + 0.34219cm + 20.85477cm + 15 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.83852cm + + + 1.21168cm + + + 1.69623cm + + + + + 0.44125cm + + + + + true + true + + + + + IMPUESTO + + + + + + + Textbox10 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TASA + + + + + + + Textbox12 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Textbox21 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!Impuesto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!tasa.Value + + + + + + + tasa + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 7.0273cm + 0.10282cm + 0.85604cm + 4.74643cm + 16 + + =IIf(Fields!Importe.Value = 0, True,False) + + + + + + + true + true + + + + + Nombre Comercial: + + + + + + + + + Beneficiario: + + + + + + + + + + + + + Banco: + + + + + + + + + + + + + Clabe: + + + + + + + + + Cuenta: + + + + + + + + + + + Textbox1 + 12.64506cm + 0.10282cm + 2.03296cm + 3.74249cm + 17 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + AGROPECUARIA JAM SA DE CV + + + + + + + + + AGROPECUARIA JAM SA DE CV + + + + + + + + + BBVA BANCOMER, MONEDA NACIONAL + + + + + + + + + 012760004508391082 + + + + + + + + + 0450839108 + + + + + + + Textbox1 + 12.64506cm + 3.84531cm + 2.03295cm + 5.75197cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre Comercial: + + + + + + + + + Beneficiario: + + + + + + + + + + + + + Banco: + + + + + + + + + + + + + Clabe: + + + + + + + + + Cuenta: + + + + + + + + + + + Textbox1 + 12.64506cm + 9.70311cm + 2.03295cm + 4.17266cm + 19 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + AGROPECUARIA JAM SA DE CV + + + + + + + + + AGROPECUARIA JAM SA DE CV + + + + + + + + + BBVA BANCOMER, MONEDA DOLARES + + + + + + + + + 012760004508391163 + + + + + + + + + 0450839116 + + + + + + + Textbox1 + 12.64506cm + 13.87577cm + 2.03294cm + 6.94061cm + 20 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logo + FitProportional + 0.12756cm + 0.08425cm + 2.54331cm + 4.05375cm + 21 + + + + + + 31.01581cm + + + + + 21.12144cm + + + 0.63499cm + true + true + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.11289cm + 18.37079cm + 0.41981cm + 2.5cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + @@ -535,7 +546,7 @@ @@ -861,6 +873,9 @@ +
    + +
    @@ -879,7 +894,6 @@
    -
    @@ -941,6 +955,9 @@ +
    + +
    @@ -998,7 +1015,6 @@
    -
    -
    @@ -1096,9 +1111,8 @@
    -
    - Agregar + Guardar Actualizar
    @@ -1227,12 +1241,13 @@
    +
    + Actualizar + Guardar +
    + -
    - Actualizar - Agregar -
    @@ -1257,6 +1272,11 @@
    +
    +
    + Agregar +
    +
    -
    -
    - Agregar -
    -
    @@ -1395,12 +1410,13 @@ Descripción
    +
    + Actualizar + Guardar +
    +
    -
    - Actualizar - Agregar -
    @@ -1429,7 +1445,7 @@