-- si seleciona una clasif se selecciona el producto, si solo hay uno, en modal de agregar partida
-- reclasificar todos los productos.
This commit is contained in:
@@ -710,10 +710,8 @@
|
||||
</tr>
|
||||
<tr id="DivReclasifica" class="collapse">
|
||||
<th colspan="3"></th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlAplicaClasificacion" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlAplicaClasificacion_SelectedIndexChanged" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<th>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlAplicaPSMasivo" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" data-metodo="getps" DataValueField="CvePS" Onselectedindexchange="DdlAplicaPSMasivo_selectedindexchange" />
|
||||
</th>
|
||||
<th></th>
|
||||
<th>
|
||||
@@ -3823,9 +3821,8 @@
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright" id="div1" runat="server">
|
||||
<%--<asp:DropDownList ID="DdlAplicaClasificacion" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
<label for="<%= DdlAplicaClasificacion.ClientID.ToString()%>">Clasificacion:</label>
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem> </asp:DropDownList>--%>
|
||||
v
|
||||
</div>
|
||||
<%-- <div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlAplicaPS" runat="server" CssClass=" form-control input-sm select2me" Width="50%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="PSCodigo" DataValueField="CvePS">
|
||||
|
||||
@@ -1316,15 +1316,6 @@ Partial Class Compras_Compras
|
||||
'lblProveedor.Visible = False
|
||||
End If
|
||||
|
||||
If isAlmacenistaGluyas() Then
|
||||
GvInv.Columns(10).Visible = True
|
||||
'Dim productos As New ClsProductosServicios
|
||||
'If productos.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
' PSDTRemplazo = productos.DtResultados.FiltraParametros("PendienteEnOC=1", "PS")
|
||||
'End If
|
||||
'productos.Dispose()
|
||||
End If
|
||||
|
||||
PermisoEdicionManual = False
|
||||
CveMovimientoAlmacen = 0
|
||||
SetValues()
|
||||
@@ -1790,11 +1781,6 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function isAlmacenistaGluyas() As Boolean
|
||||
'Return (UsuarioActual.CveRol = 1052 And UsuarioActual.CveEmpresa = 66)
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function CargaFactura(CveFactura As Integer) As String
|
||||
Dim ObjeFacturas As New ClsCompras
|
||||
Dim RFC As String = ""
|
||||
@@ -3807,17 +3793,6 @@ Partial Class Compras_Compras
|
||||
|
||||
DdlPSAlias2.setEsWebService(True)
|
||||
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
DdlPSAlias2.ddlWS.Attributes.Add("data-subfamilia", "-1")
|
||||
DdlPSAlias2.ddlWS.Attributes.Add("data-fueporxml", "0")
|
||||
'SOLO CUANDO SEA FACTURA DE INGRESOS
|
||||
If DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
DdlPSAlias2.ddlWS.Attributes.Add("data-pagina", "Compras")
|
||||
Else
|
||||
DdlPSAlias2.ddlWS.Attributes.Add("data-pagina", "Compras2")
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not DdlPSAlias2.UsaWebService AndAlso CType(DdlPSAlias2.DataSource, DataTable) Is Nothing Then
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then
|
||||
@@ -4164,22 +4139,12 @@ Partial Class Compras_Compras
|
||||
|
||||
AddPS2(False)
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
CompruebaAgregar()
|
||||
End If
|
||||
|
||||
If isAlmacenistaGluyas() Then
|
||||
BtnGuardar.Visible = False
|
||||
AlmacenCambiaPS.Visible = True
|
||||
End If
|
||||
If UsuarioActual.Empresa.UsaAC Then CompruebaAgregar()
|
||||
|
||||
SubTotalConceptos = Math.Round(SubTotalTemp, 2)
|
||||
'TmpDT = DtPSTemp.Copy
|
||||
'DtPSTemp.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaClasificacionesComprobaciones()
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then
|
||||
@@ -4319,7 +4284,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) AndAlso UsuarioActual.CveUsuario <> 1803 Then
|
||||
Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
|
||||
Dim Fecha28Dic As Date = New Date(2024, 12, 28)
|
||||
If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
|
||||
@@ -8825,8 +8790,6 @@ Partial Class Compras_Compras
|
||||
Alert("Tiene que seleccionar algun Producto o Servicio", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
DdlAplicaClasificacion.SelectedValue = "-1"
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivClasificacion"))
|
||||
Else
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivClasificacion"))
|
||||
@@ -11055,14 +11018,8 @@ Partial Class Compras_Compras
|
||||
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
TxtDescuentoModal.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
|
||||
'ImgAmort.Attributes.Add("onclick", "javascript:$('#DivDescP').show(1000); PosicionaObjeto(this.id,'DivDescP');") ' $get('LblTitulo1').style.display = 'none'; $get('LblTituloTipo1').style.display = 'none'; $get('LblTituloTipo2').style.display = ''; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = ''; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = 'none';")
|
||||
DdlAplicaPSMasivo.setEsWebService(True)
|
||||
|
||||
'If um.GetUnidadesMedida() Then
|
||||
' GlobalDTUnidadesMedida = um.DtResultados
|
||||
'End If
|
||||
'um.Dispose()
|
||||
|
||||
'CargaEstatus()
|
||||
CargaTiposAF()
|
||||
CargaProyectoAsignado()
|
||||
CargaClasificacionesComprobaciones()
|
||||
@@ -11071,12 +11028,6 @@ Partial Class Compras_Compras
|
||||
CreaDTCompras()
|
||||
CargaMonedas()
|
||||
CargarAlmacen()
|
||||
'CreaDtAF()
|
||||
'TabOC.Visible = False
|
||||
|
||||
'BORRAR OC
|
||||
'Valores para Vinculacion OC
|
||||
'If UsuarioActual.Empresa.MetodoOC = 1 Then GvOC2.Columns(2).Visible = False : tdSurtirOC.Visible = False Else GvOC2.Columns(0).Visible = False : tdFolioOC.Visible = False
|
||||
|
||||
CveAlmacenConsignacion = -1
|
||||
CveConsignacion = -1
|
||||
@@ -17676,9 +17627,6 @@ Partial Class Compras_Compras
|
||||
|
||||
divIVA.Visible = True
|
||||
|
||||
|
||||
|
||||
|
||||
If GvInvMov.Rows.Count > 0 AndAlso GvRow.DataKey("CveTipoPS").ToEntero = 2 Then
|
||||
TxtCantidad.Enabled = False
|
||||
DdlClasificacion.Enabled = False
|
||||
@@ -17712,6 +17660,19 @@ Partial Class Compras_Compras
|
||||
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero)
|
||||
|
||||
'si solo tiene un solo producto la clasificación que lo asigne
|
||||
Dim dtps As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, DdlClasificacion.SelectedValue.ToEntero)
|
||||
If dtps.Rows.Count = 1 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlPS.SelectedValue = dtps.Rows(0)("CvePS").ToString
|
||||
DdlPS.SelectedText = dtps.Rows(0)("PSCodigo").ToString
|
||||
DdlPSChange()
|
||||
Else
|
||||
DdlPS.SelectedValue = dtps.Rows(0)("CvePS").ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UPPClasificacion.Update()
|
||||
End Sub
|
||||
Private Sub CargaPS(CveClasificacion As Integer)
|
||||
@@ -18351,8 +18312,6 @@ Partial Class Compras_Compras
|
||||
Row("IEPSPSPorcentaje") = 0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.Rows.IndexOf(Row)
|
||||
|
||||
@@ -18540,82 +18499,14 @@ Partial Class Compras_Compras
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
DdlAplicaClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
Else
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
DdlAplicaClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then
|
||||
DdlClasificacion.DataSource = DTClasificacionesComprobaciones.FiltraParametros("", Orderby:="Clasificacion")
|
||||
DdlAplicaClasificacion.DataSource = DTClasificacionesComprobaciones.FiltraParametros("", Orderby:="Clasificacion")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DdlClasificacion.DataBind()
|
||||
DdlAplicaClasificacion.DataBind()
|
||||
End Sub
|
||||
Private Sub BtnAplicarClasificacion_Click(sender As Object, e As EventArgs) Handles BtnAplicarClasificacion.Click
|
||||
ReclasificaClasificacion()
|
||||
End Sub
|
||||
Protected Sub DdlAplicaClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ReclasificaClasificacion()
|
||||
End Sub
|
||||
Private Sub ReclasificaClasificacion()
|
||||
|
||||
|
||||
If Not DdlAplicaClasificacion.SelectedValue.ToEntero > 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ErrorPS As Boolean = False
|
||||
|
||||
'Actualiza Clasificacion directamente a la DB cuando ya se tiene alguna clasificacion
|
||||
'Solo cuando el PS ya esta registrado
|
||||
If UsuarioActual.TienePermisoProceso(104) Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
For Each gvr As GridViewRow In GvPS.Rows
|
||||
If gvr.FCCheckBox("CheckClasificacion").Checked AndAlso gvr.DataKey("CvePS").ToString.ToEntero > 0 Then
|
||||
If Not ObjPS.UpdateClasificacionPS(DdlAplicaClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, gvr.DataKey("CvePS").ToString.ToEntero) Then
|
||||
ErrorPS = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
ObjPS.Dispose()
|
||||
End If
|
||||
|
||||
If Not ErrorPS Then
|
||||
Dim index As Integer = 0
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
If Dr("CvePS").ToString.ToEntero = 0 OrElse Dr("CveClasificacion").ToString.ToEntero <= 0 Then
|
||||
'Dr("CveClasificacion") = DdlClasificacion.SelectedValue.ToEntero
|
||||
Dr("Clasificacion") = DdlAplicaClasificacion.SelectedItem.Text
|
||||
Dr("CveClasificacionActualizar") = DdlAplicaClasificacion.SelectedValue.ToEntero
|
||||
ElseIf UsuarioActual.TienePermisoProceso(104) AndAlso GvPS.Rows(index).FCCheckBox("CheckClasificacion").Checked Then
|
||||
Dr("Clasificacion") = DdlAplicaClasificacion.SelectedItem.Text
|
||||
Dr("CveClasificacionActualizar") = DdlAplicaClasificacion.SelectedValue.ToEntero
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
UpPS.Update()
|
||||
Alert("La Clasificacion ha sido aplicada correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
'Para validar AC
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
CompruebaAgregar()
|
||||
End If
|
||||
Else
|
||||
Alert("Ocurrio un error al actualizar la Clasificación de los Productos/Servicios")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAsignarProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlAsignarProyecto.SelectedIndexChanged
|
||||
@@ -18689,11 +18580,8 @@ Partial Class Compras_Compras
|
||||
If DtpsTemp IsNot Nothing AndAlso DtpsTemp.Rows.Count > 0 Then
|
||||
Dr("CveContratoDetalle") = DtpsTemp.FiltroPrimeroValor("CveContratoDetalle", String.Format("CvePS = {0}", Dr("CvePS"))).ToEntero
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
GvPS.DataSource = TmpDT.FiltraParametros("", "Consec")
|
||||
GvPS.DataBind()
|
||||
UpPS.Update()
|
||||
@@ -18707,8 +18595,6 @@ Partial Class Compras_Compras
|
||||
Alert("SubProyectos cambiados correctamente", TipoMensaje.ToastInformacion)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlTipoGastoAsignar_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If Not GvPS.Rows.Count > 0 Then
|
||||
Alert("No hay partidas para reclasificar el tipo de gasto", TipoMensaje.MsgAdvertencia)
|
||||
@@ -22374,8 +22260,46 @@ Partial Class Compras_Compras
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAplicaPSMasivo_selectedindexchange(sender As Object, e As EventArgs)
|
||||
ReclasificaProductosMasivos()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ReclasificaProductosMasivos()
|
||||
|
||||
|
||||
If Not DdlAplicaPSMasivo.SelectedValue.ToEntero > 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'cveps,cveclasif, ps,clasif, cveum. unidadmedida,aplica
|
||||
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlAplicaPSMasivo.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
If drPS IsNot Nothing Then
|
||||
Dr("PSCodigo") = drPS("PSCodigo").ToString
|
||||
Dr("CveMetodoInventario") = drPS("Inv_CveMetodoInventario").ToString.ToEntero
|
||||
Dr("CveUM") = drPS("CveUnidadMedida")
|
||||
Dr("UM") = drPS("UnidadMedida")
|
||||
Dr("CveClasificacion") = drPS("CveClasificacion")
|
||||
Dr("Clasificacion") = drPS("Clasificacion")
|
||||
Dr("CvePS") = drPS("CvePS")
|
||||
Dr("PS") = drPS("PSCodigo")
|
||||
Dr("CodigoPS") = drPS("PSCodigo")
|
||||
Dr("CveTipoPS") = drPS("CveTipoPS")
|
||||
Dr("PSDescripcion") = drPS("PSCodigo")
|
||||
'Dr("AplicaSerie") = drPS("AplicaSerie")
|
||||
'Dr("AplicaLote") = drPS("AplicaLote")
|
||||
'Dr("AplicaCaducidad") = drPS("AplicaCaducidad")
|
||||
End If
|
||||
Next
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
UpPS.Update()
|
||||
Alert("La reclasificación de productos ha sido aplicada correctamente.", TipoMensaje.ToastInformacion)
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user