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

View File

@@ -1228,6 +1228,19 @@ Partial Class Compras_Compras
End Set End Set
End Property 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 Private Property CveCompraDRMC As Integer
Get Get
If ViewState("CveCompraDRMC") Is Nothing Then If ViewState("CveCompraDRMC") Is Nothing Then
@@ -1246,6 +1259,7 @@ Partial Class Compras_Compras
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip") 'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top") 'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
CargaDatosAgregarPS() CargaDatosAgregarPS()
TieneAnticiposXML = False TieneAnticiposXML = False
@@ -11252,6 +11266,14 @@ Partial Class Compras_Compras
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then 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 AplicaLote As Boolean = e.Row.DBCampo("AplicaLote").ToBool
Dim AplicaCaducidad As Boolean = e.Row.DBCampo("AplicaCaducidad").ToBool Dim AplicaCaducidad As Boolean = e.Row.DBCampo("AplicaCaducidad").ToBool
@@ -19144,84 +19166,100 @@ Partial Class Compras_Compras
Protected Sub BtnDevolucion_Click(sender As Object, e As EventArgs) Protected Sub BtnDevolucion_Click(sender As Object, e As EventArgs)
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim ImporteCompra As Decimal = 0
Dim tCveSubProyeto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero 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() ObjCompras.IniciaTransacSQL()
Dim ImporteCompra As Decimal = 0 If ModalidadDevolucion = 1 Then
If EstatusAlmacen = 0 Then If EstatusAlmacen = 0 Then
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
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal)
ImporteCompra = ImporteCompra + ((PU * Cantidad))
Else
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
End If
InicializaDevolucionAlmacen()
Else
For Each gvr As GridViewRow In GvSolDev.Rows For Each gvr As GridViewRow In GvSolDev.Rows
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal Dim Cantidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal
Dim PU As Decimal = gvr.DataKey("PU").ToDecimal Dim PU As Decimal = gvr.DataKey("PU").ToDecimal
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal)
ImporteCompra = ImporteCompra + ((PU * Cantidad)) ImporteCompra = ImporteCompra + ((PU * Cantidad))
Else
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0)
End If End If
Next Next
End If
ImporteRNC = ImporteCompra.RoundSQL ImporteRNC = ImporteCompra.RoundSQL
If ChkEsDevolucionDevInv.Checked Then
If ChkEsDevolucionDevInv.Checked Then Dim objConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL)
Dim objConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL) CvePrePoliza = objConta.AddPrePolizas("Compras/RncDevInv", 53, ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, $"RNC Devolucion Inv {TxtSerie.Text}-{TxtFolio.Text}",
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=0, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue,
UsuarioActual.CveEmpresa), CveTipoPoliza:=objConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
If CvePrePoliza > 0 Then
CvePrePoliza = objConta.AddPrePolizas("Compras/RncDevInv", 53, ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, $"RNC Devolucion Inv {TxtSerie.Text}-{TxtFolio.Text}", Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=0, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue,
UsuarioActual.CveEmpresa), CveTipoPoliza:=objConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
If CvePrePoliza > 0 Then
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal Dim CompraActual As New Compra
CompraActual.CveCompra = CveCompra
CompraActual.CveTipoConceptoProveedor = CveTipoConcepto
CompraActual.CveProveedor = CveProveedor
CompraActual.CveMoneda = DdlMoneda.SelectedValue.ToEntero
CompraActual.Fecha = TxtFecha.Text.ToDate
CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim
CompraActual.ProveedorNombre = HplProveedor.Text
CompraActual.TC = TipoCambio
CompraActual.Total = TxtTotal.Text.ToDecimal
CompraActual.IVA = TxtIVA.Text.ToDecimal
CompraActual.IVADeducible = TxtIVA.Text.ToDecimal
CompraActual.IEPS = TxtIEPS.Text.ToDecimal
CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal
CompraActual.RetISR = TxtRetISR.Text.ToDecimal
CompraActual.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero
CompraActual.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero
CompraActual.PorcentajeIVA = PorcentajeIVA
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = tCveSubProyeto
CompraActual.EsImportacion = chkImportacion.Checked
Dim CompraActual As New Compra If Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, objConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", DdlMoneda.SelectedValue.ToEntero,
CompraActual.CveCompra = CveCompra TxtSerie.Text, TxtFolio.Text, EsDRMN:=True) Then
CompraActual.CveTipoConceptoProveedor = CveTipoConcepto TieneError = True
CompraActual.CveProveedor = CveProveedor End If
CompraActual.CveMoneda = DdlMoneda.SelectedValue.ToEntero
CompraActual.Fecha = TxtFecha.Text.ToDate
CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim
CompraActual.ProveedorNombre = HplProveedor.Text
CompraActual.TC = TipoCambio
CompraActual.Total = TxtTotal.Text.ToDecimal
CompraActual.IVA = TxtIVA.Text.ToDecimal
CompraActual.IVADeducible = TxtIVA.Text.ToDecimal
CompraActual.IEPS = TxtIEPS.Text.ToDecimal
CompraActual.RetIVA = TxtRetIVA.Text.ToDecimal
CompraActual.RetISR = TxtRetISR.Text.ToDecimal
CompraActual.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero
CompraActual.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero
CompraActual.PorcentajeIVA = PorcentajeIVA
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = tCveSubProyeto
CompraActual.EsImportacion = chkImportacion.Checked
If Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, objConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", DdlMoneda.SelectedValue.ToEntero, Else
TxtSerie.Text, TxtFolio.Text, EsDRMN:=True) Then
TieneError = True TieneError = True
End If End If
Else If Not CveCompraDRMC > 0 Then
TieneError = True
End If
If Not CveCompraDRMC > 0 Then
TieneError = True
End If
If Not TieneError Then
If Not RegistroInventarioDevTemporal(ObjCompras.IniciaTransacSQL, tCveSubProyeto, CveCompraDRMC, EsCancelacion:=False) Then
TieneError = True TieneError = True
End If End If
If Not TieneError Then
If Not RegistroInventarioDevTemporal(ObjCompras.IniciaTransacSQL, tCveSubProyeto, CveCompraDRMC, EsCancelacion:=False) Then
TieneError = True
End If
End If
End If 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 End If
If Not TieneError Then If Not TieneError Then
@@ -19232,7 +19270,7 @@ Partial Class Compras_Compras
End If End If
ObjCompras.Dispose() ObjCompras.Dispose()
InicializaDevolucionAlmacen()
End Sub End Sub
Function RegistroInventarioDevTemporal(ByRef transaccion As SqlTransaction, tCveSubProyecto As Integer, CveCompraDRMCRelacionada As Integer, EsCancelacion As Boolean) As Boolean 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 e.Row.Font.Bold = True
End If End If
Else 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 e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
End If End If
End If End If

