From 6306be388747a186a15c3f3a224e700a408185e9 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 6 Oct 2022 19:31:37 -0700 Subject: [PATCH 1/9] --COMPUESTO AUTOPOSTBACK --- Inventarios/PopUpExistenciasAlmacen.aspx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index e091a6eb0..53a6de054 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -80,7 +80,6 @@ - @@ -94,11 +93,10 @@ Compuesto: - + - From 6ddd2dee6d3c58218710871a4b61fd78ac50be62 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 10 Oct 2022 14:55:29 -0700 Subject: [PATCH 2/9] -- pago con ixc --- App_Code/ClsPaginas.vb | 27 ++++--- Ventas/Ventas.aspx.vb | 156 ++++++++--------------------------------- 2 files changed, 48 insertions(+), 135 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 65ef143b6..0432f737a 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10138,19 +10138,30 @@ Public Class ClsPaginas If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero If Pago.CveMonedaPago > 1 AndAlso ObjConta.GetRetCuenta(207, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + If UsuarioActual.CveEmpresa.Contiene(119) Then + If Pago.FechaDocumentoRelacionado.Year <= 2017 Then + Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL()) + If ObjCliente.GetClientes(VentaActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) AndAlso ObjCliente.DtResultados.Rows.Count > 0 Then + + If Pago.CveMonedaPago > 1 Then VentaActual.IdCtaContableClienteAnticipoExtranjera = ObjCliente.IdCtaContMonedaExtranjera Else VentaActual.IdCtaContableClienteAnticipo = ObjCliente.IdCtaContClientes + + End If + End If + End If + End If If Pago.CveMonedaPago > 1 Then - 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 66, Pago.Referencia, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipo, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True - ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True - Else - 'Agregamos Nacional - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 66, Pago.Referencia, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + Else + 'Agregamos Nacional + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True - End If + End If End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 96797b397..b5ce8b7a7 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8974,15 +8974,15 @@ Partial Class Ventas EsValido = True End If - If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then - CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo) - 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA - If PU <= CostoMayor Then - EsValidoMayor = True - End If - Else - EsValidoMayor = True - End If + 'If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then + ' CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo) + ' 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA + ' If PU <= CostoMayor Then + ' EsValidoMayor = True + ' End If + 'Else + ' EsValidoMayor = True + 'End If 'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR If Not EsValido Or PU = 0 Then @@ -8998,24 +8998,24 @@ Partial Class Ventas End If 'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) - If Not EsValido Then + 'If Not EsValido Then - MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado
", dr("PS").ToString()) - If TienePermisoImportes Then - MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) - MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) - MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) - End If - End If + ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado
", dr("PS").ToString()) + ' If TienePermisoImportes Then + ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) + ' MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) + ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) + ' End If + 'End If - If Not EsValidoMayor Then - MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado
", dr("PS").ToString()) - If TienePermisoImportes Then - MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) - MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor) - MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) - End If - End If + 'If Not EsValidoMayor Then + ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado
", dr("PS").ToString()) + ' If TienePermisoImportes Then + ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) + ' MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor) + ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) + ' End If + 'End If ' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then @@ -15764,47 +15764,8 @@ Partial Class Ventas For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then - - Dim FechaUltimaFluctuacion As Date = MinFecha - Dim TipoCambioFluctuacion As Decimal = 1 - Dim tFecha As Date = Now - - Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - - - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If UltimaFluctuacion.FechaFluctuacion <= tFecha Then - FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion - TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion - End If - End If - - - If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS - tipoCambioPago = 1 - tipoCambioVenta = 1 - tipoCambioVentaValuacion = 1 - PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal - ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS - tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal - tipoCambioVenta = TxtTipoCambio.Text.ToDecimal - tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) - PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal - ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES - tipoCambioPago = gvr.DataKey("TipoCambio").ToString().ToDecimal - tipoCambioVenta = TxtTipoCambio.Text.ToDecimal - tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) - PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal - ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES - tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal - tipoCambioVenta = 1 - tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) - PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal - End If - Dim importeMovimiento As Decimal = 0 Dim importeMN As Decimal = 0 - Dim TC As Decimal Dim IdCtaContable As Integer Dim TipoMovimiento As Boolean = True Dim Concepto As String = VentaActual.SerieFolio @@ -15874,81 +15835,22 @@ Partial Class Ventas If gvr.DataKey("CveIE").ToEntero() > 0 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - IdCtaContable = IdCtaContClientes If importeMovimiento <> 0 Then Dim Pago As New VentaPago + Pago.ImportePagoVenta = importeMovimiento Pago.ImportePago = importeMovimiento Pago.CveIE = CveIEAnticipo Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero() - Pago.TipoPago = "A" + Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal + Pago.TipoPago = "I" + Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero() - Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1" Pago.Referencia = gvr.DataKey("Folio") ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) - ' Agregamos el 2 - If tipoCambioPago = 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - Else 'Cuando son dolares - If importeMovimiento <> 0 Then - If IdCtaContComplementaria > 0 Or 0 > 0 Then - 'Agregamos la Complementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - Else - 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - End If - End If - End If - - importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal) - importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) - - - 'Agregamos el 92 - importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) - importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) - IdCtaContable = IdCtaContAnticipos - - If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If Not tipoCambioPago = 1 Then - IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos - Else - IdCtaContable = ObjCliente.IdCtaContAnticipos - End If - End If - End If - - If UsuarioActual.CveEmpresa.Contiene(119) Then - If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If Not tipoCambioPago = 1 Then - IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera - Else - IdCtaContable = ObjCliente.IdCtaContClientes - End If - End If - End If - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - End If End If End Select From a8e34641a456d55d2aad8bb3a278a531b4f9c2cb Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 10 Oct 2022 14:56:00 -0700 Subject: [PATCH 3/9] --espacio de filtro --- Inventarios/RepEntradasSalidas.aspx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index fa4219179..2624a9801 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -185,14 +185,12 @@ - -
- +
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
-
+