This commit is contained in:
2025-01-08 17:53:31 -07:00
14 changed files with 214 additions and 118 deletions

View File

@@ -1342,7 +1342,14 @@
</ItemTemplate>
</asp:TemplateField>
<%--3--%>
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText=" Producto" DataField="CodigoPS" />
<%--<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText=" Producto" DataField="CodigoPS" />--%>
<asp:TemplateField>
<HeaderTemplate>Producto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
<asp:HyperLink ID="HlPS" runat="server" Text='<%# Eval("CodigoPS") %>' Visible="false" Target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<%--4--%>
<asp:BoundField ItemStyle-Width="120px" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />
<%--5--%>
@@ -1439,6 +1446,7 @@
<HeaderTemplate>Producto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
<asp:HyperLink ID="HlPS" runat="server" Text='<%# Eval("CodigoPS") %>' Visible="false" Target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie" Visible="false">

View File

@@ -1228,6 +1228,19 @@ Partial Class Compras_Compras
End Set
End Property
Private Property TienePermisoKardex As Boolean
Get
If ViewState("TienePermisoKardex") Is Nothing Then
ViewState("TienePermisoKardex") = False
End If
Return Boolean.Parse(ViewState("TienePermisoKardex").ToString)
End Get
Set(value As Boolean)
ViewState("TienePermisoKardex") = value
End Set
End Property
Private Property CveCompraDRMC As Integer
Get
If ViewState("CveCompraDRMC") Is Nothing Then
@@ -1246,6 +1259,7 @@ Partial Class Compras_Compras
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
CargaDatosAgregarPS()
TieneAnticiposXML = False
@@ -11252,6 +11266,14 @@ Partial Class Compras_Compras
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If TienePermisoKardex Then
e.Row.FCLiteral("LtlPS").Visible = False
e.Row.FCHyperLink("HlPS").Visible = True
e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DataKey("CvePS")}"
End If
Dim AplicaLote As Boolean = e.Row.DBCampo("AplicaLote").ToBool
Dim AplicaCaducidad As Boolean = e.Row.DBCampo("AplicaCaducidad").ToBool
@@ -19144,10 +19166,15 @@ Partial Class Compras_Compras
Protected Sub BtnDevolucion_Click(sender As Object, e As EventArgs)
Dim ObjCompras As New ClsCompras
Dim TieneError As Boolean = False
Dim ImporteCompra As Decimal = 0
Dim tCveSubProyeto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
Dim ModalidadDevolucion As Integer = 1 ' 1 - devolución para que alamcen la confirme, 2 - devolución en automático generando RNC
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then ModalidadDevolucion = 2
ObjCompras.IniciaTransacSQL()
Dim ImporteCompra As Decimal = 0
If ModalidadDevolucion = 1 Then
If EstatusAlmacen = 0 Then
For Each gvr As GridViewRow In GvSolDev.Rows
@@ -19160,10 +19187,25 @@ Partial Class Compras_Compras
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0)
End If
Next
If Not TieneError AndAlso ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1), UsuarioActual.CveUsuario) Then
EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
End If
ImporteRNC = ImporteCompra.RoundSQL
End If
InicializaDevolucionAlmacen()
Else
For Each gvr As GridViewRow In GvSolDev.Rows
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal
Dim PU As Decimal = gvr.DataKey("PU").ToDecimal
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
ImporteCompra = ImporteCompra + ((PU * Cantidad))
End If
Next
ImporteRNC = ImporteCompra.RoundSQL
If ChkEsDevolucionDevInv.Checked Then
@@ -19218,10 +19260,6 @@ Partial Class Compras_Compras
End If
End If
If Not TieneError AndAlso ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1), UsuarioActual.CveUsuario) Then
EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
End If
If Not TieneError Then
@@ -19232,7 +19270,7 @@ Partial Class Compras_Compras
End If
ObjCompras.Dispose()
InicializaDevolucionAlmacen()
End Sub
Function RegistroInventarioDevTemporal(ByRef transaccion As SqlTransaction, tCveSubProyecto As Integer, CveCompraDRMCRelacionada As Integer, EsCancelacion As Boolean) As Boolean
@@ -19619,6 +19657,13 @@ Partial Class Compras_Compras
e.Row.Font.Bold = True
End If
Else
If TienePermisoKardex Then
e.Row.FCLiteral("LtlPS").Visible = False
e.Row.FCHyperLink("HlPS").Visible = True
e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DataKey("CvePS")}"
End If
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
End If
End If

View File

@@ -425,7 +425,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código Prov.</Value>
<Value># Parte</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize>

View File

