This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-10-11 17:20:34 -07:00
39 changed files with 23655 additions and 9388 deletions

View File

@@ -1142,6 +1142,15 @@ Partial Class Ventas
End Set
End Property
Private Property PermiteCredito As Boolean
Get
Return If(IsNothing(ViewState("PermiteCredito")), False, CBool(ViewState("PermiteCredito")))
End Get
Set(value As Boolean)
ViewState("PermiteCredito") = value
End Set
End Property
#End Region
#Region "Propiedades PuntoVenta"
@@ -1598,6 +1607,14 @@ Partial Class Ventas
End Set
End Property
Private Property CvePrecioLista As Integer
Get
Return ViewState("CvePrecioLista").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePrecioLista") = value
End Set
End Property
#End Region
@@ -1652,6 +1669,7 @@ Partial Class Ventas
ViewState("ClienteDesglosaIEPS") = False
ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0
idCuentaContabilizacion = 1
CveEmpresaCRM = 0
CveAcercamientoCRM = 0
@@ -3848,6 +3866,7 @@ Partial Class Ventas
DdlSubProyectoDatos.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString, DbRowVenta("SubProyecto").ToString)
CargarAlmacenes()
If DdlSubProyectoCobranza.Items.Count = 0 Then
DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -4444,7 +4463,7 @@ Partial Class Ventas
End Function
Private Sub CargarAlmacenes()
If CveVenta > 0 Then
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then
DivAlmacen.Visible = False
Else
Dim DTAlmacen As DataTable
@@ -4605,6 +4624,8 @@ Partial Class Ventas
ViewState("CveCuentaRetISR") = ObjCliente.CveCuentaRetISR
ViewState("CodCliente") = ObjCliente.Codigo
ViewState("CvePrecioLista") = ObjCliente.CvePrecioLista
ViewState("CliNoExt") = ObjCliente.NoExt
ViewState("CliNoInt") = ObjCliente.NoInt
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
@@ -4860,7 +4881,7 @@ Partial Class Ventas
TrAtencionA.Visible = True
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
Me.PermiteCredito = ObjCliente.PermiteCredito
LbAgregar.Enabled = True
LnkAgregarPyME.Enabled = True
@@ -5780,7 +5801,7 @@ Partial Class Ventas
End If
If CveVenta > 0 Then
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then
If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero
e.Row.FCCheckBox("cbInv").Visible = False
End If
@@ -13851,10 +13872,10 @@ Partial Class Ventas
PU = 0
Dim PrecioSugerido As Decimal = 0
Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
If CvePrecioListaPS > 0 Then
'Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
If CvePrecioLista > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSAdicional) Then
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, CvePS:=CvePSAdicional) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
If PrecioSugerido = 0 Then
@@ -14500,7 +14521,7 @@ Partial Class Ventas
GvPS.DataBind()
'RECARGA GV INVENTARIO
If Not CveVenta > 0 Then
If Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot" Then
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
CargaGVInv(DtInv)
End If
@@ -14905,7 +14926,7 @@ Partial Class Ventas
Dim AplicaMovimientoDetalleEntrada As Boolean = False
If RemisionesLista.Count > 0 Then
AplicaMovimientoDetalleEntrada = True
MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND TieneSalidaxFactura IS NULL"))
MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)"))
Else
MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}")
End If
@@ -16534,6 +16555,11 @@ Partial Class Ventas
Private Function ValidaPagosContado() As Boolean
Dim Retorno = False
If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True
End If
If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
Retorno = True