-- activar comisiones para la E140

-- que se pueda utiliza otros ingresos, para pagos no solo de bancos
This commit is contained in:
2023-06-12 10:41:36 -07:00
parent bf4a0e3e31
commit 92c97edd81
2 changed files with 44 additions and 22 deletions

View File

@@ -76,6 +76,7 @@
<asp:CheckBox Text="Pagar con pesos" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarPesos" OnCheckedChanged="ChkPagarPesos_CheckedChanged" runat="server" ClientIDMode="Static" />
<asp:CheckBox Text="Pagar con dolares" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarDolares" OnCheckedChanged="ChkPagarDolares_CheckedChanged" runat="server" ClientIDMode="Static" />
</div>
</div>
<asp:Panel ID="PanelBancos" runat="server" Visible="true">
@@ -138,16 +139,7 @@
<asp:TextBox ID="TxtPagueseA" runat="server" MaxLength="70" Width="100%"></asp:TextBox>&nbsp;<asp:Image ID="ImgBuscaProv" runat="server" Visible="false" ImageUrl="/Imagenes/buscar.gif" onclick="_loadJavaScript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact',800,600,'popBuscarProv');" Width="16px" Style="cursor: pointer;" alt="Buscar" />
</div>
</div>
<div class="row" runat="server" id="rowComisiones" visible="false">
<label class="col-xs-4" runat="server" id="lblpagocomisiones">Comisiones:</label>
<div class="col-xs-8">
<asp:DropDownList ID="DdlOtrosPagos" CssClass="form-control input-sm select2me" runat="server" AutoPostBack="true" Width="100%">
<asp:ListItem Value="-1">-</asp:ListItem>
<asp:ListItem Value="2">Otros Ingresos</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server">
<ContentTemplate>
@@ -510,8 +502,11 @@
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Importes</span>
</div>
<div class="col-xs-6" runat="server" id="rowComisiones" visible="false">
<asp:CheckBox ID="ChkComisiones" runat="server" Text="Comisiones" TextAlign="Right" AutoPostBack="true" />
</div>
<div class="actions">
<div class="btn-group">
</div>

View File

@@ -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.<br/>")
If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa)
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
StrMsg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
Else
If IdPoliza > 0 Then
StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", 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