Wish List

This commit is contained in:
rakcsle
2025-03-26 15:27:34 -07:00
parent 261eb6e393
commit ce5e276ab4
2 changed files with 65 additions and 14 deletions

View File

@@ -488,7 +488,7 @@
REQ REQ
</div> </div>
<div style="color: blue; font-size: 20px; font-weight: bold;"> <div style="color: blue; font-size: 20px; font-weight: bold;">
<asp:LinkButton ID="LnkIndicador_REQ" Text="" OnClick="LnkIndicador_REQ_Click" runat="server" CssClass="Texto" /> <asp:LinkButton ID="LnkIndicador_REQ" Text="0" OnClick="LnkIndicador_REQ_Click" runat="server" CssClass="Texto" />
</div> </div>
</div> </div>
@@ -666,7 +666,7 @@
<div class="modal-content" style="width:500px;"> <div class="modal-content" style="width:500px;">
<div class="modal-header "> <div class="modal-header ">
<h4 class="modal-title"> <h4 class="modal-title">
<asp:Literal ID="Literal3" Text="OC Pendientes por Recibir" runat="server"> </asp:Literal></h4> <asp:Literal ID="LtlModalOC" Text="OC Pendientes por Recibir" runat="server"> </asp:Literal></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row" > <div class="row" >

View File

