Compras Cancelacion Fecha de cancelacion de movimeinto con devolución
This commit is contained in:
@@ -2562,7 +2562,7 @@
|
||||
<asp:Button ID="BtnEliminarCompra" CssClass="btn btn-danger" Visible="False" runat="server" Text="Eliminar Compra" />
|
||||
<br />
|
||||
<br />
|
||||
<asp:Button ID="BtnCancelarCompra" OnClientClick="ShowDivCancelarCompra();" Text="Cancelar Compra" CssClass="btn btn-danger" Visible="false" runat="server" />
|
||||
<asp:Button ID="BtnCancelarCompra" Text="Cancelar Compra" CssClass="btn btn-danger" Visible="false" runat="server" OnClick="BtnCancelarCompra_Click" />
|
||||
<br />
|
||||
<br />
|
||||
<asp:Button ID="BtnRegenerarPrePolizaAlmacen" OnClick="BtnRegenerarPrePolizaAlmacen_Click" CssClass="btn btn-warning" Visible="False" runat="server" Text="Regenerar PrePoliza" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea regenerar la prepoliza?" data-btn-ok-label="si" />
|
||||
@@ -3152,7 +3152,7 @@
|
||||
<div class="row" style="align-items: center" id="divDevAuto" runat="server" visible="false">
|
||||
<label class="col-md-4">Devolución automática:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox Text="" runat="server" ID="CheckDevAuto" Visible="True" />
|
||||
<asp:CheckBox Text="" runat="server" ID="CheckDevAuto" Visible="True" AutoPostBack="true" OnCheckedChanged="CheckDevAuto_CheckedChanged" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6479,11 +6479,11 @@
|
||||
});
|
||||
|
||||
|
||||
//Cancelar Compra
|
||||
<%-- //Cancelar Compra
|
||||
function ShowDivCancelarCompra() {
|
||||
$('#<%= TxtFechaCancelacion.ClientID%>').val($get("TxtFecha").value);
|
||||
$('#DivCancelarCompra').modal();
|
||||
}
|
||||
}--%>
|
||||
function HideDivCancelarCompra() {
|
||||
$('#DivCancelarCompra').modal('hide');
|
||||
}
|
||||
|
||||
@@ -1079,6 +1079,18 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FechaCancelacionMovimiento As Date
|
||||
Get
|
||||
If ViewState("FechaCancelacionMovimiento") Is Nothing Then
|
||||
ViewState("FechaCancelacionMovimiento") = MinFecha
|
||||
End If
|
||||
Return ViewState("FechaCancelacionMovimiento").ToString.ToDateTime
|
||||
End Get
|
||||
Set(value As Date)
|
||||
ViewState("FechaCancelacionMovimiento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
|
||||
@@ -5734,6 +5746,9 @@ LblAmortizacion.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal,
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
importeMovimiento = importePagoProv
|
||||
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
importeMovimiento = importeMovimiento / TipoCambioCompra
|
||||
@@ -5761,9 +5776,9 @@ LblAmortizacion.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal,
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
'daskldaskldmaskldanmlksd
|
||||
If importeMovimiento <> 0 Then
|
||||
For Each gvRowCredito As GridViewRow In GvCreditos.Rows
|
||||
|
||||
'If importeMovimiento <> 0 Then
|
||||
For Each gvRowCredito As GridViewRow In GvCreditos.Rows
|
||||
|
||||
Dim ImportePagoCredito As Decimal = If(gvRowCredito.FCTextBox("TxtAmbos").Text.ToDecimal > 0, gvRowCredito.FCTextBox("TxtAmbos").Text.ToDecimal, (gvRowCredito.FCTextBox("TxtCapital").Text.ToDecimal + gvRowCredito.FCTextBox("TxtInteres").Text.ToDecimal))
|
||||
Dim ImporteIEAnticipo As Decimal = gvRowCredito.DataKey("ImporteIE").ToDecimal '' Lo que se pago desde el movimiento Bancario
|
||||
@@ -5812,7 +5827,7 @@ LblAmortizacion.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal,
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'End If
|
||||
End If
|
||||
importeMovimiento = 0 : importeMN = 0
|
||||
If TipoCambioCompra > 1 AndAlso DdlMoneda.SelectedValue.ToEntero <> 1 Then Concepto += $" TC{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}"
|
||||
@@ -19963,6 +19978,46 @@ LblAmortizacion.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal,
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnCancelarCompra_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim objCompras As New ClsCompras
|
||||
|
||||
|
||||
If objCompras.GetFechaCancelacionMovimiento(CveCompra:=CveCompra, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
FechaCancelacionMovimiento = objCompras.FechaCancelacionMovto
|
||||
Else
|
||||
FechaCancelacionMovimiento = MinFecha
|
||||
End If
|
||||
|
||||
TxtFechaCancelacion.Text = TxtFecha.Text
|
||||
|
||||
objCompras.Dispose()
|
||||
|
||||
UpCancelarCompra.Update()
|
||||
|
||||
RegistraScript(" $('#DivCancelarCompra').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CheckDevAuto_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
TxtFechaCancelacion.Text = ""
|
||||
BtnCancelarCompra2.Enabled = False
|
||||
|
||||
If CheckDevAuto.Checked Then
|
||||
If FechaCancelacionMovimiento > MinFecha Then
|
||||
TxtFechaCancelacion.Text = FechaCancelacionMovimiento.ToString("dd/MM/yyyy")
|
||||
BtnCancelarCompra2.Enabled = True
|
||||
End If
|
||||
Else
|
||||
TxtFechaCancelacion.Text = TxtFecha.Text
|
||||
BtnCancelarCompra2.Enabled = True
|
||||
End If
|
||||
|
||||
UpCancelarCompra.Update()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user