@@ -359,7 +359,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código Prov.</Value>
<Value># Parte</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9.5pt</FontSize>
@@ -875,6 +875,7 @@
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DsOC</DataSetName>
<Top>0cm</Top>
<Left>0.04788in</Left>
<Height>0.34081in</Height>
<Width>8.21665in</Width>
@@ -1700,7 +1701,7 @@
<Height>3.83039in</Height>
<Style />
</Body>
<Width>8.26453in</Width>
<Width>8.29578in</Width>
<Page>
<PageHeader>
<Height>5.96613cm</Height>
@@ -1884,7 +1885,7 @@
<Top>0.98635in</Top>
<Left>0.16378cm</Left>
<Height>1.36252in</Height>
<Width>2.82301in</Width>
<Width>4.02093in</Width>
<Style>
<Border>
<Style>None</Style>
@@ -1902,7 +1903,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0 or LEN(Parameters!ProveedorLugar.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize>
@@ -1932,6 +1933,14 @@
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!ProveedorLugar.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
@@ -1942,7 +1951,7 @@
<Top>2.50885cm</Top>
<Left>12.69644cm</Left>
<Height>3.45728cm</Height>
<Width>7.11877cm</Width>
<Width>8.00264cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>

View File

@@ -1247,7 +1247,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value EvaluationMode="Constant">Parameters!FechaImpresion.Value</Value>
<Value>=Parameters!FechaImpresion.Value</Value>
<Style>
<FontSize>9pt</FontSize>
<Format>D</Format>

View File

@@ -1629,7 +1629,14 @@ Partial Class Inventarios_EntradasSalidas
Dim Existencia As Decimal = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
' LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then
Dim Acunmulado As Decimal = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}")
If FechaCaducidadVal > MinFecha Then
Acunmulado = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} and Lote = '{Lote}' and FechaCaducidad = '{FechaCaducidadVal}' ")
End If
If Existencia - Cantidad - Acunmulado < 0 Then
If Existencia <= 0 Then
Alert("No hay existencia del producto: " & PS, TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")

View File

@@ -281,45 +281,7 @@ Partial Class Inventarios_Kardex
If UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1 Then
LnkExistenciasPorCapas.Visible = True
End If
'CARGA INDICADORES
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True
Dim Dr = DtTemp.FiltroUltimo("")
Dim TC = If(GlobalTipoCambio(NowADS()) > 0, GlobalTipoCambio(NowADS()), 1)
LtIndicador_Existencia.Text = Dr("Existencias").ToString.ToDecimal.ToString("#,##0.####")
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
Dim CostoPromedio As Decimal = If(Dr("Existencias").ToString.ToDecimal.RoundSQL(4) > 0, Dr("ValorInventario").ToString.ToDecimal.RoundSQL(4) / Dr("Existencias").ToString.ToDecimal.RoundSQL(4), 0)
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
'LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
'LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del día <b> $ {TC.FormatoNumero(4)} </b>"
If TxtSerie.Text <> "" Then
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
Else
LtIndicador_MensajeSerie.Text = ""
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
CargarOCPendientesCompra()
DivIndicadorOC.Visible = True
End If
UpIndicadores.Update()
GvM.Attributes.Add("data-heighterror", "430")
Else
GvM.Attributes.Add("data-heighterror", "270")
End If
GvM.DataSource = DtTemp
GvM.DataBind()
UpAcciones.Update()
@@ -382,6 +344,46 @@ Partial Class Inventarios_Kardex
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
dt = ObjInventarios.DtResultados.Copy
'CARGA INDICADORES
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True
Dim Dr = dt.FiltroUltimo("")
Dim TC = If(GlobalTipoCambio(NowADS()) > 0, GlobalTipoCambio(NowADS()), 1)
LtIndicador_Existencia.Text = Dr("Existencias").ToString.ToDecimal.ToString("#,##0.####")
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
Dim CostoPromedio As Decimal = If(Dr("Existencias").ToString.ToDecimal.RoundSQL(4) > 0, Dr("ValorInventario").ToString.ToDecimal.RoundSQL(4) / Dr("Existencias").ToString.ToDecimal.RoundSQL(4), 0)
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
'LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
'LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del día <b> $ {TC.FormatoNumero(4)} </b>"
If TxtSerie.Text <> "" Then
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
Else
LtIndicador_MensajeSerie.Text = ""
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
CargarOCPendientesCompra()
DivIndicadorOC.Visible = True
End If
UpIndicadores.Update()
GvM.Attributes.Add("data-heighterror", "430")
Else
GvM.Attributes.Add("data-heighterror", "270")
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente
ObjInventarios.Dispose()

View File

@@ -90,7 +90,7 @@
</div>
<div class="copyright">
<asp:Literal ID="Ltlcopyright" runat="server">2024 © AD Sistemas.</asp:Literal>
<asp:Literal ID="Ltlcopyright" runat="server">2025 © AD Sistemas.</asp:Literal>
</div>
<%--<div class="col-lg-offset-4 col-md-offset-4 col-sm-offset-3 col-lg-4 col-md-4 col-sm-6 col-xs-12 text-right">
<asp:LinkButton ID="linkRegistrar" runat="server" CssClass="restaurar-password" OnClientClick="window.location.href='ActivarUsuario.aspx'">Registrar</asp:LinkButton>

View File

@@ -998,6 +998,7 @@
</span>
<br />
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>'></asp:Label>
<asp:HyperLink ID="HlPS" runat="server" Text='<%# Eval("PS") %>' Visible="false" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Style="width: 100%; max-width: 600px;" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged1">
@@ -1948,12 +1949,12 @@
<div class="portlet-body">
<asp:GridView ID="GVH" runat="server" AutoGenerateColumns="False" GridLines="None" BorderWidth="0" Width="100%" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true">
<Columns>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="155px">
<ItemTemplate>
<asp:Literal ID="LblFecha" runat="server" Text='<%# Eval("FechaIng")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Concepto" />
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Concepto" ItemStyle-Width="100px" />
<asp:BoundField DataField="Anterior" HeaderText="Antes" />
<asp:BoundField DataField="Actual" HeaderText="Después" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />

View File

@@ -671,6 +671,19 @@ Partial Class OC_OC
End Set
End Property
Private Property TienePermisoKardex As Boolean
Get
If ViewState("TienePermisoKardex") Is Nothing Then
ViewState("TienePermisoKardex") = False
End If
Return Boolean.Parse(ViewState("TienePermisoKardex").ToString)
End Get
Set(value As Boolean)
ViewState("TienePermisoKardex") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -684,6 +697,8 @@ Partial Class OC_OC
EsGrupoDiaz = True
End If
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
CargaDatosAgregarPS()
CveProveedorOriginal = -1
InventarioPrePoliza176 = 0
@@ -4096,6 +4111,12 @@ Partial Class OC_OC
If e.Row.RowType = DataControlRowType.DataRow Then
If TienePermisoKardex AndAlso e.Row.RowState = DataControlRowState.Normal Then
e.Row.FCLabel("LblPS").Visible = False
e.Row.FCHyperLink("HlPS").Visible = True
e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DBCampo("CvePS").ToString}"
End If
Try
If e.Row.FCLabel("LtlCantidad") IsNot Nothing Then
e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip")
@@ -4316,6 +4337,7 @@ Partial Class OC_OC
End If
End If
End Sub
Protected Sub GvD_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvD.RowDeleting

