--Generacion de traspaso para movimientos de gasto, en retiro de efectivo
This commit is contained in:
@@ -735,7 +735,24 @@
|
|||||||
<asp:CheckBox ID="ChkAplicaGasto" runat="server" Text="Gasto" AutoPostBack="true" OnCheckedChanged="ChkAplicaGasto_CheckedChanged" />
|
<asp:CheckBox ID="ChkAplicaGasto" runat="server" Text="Gasto" AutoPostBack="true" OnCheckedChanged="ChkAplicaGasto_CheckedChanged" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" runat="server" visible="false" id="DivCuentaGasto">
|
<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 class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
Origen:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<asp:DropDownList ID="DdlCuentaGastoOrigen" runat="server" CssClass="form-control input-sm select2me" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
Destino:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<asp:DropDownList ID="DdlCuentaGastoDestino" runat="server" CssClass="form-control input-sm select2me" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -113,6 +113,14 @@ Partial Class Ventas_PVCobranza
|
|||||||
DdlCuentaCheque.DataBind()
|
DdlCuentaCheque.DataBind()
|
||||||
DdlCuentaTransferencia.DataBind()
|
DdlCuentaTransferencia.DataBind()
|
||||||
|
|
||||||
|
DdlCuentaGastoOrigen.DataSource = DtCC.FiltraParametros("CveMoneda = 1 AND CveTipoCuenta = 1")
|
||||||
|
DdlCuentaGastoOrigen.DataBind()
|
||||||
|
DdlCuentaGastoOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
|
DdlCuentaGastoDestino.DataSource = DtCC.FiltraParametros("CveMoneda = 1 AND CveTipoCuenta = 1")
|
||||||
|
DdlCuentaGastoDestino.DataBind()
|
||||||
|
DdlCuentaGastoDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
@@ -644,6 +652,7 @@ Partial Class Ventas_PVCobranza
|
|||||||
Dim ObjPVenta As New ClsPuntoVenta
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
Dim ObjIE As New ClsBancos(ObjPVenta.IniciaTransacSQL())
|
Dim ObjIE As New ClsBancos(ObjPVenta.IniciaTransacSQL())
|
||||||
Dim ObjMov As New ClsContabilidad(ObjPVenta.IniciaTransacSQL())
|
Dim ObjMov As New ClsContabilidad(ObjPVenta.IniciaTransacSQL())
|
||||||
|
Dim documentos As String = ""
|
||||||
Try
|
Try
|
||||||
Dim CveMoneda As Integer = 1
|
Dim CveMoneda As Integer = 1
|
||||||
Dim TipoCambio As Decimal = 1D
|
Dim TipoCambio As Decimal = 1D
|
||||||
@@ -652,29 +661,28 @@ Partial Class Ventas_PVCobranza
|
|||||||
If Not ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, Importe, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
|
If Not ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, Importe, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
If ChkAplicaGasto.Checked Then
|
|
||||||
|
|
||||||
Dim CveTipoTransaccion As Integer = 2
|
If ChkAplicaGasto.Checked Then
|
||||||
|
documentos = "Los Depósitos se realizaron exitosamente<br/><br/>"
|
||||||
|
|
||||||
Dim CvePrePoliza = ObjMov.AddPrePolizas("PVCobranza/Gasto ", 23, Importe, Importe, CveMoneda, Now, "Gasto", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza = ObjMov.AddPrePolizas("PVCobranza/Gasto ", 23, Importe, Importe, CveMoneda, Now, "Gasto", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
'TRANSFERENCIA BANCARIA
|
'TRANSFERENCIA BANCARIA
|
||||||
Dim EsAbonoEnCuenta As Boolean = False
|
Dim EsAbonoEnCuenta As Boolean = False
|
||||||
Dim AplicaImpuestos As Boolean = False
|
Dim AplicaImpuestos As Boolean = False
|
||||||
Dim Folio As Long = ObjIE.GetNextFolio(DdlCuentaGasto.SelectedValue.ToEntero, CveTipoTransaccion)
|
Dim FolioOrigen As Long = ObjIE.GetNextFolio(DdlCuentaGastoOrigen.SelectedValue.ToEntero, 2)
|
||||||
|
Dim FolioDestino As Long = ObjIE.GetNextFolio(DdlCuentaGastoOrigen.SelectedValue.ToEntero, 8)
|
||||||
|
|
||||||
Dim CveIE = ObjIE.AddBancos_IE(DdlCuentaGasto.SelectedValue.ToEntero, CveTipoTransaccion, Now, Folio.ToString(), "", Importe, CveMoneda,
|
Dim CveIEDestino As Integer = -1
|
||||||
|
Dim CveIEOrigen = ObjIE.AddBancos_IE(DdlCuentaGastoOrigen.SelectedValue.ToEntero, 2, Now, FolioOrigen.ToString(), "", Importe, CveMoneda,
|
||||||
TipoCambio, TxtDescripcionIE.Text.Trim(), "", EsAbonoEnCuenta, AplicaImpuestos, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=Me.CveCorte)
|
TipoCambio, TxtDescripcionIE.Text.Trim(), "", EsAbonoEnCuenta, AplicaImpuestos, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=Me.CveCorte)
|
||||||
|
|
||||||
Dim TipoMovimiento As Boolean = True
|
If CveIEOrigen > 0 Then
|
||||||
|
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>IE Salida: {1}</a>     <br/> ", CveIEOrigen, FolioOrigen)
|
||||||
|
|
||||||
Dim Importe30 As Decimal = TxtCantidadIE.Text.ToDecimal
|
CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaGastoDestino.SelectedValue.ToEntero, 8, Now, FolioDestino.ToString(), "", Importe, CveMoneda,
|
||||||
|
TipoCambio, TxtDescripcionIE.Text.Trim(), "", EsAbonoEnCuenta, AplicaImpuestos, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=Me.CveCorte)
|
||||||
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe, Importe30, 30, Folio.ToString(), Folio.ToString(), CveIE:=CveIE) Then
|
If CveIEDestino > 0 Then
|
||||||
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
|
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>IE Entrada: {1}</a>     <br/> ", CveIEDestino, FolioDestino)
|
||||||
'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
|
Else
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
@@ -682,26 +690,49 @@ Partial Class Ventas_PVCobranza
|
|||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
Dim TipoMovimiento As Boolean = True
|
||||||
|
|
||||||
|
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe, Importe, 30, FolioOrigen.ToString(), FolioOrigen.ToString(), CveIE:=CveIEOrigen) Then
|
||||||
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, Importe, Importe, 30, FolioDestino.ToString(), FolioDestino.ToString(), CveIE:=CveIEDestino) Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
TieneError = True
|
TieneError = True
|
||||||
|
GuardaLog(ex.ToString())
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
If TieneError Then
|
If TieneError Then
|
||||||
|
documentos = ""
|
||||||
ObjPVenta.RollBack()
|
ObjPVenta.RollBack()
|
||||||
|
Alert("Ocurrió un error al generar el movimiento", TipoMensaje.MsgError)
|
||||||
Else
|
Else
|
||||||
ObjPVenta.Commit()
|
ObjPVenta.Commit()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjPVenta.Dispose()
|
ObjPVenta.Dispose()
|
||||||
|
ObjIE.Dispose()
|
||||||
|
ObjMov.Dispose()
|
||||||
|
|
||||||
If Not TieneError Then
|
If Not TieneError Then
|
||||||
TxtCantidadIE.Text = ""
|
TxtCantidadIE.Text = ""
|
||||||
TxtDescripcionIE.Text = ""
|
TxtDescripcionIE.Text = ""
|
||||||
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
|
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
|
||||||
Alert("El movimiento se realizó correctamente")
|
|
||||||
UpIngresoEgreso.Update()
|
If ChkAplicaGasto.Checked Then
|
||||||
|
Alert(documentos)
|
||||||
|
Else
|
||||||
|
Alert("El movimiento se realizó correctamente")
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
UpIngresoEgreso.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ImpresionDirectaPDF(CveVenta As Integer)
|
Private Sub ImpresionDirectaPDF(CveVenta As Integer)
|
||||||
|
|||||||
Reference in New Issue
Block a user