Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -10,6 +10,14 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property CveCorte As Integer
|
||||
Get
|
||||
Return ViewState("CveCorte").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCorte") = value
|
||||
End Set
|
||||
End Property
|
||||
Private ReadOnly Property CveCliente As Integer
|
||||
Get
|
||||
Return ViewState("CveCliente").ToString.ToEntero
|
||||
@@ -172,6 +180,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
Me.CveCorte = -1
|
||||
CveMonedaPago = -1
|
||||
If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToString.ToEntero > 0 Then
|
||||
ViewState("CveCliente") = Request("CveCliente").ToString.ToEntero
|
||||
@@ -229,6 +238,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
ChkPagarDolares.Visible = False
|
||||
End If
|
||||
RegistraScript($"TipoCambioActual = {GlobalTipoCambio(Fecha).FormatoNumero(4)}")
|
||||
|
||||
Me.CveCorte = CargaCorteCaja(-1, UsuarioActual)
|
||||
End If
|
||||
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().ToString("dd/MM/yyyy")
|
||||
@@ -255,6 +266,58 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Function CargaCorteCaja(CveVenta As Integer, UsuarioActual As Usuario) As Integer
|
||||
Dim CveCorte As Integer = -1
|
||||
|
||||
Dim CveCorteVenta As Integer = -1
|
||||
Dim EsCredito As Boolean = False
|
||||
Dim UsaCorteActual As Boolean = False
|
||||
|
||||
If CveVenta > 0 Then
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
EsCredito = If(ObjVentas.DtResultados.FiltroPrimeroValor("CondicionesPago").ToEntero() = 1, True, False)
|
||||
CveCorteVenta = ObjVentas.DtResultados.FiltroPrimeroValor("CveCorte").ToEntero()
|
||||
End If
|
||||
End Using
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then
|
||||
'SI ES FACTURA A CREDITO
|
||||
If EsCredito OrElse CveCorteVenta <= 0 Then
|
||||
UsaCorteActual = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI ES CONTADO TOMAR EL DE LA VENTA
|
||||
If Not EsCredito Then
|
||||
UsaCorteActual = False
|
||||
End If
|
||||
|
||||
'EN BDH TOMAR EL DE LA VENTA
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
UsaCorteActual = False
|
||||
End If
|
||||
Else
|
||||
If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then
|
||||
UsaCorteActual = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsaCorteActual Then
|
||||
Dim ObjPVenta As New ClsPuntoVenta
|
||||
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
|
||||
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||
CveCorte = ObjPVenta.CveCorte
|
||||
End If
|
||||
End If
|
||||
ObjPVenta.Dispose()
|
||||
Else
|
||||
CveCorte = CveCorteVenta
|
||||
End If
|
||||
|
||||
Return CveCorte
|
||||
End Function
|
||||
|
||||
Private Sub CargaTipoTransaccion()
|
||||
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros("Tipo = 'Ing' AND Estatus = 1 ")
|
||||
DdlTipoTransaccion.DataBind()
|
||||
@@ -870,7 +933,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, Folio, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal,
|
||||
GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio,
|
||||
TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito,
|
||||
CveProveedorIntermediario:=CveProvIntermediario, ImporteDeduccionesPago:=TxtImporteDeduccionesPago.Text.ToDecimal, FechaEmision:=FechaEmision)
|
||||
CveProveedorIntermediario:=CveProvIntermediario, ImporteDeduccionesPago:=TxtImporteDeduccionesPago.Text.ToDecimal, FechaEmision:=FechaEmision, CveCorte:=Me.CveCorte)
|
||||
If Folio = "-1" Then
|
||||
TxtFolio.Text = ObjIE.Folio.ToString()
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user