This commit is contained in:
2022-02-10 20:56:19 -07:00
21 changed files with 1572 additions and 142 deletions

View File

@@ -4434,7 +4434,7 @@
<ContentTemplate>
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto,TipoEstatus"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>

View File

@@ -9420,7 +9420,7 @@ Partial Class Clientes
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("CveConcepto").ToEntero() = 1 Then
If e.Row.DataKey("CveConcepto").ToEntero() = 1 AndAlso e.Row.DataKey("TipoEstatus").ToEntero() <> 5 Then
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))

View File

@@ -1286,6 +1286,7 @@ Partial Class PV
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
DdlTipoComprobante.SelectedValueExist("Rem")
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty)
End If
DdlTipoDefecto.Width = New Unit(260%)
@@ -5964,7 +5965,7 @@ Partial Class PV
Case 1 'CREDITO
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
Case 2 'CONTADO
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
DivContado.Visible = True
TxtImporteContado.Text = TxtTotal.Text
End If
@@ -6165,6 +6166,11 @@ Partial Class PV
Retorno = True
End If
If DtPagos IsNot Nothing AndAlso DtPagos.SUM("Importe").ToString.ToDecimal() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
Alert("Los pagos no deben ser aplicados a una remisión.", TipoMensaje.MsgAdvertencia)
Retorno = True
End If
Return Retorno
End Function
@@ -7315,12 +7321,10 @@ Partial Class PV
TxtPrecio.Text = TxtPrecio.Text
TxtObsPS.Text = "Descuento por garantía"
Else
'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
' If Gvr.RowType = DataControlRowType.DataRow Then
' Gvr.FCTextBox("TxtCantidad").Text = ""
' Gvr.FCTextBox("TxtCantidad").Enabled = True
' End If
'Next
If TmpDTAjustes IsNot Nothing Then
TmpDTAjustes.Clear()
End If
TxtObsPS.Text = TxtObsPS.Text.Replace("Descuento por garantía", "")
DdlRecepcionUsados.SelectedValueExist("-1")
DdlRecepcionUsados.Enabled = True

View File

@@ -6602,6 +6602,30 @@ Partial Class Ventas
LnkOCs.Visible = False
End If
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
End If
End If
Else
@@ -6620,6 +6644,32 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
End If
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
If EsCotizacion AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
End If
End If
End If
@@ -6753,10 +6803,39 @@ Partial Class Ventas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
Dim ObjVentas As New ClsVentas
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
Dim RowAutorizacion As DataRow = Nothing
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
If TieneDiasVencidos Then
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
Else
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
End If
If RowAutorizacion IsNot Nothing Then
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
End If
End If
ObjVentas.Dispose()
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Opcion > 0 AndAlso Autorizacion <= 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
Else
If Opcion > 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
End If
End If
End If