Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1019,7 +1019,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
'verifico si existe
|
||||
If (DdlSubProyecto.Items.FindByValue(Mov.CveSubProyecto.ToString()) Is Nothing) Then
|
||||
Dim dr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=Mov.CveSubProyecto, Estatus:=-1).FiltroPrimero("")
|
||||
Dim dr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=Mov.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimero("")
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem(dr("SubProyecto").ToString, dr("CveSubProyecto").ToString)) ' lo genera Obj.SelectedValue = Valor.ToString
|
||||
End If
|
||||
|
||||
|
||||
@@ -1478,6 +1478,8 @@
|
||||
<%--19--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkExistencias" runat="server" Visible="false" AlternateText="Ver Existencias" CausesValidation="False" CommandName="Existencias" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-eye'></i>" />
|
||||
<asp:LinkButton ID="LnkDescuentos" runat="server" Visible="false" AlternateText="Descuento" CausesValidation="False" CommandName="Descuento" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-percent'></i>" />
|
||||
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||
@@ -8741,8 +8743,36 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="DivModalVerExistencias" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<asp:UpdatePanel ID="UpVerExistencias" runat="server" UpdateMode="Conditional" class="modal-content">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlVerExistenciasPS" runat="server"></asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvVerExistencias" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="" CssClass="table table-striped table-hover" GridLines="None" OnRowDataBound="GvVerExistencias_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
|
||||
<asp:BoundField DataField="UnidadMedida" HeaderText="Unidad Medida" />
|
||||
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DvModalTipoVenta" class="modal ADS fade" role="dialog">
|
||||
|
||||
|
||||
@@ -3741,9 +3741,9 @@ Partial Class Ventas
|
||||
Dim Dt As DataTable = Nothing
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(384) Then
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Predeterminada = 'True'")
|
||||
Dt = ObjVta.DtResultados.Copy()
|
||||
Else
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Predeterminada = 'True' AND Restringuida = 'False'")
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
|
||||
End If
|
||||
|
||||
DdlPrecioLista.DataSource = Dt
|
||||
@@ -8790,6 +8790,10 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
e.Row.FCLinkButton("LnkExistencias").Visible = True
|
||||
End If
|
||||
|
||||
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||
@@ -17933,15 +17937,38 @@ Partial Class Ventas
|
||||
If ObjPrecioSugerido.CvePrecioLista > 0 AndAlso DivPrecioLista.Visible Then
|
||||
DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista)
|
||||
|
||||
If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
|
||||
Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
|
||||
Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count > 0 Then
|
||||
'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
|
||||
If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
|
||||
If ObjPrecioSugerido.CvePrecioLista = Me.CvePrecioListaCliente Then
|
||||
Alert("La lista de precios del cliente no esta permitido en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
End If
|
||||
Else
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
|
||||
Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
|
||||
Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
|
||||
If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -18593,7 +18620,7 @@ Partial Class Ventas
|
||||
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
End If
|
||||
|
||||
CargaListasPreciosSubProyectos(-1)
|
||||
CargaListasPreciosSubProyectos(If(DdlPS.SelectedValue.ToEntero() <= 0, -1, DdlPS.SelectedValue.ToEntero()))
|
||||
|
||||
UpDetalle.Update()
|
||||
UpEmitirTransitorio.Update()
|
||||
@@ -25313,6 +25340,35 @@ Partial Class Ventas
|
||||
RegistraScript("$('#ModalPermisoDesc').modal({backdrop: 'static', keyboard: false});setTimeout(() => {$('#txtUserDesc').focus();}, 500); ", "A2")
|
||||
End If
|
||||
|
||||
ElseIf e.CommandName = "Existencias" Then
|
||||
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
||||
|
||||
LtlVerExistenciasPS.Text = $"Existencias: {GvRow.DataKey("PS")}"
|
||||
|
||||
Dim RestringirAlmacenes As Integer = -1
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
RestringirAlmacenes = 1 'restringue los almacenes:Consignación,Productos Financieros Asignados,,roductos Financieros,Consumo Interno,Activo Fijo,Merma,Consignación de Contrato,Devolucion proveedor,
|
||||
End If
|
||||
|
||||
Dim BuscarEnTabla As Boolean = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(715) = "1" Then
|
||||
BuscarEnTabla = True
|
||||
End If
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios()
|
||||
If ObjInventarios.GetExistenciasProducto(GvRow.DataKey("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
|
||||
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
|
||||
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100, BuscarEnTabla:=BuscarEnTabla) Then
|
||||
GvVerExistencias.DataSource = ObjInventarios.DtResultados.Copy()
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
GvVerExistencias.DataBind()
|
||||
|
||||
UpVerExistencias.Update()
|
||||
|
||||
RegistraScript("$('#DivModalVerExistencias').modal({backdrop: 'static', keyboard: false}); ", "A2")
|
||||
Else
|
||||
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
@@ -32674,7 +32730,6 @@ Partial Class Ventas
|
||||
DdlSubProyectoDatos.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveSubProyecto"))
|
||||
End If
|
||||
DdlSucursalCliente.SelectedValueExist(If(dtSeleccionadas.FiltroPrimeroValor("CveClienteSucursal").ToEntero() > 0, dtSeleccionadas.FiltroPrimeroValor("CveClienteSucursal"), "-1"))
|
||||
DdlVendedor.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveVendedor"))
|
||||
|
||||
CambiaSucursalGeneral()
|
||||
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
@@ -32702,6 +32757,8 @@ Partial Class Ventas
|
||||
|
||||
RemisionesLista.Clear()
|
||||
|
||||
DdlVendedor.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveVendedor"))
|
||||
|
||||
Dim MsgUsados As New StringBuilder
|
||||
Dim UsadosValidados As Boolean = True
|
||||
|
||||
@@ -38827,5 +38884,12 @@ Partial Class Ventas
|
||||
|
||||
Return "<a href='javascript:void(0);' class='Texto' onclick=''javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact', 800, 547, 'N', 'PopUpBuscar')''> ver </a>"
|
||||
End Function
|
||||
Protected Sub GvVerExistencias_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveAlmacen") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user