Resumen Movimientos Diarios, Solicitud de traspaso
This commit is contained in:
@@ -1530,13 +1530,14 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, CveAlmacen As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_RepResumenMovimientosDiarioGet", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -7395,6 +7395,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Pago.OtroGastoIngreso = -ImporComisionAnticipo
|
||||
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -145,7 +145,7 @@
|
||||
<div class="titlefiltros caption magindate">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate text-right">Fecha del mes: </div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaMes" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -155,6 +155,13 @@
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaMes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaMes" PopupButtonID="ImgFechaMes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate text-right" runat="server">Almacén:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,13 +18,25 @@ Partial Class Inventarios_RepResumenMovimientosDiario
|
||||
End Property
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TxtFechaMes.Text = NowADS().ToString("dd/MM/yyyy")
|
||||
InicializaControles()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InicializaControles()
|
||||
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
ddlAlmacen.DataBind()
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
TxtFechaMes.Text = NowADS().ToString("dd/MM/yyyy")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargarDatos()
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetRepResumenMovimientosDiario(TxtFechaMes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventarios.GetRepResumenMovimientosDiario(TxtFechaMes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero) Then
|
||||
DtDatos = ObjInventarios.DtResultados.Copy()
|
||||
GvDatos.DataSource = DtDatos
|
||||
End If
|
||||
|
||||
@@ -320,7 +320,7 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
End If
|
||||
|
||||
If Not GvDatos.Rows.Count > 0 Then
|
||||
Alert("No se ha seleccionado ningún Producto para trasladar.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("No se ha seleccionado ningún producto para trasladar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -479,6 +479,20 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim HaySeleccion As Boolean = False
|
||||
For Each gvr As GridViewRow In GvSolicitudes.Rows
|
||||
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
If gvr.FCCheckBox("Chk").Checked AndAlso Cantidad > 0 Then
|
||||
HaySeleccion = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not HaySeleccion Then
|
||||
Alert("No se ha seleccionado ningún producto para trasladar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim ErrorExistencia As Boolean = False
|
||||
|
||||
@@ -749,8 +763,8 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim PermisoOrigen As Boolean = If(e.Row.DataKey("PermisoOrigen").ToEntero = 1, True, False)
|
||||
Dim PermisoDestino As Boolean = If(e.Row.DataKey("PermisoDestino").ToEntero = 1, True, False)
|
||||
'Dim PermisoOrigen As Boolean = If(e.Row.DataKey("PermisoOrigen").ToEntero = 1, True, False)
|
||||
'Dim PermisoDestino As Boolean = If(e.Row.DataKey("PermisoDestino").ToEntero = 1, True, False)
|
||||
|
||||
Dim CveMovimientoAlmacen As Integer = e.Row.DataKey("CveMovimientoAlmacen").ToEntero
|
||||
Dim FolioMovimiento As Integer = e.Row.DataKey("FolioMovimiento").ToEntero
|
||||
@@ -758,6 +772,9 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Dim CveMovimientoTransitorio As Integer = e.Row.DataKey("CveMovimientoTransitorio").ToEntero
|
||||
Dim CveAlmacenTransitorio As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero
|
||||
|
||||
Dim PermisoOrigen As Boolean = If(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveAlmacen = {e.Row.DataKey("CveAlmacenOrigen").ToEntero}").ToEntero > 0, True, False)
|
||||
Dim PermisoDestino As Boolean = If(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveAlmacen = {CveAlmacenDestino}").ToEntero > 0, True, False)
|
||||
|
||||
'Dim CveMovimientoEntrada As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero ' Este es el movmiento de recepcion de traspaso
|
||||
|
||||
e.Row.FCLinkButton("LnkMostrarTraspaso").Visible = True
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
<asp:Button runat="server" ID="BtnDescuenEscalonado" Text="Aplicar" CssClass="btn btn-primary" OnClick="BtnDescuenEscalonado_Click" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
|
||||
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
|
||||
<td><b>%Desc. Pronto Pago:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
|
||||
@@ -509,6 +509,12 @@
|
||||
</td>
|
||||
<td><asp:CheckBox runat="server" ID="ChkEsTemporal" Text=" Es Temporal" Width="100px" /></td>
|
||||
</tr>
|
||||
<tr id="TrBotonesInvTemporal" runat="server" visible="false">
|
||||
<td></td>
|
||||
<td><asp:Button runat="server" ID="BtnInvTempEntrada" Text="Entrada" CssClass="btn btn-primary" OnClick="BtnInvTempEntrada_Click" /> </td>
|
||||
<td><asp:Button runat="server" ID="BtnInvTempSalida" Text="Salida" CssClass="btn btn-primary" OnClick="BtnInvTempSalida_Click" /> </td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
282
OC/OC.aspx.vb
282
OC/OC.aspx.vb
@@ -7,7 +7,7 @@ Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Newtonsoft.Json
|
||||
Imports Telerik.Web.Apoc
|
||||
|
||||
|
||||
Partial Class OC_OC
|
||||
Inherits ClsPaginas
|
||||
@@ -657,6 +657,19 @@ Partial Class OC_OC
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property EsGrupoDiaz As Boolean
|
||||
Get
|
||||
If ViewState("EsGrupoDiaz") Is Nothing Then
|
||||
ViewState("EsGrupoDiaz") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("EsGrupoDiaz").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsGrupoDiaz") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -664,7 +677,11 @@ Partial Class OC_OC
|
||||
If Not Page.IsPostBack Then
|
||||
GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing
|
||||
NotificacionCorreo = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then NotificacionCorreo = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
NotificacionCorreo = False
|
||||
EsGrupoDiaz = True
|
||||
End If
|
||||
|
||||
CargaDatosAgregarPS()
|
||||
CveProveedorOriginal = -1
|
||||
@@ -1031,20 +1048,21 @@ Partial Class OC_OC
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If EsGrupoDiaz Then
|
||||
chkSubProyectoEntrega.Visible = True
|
||||
LblPrioridad.Text = "Sucursal"
|
||||
DdlPrioridad.Visible = False
|
||||
DdlSubProyectoGral.Visible = True
|
||||
TrDescuentoEscalonado.Visible = True
|
||||
TrDescuentoProntoPago.Visible = True
|
||||
TrBotonesInvTemporal.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
|
||||
BtnEdicionMasiva.Visible = True
|
||||
End If
|
||||
|
||||
If CveOrdenCompra > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" OrElse UsuarioActual.CveRol = 1 Then
|
||||
If CveOrdenCompra > 0 AndAlso EsGrupoDiaz OrElse UsuarioActual.CveRol = 1 Then
|
||||
LnkDescargarPSExcel.Visible = True
|
||||
End If
|
||||
|
||||
@@ -1056,7 +1074,7 @@ Partial Class OC_OC
|
||||
If CveOrdenCompra > 0 Then
|
||||
GvD.Columns(20).Visible = False
|
||||
Else
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If EsGrupoDiaz Then
|
||||
TxtCant.Text = "1"
|
||||
TxtCant.Focus()
|
||||
RegistraScript("abrirDdlPS();", "A1")
|
||||
@@ -2032,7 +2050,7 @@ Partial Class OC_OC
|
||||
objOC.Dispose()
|
||||
GvVentaRelacionadas.DataBind()
|
||||
|
||||
If TieneInventario Then
|
||||
If TieneInventario Or EsGrupoDiaz Then
|
||||
'CARGA MOVTOS DE ALMACEN
|
||||
InicializaMovtosAlmacen()
|
||||
End If
|
||||
@@ -2377,7 +2395,7 @@ Partial Class OC_OC
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If EsGrupoDiaz Then
|
||||
txtPrecioUnitario.Focus()
|
||||
UPPDetalle.Update()
|
||||
End If
|
||||
@@ -3061,6 +3079,8 @@ Partial Class OC_OC
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
If Conta IsNot Nothing Then Conta.Commit()
|
||||
OC.Commit()
|
||||
@@ -7499,7 +7519,9 @@ Partial Class OC_OC
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If ObjInventarios.GetMovimientosOC(CveOrdenCompra, CveEmpresaActual) Then
|
||||
|
||||
TabAlmacen.Visible = True
|
||||
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
GVInv.DataSource = ObjInventarios.DtResultados
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
@@ -7510,6 +7532,10 @@ Partial Class OC_OC
|
||||
LnkCambiarMoneda.Visible = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If EsGrupoDiaz Then
|
||||
TabAlmacen.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -9700,6 +9726,248 @@ 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
|
||||
|
||||
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
Dim ObjOC As New ClsOC(transaccion)
|
||||
Dim DTDetalleOC As New DataTable
|
||||
|
||||
If ObjOC.GetOrdenesDetalle(CveOCInv, UsuarioActual.CveEmpresa) Then
|
||||
DTDetalleOC = ObjOC.DtResultados.FiltraParametros(" CveTipoPS = 2 ")
|
||||
|
||||
If DTDetalleOC.Rows.Count = 0 Then 'No hay PSs Tipo Producto
|
||||
Return True
|
||||
End If
|
||||
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim tCveSubProyecto As Integer = UsuarioActual.CveSubProyecto
|
||||
If ModalidadSubProyectoGeneral Then tCveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero
|
||||
|
||||
If tCveSubProyecto <= 0 Then
|
||||
tCveSubProyecto = GetCveSubProyectoDetalles()
|
||||
End If
|
||||
|
||||
If tCveSubProyecto <= 0 Then
|
||||
Alert("Sub Proyecto no asignado.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveSubProyecto = {tCveSubProyecto} AND CveTipoAlmacen = 1 ").ToEntero
|
||||
|
||||
If CveAlmacen <= 0 Then
|
||||
Alert("Almacén no asignado.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim ObjConta As New ClsContabilidad(transaccion)
|
||||
Dim ObjInventario As New ClsInventarios(transaccion)
|
||||
|
||||
|
||||
'Dim CveConceptoInv As Integer = If(TipoTermino = 1, 3, 2)
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/OC", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, TxtDescrip.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoInv, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, tCveSubProyecto, -1, Observaciones:=TxtDescrip.Text, Modulo:="OC/1")
|
||||
Dim FolioMto As Integer = ObjInventario.Folio
|
||||
|
||||
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
|
||||
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
|
||||
ObjInventario.RollBack() 'deshace lo insertado
|
||||
Else
|
||||
|
||||
Dim Mensaje As String = ""
|
||||
|
||||
''VALIDA EXISTENCIAS
|
||||
Dim Cont As Integer = 0
|
||||
If CveConceptoInv = 3 Then
|
||||
|
||||
For Each Dr As DataRow In DTDetalleOC.Rows
|
||||
'Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
|
||||
Dim FechaMovtoExistenciaStr As String = $"{NowADS.ToString("yyyy/MM/dd")} {NowADS.ToString("HH:mm")}"
|
||||
|
||||
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=FechaMovtoExistenciaStr) >= Dr("Cantidad").ToString.ToDouble Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
Mensaje = "Error al guardar los movimientos"
|
||||
Respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(114) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
Mensaje = "Error al guardar los movimientos"
|
||||
Respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
Mensaje = String.Format("No hay existencias suficientes del producto: {0}", Dr("PS"))
|
||||
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
Cont += 1
|
||||
Next
|
||||
|
||||
Else
|
||||
For Each Dr As DataRow In DTDetalleOC.Rows
|
||||
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
If CveConceptoInv = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
|
||||
ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.Replace(",", "").ToDate).ToDecimal
|
||||
Else
|
||||
ImporteConcepto = Dr("PU").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
Mensaje = "Error al guardar los movimientos"
|
||||
Respuesta = False
|
||||
Exit For
|
||||
|
||||
End If
|
||||
Cont += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim EsContabilizable As Boolean = False
|
||||
|
||||
'Registro la prepóliza
|
||||
If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL()
|
||||
Dim tValorOtro As Decimal = tValorInventario
|
||||
|
||||
Dim TipoMovtoAlmacen As Boolean = False
|
||||
Dim TipoMovtoOtro As Boolean = True
|
||||
|
||||
|
||||
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacen))
|
||||
If drA2 IsNot Nothing Then
|
||||
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
|
||||
End If
|
||||
|
||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConceptoInv).ToEntero
|
||||
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
|
||||
TipoMovtoOtro = Not TipoMovtoAlmacen
|
||||
|
||||
Dim CveConceptoContable As Integer = 260
|
||||
Dim CveClasificacion As Integer = -1
|
||||
Select Case CveConceptoInv
|
||||
Case 2, 32
|
||||
CveConceptoContable = 78
|
||||
EsContabilizable = True
|
||||
Case 28, 31
|
||||
CveConceptoContable = 51
|
||||
If CveConceptoInv = 28 Then
|
||||
''cuando es 28, es otros ingresos.78
|
||||
CveConceptoContable = 78
|
||||
End If
|
||||
EsContabilizable = True
|
||||
Case 30
|
||||
CveConceptoContable = 181
|
||||
TipoMovtoOtro = False
|
||||
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
|
||||
Case 34
|
||||
CveConceptoContable = 51
|
||||
EsContabilizable = True
|
||||
Case 13, 29
|
||||
CveConceptoContable = 69
|
||||
TipoMovtoOtro = True
|
||||
tValorOtro = -tValorOtro
|
||||
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
|
||||
If drr IsNot Nothing Then
|
||||
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
|
||||
End If
|
||||
Case 3
|
||||
CveConceptoContable = 51
|
||||
EsContabilizable = True
|
||||
Case Else
|
||||
CveConceptoContable = 95
|
||||
|
||||
End Select
|
||||
|
||||
'2-78
|
||||
Dim Obs As String = TxtDescrip.Text
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, tValorInventario, 68, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
|
||||
Respuesta = False
|
||||
Else
|
||||
|
||||
'Dim Total As Decimal = 0
|
||||
If CveConceptoContable.Contiene(181, 78, 51, 69) Then
|
||||
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
|
||||
|
||||
For Each Dr As DataRow In Dt.Rows
|
||||
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL()
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, lblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
|
||||
Respuesta = False
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
|
||||
Respuesta = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Respuesta Then
|
||||
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}")
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnInvTempEntrada_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjOC As New ClsOC
|
||||
|
||||
Try
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 2) Then
|
||||
ObjOC.Commit()
|
||||
Else
|
||||
ObjOC.RollBack()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjOC.RollBack()
|
||||
Finally
|
||||
ObjOC.Dispose()
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnInvTempSalida_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjOC As New ClsOC
|
||||
Try
|
||||
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 3) Then
|
||||
ObjOC.Commit()
|
||||
Else
|
||||
ObjOC.RollBack()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ObjOC.RollBack()
|
||||
Finally
|
||||
ObjOC.Dispose()
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user