--chk de gastos en cobranza
This commit is contained in:
@@ -723,15 +723,25 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidadIE" CssClass="form-control" runat="server" Width="170px" />
|
||||
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TxtCantidadIE" Display="None" ErrorMessage="El campo <b>''Dinero''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationExpression="^([1-9]{1}[\d]{0,2}(\,[\d]{3})*(\.[\d]{0,4})?|[1-9]{1}[\d]{0,}(\.[\d]{0,4})?|0(\.[\d]{0,2})?|(\.[\d]{1,4})?)$" ValidationGroup="GprIngresoEgreso"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="RegularExpressionValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtCantidadIE.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkAplicaGasto" runat="server" Text="Gasto" AutoPostBack="true" OnCheckedChanged="ChkAplicaGasto_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-md-6" runat="server" visible="false" id="DivCuentaGasto">
|
||||
<asp:DropDownList ID="DdlCuentaGasto" runat="server" CssClass="form-control input-sm select2me" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtDescripcionIE.ClientID.ToString()%>">Descripcion:</label>
|
||||
<label for="<%= TxtDescripcionIE.ClientID.ToString()%>">Descripción:</label>
|
||||
<asp:TextBox runat="server" ID="TxtDescripcionIE" CssClass="form-control" TextMode="MultiLine" Width="500px" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -635,17 +635,73 @@ Partial Class Ventas_PVCobranza
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click
|
||||
Dim ObjPVenta As New ClsPuntoVenta
|
||||
If TxtCantidadIE.Text.ToEntero() > 0 Then
|
||||
If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
|
||||
TxtCantidadIE.Text = ""
|
||||
TxtDescripcionIE.Text = ""
|
||||
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
|
||||
Alert("El movimiento se realizó correctamente")
|
||||
UpIngresoEgreso.Update()
|
||||
End If
|
||||
If TxtCantidadIE.Text.ToEntero() <= 0 Then
|
||||
Alert("La cantidad debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjPVenta As New ClsPuntoVenta
|
||||
Dim ObjIE As New ClsBancos(ObjPVenta.IniciaTransacSQL())
|
||||
Dim ObjMov As New ClsContabilidad(ObjPVenta.IniciaTransacSQL())
|
||||
Try
|
||||
Dim CveMoneda As Integer = 1
|
||||
Dim TipoCambio As Decimal = 1D
|
||||
|
||||
Dim Importe As Decimal = TxtCantidadIE.Text.ToDecimal()
|
||||
If Not ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, Importe, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
|
||||
TieneError = True
|
||||
End If
|
||||
If ChkAplicaGasto.Checked Then
|
||||
|
||||
Dim CveTipoTransaccion As Integer = 2
|
||||
Dim CvePrePoliza = ObjMov.AddPrePolizas("PVCobranza/Gasto ", 23, Importe, Importe, CveMoneda, Now, "Gasto", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'TRANSFERENCIA BANCARIA
|
||||
Dim EsAbonoEnCuenta As Boolean = False
|
||||
Dim AplicaImpuestos As Boolean = False
|
||||
Dim Folio As Long = ObjIE.GetNextFolio(DdlCuentaGasto.SelectedValue.ToEntero, CveTipoTransaccion)
|
||||
|
||||
Dim CveIE = ObjIE.AddBancos_IE(DdlCuentaGasto.SelectedValue.ToEntero, CveTipoTransaccion, Now, Folio.ToString(), "", Importe, CveMoneda,
|
||||
TipoCambio, TxtDescripcionIE.Text.Trim(), "", EsAbonoEnCuenta, AplicaImpuestos, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=Me.CveCorte)
|
||||
|
||||
Dim TipoMovimiento As Boolean = True
|
||||
|
||||
Dim Importe30 As Decimal = TxtCantidadIE.Text.ToDecimal
|
||||
|
||||
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe, Importe30, 30, Folio.ToString(), Folio.ToString(), CveIE:=CveIE) Then
|
||||
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
|
||||
'TEMPORAL - Préstamo Personal/Gasto por Comprobar
|
||||
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe, Importe30, 28, Folio.ToString(), Folio.ToString(), CveIE:=CveIE, CvePersonal:=UsuarioActual.CvePersonal) Then
|
||||
'If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtImporte.Text.ToDecimal, 19, Ref, Conc, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
|
||||
' TieneError = True
|
||||
'End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjPVenta.RollBack()
|
||||
Else
|
||||
ObjPVenta.Commit()
|
||||
End If
|
||||
|
||||
ObjPVenta.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
TxtCantidadIE.Text = ""
|
||||
TxtDescripcionIE.Text = ""
|
||||
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
|
||||
Alert("El movimiento se realizó correctamente")
|
||||
UpIngresoEgreso.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ImpresionDirectaPDF(CveVenta As Integer)
|
||||
@@ -816,6 +872,12 @@ Partial Class Ventas_PVCobranza
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkAplicaGasto_CheckedChanged(sender As Object, e As EventArgs)
|
||||
DivCuentaGasto.Visible = ChkAplicaGasto.Checked
|
||||
|
||||
UpIngresoEgreso.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user