View File

@@ -165,7 +165,7 @@
</ContentTemplate>
</asp:UpdatePanel>
<tr align="left" style="display:none;">
<tr align="left">
<td class="text-right"><b>Pedido:</b></td>
<td>
<asp:TextBox ID="TxtPedidoContrato" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
@@ -175,17 +175,12 @@
<asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
</td>
</tr>
<tr align="left" runat="server" id="TRVendedores" >
<td class="text-right"></td>
<td>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
<td colspan="4">
<div class="row">
<div class="col-md-6 " style="text-align:center"> <asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></div>
</div>
</td>
</tr>
</table>
</asp:Panel>

View File

@@ -165,6 +165,7 @@
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha Hora Cirugia" DataField="FechaCirugia" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:dd/MM/yyyy hh:mm}" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tipo Venta" DataField="TipoVenta" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />

View File

@@ -2051,6 +2051,7 @@
<HeaderTemplate>Producto o Servicio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("PS") %>'></asp:Literal>
<asp:HyperLink ID="HlPS" runat="server" Text='<%# Eval("PS") %>' Visible="false" Target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>

View File

@@ -2445,6 +2445,8 @@ Partial Class Ventas
Exit Sub
End If
Modalidad = ""
Opcion = ""
Index = 0
@@ -9557,6 +9559,7 @@ Partial Class Ventas
e.Row.CssClass = "SubTotales"
End If
Else
Dim tFecha As Date = If(e.Row.DBCampo("Fecha") <> "", e.Row.DBCampo("Fecha").ToDate, NowADS())
e.Row.FCLiteral("LtlPS").Text = String.Format("<a Class='Texto' target='_blank' href='/Inventarios/Kardex.aspx?CvePS={0}&CveAlmacen={1}&FechaI={2}&FechaF={3}'> {4}</a>", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveAlmacen"), tFecha.AddDays(-7).ToShortDateString, tFecha.AddDays(7).ToShortDateString, e.Row.DBCampo("PS"))
@@ -9578,6 +9581,8 @@ Partial Class Ventas
End If
End If
End If
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then