View File

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

View File

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

View File

@@ -1247,7 +1247,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value EvaluationMode="Constant">Parameters!FechaImpresion.Value</Value> <Value>=Parameters!FechaImpresion.Value</Value>
<Style> <Style>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
<Format>D</Format> <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) 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 ' 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 If Existencia <= 0 Then
Alert("No hay existencia del producto: " & PS, TipoMensaje.MsgAdvertencia) Alert("No hay existencia del producto: " & PS, TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") 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 If UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1 Then
LnkExistenciasPorCapas.Visible = True LnkExistenciasPorCapas.Visible = True
End If 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.DataSource = DtTemp
GvM.DataBind() GvM.DataBind()
UpAcciones.Update() 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, 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 ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
dt = ObjInventarios.DtResultados.Copy 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 End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente
ObjInventarios.Dispose() ObjInventarios.Dispose()

View File

@@ -90,7 +90,7 @@
</div> </div>
<div class="copyright"> <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>
<%--<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"> <%--<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> <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> </span>
<br /> <br />
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>'></asp:Label> <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> </ItemTemplate>
<EditItemTemplate> <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"> <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"> <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"> <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> <Columns>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Fecha" ItemStyle-Width="155px">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LblFecha" runat="server" Text='<%# Eval("FechaIng")%>'></asp:Literal> <asp:Literal ID="LblFecha" runat="server" Text='<%# Eval("FechaIng")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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="Anterior" HeaderText="Antes" />
<asp:BoundField DataField="Actual" HeaderText="Después" /> <asp:BoundField DataField="Actual" HeaderText="Después" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" /> <asp:BoundField DataField="Usuario" HeaderText="Usuario" />

View File

@@ -671,6 +671,19 @@ Partial Class OC_OC
End Set End Set
End Property 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 #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -684,6 +697,8 @@ Partial Class OC_OC
EsGrupoDiaz = True EsGrupoDiaz = True
End If End If
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
CargaDatosAgregarPS() CargaDatosAgregarPS()
CveProveedorOriginal = -1 CveProveedorOriginal = -1
InventarioPrePoliza176 = 0 InventarioPrePoliza176 = 0
@@ -4096,6 +4111,12 @@ Partial Class OC_OC
If e.Row.RowType = DataControlRowType.DataRow Then 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 Try
If e.Row.FCLabel("LtlCantidad") IsNot Nothing Then If e.Row.FCLabel("LtlCantidad") IsNot Nothing Then
e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip") e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip")
@@ -4316,6 +4337,7 @@ Partial Class OC_OC
End If End If
End If End If
End Sub End Sub
Protected Sub GvD_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvD.RowDeleting Protected Sub GvD_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvD.RowDeleting

