diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index acabd6abe..76da1aa43 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -806,7 +806,13 @@ Public Class ClsCRM SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al eliminar el Acercamiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + If ex.Message.Contains("CveVenta = ") Then + Dim CveVenta As String = ex.Message + CveVenta = CveVenta.Substring(11, 8) + Alert(String.Format("Este acercamiento esta ligado a una cotización
Cotización: {0}", CveVenta), TipoMensaje.MsgAdvertencia) + Else + OnError("Ocurrió un error al eliminar el Acercamiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If End Try Return Retorno End Function 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/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 10b6cbae5..e3746b0e5 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -7282,19 +7282,21 @@ Public Class ClsContPAQi Return Retorno End Function - Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, SegmentoNegocio As Integer) As Boolean + Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, SegmentoNegocio As Integer, Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False StrSQL.Clear() - StrSQL.Append(" SELECT P.Id, P.Fecha, T.Nombre AS TipoPol, P.Concepto, P.Cargos, P.Abonos, P.Folio ") + StrSQL.Append(" SELECT P.Id, P.Fecha, T.Nombre AS TipoPol, P.Concepto, P.Cargos, P.Abonos, P.Folio, PP.CvePrepoliza ") StrSQL.Append(" FROM [dbo].[Polizas] P ") StrSQL.Append(" LEFT JOIN TiposPolizas T ON T.Id = P.TipoPol ") StrSQL.Append(" LEFT JOIN MovimientosPoliza M ON M.IdPoliza = P.Id ") + StrSQL.Append(" LEFT JOIN [SERVIDOR].[Ventas].dbo.Conta_PrePolizas PP on P.Id = PP.IdPoliza") StrSQL.Append(" WHERE P.Ejercicio = @Ejercicio ") StrSQL.Append(" AND P.Periodo = @Periodo ") StrSQL.Append(" AND (@TipoPoliza = -1 OR P.TipoPol = @TipoPoliza) ") StrSQL.Append(" AND (@SegmentoNegocio = -1 OR M.IdSegNeg = @SegmentoNegocio) ") - StrSQL.Append(" GROUP BY P.Id, P.Fecha, T.Nombre, P.Concepto, P.Cargos, P.Abonos, P.Folio ") + StrSQL.Append(" AND (PP.CveEmpresa = @CveEmpresa) ") + StrSQL.Append(" GROUP BY P.Id, P.Fecha, T.Nombre, P.Concepto, P.Cargos, P.Abonos, P.Folio, PP.CvePrepoliza ") StrSQL.Append(" ORDER BY P.Folio ") SqlDataAdapter(StrSQL.ToString, CommandType.Text) @@ -7305,6 +7307,8 @@ Public Class ClsContPAQi .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza .Add("@SegmentoNegocio", SqlDbType.Int).Value = SegmentoNegocio + .Add("@CveEmpresa", SqlDbType.Int).Value = SegmentoNegocio + End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 856644c2e..4e204f882 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6474,7 +6474,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 @@ -6719,7 +6719,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/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/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 20e230d4d..adbf00f56 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -256,30 +256,89 @@ function FnSuma(chk, cantidad) { var saldoInicial = ToDouble($('#C_lblValorTotal').text()); + var ValorTotalSeleccionado2 = 0; + + $('#C_GvFacturas input[type=checkbox]').each( + function () { + if (this.checked) { + ValorTotalSeleccionado2 = ValorTotalSeleccionado2 + ToDouble(FormatoNumero($(this).val(), 2)); + } + } + ); + + ValorTotalSeleccionado = ValorTotalSeleccionado2; + if (chk.checked == false) { cantidad = cantidad * -1; } saldoInicial = saldoInicial + cantidad; $('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2)); - $('#C_lblValorTotalSeleccionado').text(FormatoNumero(saldoInicial, 2)); - ValorTotalSeleccionado = saldoInicial - + $('#C_lblValorTotalSeleccionado').text(FormatoNumero(ValorTotalSeleccionado, 2)); + debugger; + + + if ($('#C_ChkFaltante').attr('checked')) { + var txtcomision = ToDouble($('#C_TxtComision').val()); + if (txtcomision != 0) { + var comisionNegativa = 0; + if (txtcomision < 0) { + comisionNegativa = txtcomision * -1; + } + if (comisionNegativa > saldo) { + $('#C_TxtComision').val(0); + comision = 0; + descuento = 0; + txtcomision = 0; + alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado"); + saldo = 0; + $('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2)); + debugger; + } else { + + //debugger; + } + } + } + if ($('#C_ChkDescuento').attr('checked')) { + var txtdescuento = ToDouble($('#C_TxtDescuento').val()); + if (txtdescuento != 0) { + var DescuentoNegativa = 0; + if (txtdescuento < 0) { + DescuentoNegativa = txtdescuento * -1; + } + if (DescuentoNegativa > saldo) { + $('#C_TxtDescuento').val(0); + comision = 0; + descuento = 0; + txtdescuento = 0; + alert("No es posible poner un descuento superior a lo seleccionado"); + saldo = 0; + $('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2)); + debugger; + } else { + //saldo = ValorTotalSeleccionado + txtdescuento + comision; + //$('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); + //descuento = ToDouble($('#C_TxtDescuento').val()) + //debugger; + } + } + } + } function txtSuma(txt) { var comision2 = ToDouble($('#C_TxtComision').val()); var comisionNegativa = 0; if (comision2 < 0) { - comisionNegativa = comision2 * -1 + comisionNegativa = comision2 * -1; } if (comisionNegativa > ValorTotalSeleccionado) { - $('#C_TxtComision').val(comision) + $('#C_TxtComision').val(0) alert("No es posible poner una comision superior a lo seleccionado") } else { saldo = ValorTotalSeleccionado + comision2 + descuento; $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); comision = ToDouble($('#C_TxtComision').val()) - debugger; } } @@ -288,7 +347,7 @@ var comision2 = ToDouble($('#C_TxtDescuento').val()); var comisionNegativa = 0; if (comision2 < 0) { - comisionNegativa = comision2 * -1 + comisionNegativa = comision2 * -1; } if (comisionNegativa > ValorTotalSeleccionado) { $('#C_TxtDescuento').val(descuento) @@ -297,7 +356,6 @@ saldo = ValorTotalSeleccionado + comision2 + comision; $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); descuento = ToDouble($('#C_TxtDescuento').val()) - debugger; } } @@ -311,7 +369,7 @@ $('#divClasificacion').css("display", "block"); } else { $('#DivComision').css("display", "none"); - $('#divSubProyecto').css("display", "none"); + $('#LblSubproyecto').css("display", "none"); $('#divSubProyecto').css("display", "none"); $('#LblClasificacion').css("display", "none"); $('#divClasificacion').css("display", "none"); diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 9274e79ab..ef5e7ca4e 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -148,11 +148,11 @@ Partial Class Bancos_DepositosCaja NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) 'Entrada a bancos - FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8) + FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 13) If Not FolioIE > 0 Then OcurrioError = True End If - CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 13, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) documentos += String.Format("Depósito: {1}    
", CveIEOrigen, FolioIE) @@ -253,6 +253,8 @@ Partial Class Bancos_DepositosCaja Protected Sub GvFacturas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFacturas.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCCheckBox("ChkFactura").Attributes.Add("onclick", String.Format("FnSuma(this,{0});", e.Row.DBCampo("Importe"))) + e.Row.FCCheckBox("ChkFactura").InputAttributes.Add("Value", e.Row.DBCampo("Importe")) + End If End Sub diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index b60f17172..af9359a92 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -30,6 +30,9 @@
  • Actualizar Tipo Cambio
  • +
  • + PrePoliza +
  • <%--
  • Emitir Complemento de Pago diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index d2f2a0233..5dab27d13 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -863,6 +863,8 @@ Partial Class Bancos_IE LblCuenta.Text = ObjIE.BancoNumCuentaMoneda ViewState("CvePrePoliza") = ObjIE.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero + HpLPrePoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePoliza.aspx?CvePrepoliza={0}", ViewState("CvePrePoliza")) + HpLPrePoliza.Visible = True TxtFechaDocumento.Text = ObjIE.FechaDocumento.ToShortDateString TxtFolio.Text = ObjIE.Folio LblBeneficiario.Text = ObjIE.PagueseA 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/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/CatEmpresasCRM.aspx.cs b/CRM/CatEmpresasCRM.aspx.cs index 3f91131e8..729929056 100644 --- a/CRM/CatEmpresasCRM.aspx.cs +++ b/CRM/CatEmpresasCRM.aspx.cs @@ -176,59 +176,62 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas string Correo = row["Correo"].ToString(); int CveMedioCaptacion = -1; - if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa)) - { - DataRow MediosCaptacion = ObjCRM.DtResultados.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion)); - if(MediosCaptacion != null) + if (MedioCaptacion != "" || Agente != "") { + + if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa)) { - CveMedioCaptacion = MediosCaptacion["CveMedioCaptacion"].ToString().ToEntero(); + DataRow MediosCaptacion = ObjCRM.DtResultados.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion)); + if(MediosCaptacion != null) + { + CveMedioCaptacion = MediosCaptacion["CveMedioCaptacion"].ToString().ToEntero(); + }else + { + Alert(String.Format("El medio de captación '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia); + TieneError = true; + break; + } + } + + int CveVendedor = -1; + DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Vendedor = '{0}'",Agente)); + if (Vendedor != null) + { + CveVendedor = Vendedor["CveVendedor"].ToString().ToEntero(); }else { - Alert(String.Format("El medio de captación '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia); + Alert(String.Format("El vendedor '{0}' no fue encontrado", Agente), ModExtensiones.TipoMensaje.MsgAdvertencia); TieneError = true; break; } - } - int CveVendedor = -1; - DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Vendedor = '{0}'",Agente)); - if (Vendedor != null) - { - CveVendedor = Vendedor["CveVendedor"].ToString().ToEntero(); - }else - { - Alert(String.Format("El vendedor '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia); - TieneError = true; - break; - } + int CveSubProyecto = -1; + DataRow SubProyecto = get_GlobalDTSubProyectos(-1,CveEmpresa:UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("SubProyecto = '{0}'",Sucursal)); + if(SubProyecto != null) + { + CveSubProyecto = SubProyecto["CveSubProyecto"].ToString().ToEntero(); + }else + { + Alert(String.Format("El SubProyecto '{0}'", Sucursal), ModExtensiones.TipoMensaje.MsgAdvertencia); + TieneError = true; + break; + } - int CveSubProyecto = -1; - DataRow SubProyecto = get_GlobalDTSubProyectos(-1,CveEmpresa:UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("SubProyecto = '{0}'",Sucursal)); - if(SubProyecto != null) - { - CveSubProyecto = SubProyecto["CveSubProyecto"].ToString().ToEntero(); - }else - { - Alert(String.Format("El SubProyecto '{0}'", Sucursal), ModExtensiones.TipoMensaje.MsgAdvertencia); - TieneError = true; - break; - } + int CveGiro = -1; + DataRow GiroDt = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("ClienteClasificacion = '{0}'", Giro)); + if (GiroDt != null) + { + CveGiro = GiroDt["CveClienteClasificacion"].ToString().ToEntero(); + } + else + { + Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia); + TieneError = true; + break; + } - int CveGiro = -1; - DataRow GiroDt = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("ClienteClasificacion = '{0}'", Giro)); - if (GiroDt != null) - { - CveGiro = GiroDt["CveClienteClasificacion"].ToString().ToEntero(); - } - else - { - Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia); - TieneError = true; - break; - } - - TieneError = (!(ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, -1, CveVendedor, CveSubProyecto, Mail, CveGiro) > 0)); + TieneError = (!(ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, -1, CveVendedor, CveSubProyecto, Mail, CveGiro) > 0)); + } } if (TieneError) diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index 3e8c7d744..46b0baf93 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -88,8 +88,8 @@
    - - + +
    diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 7fdf33a49..b0dc49fe5 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -571,10 +571,10 @@ public partial class CRM_EmpresaCRM : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa)) { - DdlTipoPrceso2.DataSource = ObjCRM.DtResultados; - DdlTipoPrceso2.Items.Insert(0, new ListItem("Seleccione","-1")); + DdlTipoProceso2.DataSource = ObjCRM.DtResultados; + DdlTipoProceso2.Items.Insert(0, new ListItem("Seleccione","-1")); } - DdlTipoPrceso2.DataBind(); + DdlTipoProceso2.DataBind(); ObjCRM.Dispose(); } @@ -583,7 +583,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, -1)) { - DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoPrceso2.SelectedValue)); + DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso2.SelectedValue)); DdlMedioCaptacion.Items.Insert(0, new ListItem("Seleccione ", "-1")); DdlMedioCaptacionAcercamiento.Items.Clear(); DdlMedioCaptacionAcercamiento.DataSource = ObjCRM.DtResultados; @@ -638,7 +638,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtNombreEmpresa.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Empresa"); TxtRFC.Text = ObjCRM.DtResultados.FiltroPrimeroValor("RFC"); - DdlTipoPrceso2.SelectedValue = ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso"); + DdlTipoProceso2.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso")); CargaMetodosCaptacion(); TxtCorreoEmpresaCRM.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Correo"); DdlMedioCaptacion.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveMedioCaptacion")); 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/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 25346b21c..09f67a4e8 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1457,7 +1457,8 @@ Partial Class Compras_Proveedores #Region "LL E N A R - C O M B O S" Private Sub CargaResponsable() - DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + 'DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, DistinctColumns:={"CveUsuario", "Nombre"}) + DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveUsuario", "Nombre"}) DdlCveUsuarioResponsable.DataBind() End Sub Private Sub CargaClasificacionProveedor() diff --git a/Contabilidad/FiltraPolizas.aspx b/Contabilidad/FiltraPolizas.aspx index f14fbb7d1..32e4f7f93 100644 --- a/Contabilidad/FiltraPolizas.aspx +++ b/Contabilidad/FiltraPolizas.aspx @@ -33,12 +33,12 @@
    - +
    - + @@ -56,7 +56,7 @@
    - + @@ -171,6 +171,14 @@ + + + + + + + + diff --git a/Contabilidad/FiltraPolizas.aspx.vb b/Contabilidad/FiltraPolizas.aspx.vb index 3465ec8a5..a2095a75f 100644 --- a/Contabilidad/FiltraPolizas.aspx.vb +++ b/Contabilidad/FiltraPolizas.aspx.vb @@ -49,7 +49,7 @@ Partial Class Contabilidad_FiltraPolizas Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero() Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - If ObjConta.GetPolizas(Ejercicio, Periodo, DdlTipoPoliza.SelectedValue.ToEntero(), DdlSegmentoNeg.SelectedValue.ToEntero()) Then + If ObjConta.GetPolizas(Ejercicio, Periodo, DdlTipoPoliza.SelectedValue.ToEntero(), DdlSegmentoNeg.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then DtDatos = ObjConta.DtResultados Gv.DataSource = ObjConta.DtResultados 'If DdlTipoPoliza.SelectedValue.ToEntero > 0 Then diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx index 0ef7196ce..ddfbb440e 100644 --- a/Contabilidad/RegPrePoliza.aspx +++ b/Contabilidad/RegPrePoliza.aspx @@ -70,13 +70,24 @@
  • - Cargar Excel + Cargar Excel
  • Crear Complemento de Pago
  • +
  • + Paquete Egresos +
  • +
  • + Cargar Comprobante +
  • + + + + + @@ -783,7 +794,50 @@ + diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index c5225c895..0f95cab57 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,39 @@ 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 + + Public Property TipoPoliza As String + Get + Return CType(ViewState("TipoPoliza"), String) + End Get + Set(value As String) + ViewState("TipoPoliza") = 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 +295,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 @@ -418,6 +448,9 @@ Partial Class ContabilidadC_RegPrePoliza TxtFechaDocumento.Text = dr("Fecha") TxtConcepto.Text = dr("Concepto") DivDatosPoliza.Visible = True + TipoPoliza = DdlTipoPoliza.SelectedItem.Text + Folio = dr("FolioPoliza").ToString + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then DivAgregarConceptos.Visible = True @@ -485,19 +518,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 +544,11 @@ 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) Then + LnkImprimirPDF.Visible = True + LnkComprobante.Visible = True + CveIE = e.Row.DBCampo("CveIE").ToString.ToEntero + End If 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable @@ -811,6 +849,8 @@ Partial Class ContabilidadC_RegPrePoliza dr("MultipleSubProyecto") = drt("MultipleSubProyecto") dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto") dr("CveCuenta") = drt("CveCuenta") + dr("FolioPoliza") = drt("FolioPoliza") + DtMovimientos.Rows.Add(dr) @@ -891,7 +931,6 @@ Partial Class ContabilidadC_RegPrePoliza If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then e.Row.FCLinkButton("ImgBancos").Visible = True - If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" End If @@ -1724,6 +1763,239 @@ 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 filtro() As String = {"CveCompra", "CveIE", "CveConceptoContable"} + Dim filtroComplemento() As String = {"CveIE"} + Dim Pathpdf As New List(Of String) + Dim pdfs = New List(Of Byte()) + Dim Path As String + Dim dt As DataTable = DtMovimientos.FiltraParametros("", "", filtro) + Dim ObjCompra As New ClsCompras + Dim ObjIE As New ClsBancos() + Dim pathPoliza As String + Dim TieneComprobante As Boolean = True + 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 TieneComprobante Then + 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 + TieneComprobante = True + 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(iTextSharp.text.PageSize.A4, 18, 18, 18, 18) + PdfWriter.GetInstance(crea_archivo, New FileStream(ComprobantePDF, FileMode.Create)) + crea_archivo.Open() + Dim image As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(Path) + If image.Height > image.Width Then + Dim percentage As Double = 0.0F + percentage = 700 / image.Height + image.ScalePercent(percentage * 100) + Else + Dim percentage As Double = 0.0F + percentage = 540 / image.Width + image.ScalePercent(percentage * 100) + End If + crea_archivo.Add(image) + End Using + Pathpdf.Add(ComprobantePDF) + Else + Pathpdf.Add(Path) + End If + Else + TieneComprobante = False + Exit For + End If + End If + End If + End If + End If + If Row("CveConceptoContable").ToString.ToEntero.Contiene(17, 309, 312, 308) 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 + End If + Next + + If TieneComprobante Then + dt = DtMovimientos.FiltraParametros("", "", filtroComplemento) + For Each Row As DataRow In dt.Rows + If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, Row("CveIE").ToString.ToEntero) Then + Console.WriteLine(Row("CveIE").ToString) + 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 + Console.WriteLine(RFC & CveFactura) + If CveFactura <> "" Then + Path = String.Format("{0}Compras\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, RFC, CveFactura) + Console.WriteLine(Path) + 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 + Else + Alert("No se tiene cargado comprobante de pago", TipoMensaje.MsgAdvertencia) + End If + + + Catch ex As Exception + Alert("Error al descargar el paquete", TipoMensaje.MsgError) + 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 + 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("TipoPoliza").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 + End If + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) + 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}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio), 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}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio)) + + 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}\{2}-{3}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, TipoPoliza, Folio)) + 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 +2217,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 +2286,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/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index d7c95adc4..b5e938280 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -216,6 +216,7 @@ + @@ -231,7 +232,7 @@ - + diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 659597ce7..dd79dcb50 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -53,7 +53,6 @@ public partial class Contabilidad_RepIVA : ClsPaginas if (!IsPostBack) { InicializaValores(); - } } @@ -61,8 +60,9 @@ public partial class Contabilidad_RepIVA : ClsPaginas { TipoCambio = 1; TCEspecifico = -1; - txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}"; - txtFechaF.Text = DateTime.Now.ToShortDateString(); + DateTime FF = DateTime.Now.AddMonths(-1); + txtFechaI.Text = $"01/{FF.Month}/{FF.Year}"; + txtFechaF.Text = FF.ToShortDateString(); LnkAccionesDIOT.Visible = true; @@ -104,6 +104,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT"; } + GvA.Columns[11].Visible = DtIVAAcreditable.SUM("IvaExentoImpo") > 0; // sino tiene valor la columna de importación de oculta + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { 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/119/Formatos/Polizas.rdlc b/Empresas/119/Formatos/Polizas.rdlc index fa48d9432..48a40c9ba 100644 --- a/Empresas/119/Formatos/Polizas.rdlc +++ b/Empresas/119/Formatos/Polizas.rdlc @@ -1,5 +1,5 @@ - + 0 @@ -171,7 +171,6 @@ 2pt - true @@ -461,7 +460,6 @@ 7 - true @@ -553,7 +551,6 @@ 2pt - true @@ -774,7 +771,6 @@ 1pt - true @@ -885,40 +881,40 @@ - - true - - - - - = Fields!Cargo.Value - - - + + true + + + + + =Fields!Cargo.Value + + + + + + + Cargo + + =iif(Fields!TipoMovto.Value = "1", true, false) + + + 1pt + 1pt + 1pt + 1pt - - - - =iif(Fields!TipoMovto.Value ="0",False,True) - - - - 1pt - 1pt - 1pt - 1pt - es-MX - - + @@ -929,7 +925,7 @@ - = Fields!Abono.Value + =Fields!Abono.Value + true @@ -996,7 +993,6 @@ 1pt - true @@ -1071,7 +1067,7 @@ - + true true @@ -1091,7 +1087,7 @@ - Textbox113 + Textbox6 @@ -1211,7 +1207,6 @@ 1pt - true @@ -1546,7 +1541,6 @@ 3 - true @@ -2052,6 +2046,7 @@ ReportParameter1 + REM Reset Page Number: Shared offset As Integer diff --git a/Empresas/158/Formatos/Factura.rdlc b/Empresas/158/Formatos/Factura.rdlc new file mode 100644 index 000000000..12ee27d56 --- /dev/null +++ b/Empresas/158/Formatos/Factura.rdlc @@ -0,0 +1,6015 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 06ae5329-8ff5-42b5-b7f4-6d68e5186420 + + + + System.Data.DataSet + /* Local Connection */ + + 3fde81d4-b9ca-4175-9160-5293ca8b9aa9 + + + + System.Data.DataSet + /* Local Connection */ + + c220a38d-e45b-4e04-917e-7dfd9cc3345f + + + + System.Data.DataSet + /* Local Connection */ + + c220a38d-e45b-4e04-917e-7dfd9cc3345f + + + + System.Data.DataSet + /* Local Connection */ + + c220a38d-e45b-4e04-917e-7dfd9cc3345f + + + + System.Data.DataSet + /* Local Connection */ + + c220a38d-e45b-4e04-917e-7dfd9cc3345f + + + + + + DsOC + /* Local Query */ + + + + ImporteIEPS + System.Decimal + + + ImporteIVA + System.Decimal + + + PorcentajeIEPS + System.Decimal + + + PorcentajeIVA + System.Decimal + + + Cantidad + System.Double + + + CveUnidadMedida + System.Int64 + + + Abreviatura + System.String + + + PS + System.String + + + CveClasificacion + System.Int64 + + + Clasificacion + System.String + + + CveActivoFijo + System.Int64 + + + Codigo + System.String + + + TipoDato + System.Int64 + + + CodigoAF + System.String + + + CodigoPS + System.String + + + UnidadMedida + System.String + + + Importe + System.Decimal + + + Total + System.Decimal + + + UM + System.String + + + Obs + System.String + + + SubProyecto + System.String + + + PU + System.String + + + Descuento + System.String + + + Marca + System.String + + + SATClaveProdServ + System.String + + + + DsOC + C:\Users\Orlando Bojorquez\Documents\Visual Studio 2013\WebSites\WebSite1\App_Code\DsOC.xsd + DtOCDetalle + + + + + + + + DataSet2 + /* Local Query */ + + + + ImpuestoLocal + System.String + + + Importe + System.Double + + + Nombre + System.String + + + ImporteT + System.String + + + Orden + System.String + + + + DataSet2 + C:\Users\jesus\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DataSet2.xsd + DataTable1 + + + + + + + + DsFirmas + /* Local Query */ + + + + Titulo + System.String + + + Nombre + System.String + + + Puesto + System.String + + + Lado + System.String + + + + DsFirmas + C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd + DataTable1 + + + + + + + + DsDesgloseImpuestos + /* Local Query */ + + + + Impuesto + System.String + + + tasa + System.String + + + Importe + System.String + + + Orden + System.String + + + + DsDesgloseImpuestos + C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd + DataTable1 + + + + + + + + DsDesgloseImpuestos + /* Local Query */ + + + + SerieFolio + System.String + + + Fecha + System.String + + + Importe + System.String + + + FolioFiscal + System.String + + + + DsDocumentosRelacionados + C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd + DataTable1 + + + + + + + + DsDesgloseImpuestos + /* Local Query */ + + + + SerieFolio + System.String + + + Fecha + System.String + + + SubTotal + System.String + + + Importe + System.String + + + Moneda + System.String + + + + DsNCVinculadas + C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd + DataTable1 + + + + + + + + + + + + + + true + true + + + + + Serie: + + + + + + + + =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 +
    @@ -32,7 +41,7 @@ PDF --%>
  • - Expediente de personal + Expediente de personal
  • Gafete @@ -61,7 +70,7 @@
  • - PDF consumo + PDF consumo
  • @@ -80,7 +89,7 @@ -
  • +
  • @@ -102,7 +111,7 @@
    - +
    + <%----%> @@ -1938,7 +1960,7 @@ Asistencia - + @@ -1962,7 +1984,7 @@ Motivo H. Extras - + @@ -1983,7 +2005,7 @@ -
    +

    @@ -2150,8 +2172,14 @@
    - - + + @@ -2304,7 +2332,7 @@
    @@ -175,7 +184,7 @@
    -
    +
    @@ -276,7 +285,7 @@
    -
    -
    - + <%-- @@ -580,7 +594,8 @@
    - Proyecto: + Proyecto: <%-- --%> @@ -588,7 +603,8 @@
    - SubProyecto: + SubProyecto: @@ -640,9 +656,9 @@
    -
    +
    - + @@ -659,9 +675,9 @@
    -
    +
    - + @@ -678,9 +694,9 @@
    -
    +
    - + @@ -751,7 +767,8 @@
    - + @@ -769,7 +786,7 @@
    -
    @@ -889,7 +906,7 @@ - + @@ -905,7 +922,7 @@
    -
    +
    Cuentas Bancarias @@ -1042,7 +1059,7 @@ - <%----%> @@ -1132,7 +1149,7 @@   - + @@ -1175,7 +1192,7 @@ CssClass="btn btn-circle btn-sm red" Text="" /> - + @@ -1192,7 +1209,7 @@
    -
    +
    Pagos Realizados @@ -1200,7 +1217,7 @@
    - + Factura @@ -1284,7 +1301,7 @@
    -
    +
    @@ -1362,7 +1379,7 @@
    -
    ComandosComandos
    -
    +
    @@ -1874,17 +1896,17 @@ --%>
    - + - + - @@ -1896,7 +1918,7 @@ - +
    - -
    + + @@ -2640,7 +2668,7 @@
    -
    @@ -2653,8 +2681,14 @@ - - + + @@ -2857,10 +2891,11 @@
    -
    Fecha Inicio:
    +
    Fecha Inicio:
    -
    - +
    + @@ -2874,10 +2909,11 @@
    -
    Fecha Fin:
    +
    Fecha Fin:
    -
    - +
    + @@ -2908,7 +2944,7 @@
    -
    -