This commit is contained in:
2024-12-10 11:37:57 -07:00
2 changed files with 121 additions and 59 deletions

View File

@@ -511,7 +511,19 @@ Partial Class Bancos_DepositosCaja
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveUsuario) Then
Dim CveSubProyecto As Integer = -1
If DdlSubProyectos.SelectedValue.ToEntero > 0 Then
CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero
End If
Dim CveSubProyectoCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
If CveSubProyectoCuenta > 0 Then
CveSubProyecto = CveSubProyectoCuenta
End If
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0")
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ")
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta

View File

@@ -8715,8 +8715,25 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
e.Row.FCHtmlGenericControl("DivPrecioLista").Visible = True
e.Row.FCDropDownList("DdlPrecioListaEdit").DataSource = GlobalDTPrecioListas(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind()
If UsuarioActual.CveEmpresa = 189 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") Then
Using ObjVta As New ClsVentas
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), e.Row.DBCampo("CvePS").ToEntero(), UsuarioActual.CveEmpresa) Then
Dim Dt As DataTable = Nothing
If UsuarioActual.TienePermisoProceso(384) Then
Dt = ObjVta.DtResultados.Copy()
Else
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
End If
e.Row.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
End If
End Using
End If
End If
e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind()
e.Row.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(e.Row.DBCampo("CvePrecioLista"))
End If
@@ -8993,10 +9010,17 @@ Partial Class Ventas
End If
If UsuarioActual.CveEmpresa = 189 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
If UsuarioActual.CveEmpresa = 189 Then
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.NewEditIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("")
If CBool(DrPS("PrecioLibre")) Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = True
Else
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
End If
End If
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1
@@ -9049,6 +9073,7 @@ Partial Class Ventas
Dim DatarowPS As DataRow = Nothing
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1
Dim PrecioLibre As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If DdlTipoComprobante.SelectedValue = "Cot" Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
@@ -9057,6 +9082,8 @@ Partial Class Ventas
End If
End If
PrecioLibre = CBool(DatarowPS("PrecioLibre"))
If DdlTipoComprobante.SelectedValue = "Ant" Then
Dim PSCodigoSAT As String = DatarowPS("SATClavePS").ToString
If PSCodigoSAT <> "84111506" Then
@@ -9225,6 +9252,8 @@ Partial Class Ventas
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
Dim MensajeCosto As New StringBuilder
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
If Not PrecioLibre Then
If Not EsValido Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", DatarowPS("PS").ToString())
If TienePermisoImportes Then
@@ -9253,6 +9282,8 @@ Partial Class Ventas
e.Cancel = True
Exit Sub
End If
End If
End If
End If
@@ -18358,18 +18389,24 @@ Partial Class Ventas
tPrecioSugerido = 0
PrecioSugerido = 0
If Not CBool(drPS("PrecioLibre")) Then
Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
End If
End If
Else
ObjPrecioSugerido.CvePrecioLista = -1
ObjPrecioSugerido.PrecioSugerido = 0
tPrecioSugerido = 0
PrecioSugerido = 0
If Not CBool(drPS("PrecioLibre")) Then
Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
End If
End If
End If
End If
End If
@@ -18387,11 +18424,10 @@ Partial Class Ventas
tPrecioSugerido = 0
PrecioSugerido = 0
TxtPrecio.Enabled = True
TxtPrecio.Enabled = CBool(drPS("PrecioLibre"))
Else
TxtPrecio.Enabled = False
TxtPrecio.Enabled = CBool(drPS("PrecioLibre"))
End If
End If
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
@@ -18467,11 +18503,13 @@ Partial Class Ventas
ObjInventarios.Dispose()
If Costo > 0 Then
If TxtPrecio.Text.ToDecimal() > 0 Then
Dim PorUtilidad = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / TxtPrecio.Text.ToDecimal()) * 100D)
LtlHeaderCosto.Text = String.Format("{0:N2} <br/> {1}", Costo, PorUtilidad)
End If
End If
End If
End If
If AgregarPSAutomaticamente Then
AgregarPS()
@@ -19411,6 +19449,8 @@ Partial Class Ventas
Return False
End If
Dim PrecioLibre As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DatarowPS IsNot Nothing Then
@@ -19429,6 +19469,8 @@ Partial Class Ventas
End If
End If
PrecioLibre = CBool(DatarowPS("PrecioLibre"))
End If
End If
@@ -19647,8 +19689,10 @@ Partial Class Ventas
End If
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
If Not PrecioLibre Then
Dim MensajeCosto As New StringBuilder
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
If Not EsValido Then
MensajeCosto.AppendFormat("El Producto <b>{0}-{1}</b>. No se puede vender a un precio menor de su Costo <br/>", HdnCodigoPS.Value, HdnPS.Value)
If TienePermisoImportes Then
@@ -19672,6 +19716,7 @@ Partial Class Ventas
Alert(MensajeCosto.ToString(), TipoMensaje.MsgAdvertencia)
Return False
End If
End If
End If
End If
@@ -19949,10 +19994,15 @@ Partial Class Ventas
End If
Else
Dim PermiteEdicion = UsuarioActual.CveEmpresa = 189 AndAlso TxtPrecio.Enabled
If Not PermiteEdicion Then
'sino es la seleccionada se recalcula de nuevo
CargaPrecioLista(DdlPS.SelectedValue.ToEntero)
Exit Sub
End If
End If
Else
If Me.CvePrecioLista > 0 Then
CvePrecioListaPS = Me.CvePrecioLista