IE Pago de anticipos de OC en dolares con pesos
This commit is contained in:
@@ -123,20 +123,48 @@
|
|||||||
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
|
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:Label CssClass="col-md-1" Text="" ID="LbTipoMoneda" runat="server" />
|
||||||
|
<div class="col-md-2" id="DVPAgoEnPesos" runat="server" visible ="false">
|
||||||
|
<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" runat="server" OnCheckedChanged="ChkPagarDolares_CheckedChanged" ClientIDMode="Static" />--%>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-2 control-label">Cuenta:</label>
|
<label class="col-md-2 control-label">Cuenta:</label>
|
||||||
<div class="col-md-5">
|
<div class="col-md-4">
|
||||||
<asp:Label ID="LblCuenta" runat="server" Text=""></asp:Label>
|
<asp:Label ID="LblCuenta" runat="server" Text=""></asp:Label>
|
||||||
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar">
|
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-1">
|
||||||
<asp:Label ID="LblEstatusIE" runat="server" Text="Activo" Visible="false"></asp:Label>
|
<asp:Label ID="LblEstatusIE" runat="server" Text="Activo" Visible="false"></asp:Label>
|
||||||
<asp:DropDownList runat="server" CssClass="form-control input-sm select2me" ID="DdlEstatusIE" DataValueField="CveEstatusIE" DataTextField="EstatusIE" AutoPostBack="false"></asp:DropDownList>
|
<asp:DropDownList runat="server" CssClass="form-control input-sm select2me" ID="DdlEstatusIE" DataValueField="CveEstatusIE" DataTextField="EstatusIE" AutoPostBack="false"></asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2" runat="server" id="DivTC" visible="false">
|
||||||
|
T.C.:
|
||||||
|
<asp:TextBox ID="TxtTC" runat="server" Text="1" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" onblur="CambiaTCPagoOC();" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTC" Enabled="false" runat="server" ControlToValidate="TxtTC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCETC" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" />
|
||||||
|
<div style="display:none">
|
||||||
|
<asp:Button ID="LnkActualizaTCOC" ClientIDMode="Static" runat="server" Text="Actaulziar" OnClick="LnkActualizaTCOC_Click" ></asp:Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2" runat="server" id="DivTC2" visible="false">
|
||||||
|
Dolares
|
||||||
|
<asp:TextBox ID="TxtImporteDolares" runat="server" Text="1" placeholder="Dolares" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||||
|
<%--<asp:Label ID="Label1" Text="" ClientIDMode="Static" runat="server" />--%>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row" id="DivCheques" runat="server" visible="false">
|
<div class="row" id="DivCheques" runat="server" visible="false">
|
||||||
<label class="col-md-2 control-label">Movimiento Relacionado:</label>
|
<label class="col-md-2 control-label">Movimiento Relacionado:</label>
|
||||||
@@ -1781,5 +1809,10 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CambiaTCPagoOC() {
|
||||||
|
|
||||||
|
$("#LnkActualizaTCOC").click();
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -297,6 +297,17 @@ Partial Class Bancos_IE
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
Private Property CveOCSolicitudAnticipo As Integer
|
||||||
Get
|
Get
|
||||||
|
|
||||||
@@ -504,6 +515,22 @@ Partial Class Bancos_IE
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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"
|
#Region "CANCELACIÓN COMPLEMENTO MODAL V2"
|
||||||
|
|
||||||
Property CveComplementoPagoCancelar As Integer
|
Property CveComplementoPagoCancelar As Integer
|
||||||
@@ -2471,6 +2498,9 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
If CveOCSolicitudAnticipo > 0 Then
|
If CveOCSolicitudAnticipo > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim ObjOC As New ClsOC
|
Dim ObjOC As New ClsOC
|
||||||
If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then
|
If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then
|
||||||
SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal
|
SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal
|
||||||
@@ -2479,10 +2509,18 @@ Partial Class Bancos_IE
|
|||||||
End If
|
End If
|
||||||
ObjOC.Dispose()
|
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
|
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)
|
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
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return EsValido
|
Return EsValido
|
||||||
@@ -5557,11 +5595,23 @@ Partial Class Bancos_IE
|
|||||||
Else
|
Else
|
||||||
TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
|
TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
|
||||||
TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||||
|
|
||||||
|
ImporteOriginalDolaras = DrOC("ImporteAnticipo").ToString.ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString
|
DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString
|
||||||
|
|
||||||
CveMoneda = DrOC("CveMoneda").ToString.ToEntero
|
CveMoneda = DrOC("CveMoneda").ToString.ToEntero
|
||||||
CargaCuenta(DrOC("CveMoneda").ToString.ToEntero)
|
CargaCuenta(DrOC("CveMoneda").ToString.ToEntero)
|
||||||
|
|
||||||
|
CveMonedaOriginal = DrOC("CveMoneda").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
If CveMonedaOriginal > 1 Then
|
||||||
|
MostrarPagoEnPesos(True)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
UpCuentaDeposito.Update()
|
UpCuentaDeposito.Update()
|
||||||
If DrOC("CveProveedor").ToString.ToEntero > 0 Then
|
If DrOC("CveProveedor").ToString.ToEntero > 0 Then
|
||||||
HdnCveProveedor.Value = DrOC("CveProveedor").ToString
|
HdnCveProveedor.Value = DrOC("CveProveedor").ToString
|
||||||
@@ -5644,6 +5694,69 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
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
|
Private Function GuardaSolicitudAnticipoOC(ByRef ObjOC As ClsOC) As String
|
||||||
Dim ObjOI As New ClsOIEventos
|
Dim ObjOI As New ClsOIEventos
|
||||||
Dim CveEvento As Integer = 0
|
Dim CveEvento As Integer = 0
|
||||||
@@ -6724,4 +6837,5 @@ Partial Class Bancos_IE
|
|||||||
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
|
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
|
||||||
Calendario.EndDate = DateTime.Now
|
Calendario.EndDate = DateTime.Now
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user