From d75b5adb5c0d9acee3b32fd1955ed320fa8ef8c5 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 Dec 2021 09:37:29 -0700 Subject: [PATCH 1/2] IE Pago de anticipos de OC en dolares con pesos --- Bancos/IE.aspx | 37 ++++++++++++++- Bancos/IE.aspx.vb | 116 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 150 insertions(+), 3 deletions(-) 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 From 69d9226a68a12bc2d558bf464bbd11b9ee11126e Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 Dec 2021 10:22:57 -0700 Subject: [PATCH 2/2] Carta porte QR y Logo en https --- Compras/PopUpVerFactura.aspx.vb | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 167e85864..00a02d55e 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -846,15 +846,17 @@ Partial Class PopUpVerFactura Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - 'If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) + 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) - 'Else - ' params.Add(New ReportParameter("LogoPath", "")) - 'End If + Else + params.Add(New ReportParameter("LogoPath", "")) + End If params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) @@ -1174,15 +1176,25 @@ Partial Class PopUpVerFactura CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) End If - ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, SerieFolio) + + ImagenCBB = New System.IO.FileInfo(RutaCBB) + + If ImagenCBB.Exists Then + ImgCBB = String.Format("file://{0}", ImagenCBB.FullName) + Else + ImgCBB = "" + End If + End If If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If