View File

@@ -75,7 +75,7 @@
<%--<asp:DropDownList ID="DdlNombre" runat="server" CssClass="select2me" DataTextField="CodigoNombre" AutoPostBack="true" DataValueField="CveCliente" Width="230px"></asp:DropDownList>--%> <%--<asp:DropDownList ID="DdlNombre" runat="server" CssClass="select2me" DataTextField="CodigoNombre" AutoPostBack="true" DataValueField="CveCliente" Width="230px"></asp:DropDownList>--%>
</td> </td>
<td class="text-right"><b>Vendedor:</b></td> <td class="text-right"><b>Vendedor:</b></td>
<td> <td>
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="228px" > <asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="228px" >
<asp:ListItem Selected="true" Text="Todos" Value="-1" ></asp:ListItem> <asp:ListItem Selected="true" Text="Todos" Value="-1" ></asp:ListItem>
@@ -165,7 +165,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<tr align="left" style="display:none;"> <tr align="left">
<td class="text-right"><b>Pedido:</b></td> <td class="text-right"><b>Pedido:</b></td>
<td> <td>
<asp:TextBox ID="TxtPedidoContrato" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox> <asp:TextBox ID="TxtPedidoContrato" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
@@ -174,18 +174,13 @@
<td> <td>
<asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox> <asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
</td> </td>
</tr> </tr>
<tr align="left" runat="server" id="TRVendedores" >
<td class="text-right"></td>
<td>
</td>
</tr>
<tr> <tr>
<td style="text-align: center;" colspan="4"> <td colspan="4">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td> <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> </tr>
</table> </table>
</asp:Panel> </asp:Panel>

View File

@@ -165,6 +165,7 @@
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" /> <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="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="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="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />

View File

@@ -1982,7 +1982,7 @@
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Producto</HeaderTemplate> <HeaderTemplate>Producto</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal> <asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Serie" Visible="false"> <asp:TemplateField HeaderText="Serie" Visible="false">
@@ -2051,6 +2051,7 @@
<HeaderTemplate>Producto o Servicio</HeaderTemplate> <HeaderTemplate>Producto o Servicio</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("PS") %>'></asp:Literal> <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> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -2445,6 +2445,8 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
Modalidad = "" Modalidad = ""
Opcion = "" Opcion = ""
Index = 0 Index = 0
@@ -9557,6 +9559,7 @@ Partial Class Ventas
e.Row.CssClass = "SubTotales" e.Row.CssClass = "SubTotales"
End If End If
Else Else
Dim tFecha As Date = If(e.Row.DBCampo("Fecha") <> "", e.Row.DBCampo("Fecha").ToDate, NowADS()) 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")) 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 End If
End If End If
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then