Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3288,8 +3288,9 @@
|
||||
<asp:CheckBox ID="ChkUsaLimiteCredito" runat="server" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList runat="server" ID="DdlTipoFechaVencimiento" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Value="1">Fecha Factura</asp:ListItem>
|
||||
<asp:DropDownList runat="server" ID="DdlTipoFechaVencimiento" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Value="-1">-</asp:ListItem>
|
||||
<asp:ListItem Value="1" Selected="True">Fecha Factura</asp:ListItem>
|
||||
<asp:ListItem Value="2">Fecha Entrada</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@
|
||||
REQ
|
||||
</div>
|
||||
<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>
|
||||
@@ -666,7 +666,7 @@
|
||||
<div class="modal-content" style="width:500px;">
|
||||
<div class="modal-header ">
|
||||
<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 class="modal-body">
|
||||
<div class="row" >
|
||||
|
||||
@@ -32,6 +32,20 @@ Partial Class Inventarios_Kardex
|
||||
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
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -335,7 +349,7 @@ Partial Class Inventarios_Kardex
|
||||
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"
|
||||
@@ -347,12 +361,18 @@ Partial Class Inventarios_Kardex
|
||||
Dim ObjOC As New ClsOC
|
||||
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
|
||||
LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
|
||||
LnkIndicador_OC2.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
|
||||
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
|
||||
@@ -846,13 +866,19 @@ Partial Class Inventarios_Kardex
|
||||
End Function
|
||||
|
||||
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"))
|
||||
UpModalOC.Update()
|
||||
End Sub
|
||||
|
||||
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"))
|
||||
UpModalOC.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkCancelarOCDetalle_Click(sender As Object, e As EventArgs)
|
||||
@@ -866,9 +892,14 @@ Partial Class Inventarios_Kardex
|
||||
End If
|
||||
|
||||
Dim ObjOC As New ClsOC
|
||||
If ObjOC.CancelarPartidaPendiente(CveOrdenCompraDetalle, NuevaCantidad, UsuarioActual.CveEmpresa, GlobalDTAFCaracteristicasOpciones:=1) Then
|
||||
CargarOCPendientesCompra(1)
|
||||
CargarOCPendientesCompra(2)
|
||||
If ObjOC.CancelarPartidaPendiente(CveOrdenCompraDetalle, NuevaCantidad, UsuarioActual.CveEmpresa, Opcion:=TipoCancelacion) Then
|
||||
If TipoCancelacion = 1 Then
|
||||
CargarOCPendientesCompra(1, True)
|
||||
Else
|
||||
CargarOCPendientesCompra(2, True)
|
||||
End If
|
||||
|
||||
|
||||
Alert("La partida se cancelo correctamente.")
|
||||
End If
|
||||
|
||||
@@ -929,7 +960,9 @@ Partial Class Inventarios_Kardex
|
||||
|
||||
|
||||
Protected Sub LnkAgrgarWishList_Click(sender As Object, e As EventArgs)
|
||||
AgregarAWishList()
|
||||
If AgregarAWishList() Then
|
||||
CargarOCPendientesCompra(2)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function AgregarAWishList() As Boolean
|
||||
@@ -941,6 +974,7 @@ Partial Class Inventarios_Kardex
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Dim FolioOrdenCompra As String = ""
|
||||
Dim CveOrdenCompra As Integer = -1
|
||||
Dim CveOrdenCompraDetalle As Integer = -1
|
||||
Dim UltimoCosto As Decimal = 0D
|
||||
Dim CveProveedorCompra As Integer = -1
|
||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||
@@ -1020,15 +1054,32 @@ Partial Class Inventarios_Kardex
|
||||
|
||||
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 IVA As Decimal = (Total * PorcentajeIVA).RoundSQL
|
||||
RetIVA = IVA * PorcentajeRetIVA
|
||||
RetISR = Total * PorcentajeRetISR
|
||||
|
||||
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
|
||||
If CveOrdenCompraDetalle > 0 Then
|
||||
If Not ObjOC.UpdateOrdenCompraDetalle(Cantidad, CveUnidadMedida, CvePS, UltimoCosto, CveSubProyecto, -1, "Obs", UsuarioActual.CveUsuario, CveOrdenCompraDetalle, -1, 0, IVA:=IVA, RetIVA:=RetIVA, RetISR:=RetISR,
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -40310,34 +40310,6 @@ Partial Class Ventas
|
||||
DVGvPSProced.Visible = True
|
||||
GvPSProced.Columns(4).Visible = RBLTipoVenta.SelectedValue = "2" ' comisión Ed. Médica, solo cuando es pago directo
|
||||
|
||||
For Each GvRow As GridViewRow In GvPSProced.Rows
|
||||
If RBLTipoVenta.SelectedValue = "2" Then
|
||||
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
Dim PU As Decimal = GvRow.DataKey("Precio").ToDecimal
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
|
||||
'SUGIERE PRECIO
|
||||
Dim PrecioSugerido As Decimal = 0
|
||||
Dim tPrecioSugerido As Decimal = 0
|
||||
tPrecioSugerido = PU
|
||||
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion)
|
||||
|
||||
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
|
||||
If ObjPrecioSugerido.CvePrecioLista > 0 AndAlso DivPrecioLista.Visible Then
|
||||
DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista)
|
||||
End If
|
||||
|
||||
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
|
||||
GvRow.FCTextBox("TxtPrecio").Text = PrecioSugerido.ToString("#,##0.####")
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user