--
This commit is contained in:
@@ -425,7 +425,7 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpNumeroParte">
|
||||
<ContentTemplate>
|
||||
<asp:Label runat="server" ID="LblNumeroParte" Text="" Visible ="false"></asp:Label>
|
||||
@@ -433,6 +433,30 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:UpdatePanel runat="server" ID="UpAddWishList" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div runat="server" id="DVWishList" visible="false">
|
||||
<table style="width:170px!important" >
|
||||
<td style="width:70px!important">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox runat="server" ID="TxtCantidad" Width="70px" CssClass="form-control"></asp:TextBox>
|
||||
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtCantidad" FilterType="Custom" ValidChars="1234567890." />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td style="width:100px!important">
|
||||
<asp:LinkButton ID="LnkAgrgarWishList" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkAgrgarWishList_Click" Width="91px"><i class="fa fa-shopping-cart" aria-hidden="true"></i> Agregar</asp:LinkButton>
|
||||
</td>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpOCS" UpdateMode="Conditional">
|
||||
|
||||
@@ -67,8 +67,15 @@ Partial Class Inventarios_Kardex
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
LblPS.ToolTip = ddlProducto2.SelectedValue
|
||||
lblAlm.InnerText = ddlProducto2.SelectedValue
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
DVWishList.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -893,7 +900,7 @@ Partial Class Inventarios_Kardex
|
||||
Protected Sub ddlProducto2_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
LnkKPIVerComportamiento.Visible = False
|
||||
If ddlProducto2.SelectedValue.ToEntero > 0 And UsuarioActual.CveRol = 1 Then
|
||||
If ddlProducto2.SelectedValue.ToEntero > 0 And UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
LnkKPIVerComportamiento.Visible = True
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
@@ -901,4 +908,129 @@ Partial Class Inventarios_Kardex
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAgrgarWishList_Click(sender As Object, e As EventArgs)
|
||||
AgregarAWishList()
|
||||
End Sub
|
||||
|
||||
Private Function AgregarAWishList() As Boolean
|
||||
|
||||
Dim respuesta As Boolean = True
|
||||
Dim CveAlmacen As Integer = -1
|
||||
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
Dim almacenStr As String() = ddlAlmacen.GetSelectedValues().Split(","c)
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Dim FolioOrdenCompra As String = ""
|
||||
Dim CveOrdenCompra As Integer = -1
|
||||
Dim UltimoCosto As Decimal = 0D
|
||||
Dim CveProveedorCompra As Integer = -1
|
||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||
Dim PorcentajeIVA As Decimal = 0
|
||||
Dim PorcentajeIVASucursal As Decimal = 0
|
||||
Dim CveUnidadMedida As Integer = -1
|
||||
Dim RetISR As Decimal = 0
|
||||
Dim RetIVA As Decimal = 0
|
||||
Dim PorcentajeRetISR As Decimal = 0
|
||||
Dim PorcentajeRetIVA As Decimal = 0
|
||||
|
||||
|
||||
If Not Cantidad > 0 Then
|
||||
Alert("Debe indicar una cantidad.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
If almacenStr.Length > 0 Then
|
||||
CveAlmacen = almacenStr(0).ToEntero
|
||||
End If
|
||||
|
||||
If CveAlmacen > 0 Then
|
||||
CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
|
||||
If CveSubProyecto > 0 Then
|
||||
Dim DRowSubProyecto As DataRow = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto).FiltroPrimero("")
|
||||
If DRowSubProyecto IsNot Nothing Then
|
||||
PorcentajeIVASucursal = DRowSubProyecto("IVA").ToString.ToDecimal
|
||||
Else
|
||||
Alert("No se encontro el subproyecto.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Alert("No se encontro el subproyecto.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Alert("Debe seleccionar un almacén.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim DTRowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("")
|
||||
If DTRowPS IsNot Nothing Then
|
||||
UltimoCosto = DTRowPS("UltimoCosto").ToString.ToDecimal
|
||||
CveProveedorCompra = If(DTRowPS("CveProveedorCompra").ToString.ToEntero > 0, DTRowPS("CveProveedorCompra").ToString.ToEntero, -1)
|
||||
CveUnidadMedida = DTRowPS("CveUnidadMedida").ToString.ToEntero
|
||||
PorcentajeIVA = If(DTRowPS("IVA").ToString.ToEntero = -1, PorcentajeIVASucursal, 0)
|
||||
PorcentajeRetISR = DTRowPS("RetISR").ToString.ToDecimal
|
||||
PorcentajeRetIVA = DTRowPS("RetIVA").ToString.ToDecimal
|
||||
End If
|
||||
Else
|
||||
Alert("Debe seleccionar un producto.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim ObjOC As New ClsOC
|
||||
ObjOC.IniciaTransacSQL()
|
||||
|
||||
If ObjOC.GetOrdenesCompraRep("REQ", -1, CveSubProyecto, -1, 0, MinFecha, MaxFecha, -1, CveProveedorCompra, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) Then
|
||||
If ObjOC.DtResultados IsNot Nothing AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
|
||||
CveOrdenCompra = ObjOC.DtResultados(0)("CveOrdenCompra").ToString.ToEntero
|
||||
FolioOrdenCompra = ObjOC.DtResultados(0)("SerieFolio").ToString
|
||||
End If
|
||||
Else
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
If respuesta AndAlso Not CveOrdenCompra > 0 Then
|
||||
If ObjOC.AddOrdenCompra("REQ", CveSubProyecto, "Compra de Stock", "Compra de Stock", 1, NowADS, 1, 0, NowADS.ToString("dd/MM/yyyy"), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveProveedorCompra, CveSubProyectoEntrega:=CveSubProyecto, PorcentajeIVA:=PorcentajeIVA) Then
|
||||
CveOrdenCompra = ObjOC.CveOrdenCompra
|
||||
FolioOrdenCompra = ObjOC.SerieFolio
|
||||
Else
|
||||
respuesta = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If respuesta AndAlso CveOrdenCompra > 0 Then
|
||||
|
||||
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
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If respuesta Then
|
||||
Alert($"Producto agregado a la lista, requisición: {FolioOrdenCompra}.", TipoMensaje.ToastInformacion)
|
||||
ObjOC.Commit()
|
||||
TxtCantidad.Text = ""
|
||||
UpAddWishList.Update()
|
||||
Else
|
||||
Alert("No se agrego el producto a la lista.", TipoMensaje.ToastAdventencia)
|
||||
ObjOC.RollBack()
|
||||
End If
|
||||
|
||||
|
||||
ObjOC.Dispose()
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_RecepcionAlmacen
|
||||
@@ -2568,6 +2570,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End If
|
||||
|
||||
Dim CveProveedorCompra As Integer = -1
|
||||
Try
|
||||
'RECARGA TC CUANDO ES RECEPCION CON OC Y DOLARES
|
||||
If CveOCSurtir > 0 And CveMoneda <> 1 Then
|
||||
@@ -3346,6 +3349,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
'PREPOLIZA - SOLO CUANDO SEA RECEPCIÓN
|
||||
|
||||
If TipoMovimiento = 1 AndAlso Not ErrorMovInv Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
@@ -3372,6 +3376,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate
|
||||
Fecha = TxtFecha.Text.ToDate
|
||||
CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero
|
||||
CveProveedorCompra = CveProveedor
|
||||
ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString
|
||||
SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}"
|
||||
CveConceptoContableCosto = 205
|
||||
@@ -3663,6 +3668,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
RenombrarBitacoras()
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv And CveProveedorCompra > 0 And CveCompraSurtir > 0 Then
|
||||
If Not ActualizaFechaVencimientoCompra(CveCompraSurtir, CveProveedorCompra, ObjInventario.IniciaTransacSQL) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'FINAL
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||
@@ -3764,6 +3775,31 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Function ActualizaFechaVencimientoCompra(CveCompra As Integer, CveProveedor As Integer, TransaccionSql As SqlTransaction) As Boolean
|
||||
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
Dim objProveedores As New ClsCompProveedores(TransaccionSql)
|
||||
Dim objCompras As New ClsCompras(TransaccionSql)
|
||||
Dim CveTipoFechaVencimiento As Integer = 1
|
||||
|
||||
If objProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
CveTipoFechaVencimiento = objProveedores.CveTipoFechaVencimiento
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If CveTipoFechaVencimiento = 2 Then
|
||||
If Not objCompras.UpdateFechaVencimientoCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Return If(ErrorProceso, False, True)
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub RenombrarBitacoras()
|
||||
Dim fechaActual As String = DateTime.Now.ToString("yyyyMMddHHmmss")
|
||||
|
||||
|
||||
@@ -2737,6 +2737,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||
TmpDT.Columns("CvePromocionDetalle").DefaultValue = -1
|
||||
TmpDT.Columns.Add("CantidadConversion", GetType(Integer))
|
||||
TmpDT.Columns("CantidadConversion").DefaultValue = 0
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user