From 6e4e457375980ebcde9498928776a844733049de Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Fri, 10 Mar 2023 09:09:21 -0700 Subject: [PATCH 1/4] RDLCS checques 141, Contabiliza Fluctuaciones cambirias --- App_Code/ClsBancos.vb | 1 + App_Code/ClsCompras.vb | 2 + App_Code/ClsPaginas.vb | 11 ++- Bancos/FluctuacionCambiaria.aspx.vb | 16 ++++- .../RepMovimientosAuxiliaresCatalogo.aspx.vb | 2 + Empresas/141/Formatos/CHQ-7451.rdlc | 68 +------------------ Empresas/141/Formatos/CHQ-7452.rdlc | 68 +------------------ Inventarios/EntradasSalidas.aspx.vb | 22 +++++- Inventarios/ResguardoMaterial.aspx.vb | 5 +- 9 files changed, 59 insertions(+), 136 deletions(-) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index eda93b9f0..6b6d7482e 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -3425,6 +3425,7 @@ Public Class ClsBancos End With Try + SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 4073459b0..64dd189b6 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -262,6 +262,8 @@ Public Class ClsCompras Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then Alert(String.Format("Ya existe una compra con el mismo Folio: {0}-{1}.", Serie, Folio), TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("UK_Comp_Compras_CveFactura") Then + Alert(String.Format("La factura {0}-{1} ya se encuentra registrada.", Serie, Folio), TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al Guardar la Compra.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 9569d71cc..42a27f788 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3533,7 +3533,16 @@ Public Class ClsPaginas If ObjPersonal.GetPersonal(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPersonal.DtResultados ObjPersonal.Dispose() End If - GlobalDTRHPersonal = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + + + Dim Str As New StringBuilder + + If CvePersonal <> -1 Then Str.Append($" CvePersonal = {CvePersonal}") + + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + 'GlobalDTRHPersonal = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + GlobalDTRHPersonal = Dv.ToTable + End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTRHPersonal-{CveEmpresa}" diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index c6ec2a338..75f553751 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -825,7 +825,21 @@ Partial Class Bancos_FluctuacionCambiaria End If Next - Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa) + Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa) + + + If Not ErrorRegistrar Then + + If Conta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If Conta.ValorPolizaDescuadre > 0 Then + ErrorRegistrar = True + GuardaLogAD($"Banc/FluctuaA | Error:{Conta.MensajePolizaDescuadre} Diferencia:{Conta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia) + End If + + End If If Not ErrorRegistrar Then Conta.Commit() diff --git a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb index eaa7625c1..5b454feba 100644 --- a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb +++ b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb @@ -478,6 +478,7 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo End Sub Private Sub ImprimirReporte(Optional Formato As String = "PDF") + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") @@ -487,6 +488,7 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo params.Add(New ReportParameter("CveMoneda", DdlMoneda.SelectedValue)) params.Add(New ReportParameter("Cuenta", Cuenta)) ImprimirPDF("Empresas/Grales/Formatos/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato) + End Sub Protected Sub DdlTipoCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoCuentas.SelectedIndexChanged If DdlTipoCuentas.SelectedValue.ToEntero = -2 Then diff --git a/Empresas/141/Formatos/CHQ-7451.rdlc b/Empresas/141/Formatos/CHQ-7451.rdlc index e264827c0..3ae1e51bf 100644 --- a/Empresas/141/Formatos/CHQ-7451.rdlc +++ b/Empresas/141/Formatos/CHQ-7451.rdlc @@ -842,70 +842,6 @@ 2pt - - true - true - - - - - JOC - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - FLR - - - - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -928,7 +864,7 @@ 14.00924cm 0.6cm 2.5cm - 3 + 1 @@ -961,7 +897,7 @@ 18.00832cm 0.6cm 2.36771cm - 4 + 2 diff --git a/Empresas/141/Formatos/CHQ-7452.rdlc b/Empresas/141/Formatos/CHQ-7452.rdlc index 6ca51520a..9da2a72e4 100644 --- a/Empresas/141/Formatos/CHQ-7452.rdlc +++ b/Empresas/141/Formatos/CHQ-7452.rdlc @@ -842,70 +842,6 @@ 2pt - - true - true - - - - - JOC - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - FLR - - - - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -928,7 +864,7 @@ 14.00924cm 0.6cm 2.5cm - 3 + 1 @@ -961,7 +897,7 @@ 18.00832cm 0.6cm 2.36771cm - 4 + 2 diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 9865b593f..73704b612 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1890,6 +1890,9 @@ Partial Class Inventarios_EntradasSalidas Dim CveConceptoContable As Integer = 260 Dim CveClasificacion As Integer = -1 Select Case DdlConcepto.SelectedValue.ToEntero + Case 2 + CveConceptoContable = 78 + EsContabilizable = True Case 28, 31 CveConceptoContable = 51 @@ -1919,6 +1922,9 @@ Partial Class Inventarios_EntradasSalidas End Select + + '2-78 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservaciones.Text.Trim, 68, TxtObservaciones.Text.Trim, TxtFecha.Text.ToDate, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=tValorInventario, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then ErrorMovInv = True Else @@ -1941,6 +1947,19 @@ Partial Class Inventarios_EntradasSalidas ErrorMovInv = True End If + If Not ErrorMovInv Then + + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + ErrorMovInv = True + GuardaLogAD($"Inv/ES | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia) + End If + Else + Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia) + End If + End If + '------------------------------------------------ If Not ErrorMovInv Then 'DEVENGAR @@ -2076,7 +2095,8 @@ Partial Class Inventarios_EntradasSalidas - If Not ErrorAC And Not ErrorMovInv Then + If Not ErrorAC And Not ErrorMovInv Then + Dim Msg As New StringBuilder Msg.AppendFormat("
El Movimiento se registro con el Folio: {0}", ObjInventario.Folio, CveMovimiento) Msg.AppendFormat("

Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 4185a3525..43311a43a 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -151,7 +151,10 @@ Partial Class Inventarios_ResguardoMaterial Private Sub OcultarControles(CvePersonal As Integer) DdlPersonal.SelectedValue = CvePersonal.ToString() - DdlPersonal.SelectedText = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal).FiltroPrimeroValor("NombreCompleto") + DdlPersonal.SelectedText = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal).FiltroPrimeroValor("NombreCompleto", $" CvePersonal = {CvePersonal}") + + + DdlPersonal.Enabled = False DVTipo.Visible = False End Sub From d2bd3cc3d72d60a1708ea3f4995f314682aad38f Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 10 Mar 2023 18:05:42 -0700 Subject: [PATCH 2/4] =?UTF-8?q?--=20correcci=C3=B3n=20cuand=20es=20estatus?= =?UTF-8?q?=2023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/RepCancelacionesPorRespuesta.aspx.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index f324421c8..91987c8cc 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -600,10 +600,10 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas // - if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) - { - e.Row.FCLinkButton("LnkValidarRefac").Visible = false; - } + //if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) + //{ + // e.Row.FCLinkButton("LnkValidarRefac").Visible = false; + //} From f1499561fd6ee08d65f32d51e400a7319adb92a1 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 10 Mar 2023 19:38:23 -0700 Subject: [PATCH 3/4] --parametro de moneda en elIE --- Contabilidad/RegPrePolizaS.aspx.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 36dbcce18..25f8b9975 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1042,8 +1042,11 @@ Partial Class ContabilidadC_RegPrePolizaS If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero) + Dim tCveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuenta.SelectedValue.ToEntero).FiltroPrimeroValor("CveMoneda").ToEntero + + CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, tFolio, - gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, CveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "", + gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, tCveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "", False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" From 4694a0f0d37e605919b3783aaf727d0621d4c961 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 10 Mar 2023 19:38:41 -0700 Subject: [PATCH 4/4] -- TC en pago por ixc --- App_Code/ClsPaginas.vb | 32 ++++++++++++++++++++--- Ventas/ClientesAbonar.aspx.vb | 48 ++++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 9569d71cc..a7575fbdf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8072,6 +8072,7 @@ Public Class ClsPaginas Dim tFechaUltimaFluctuacion As Date Dim tImportePago, tImporteVenta As Decimal Dim CveConceptoContableComplementaria As Integer = 207 + Dim Contabilizable As Boolean = True If PorcentajePago > 1 Then PorcentajePago = 1 Pago.CveConceptoPago = If(Pago.CveConceptoPago = -1, 2, Pago.CveConceptoPago) 'si viene en parametro lo toma com primera opcion, sino el 2 If VentaActual.CveMoneda <> 1 Then @@ -8088,7 +8089,8 @@ Public Class ClsPaginas TCValuacion = UltimaFluctuacion.TCFluctuacion End If If VentaActual.Fecha < tFechaUltimaFluctuacion Then TCValuacionVenta = TCValuacion - If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion + 'si tiene fecha de documento, debe de evaluarse para su tc. y no la fecha de la prepóliza + If IIf(Pago.FechaDocumentoRelacionado > MinFecha, Pago.FechaDocumentoRelacionado, Pago.Fecha).ToString.ToDate < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion End If End If If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares @@ -8102,11 +8104,34 @@ Public Class ClsPaginas tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL End If If VentaActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoVenta + 'CONDICION ESPECIAL, PARA ANTICIPOS ESPECIALES, QUE SE EMITE LA VENTA, PERO NO SE CONTABILIZA, EL TRATAMIENTO SE LLEVA POR EL ANTICIPO + If VentaActual.TipoDocto = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then + Pago.AplicaTraslado = False + Dim IdCtaContable As Integer = VentaActual.IdCtaContableClienteAnticipo + If VentaActual.CveMoneda = 2 Then IdCtaContable = VentaActual.IdCtaContableClienteAnticipoExtranjera + Contabilizable = False + + If Pago.CveMonedaPago > 1 Then + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoComplementaria, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + Else + 'Agregamos Nacional + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipo, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True + End If + + If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + ErrorMovtos = True + End If + + End If + 'movimiento de pago cliente - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True 'movimiento de pago cliente Complementaria If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True End If If Pago.AplicaTraslado Then 'si tiene iva y su proporcion @@ -8272,6 +8297,7 @@ Public Class ClsPaginas Public Property CveVenta As Integer = -1 Public Property CveCliente As Integer Public Property CveMoneda As Integer + Public Property TipoDocto As String Public Property Fecha As Date Public Property SerieFolio As String = "" Public Property ClienteNombre As String = "" diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 38fb457dc..031d14147 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -36,6 +36,14 @@ Partial Class Ventas_ClientesAbonar ViewState("CveMonedaFiltro") = value End Set End Property + Private Property FechaIngreso As Date + Get + Return ViewState("FechaIngreso").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaIngreso") = value + End Set + End Property Private Property CveSubProyecto As Integer Get Return ViewState("CveSubProyecto").ToString.ToEntero @@ -855,7 +863,7 @@ Partial Class Ventas_ClientesAbonar End If CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveProveedorIntermediario:=CveProvIntermediario) Else - If RblTipoPago.SelectedValue.Contiene("3") Then + If RblTipoPago.SelectedValue.Contiene("3") Then 'ixc CveIE = DdlIngreso.SelectedValue.ToEntero If CveMonedaPago = 2 And Not ChkPagarPesos.Checked Then CveMoneda = 2 If ChkPagarDolares.Checked Then CveMoneda = 2 @@ -957,6 +965,7 @@ Partial Class Ventas_ClientesAbonar VentaActual.Fecha = gvr.DataKey("Fecha").ToDate VentaActual.CveCliente = gvr.DataKey("CveCliente").ToEntero VentaActual.CveMoneda = gvr.DataKey("CveMoneda").ToEntero + VentaActual.TipoDocto = gvr.DataKey("TipoDocto") VentaActual.SerieFolio = gvr.DataKey("SerieFolio") VentaActual.ClienteNombre = NombreComercial VentaActual.TC = gvr.DataKey("TipoCambio").ToDecimal @@ -981,34 +990,37 @@ Partial Class Ventas_ClientesAbonar Pago.ImportePagoVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal Pago.Referencia = TxtFolio.Text - If RblTipoPago.SelectedValue = "3" Then Pago.TipoPago = "I" + If RblTipoPago.SelectedValue = "3" Then + Pago.TipoPago = "I" + Pago.FechaDocumentoRelacionado = FechaIngreso + End If 'Tipos de cambio If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos Pago.TCPago = TxtTC.Text.ToDecimal - ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES Pago.TCPago = IIf(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal) - ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES Pago.TCPago = TxtTCDolares.Text.ToDecimal End If tipoCambioPago = Pago.TCPago If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal - If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then - EsAnticipoEspecial = True - Pago.AplicaTraslado = False - Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente) - If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera) + 'If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then + ' EsAnticipoEspecial = True + ' Pago.AplicaTraslado = False + ' Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente) + ' If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera) - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then - MsgError = "No se pudo insertar la póliza" - End If - Else - MsgError = "No se pudo insertar la póliza" - End If - End If + ' If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' Else + ' MsgError = "No se pudo insertar la póliza" + ' End If + 'End If If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola Dim FluctuacionAnticipo As Decimal = 0 @@ -2714,6 +2726,8 @@ Partial Class Ventas_ClientesAbonar Dim Deudores As New ClsMovimientos If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then HdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.SelectedValue)) + TxtTCDolares.Text = Deudores.DtResultados.FiltroPrimeroValor("TipoCambio", String.Format("CveIE = {0}", DdlIngreso.SelectedValue)) + FechaIngreso = Deudores.DtResultados.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE = {0}", DdlIngreso.SelectedValue)) End If Deudores.Dispose() End If