diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 6a8e7f9bd..704255414 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -123,20 +123,48 @@ + + +
+ + <%----%> +
+ +
-
+
-
+
+ +
+ T.C.: + + + + +
+ +
+ +
+
+ Dolares + + <%----%> + +
+ +
@@ -1781,5 +1809,10 @@ return false; } + function CambiaTCPagoOC() { + + $("#LnkActualizaTCOC").click(); + } + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fa4a59b34..f24961ea0 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -297,6 +297,17 @@ Partial Class Bancos_IE End Set End Property + + Private Property CveMonedaOriginal As Integer + Get + Return ViewState("CveMonedaOriginal").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveMonedaOriginal") = value + End Set + End Property + + Private Property CveOCSolicitudAnticipo As Integer Get @@ -504,6 +515,22 @@ Partial Class Bancos_IE End Set End Property + + Private Property ImporteOriginalDolaras As Decimal + Get + If ViewState("ImporteOriginalDolaras") Is Nothing Then + Return 0 + Else + Return ViewState("ImporteOriginalDolaras").ToString().ToDecimal() + End If + + End Get + Set(value As Decimal) + ViewState("ImporteOriginalDolaras") = value + End Set + End Property + + #Region "CANCELACIÓN COMPLEMENTO MODAL V2" Property CveComplementoPagoCancelar As Integer @@ -2471,6 +2498,9 @@ Partial Class Bancos_IE If CveOCSolicitudAnticipo > 0 Then + + + Dim ObjOC As New ClsOC If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal @@ -2479,10 +2509,18 @@ Partial Class Bancos_IE End If ObjOC.Dispose() - If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal + + ' + If ChkPagarPesos.Checked Then + ImporteComparacion = ImporteOriginalDolaras + End If + + If ImporteComparacion > SaldoOCAnticipo Then EsValido = False Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) End If + End If Return EsValido @@ -5557,11 +5595,23 @@ Partial Class Bancos_IE Else TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + ImporteOriginalDolaras = DrOC("ImporteAnticipo").ToString.ToDecimal End If DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString + CveMoneda = DrOC("CveMoneda").ToString.ToEntero CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) + + CveMonedaOriginal = DrOC("CveMoneda").ToString.ToEntero + + + If CveMonedaOriginal > 1 Then + MostrarPagoEnPesos(True) + End If + + UpCuentaDeposito.Update() If DrOC("CveProveedor").ToString.ToEntero > 0 Then HdnCveProveedor.Value = DrOC("CveProveedor").ToString @@ -5644,6 +5694,69 @@ Partial Class Bancos_IE End If End Sub + + + Private Sub MostrarPagoEnPesos(Mostrar As Boolean) + + LbTipoMoneda.Visible = Mostrar + LbTipoMoneda.Text = If(Mostrar, "Pago en doalres", "") + DVPAgoEnPesos.Visible = Mostrar + ChkPagarPesos.Visible = Mostrar + + TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + + End Sub + + + Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) + + If ChkPagarPesos.Checked Then + DivTC.Visible = True + DivTC2.Visible = True + ' DivDolaresDolares.Visible = False + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(1) + 'TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") + 'TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporte.Text = (TxtImporte.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + CveMoneda = 1 + Else + DivTC.Visible = False + DivTC2.Visible = False + CveMoneda = CveMonedaOriginal + 'DivDolaresDolares.Visible = True + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(CveMonedaOriginal) + 'TxtFechaDocumento.Attributes.Remove("onchange") + TxtImporte.Text = ImporteOriginalDolaras.ToString("###,###,###.00") + End If + + CambiaTCPagoOC() + + UpDatos.Update() + + ' RegistraScript("CambiaPesosDolares();") + End Sub + + + Public Sub CambiaTCPagoOC() + + If ChkPagarPesos.Checked Then + TxtImporte.Text = (TxtImporteDolares.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + Else + TxtImporte.Text = TxtImporteDolares.Text + End If + + UpDatos.Update() + End Sub + + Protected Sub LnkActualizaTCOC_Click(sender As Object, e As EventArgs) + CambiaTCPagoOC() + End Sub + + Private Function GuardaSolicitudAnticipoOC(ByRef ObjOC As ClsOC) As String Dim ObjOI As New ClsOIEventos Dim CveEvento As Integer = 0 @@ -6724,4 +6837,5 @@ Partial Class Bancos_IE RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString Calendario.EndDate = DateTime.Now End Sub + End Class \ No newline at end of file