OC Es Temporal, PS Actualziar Utimo Costo
This commit is contained in:
@@ -4,6 +4,7 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Newtonsoft.Json
|
||||
@@ -1056,6 +1057,12 @@ Partial Class OC_OC
|
||||
TrDescuentoEscalonado.Visible = True
|
||||
TrDescuentoProntoPago.Visible = True
|
||||
TrBotonesInvTemporal.Visible = True
|
||||
|
||||
If TipoOC = "OC" AndAlso UsuarioActual.TienePermisoProceso(401) AndAlso EsNuevo Then
|
||||
ChkEsTemporalRegistro.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
|
||||
@@ -1550,7 +1557,7 @@ Partial Class OC_OC
|
||||
|
||||
|
||||
|
||||
|
||||
ChkEsTemporal.Checked = Boolean.Parse(objOC.DtResultados.Rows(0)("EsTemporal").ToString)
|
||||
|
||||
'PROMOCIONES
|
||||
TxtPromocion.Text = objOC.Promocion
|
||||
@@ -2055,6 +2062,35 @@ Partial Class OC_OC
|
||||
InicializaMovtosAlmacen()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If EsGrupoDiaz And TipoOC = "OC" And ChkEsTemporal.Checked Then
|
||||
|
||||
Dim TieneEntrada As Boolean = False
|
||||
Dim TieneSalida As Boolean = False
|
||||
|
||||
For Each gvRow As GridViewRow In GVInv.Rows
|
||||
If gvRow.DataKey("CveConcepto").ToEntero = 33 Then
|
||||
TieneEntrada = True
|
||||
End If
|
||||
If gvRow.DataKey("CveConcepto").ToEntero = 35 Then
|
||||
TieneSalida = True
|
||||
End If
|
||||
Next
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(401) Then
|
||||
If Not TieneEntrada Then
|
||||
BtnInvTempEntrada.Visible = True
|
||||
End If
|
||||
|
||||
If TieneEntrada AndAlso Not TieneSalida Then
|
||||
BtnInvTempSalida.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(565) = "1" And pCveOrdenCompra > 0 And TipoOC.ToUpper() = "REQ" Then
|
||||
'LAS COTIZACIONES RAPIDAS SOLO DEBE APARECER SI EL PROVEEDOR ES DEDICADO
|
||||
If CveConfianzaProveedor = 1 Then
|
||||
@@ -3072,14 +3108,18 @@ Partial Class OC_OC
|
||||
|
||||
|
||||
If Not TieneError AndAlso TipoOC = "OC" Then
|
||||
|
||||
If Not GeneraPrePolizaPresupuesto(CveOrdenCompra, OC.IniciaTransacSQL) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If EsGrupoDiaz AndAlso EsNuevo AndAlso CveOrdenCompra > 0 AndAlso TipoOC = "OC" AndAlso ChkEsTemporalRegistro.Checked Then
|
||||
If Not RegistroInventarioTemporal(OC.IniciaTransacSQL, CveOrdenCompra, 1, False) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
If Conta IsNot Nothing Then Conta.Commit()
|
||||
@@ -9727,9 +9767,9 @@ Partial Class OC_OC
|
||||
FileExcel.Save(Response, $"OC_{CveOrdenCompra}.xlsx", SaveOptions.XlsxDefault)
|
||||
End Sub
|
||||
|
||||
Function RegistroInventarioTemporal(ByRef transaccion As SqlTransaction, CveOCInv As Integer, CveConceptoInv As Integer) As Boolean
|
||||
|
||||
Function RegistroInventarioTemporal(ByRef transaccion As SqlTransaction, CveOCInv As Integer, OpcionOrigen As Integer, Recargar As Boolean) As Boolean
|
||||
|
||||
Dim CveConceptoInv As Integer = If(OpcionOrigen = 1, 33, 35) 'Conceptos 33 Entrada Manual 35 Salida Manual
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
@@ -9781,6 +9821,7 @@ Partial Class OC_OC
|
||||
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
|
||||
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
|
||||
ObjInventario.RollBack() 'deshace lo insertado
|
||||
Respuesta = False
|
||||
Else
|
||||
|
||||
Dim Mensaje As String = ""
|
||||
@@ -9927,7 +9968,12 @@ Partial Class OC_OC
|
||||
End If
|
||||
|
||||
If Respuesta Then
|
||||
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}")
|
||||
If Recargar Then
|
||||
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}", TipoMensaje.MsgInformacion, "window.location.reload();")
|
||||
Else
|
||||
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
@@ -9940,7 +9986,7 @@ Partial Class OC_OC
|
||||
Dim ObjOC As New ClsOC
|
||||
|
||||
Try
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 2) Then
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 1, True) Then
|
||||
ObjOC.Commit()
|
||||
Else
|
||||
ObjOC.RollBack()
|
||||
@@ -9956,7 +10002,7 @@ Partial Class OC_OC
|
||||
Protected Sub BtnInvTempSalida_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjOC As New ClsOC
|
||||
Try
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 3) Then
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 0, True) Then
|
||||
ObjOC.Commit()
|
||||
Else
|
||||
ObjOC.RollBack()
|
||||
|
||||
Reference in New Issue
Block a user