@@ -32,6 +32,20 @@ Partial Class Inventarios_Kardex
End Property End Property
Private Property TipoCancelacion As Integer
Get
If ViewState("TipoCancelacion") Is Nothing Then
ViewState("TipoCancelacion") = -1
End If
Return ViewState("TipoCancelacion").ToString.ToEntero
End Get
Set
ViewState("TipoCancelacion") = 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
@@ -335,7 +349,7 @@ Partial Class Inventarios_Kardex
End Sub End Sub
Private Sub CargarOCPendientesCompra(Opcion As Integer) ' Opcion1 OC, 2 REQ Private Sub CargarOCPendientesCompra(Opcion As Integer, Optional CargaGrid As Boolean = False) ' Opcion1 OC, 2 REQ
Dim tCveSubProyectos As String = "-1" Dim tCveSubProyectos As String = "-1"
@@ -347,12 +361,18 @@ Partial Class Inventarios_Kardex
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa, Opcion:=Opcion) Then If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa, Opcion:=Opcion) Then
GvOC.DataSource = ObjOC.DtResultados.Copy.FiltraParametros("", "Fecha Desc") If CargaGrid Then
GvOC.DataSource = ObjOC.DtResultados.Copy.FiltraParametros("", "Fecha Desc")
End If
If Opcion = 1 Then If Opcion = 1 Then
LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
LnkIndicador_OC2.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() LnkIndicador_OC2.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
ElseIf Opcion = 2 Then ElseIf Opcion = 2 Then
LnkIndicador_REQ.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString().ToDecimal.RoundSQL(2).ToString LnkIndicador_REQ.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString().ToDecimal.RoundSQL(2).ToString("###,###.##")
If LnkIndicador_REQ.Text = "" Then
LnkIndicador_REQ.Text = "0"
End If
End If End If
End If End If
@@ -846,13 +866,19 @@ Partial Class Inventarios_Kardex
End Function End Function
Protected Sub LnkIndicador_OC_Click(sender As Object, e As EventArgs) Protected Sub LnkIndicador_OC_Click(sender As Object, e As EventArgs)
UpModalOC.Update() TipoCancelacion = 1
LtlModalOC.Text = "OC Pendientes por Recibir"
CargarOCPendientesCompra(1, True)
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalOC")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalOC"))
UpModalOC.Update()
End Sub End Sub
Protected Sub LnkIndicador_REQ_Click(sender As Object, e As EventArgs) Protected Sub LnkIndicador_REQ_Click(sender As Object, e As EventArgs)
UpModalOC.Update() TipoCancelacion = 2
LtlModalOC.Text = "Requisiciones"
CargarOCPendientesCompra(2, True)
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalOC")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalOC"))
UpModalOC.Update()
End Sub End Sub
Protected Sub LnkCancelarOCDetalle_Click(sender As Object, e As EventArgs) Protected Sub LnkCancelarOCDetalle_Click(sender As Object, e As EventArgs)
@@ -866,9 +892,14 @@ Partial Class Inventarios_Kardex
End If End If
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.CancelarPartidaPendiente(CveOrdenCompraDetalle, NuevaCantidad, UsuarioActual.CveEmpresa, GlobalDTAFCaracteristicasOpciones:=1) Then If ObjOC.CancelarPartidaPendiente(CveOrdenCompraDetalle, NuevaCantidad, UsuarioActual.CveEmpresa, Opcion:=TipoCancelacion) Then
CargarOCPendientesCompra(1) If TipoCancelacion = 1 Then
CargarOCPendientesCompra(2) CargarOCPendientesCompra(1, True)
Else
CargarOCPendientesCompra(2, True)
End If
Alert("La partida se cancelo correctamente.") Alert("La partida se cancelo correctamente.")
End If End If
@@ -929,7 +960,9 @@ Partial Class Inventarios_Kardex
Protected Sub LnkAgrgarWishList_Click(sender As Object, e As EventArgs) Protected Sub LnkAgrgarWishList_Click(sender As Object, e As EventArgs)
AgregarAWishList() If AgregarAWishList() Then
CargarOCPendientesCompra(2)
End If
End Sub End Sub
Private Function AgregarAWishList() As Boolean Private Function AgregarAWishList() As Boolean
@@ -941,6 +974,7 @@ Partial Class Inventarios_Kardex
Dim CveSubProyecto As Integer = -1 Dim CveSubProyecto As Integer = -1
Dim FolioOrdenCompra As String = "" Dim FolioOrdenCompra As String = ""
Dim CveOrdenCompra As Integer = -1 Dim CveOrdenCompra As Integer = -1
Dim CveOrdenCompraDetalle As Integer = -1
Dim UltimoCosto As Decimal = 0D Dim UltimoCosto As Decimal = 0D
Dim CveProveedorCompra As Integer = -1 Dim CveProveedorCompra As Integer = -1
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
@@ -1020,15 +1054,32 @@ Partial Class Inventarios_Kardex
If respuesta AndAlso CveOrdenCompra > 0 Then If respuesta AndAlso CveOrdenCompra > 0 Then
If ObjOC.GetOrdenesDetalle(CveOrdenCompra, UsuarioActual.CveEmpresa) Then
Dim drOcDetalle As DataRow = ObjOC.DtResultados.FiltroPrimero($"CvePs={CvePS}")
If drOcDetalle IsNot Nothing Then
CveOrdenCompraDetalle = drOcDetalle("CveOrdenCompraDetalle").ToString.ToEntero
Cantidad = drOcDetalle("Cantidad").ToString.ToDecimal + Cantidad
End If
End If
Dim Total As Decimal = (Cantidad * UltimoCosto).RoundSQL Dim Total As Decimal = (Cantidad * UltimoCosto).RoundSQL
Dim IVA As Decimal = (Total * PorcentajeIVA).RoundSQL Dim IVA As Decimal = (Total * PorcentajeIVA).RoundSQL
RetIVA = IVA * PorcentajeRetIVA RetIVA = IVA * PorcentajeRetIVA
RetISR = Total * PorcentajeRetISR RetISR = Total * PorcentajeRetISR
If Not ObjOC.AddOrdenCompraDetalle(CveOrdenCompra, Cantidad, CveUnidadMedida, CvePS, UltimoCosto, CveSubProyecto, -1, "Obs", UsuarioActual.CveUsuario, If CveOrdenCompraDetalle > 0 Then
IVA:=IVA, RetIVA:=RetIVA, RetISR:=RetISR, Total:=Total, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=PorcentajeRetIVA, RetISRPorcentaje:=PorcentajeRetISR) Then If Not ObjOC.UpdateOrdenCompraDetalle(Cantidad, CveUnidadMedida, CvePS, UltimoCosto, CveSubProyecto, -1, "Obs", UsuarioActual.CveUsuario, CveOrdenCompraDetalle, -1, 0, IVA:=IVA, RetIVA:=RetIVA, RetISR:=RetISR,
respuesta = False Total:=Total, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=PorcentajeRetIVA, RetISRPorcentaje:=PorcentajeRetISR) >= 0 Then
respuesta = False
End If
Else
If Not ObjOC.AddOrdenCompraDetalle(CveOrdenCompra, Cantidad, CveUnidadMedida, CvePS, UltimoCosto, CveSubProyecto, -1, "Obs", UsuarioActual.CveUsuario,
IVA:=IVA, RetIVA:=RetIVA, RetISR:=RetISR, Total:=Total, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=PorcentajeRetIVA, RetISRPorcentaje:=PorcentajeRetISR) Then
respuesta = False
End If
End If End If
End If End If