From bf4a0e3e31d7e40b81a1b36ef172342f8423c2b1 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Jun 2023 12:36:37 -0700 Subject: [PATCH 1/7] -- distinct cveusuaro, en combo de usuario a clonar --- Sistemas/UsuarioDetalle.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 663ea64a8..ce4094a74 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -3769,7 +3769,7 @@ Partial Class Sistemas_UsuarioDetalle #Region " CLONAR USUARIO " Private Sub InicializaClonarUsuario() - DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) + DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveUsuario", "Usuario"}) DdlUsuarioClonar.DataBind() DdlUsuarioClonar.Items.Insert(0, New ListItem("Seleccione", "-1")) From 92c97edd81ba7a543ba53d043896339ca13f28a2 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 12 Jun 2023 10:41:36 -0700 Subject: [PATCH 2/7] -- activar comisiones para la E140 -- que se pueda utiliza otros ingresos, para pagos no solo de bancos --- Bancos/PopIECompras.aspx | 17 +++++-------- Bancos/PopIECompras.aspx.vb | 49 ++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/Bancos/PopIECompras.aspx b/Bancos/PopIECompras.aspx index 8f4cf2a6a..3a5a0685d 100644 --- a/Bancos/PopIECompras.aspx +++ b/Bancos/PopIECompras.aspx @@ -76,6 +76,7 @@ + @@ -138,16 +139,7 @@   - -
- -
- - - - Otros Ingresos - -
-
+ @@ -510,8 +502,11 @@
Importes - +
+
+ +
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 835763b90..9749730e3 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -430,7 +430,7 @@ Partial Class Bancos_PopIECompras CargaCompra(CveCompra) End If - If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 72, 80) Then + If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 72, 80, 122, 140, 141, 145) Then rowComisiones.Visible = True End If @@ -1032,14 +1032,21 @@ Partial Class Bancos_PopIECompras End If End Sub - Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged - Dim EsOtrosEgresos As Boolean = (DdlOtrosPagos.SelectedValue.Equals("2")) + 'Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged + ' Dim EsOtrosEgresos As Boolean = (DdlOtrosPagos.SelectedValue.Equals("2")) + ' rowComision.Visible = EsOtrosEgresos + ' rowTotal.Visible = EsOtrosEgresos + ' TxtComision.Text = "0.00" + ' TxtTotal.Text = TxtImporte.Text + 'End Sub + + Private Sub ChkComisiones_CheckedChanged(sender As Object, e As EventArgs) Handles ChkComisiones.CheckedChanged + Dim EsOtrosEgresos As Boolean = ChkComisiones.Checked rowComision.Visible = EsOtrosEgresos rowTotal.Visible = EsOtrosEgresos TxtComision.Text = "0.00" - TxtTotal.Text = TxtImporte.Text + TxtTotal.Text = TxtImporte.Text End Sub - Protected Sub DdlFuncionarioEmpleado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFuncionarioEmpleado.SelectedIndexChanged ArrIEFuncionariosEmpleados = New ArrayList() ArrIE = New ArrayList() @@ -1399,7 +1406,12 @@ Partial Class Bancos_PopIECompras Dim Pago As New CompraPago Pago.Fecha = TxtFechaDocumento.Text.ToDate Pago.CveMonedaPago = CveMoneda - ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL + If ChkComisiones.Checked Then + ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL - TxtComision.Text.ToDecimal + Else + ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL + End If + 'Tipos de cambio If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal @@ -1416,7 +1428,8 @@ Partial Class Bancos_PopIECompras Select Case RBLContado.SelectedValue Case "1" ' Bancos - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, 15.55, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1")) + Dim ImporteBancos As Decimal = TxtImporte.Text.ToDecimal + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImporteBancos, CveMoneda, 11, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1")) If Not CveIE > 0 Then MsgError = "Ocurrio un Error al registrarse el movimiento bancario." End If @@ -1433,7 +1446,7 @@ Partial Class Bancos_PopIECompras Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" Dim Referencia As String = TxtFolio.Text.Trim - Dim tImporteMN As Decimal = ImportePagado + Dim tImporteMN As Decimal = ImporteBancos Pago.ImportePago = tImporteMN If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then @@ -1546,7 +1559,7 @@ Partial Class Bancos_PopIECompras Alert("Debe especificar el Acreedor.", TipoMensaje.MsgAdvertencia) Exit Sub End If - + Dim Aplicopagocomision As Boolean = False For Each rw As GridViewRow In GvAcreedores.Rows If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then Dim TCC As Decimal = 1 @@ -1559,6 +1572,14 @@ Partial Class Bancos_PopIECompras Pago.TCPago = If(Pago.CveMonedaPago <> 1, TxtTipoCambio.Text.ToDecimal, 1) Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero Pago.TipoPago = "Egsc" + + If TxtComision.Text.ToDecimal <> 0 AndAlso Aplicopagocomision = False Then + Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal + Aplicopagocomision = True 'solo debe de aplicarse una vez, de manera general + Else + Pago.OtroGastoIngreso = 0 + End If + If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" Else @@ -1622,7 +1643,7 @@ Partial Class Bancos_PopIECompras StrMsg.Append("El Documento se guardó correctamente.
") If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa) If UsuarioActual.Empresa.TipoContabilidad = 1 Then - StrMsg.AppendFormat("

Ver Póliza", CvePrePoliza) + StrMsg.AppendFormat("
Ver Póliza", CvePrePoliza) Else If IdPoliza > 0 Then StrMsg.AppendFormat("

Ver Póliza", IdPoliza) @@ -1818,7 +1839,13 @@ Partial Class Bancos_PopIECompras Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs) Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace("MXN", "").Replace(",", "").ToDecimal - Dim ImportePagado As Decimal = TxtImporte.Text.ToDecimal + Dim ImportePagado As Decimal = 0 + + If ChkComisiones.Checked Then + ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL - TxtComision.Text.ToDecimal + Else + ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL + End If If ChkPagarPesos.Checked Then From 117e6adf23f02eab6feb60bdda25256f06df7d4b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 12 Jun 2023 15:34:11 -0700 Subject: [PATCH 3/7] -- Aplicar Saldo a Factura --- Bancos/Creditos.aspx | 12 +++- Bancos/Creditos.aspx.vb | 142 +++++++++++++++++++++++++++++----------- 2 files changed, 114 insertions(+), 40 deletions(-) diff --git a/Bancos/Creditos.aspx b/Bancos/Creditos.aspx index 9811be61a..1b6d54886 100644 --- a/Bancos/Creditos.aspx +++ b/Bancos/Creditos.aspx @@ -1297,13 +1297,23 @@
Acreedor:
- +
+
+
Compra:
+
+ + + + + +
+